class_docstr: Implements methods performing poisoning detection based on data provenance.
  
  | Paper link: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8473440
class_docstr_tok: ["Implements","methods","performing","poisoning","detection","based","on","data","provenance",".","|","Paper","link",":","https",":","\/\/ieeexplore.ieee.org\/stamp\/stamp.jsp","?","tp=","&","arnumber=8473440"]
docstr: Returns confusion matrix.
  
  :param is_clean: Ground truth, where is_clean[i]=1 means that x_train[i] is clean and is_clean[i]=0 means
                   x_train[i] is poisonous.
  :param kwargs: A dictionary of defence-specific parameters.
  :return: JSON object with confusion matrix.
docstr_tok: ["Returns","confusion","matrix",".",":","param","is_clean",":","Ground","truth",",","where","is_clean","[","i","]","=1","means","that","x_train","[","i","]","is","clean","and","is_clean","[","i","]","=0","means","x_train","[","i","]","is","poisonous",".",":","param","kwargs",":","A","dictionary","of","defence-specific","parameters",".",":","return",":","JSON","object","with","confusion","matrix","."]
code: def evaluate_defence(self, is_clean: np.ndarray, **kwargs) -> str:
      """
      Returns confusion matrix.
  
      :param is_clean: Ground truth, where is_clean[i]=1 means that x_train[i] is clean and is_clean[i]=0 means
                       x_train[i] is poisonous.
      :param kwargs: A dictionary of defence-specific parameters.
      :return: JSON object with confusion matrix.
      """
      if is_clean is None or is_clean.size == 0:
          raise ValueError(
              "is_clean was not provided while invoking evaluate_defence."
          )
      self.set_params(**kwargs)
  
      if not self.assigned_clean_by_device:
          self.detect_poison()
  
      self.is_clean_by_device = segment_by_class(
          is_clean, self.p_train, self.num_devices
      )
      (
          self.errors_by_device,
          conf_matrix_json,
      ) = self.evaluator.analyze_correctness(
          self.assigned_clean_by_device, self.is_clean_by_device
      )
      return conf_matrix_json
  
file_path: adversarial-robustness-toolbox/art/defences/detector/poison/provenance_defense.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from copy import deepcopy
  from typing import Dict, List, Optional, Tuple, TYPE_CHECKING
  import numpy
  from sklearn.model_selection import train_test_split
  from art.defences.detector.poison.ground_truth_evaluator import GroundTruthEvaluator
  from art.defences.detector.poison.poison_filtering_defence import PoisonFilteringDefence
  from art.utils import segment_by_class, performance_diff
label_desc: Use image node_id 2 for calling the ProvenanceDefense obj's underlying member method code with example usage: obj.evaluate_defence(is_clean) and returns: conf_matrix_json