def __init__(
        self,
        classifier: "CLASSIFIER_NEURALNETWORK_TYPE",
        x_train: np.ndarray,
        y_train: np.ndarray,
        generator: DataGenerator | None = None,
        ex_re_threshold: float | None = None,
    ) -> None:
        """
        Create an :class:`.ActivationDefence` object with the provided classifier.

        :param classifier: Model evaluated for poison.
        :param x_train: A dataset used to train the classifier.
        :param y_train: Labels used to train the classifier.
        :param generator: A data generator to be used instead of `x_train` and `y_train`.
        :param ex_re_threshold: Set to a positive value to enable exclusionary reclassification
        """
        super().__init__(classifier, x_train, y_train)
        self.classifier: "CLASSIFIER_NEURALNETWORK_TYPE" = classifier
        self.nb_clusters = 2
        self.clustering_method = "KMeans"
        self.nb_dims = 10
        self.reduce = "PCA"
        self.cluster_analysis = "smaller"
        self.generator = generator
        self.activations_by_class: list[np.ndarray] = []
        self.clusters_by_class: list[np.ndarray] = []
        self.assigned_clean_by_class: np.ndarray
        self.is_clean_by_class: list[np.ndarray] = []
        self.errors_by_class: np.ndarray
        self.red_activations_by_class: list[np.ndarray] = []  # Activations reduced by class
        self.evaluator = GroundTruthEvaluator()
        self.is_clean_lst: list[int] = []
        self.confidence_level: list[float] = []
        self.poisonous_clusters: np.ndarray
        self.clusterer = MiniBatchKMeans(n_clusters=self.nb_clusters)
        self.ex_re_threshold = ex_re_threshold
        self._check_params()

        Create an :class:`.ActivationDefence` object with the provided classifier.

        :param classifier: Model evaluated for poison.
        :param x_train: A dataset used to train the classifier.
        :param y_train: Labels used to train the classifier.
        :param generator: A data generator to be used instead of `x_train` and `y_train`.
        :param ex_re_threshold: Set to a positive value to enable exclusionary reclassification
        
art/defences/detector/poison/activation_defence.py