mlsanityData to 7 Oct 2026

AnomalySD: Few-Shot Multi-Class Anomaly Detection with Stable Diffusion Model

arXiv 2408.01960 ↗First posted 4 Aug 2024cs.CV cs.AIcited by 6

On the map: Diffusion models → Flow matching, time series and science

Abstract (arXiv)

Anomaly detection is a critical task in industrial manufacturing, aiming to identify defective parts of products. Most industrial anomaly detection methods assume the availability of sufficient normal data for training. This assumption may not hold true due to the cost of labeling or data privacy policies. Additionally, mainstream methods require training bespoke models for different objects, which incurs heavy costs and lacks flexibility in practice. To address these issues, we seek help from Stable Diffusion (SD) model due to its capability of zero/few-shot inpainting, which can be leveraged to inpaint anomalous regions as normal. In this paper, a few-shot multi-class anomaly detection framework that adopts Stable Diffusion model is proposed, named AnomalySD. To adapt SD to anomaly detection task, we design different hierarchical text descriptions and the foreground mask mechanism for fine-tuning SD. In the inference stage, to accurately mask anomalous regions for inpainting, we propose multi-scale mask strategy and prototype-guided mask strategy to handle diverse anomalous regions. Hierarchical text prompts are also utilized to guide the process of inpainting in the inference stage. The anomaly score is estimated based on inpainting result of all masks. Extensive experiments on the MVTec-AD and VisA datasets demonstrate the superiority of our approach. We achieved anomaly classification and segmentation results of 93.6%/94.8% AUROC on the MVTec-AD dataset and 86.1%/96.5% AUROC on the VisA dataset under multi-class and one-shot settings.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Flow matching, time series and science, one of 14 directions in Diffusion models. Builds on 21 of its 40 references that are in the map. First posted on arXiv 4 Aug 2024.

Builds on

21 of 40 references.

Closest ancestors · 2

Same direction, newest first

  1. 2023AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model10 Dec
  2. 2023DiffusionAD: Norm-guided One-step Denoising Diffusion for Anomaly Detection15 Mar

Other references · 19

  1. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
  2. 2018The Unreasonable Effectiveness of Deep Features as a Perceptual Metriccited by 11,029
  3. 2020Denoising Diffusion Implicit Modelscited by 9,655
  4. 2021Towards Total Recall in Industrial Anomaly Detectioncited by 772
  5. 2020PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localizationcited by 591
  6. 2019Memorizing Normality to Detect Anomaly: Memory-augmented Deep Autoencoder for Unsupervised Anomaly Detectioncited by 560
  7. 2021DRAEM -- A discriminatively trained reconstruction embedding for surface anomaly detectioncited by 510
  8. 2018GANomaly: Semi-Supervised Anomaly Detection via Adversarial Trainingcited by 409
  9. 2019Uninformed Students: Student-Teacher Anomaly Detection with Discriminative Latent Embeddingscited by 386
  10. 2020Sub-Image Anomaly Detection with Deep Pyramid Correspondencescited by 297
  11. 2022A Unified Model for Multi-class Anomaly Detectioncited by 267
  12. 2022Registration based Few-Shot Anomaly Detectioncited by 133
7 more
  1. 2019Towards Visually Explaining Variational Autoencoderscited by 113
  2. 2019Skip-GANomaly: Skip Connected and Adversarially Trained Encoder-Decoder Anomaly Detectioncited by 100
  3. 2021Divide-and-Assemble: Learning Block-wise Memory for Unsupervised Anomaly Detectioncited by 83
  4. 2023Pushing the Limits of Fewshot Anomaly Detection in Industry Vision: Graphcorecited by 75
  5. 2021A Hierarchical Transformation-Discriminating Generative Model for Few Shot Anomaly Detectioncited by 60
  6. 2020Iterative energy-based projection on a normal data manifold for anomaly localizationcited by 47
  7. 2022Reconstruction from edge image combined with color and gradient difference for industrial surface anomaly detectioncited by 18

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 4; 2026: 2.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Dual-Interrelated Diffusion Model for Few-Shot Anomaly Image Generation
  2. 2025Few-Shot Anomaly-Driven Generation for Anomaly Classification and Segmentation
  3. 2025Training-Free Anomaly Generation via Dual-Attention Enhancement in Diffusion Model
  4. 2025Generate Aligned Anomaly: Region-Guided Few-Shot Anomaly Image-Mask Pair Synthesis for Industrial Inspection
  5. 2025MAGIC: Few-Shot Mask-Guided Anomaly Inpainting with Prompt Perturbation, Spatially Adaptive Guidance, and Context Awareness
  6. 2024Enhancing Multi-Class Anomaly Detection via Diffusion Refinement with Dual Conditioning
  7. 2024A Novel Approach to Industrial Defect Generation through Blended Latent Diffusion Model with Online Adaptation
  8. 2024FADE: Few-shot/zero-shot Anomaly Detection Engine using Large Vision-Language Model