def detect(self, x: np.ndarray, batch_size: int = 128, **kwargs) -> tuple[dict, np.ndarray]:
        """
        Perform detection of adversarial data and return prediction as tuple.

        :param x: Data sample on which to perform detection.
        :param batch_size: Size of batches.
        :return: (report, is_adversarial):
                where report is a dictionary containing information specified by the subset scanning method;
                where is_adversarial is a boolean list of per-sample prediction whether the sample is adversarial
                or not and has the same `batch_size` (first dimension) as `x`.
        """
        pval_ranges = self._calculate_pvalue_ranges(x, batch_size)
        scores = []

        for pval_range in tqdm(pval_ranges, desc="Subset scanning", disable=not self.verbose):
            best_score, _, _, _ = Scanner.fgss_individ_for_nets(pval_range, score_function=self.scoring_function)
            scores.append(best_score)
        scores_array = np.asarray(scores)

        is_adversarial = np.greater(scores_array, self.bgd_scores.max())
        report = {"scores": scores_array}

        return report, is_adversarial

        Perform detection of adversarial data and return prediction as tuple.

        :param x: Data sample on which to perform detection.
        :param batch_size: Size of batches.
        :return: (report, is_adversarial):
                where report is a dictionary containing information specified by the subset scanning method;
                where is_adversarial is a boolean list of per-sample prediction whether the sample is adversarial
                or not and has the same `batch_size` (first dimension) as `x`.
        
art/defences/detector/evasion/subsetscanning/detector.py