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 poison detected and a report.
  
  :param kwargs: A dictionary of detection-specific parameters.
  :return: (report, is_clean_lst):
          where a report is a dict object that contains information specified by the provenance detection method
          where is_clean is a list, where is_clean_lst[i]=1 means that x_train[i]
          there is clean and is_clean_lst[i]=0, means that x_train[i] was classified as poison.
  :rtype: `tuple`
docstr_tok: ["Returns","poison","detected","and","a","report",".",":","param","kwargs",":","A","dictionary","of","detection-specific","parameters",".",":","return",":","(","report",",","is_clean_lst",")",":","where","a","report","is","a","dict","object","that","contains","information","specified","by","the","provenance","detection","method","where","is_clean","is","a","list",",","where","is_clean_lst","[","i","]","=1","means","that","x_train","[","i","]","there","is","clean","and","is_clean_lst","[","i","]","=0",",","means","that","x_train","[","i","]","was","classified","as","poison",".",":","rtype",":","`","tuple","`"]
code: def detect_poison(
      self, **kwargs
  ) -> Tuple[Dict[int, float], List[int]]:
      """
      Returns poison detected and a report.
  
      :param kwargs: A dictionary of detection-specific parameters.
      :return: (report, is_clean_lst):
              where a report is a dict object that contains information specified by the provenance detection method
              where is_clean is a list, where is_clean_lst[i]=1 means that x_train[i]
              there is clean and is_clean_lst[i]=0, means that x_train[i] was classified as poison.
      :rtype: `tuple`
      """
      self.set_params(**kwargs)
  
      if self.x_val is None:
          report = self.detect_poison_untrusted()
      else:
          report = self.detect_poison_partially_trusted()
  
      n_train = len(self.x_train)
      indices_by_provenance = segment_by_class(
          np.arange(n_train), self.p_train, self.num_devices
      )
      self.is_clean_lst = np.array([1] * n_train)
  
      for device in report:
          self.is_clean_lst[indices_by_provenance[device]] = 0  # type: ignore
      self.assigned_clean_by_device = segment_by_class(
          np.array(self.is_clean_lst), self.p_train, self.num_devices
      )
  
      return report, self.is_clean_lst
  
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 3 for calling the ProvenanceDefense obj's underlying member method code with example usage: obj.detect_poison() and returns: report,  self