Table of Contents
Fetching ...

Reimagining Anomalies: What If Anomalies Were Normal?

Philipp Liznerski, Saurabh Varshneya, Ece Calikus, Puyu Wang, Alexander Bartscher, Sebastian Josef Vollmer, Sophie Fellenz, Marius Kloft

TL;DR

The paper tackles the opacity of deep image anomaly detectors by introducing a semantic counterfactual explanation framework that generates multiple, disentangled alternatives for each anomaly. By training a generator (via GANs or diffusion models) to produce counterfactuals with target anomaly scores while preserving realism and minimal edits, it provides high-level, what-if explanations of the detector's decisions. Theoretical analysis characterizes the training dynamics and shows when CEs align with the data distribution or reveal the influence of the anomaly-score loss. Extensive experiments across MNIST, CIFAR-10, GTSDB, ImageNet-Neighbors, and related datasets demonstrate that the proposed CEs are normal, realistic, semantically disentangled, and minimally invasive, while also exposing detector biases and outperforming traditional feature-attribution methods in providing meaningful semantic insight.

Abstract

Deep learning-based methods have achieved a breakthrough in image anomaly detection, but their complexity introduces a considerable challenge to understanding why an instance is predicted to be anomalous. We introduce a novel explanation method that generates multiple alternative modifications for each anomaly, capturing diverse concepts of anomalousness. Each modification is trained to be perceived as normal by the anomaly detector. The method provides a semantic explanation of the mechanism that triggered the detector, allowing users to explore ``what-if scenarios.'' Qualitative and quantitative analyses across various image datasets demonstrate that applying this method to state-of-the-art detectors provides high-quality semantic explanations.

Reimagining Anomalies: What If Anomalies Were Normal?

TL;DR

The paper tackles the opacity of deep image anomaly detectors by introducing a semantic counterfactual explanation framework that generates multiple, disentangled alternatives for each anomaly. By training a generator (via GANs or diffusion models) to produce counterfactuals with target anomaly scores while preserving realism and minimal edits, it provides high-level, what-if explanations of the detector's decisions. Theoretical analysis characterizes the training dynamics and shows when CEs align with the data distribution or reveal the influence of the anomaly-score loss. Extensive experiments across MNIST, CIFAR-10, GTSDB, ImageNet-Neighbors, and related datasets demonstrate that the proposed CEs are normal, realistic, semantically disentangled, and minimally invasive, while also exposing detector biases and outperforming traditional feature-attribution methods in providing meaningful semantic insight.

Abstract

Deep learning-based methods have achieved a breakthrough in image anomaly detection, but their complexity introduces a considerable challenge to understanding why an instance is predicted to be anomalous. We introduce a novel explanation method that generates multiple alternative modifications for each anomaly, capturing diverse concepts of anomalousness. Each modification is trained to be perceived as normal by the anomaly detector. The method provides a semantic explanation of the mechanism that triggered the detector, allowing users to explore ``what-if scenarios.'' Qualitative and quantitative analyses across various image datasets demonstrate that applying this method to state-of-the-art detectors provides high-quality semantic explanations.
Paper Structure (63 sections, 3 theorems, 47 equations, 33 figures, 26 tables)

This paper contains 63 sections, 3 theorems, 47 equations, 33 figures, 26 tables.

Key Result

Theorem 4.2

Assume $G$ and $R$ have enough capacity. Let $({\mathcal{D}}^*, (G^*,R^*))$ be a Nash equilibrium of the system. (I) If $\lambda_\phi=\lambda_{rec}=\lambda_{con}=0$, then $\mathbb{E}_{\alpha,k}[p_{G^*(\alpha,k)} ]=p_X$ and $V({\mathcal{D}}^*,G^*)=-2\lambda_{gan}$. (II) If $\lambda_\phi=0$ and $\phi$

Figures (33)

  • Figure 1: The figure illustrates the benefit of counterfactual explanation of anomaly detectors over traditional methods, using a dataset of handwritten digits in various colors. The normal data (top left) consist of pink digits and instances of the digit one in any color. An example anomaly---a green seven---is shown on the right. Conventional explanation methods localize the anomaly in the image and highlight it on a heatmap (bottom left). In contrast, the proposed method transforms the anomaly into multiple counterfactuals, addressing the crucial question: "How must the anomaly be altered to appear normal to the detector?"
  • Figure 2: Schematic overview of the proposed CE framework for explaining a black box image AD model $\phi$. (a) shows the training losses and their impact on the different models. (b) shows the inference, where the target anomaly score is zero. Gray nodes (i.e., the trained AD model $\phi$ and generator $G^*$) represent models that are not optimized.
  • Figure 3: Examples of CEs for Colored-MNIST, with cyan digits and the digit one serving as the normal class. The first row shows anomalous images and the next two rows their corresponding CEs using two concepts. The CEs of BCE and HSC appear normal and realistic for each concept.
  • Figure 4: CEs for MNIST with seven as the normal class. The first row shows anomalies, the other two rows CEs using two different concepts. CEs of BCE and HSC are variations of seven and thus represent intuitive counterfactuals.
  • Figure 5: Example CEs for CIFAR-10 when ships are normal. The rows show anomalies and CEs for two concepts, respectively. The CEs of BCE display normal ships, varying the background for successful disentanglement while keeping the object's color to avoid unnecessary changes.
  • ...and 28 more figures

Theorems & Definitions (10)

  • Definition 4.1
  • Theorem 4.2
  • proof : Proof of Theorem \ref{['thm:nash']}
  • Theorem 4.3
  • proof : Proof of Theorem \ref{['thm:general']}
  • Definition C.2
  • Lemma C.3
  • proof
  • proof : Proof of Theorem \ref{['thm:nash']}
  • proof : Proof of Theorem \ref{['thm:general']}