AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model
Teng Hu, Jiangning Zhang, Ran Yi, Yuzhen Du, Xu Chen, Liang Liu, Yabiao Wang, Chengjie Wang
Abstract
Anomaly inspection plays an important role in industrial manufacture. Existing anomaly inspection methods are limited in their performance due to insufficient anomaly data. Although anomaly generation methods have been proposed to augment the anomaly data, they either suffer from poor generation authenticity or inaccurate alignment between the generated anomalies and masks. To address the above problems, we propose AnomalyDiffusion, a novel diffusion-based few-shot anomaly generation model, which utilizes the strong prior information of latent diffusion model learned from large-scale dataset to enhance the generation authenticity under few-shot training data. Firstly, we propose Spatial Anomaly Embedding, which consists of a learnable anomaly embedding and a spatial embedding encoded from an anomaly mask, disentangling the anomaly information into anomaly appearance and location information. Moreover, to improve the alignment between the generated anomalies and the anomaly masks, we introduce a novel Adaptive Attention Re-weighting Mechanism. Based on the disparities between the generated anomaly image and normal sample, it dynamically guides the model to focus more on the areas with less noticeable generated anomalies, enabling generation of accurately-matched anomalous image-mask pairs. Extensive experiments demonstrate that our model significantly outperforms the state-of-the-art methods in generation authenticity and diversity, and effectively improves the performance of downstream anomaly inspection tasks. The code and data are available in https://github.com/sjtuplayer/anomalydiffusion.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext daf61182-774d-43c6-8ad7-e46bec2582b0Cited by top-tier papers42
- MambaAD: Exploring State Space Models for Multi-class Unsupervised Anomaly DetectionHaoyang He, Yuhu Bai, Jiangning Zhang, Qingdong He et al.NeurIPS 2024 · 251 citations
- CNC: Cross-modal Normality Constraint for Unsupervised Multi-class Anomaly DetectionXiaolei Wang, Xiaoyang Wang, Huihui Bai, Eng Gee Lim et al.AAAI 2025 · 19 citations
- 3CAD: A Large-Scale Real-World 3C Product Dataset for Unsupervised Anomaly DetectionEnquan Yang, Peng Xing, Hanyang Sun, Wenbo Guo et al.AAAI 2025 · 18 citations
- Revisiting Multimodal Fusion for 3D Anomaly Detection from an Architectural PerspectiveKaifang Long, Guoyang Xie, Lianbo Ma, Jiaqi Liu et al.AAAI 2025 · 17 citations
- Foundation Visual Encoders Are Secretly Few-Shot Anomaly DetectorsGuangyao Zhai, Yue Zhou, Xinyan Deng, Lars Heckler-Kram et al.ICLR 2026 · 9 citations
Builds on20
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Improved Denoising Diffusion Probabilistic ModelsAlexander Quinn Nichol, Prafulla DhariwalICML 2021 · 5,234 citations
- Towards Total Recall in Industrial Anomaly DetectionKarsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf et al.CVPR 2022 · 1,301 citations
- Differentiable Augmentation for Data-Efficient GAN TrainingShengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu et al.NeurIPS 2020 · 707 citations
Related papers
- Dual-Interrelated Diffusion Model for Few-Shot Anomaly Image GenerationYing Jin, Jinlong Peng, Qingdong He, Teng Hu et al.CVPR 2025
- Generate Aligned Anomaly: Region-Guided Few-Shot Anomaly Image-Mask Pair Synthesis for Industrial InspectionYilin Lu, Jianghang Lin, Linhuang Xie, Kai Zhao et al.ACM MM 2025
- One-to-More: High-Fidelity Training-Free Anomaly Generation with Attention ControlHaoxiang Rao, Zhao Wang, Chenyang Si, Yan Lyu et al.CVPR 2026 · 2 citations
- AnomalyControl: Highly-Aligned Anomalous Image Generation with Controlled Diffusion ModelYuanyi Duan, Wei Xu, Qinlong Wu, Guo-Sen Xie et al.ACM MM 2025 · 3 citations
- Training-Free Industrial Defect Generation with Diffusion ModelsRuyi Xu, Yen-Tzu Chiu, Tai-I Chen, Oscar Chew et al.ICCV 2025 · 8 citations
