Introduction
Anomaly Detection (AD) is the critical task of identifying rare, unexpected patterns in data. This "needle in a haystack" problem is foundational to fields like medical imaging, industrial inspection, and cybersecurity. However, AD faces three major challenges: the scarcity of real-world anomalous data, the complexity of modeling high-dimensional "normal" distributions, and the "identity shortcut," where generative models become so proficient they reconstruct the very anomalies they are meant to flag.
Diffusion Models (DMs) have recently emerged as a transformative solution. By offering superior training stability and avoiding the mode collapse issues of GANs, DMs are revolutionizing both Anomaly Detection and Anomaly Generation (AG). This survey explores how these two tasks form a synergistic cycle, where generated anomalies solve data scarcity and detection provides feedback for better synthesis.
Methodology and Taxonomy
The survey organizes the field into a tutorial-style taxonomy that bridges basic concepts with advanced methodologies across various data modalities.
Core Anomaly Scoring Mechanisms
The technical heart of DM-based anomaly detection lies in how the model assigns an "anomaly score" to a data point. The survey identifies three primary pillars:
- Reconstruction-Based Scoring: A DM is trained on normal data. When presented with an anomaly, it fails to reconstruct the abnormal features accurately. The resulting error (e.g., L1, L2, or perceptual loss) between the input and the reconstruction defines the anomaly score.
- Density-Based Scoring: This approach leverages the model's ability to estimate the probability density function $p(x)$. Anomalies are identified by their presence in low-density regions, typically measured via Negative Log-Likelihood (NLL).
- Score-Based Scoring: This method uses the learned score function—the gradient of the log-probability density. High score magnitudes indicate that a data point is far from the normal manifold, signaling a likely anomaly.
Conditioning and Modality Adaptation
To mitigate the "identity shortcut," researchers employ Conditional DMs. By using labels, text, or masks, models are forced to reconstruct data based on specific context (e.g., "reconstruct this image but ignore the masked area"), preventing them from simply copying anomalous pixels.
Furthermore, DMs are adapted for specific data types:
- Video AD: Incorporates spatio-temporal transformers to capture motion-based anomalies.
- Time Series AD: Uses 1D U-Nets and imputation methods to handle irregular sampling.
- Tabular AD: Employs specialized preprocessing for mixed categorical and numerical data.
Performance and Benchmarks
Diffusion Models are currently setting new State-of-the-Art (SOTA) records across major benchmarks. For instance, the GLAD model (2025) achieved a near-perfect 99.5% I-AUROC on the VisA image dataset. In video AD, models like DMAD have reached 99.7% AUC on the UCSD Ped2 benchmark. Even in the challenging tabular domain, hybrid models like AutoUAD hit 92.68% AUC across 47 diverse datasets, far outperforming traditional methods.
Discussion and Future Directions
The most profound insight from this survey is the synergistic loop: generation techniques create synthetic anomalies to train better detectors, while detection methods provide the error signals needed to refine synthetic data.
Despite these successes, challenges remain. The iterative denoising process of DMs is computationally expensive, hindering real-time deployment. Future research is moving toward Efficient Architectures (such as Latent Diffusion), Foundation Model Integration (using LLMs/VLMs for semantic guidance), and On-device Acceleration to bring these powerful models into practical, high-speed applications.
Summary updated