Industrial Anomaly Image Generation and Detection Based on the Diffusion Model
Xinning Yang, Kai Yuan, Yadong Cao · 2025
With the development of industrial production, the demands for product quality have increased significantly, and anomaly detection based on artificial intelligence has become an attractive topic in the industrial field. Mostly, existing detection methods rely on deep learning techniques. However, in the context of scarce anomaly samples, models are often affected by label skew, leading to a high misclassification rate of anomalies. In this paper, we attempt to generate anomaly samples using the most basic diffusion model, Stable Diffusion v3, to provide an important baseline comparison and reference for subsequent anomaly detection approaches. Compared to traditional Generative Adversarial Networks, the generation process of Stable Diffusion v3 is more stable. Additionally, we reduce the training cost by employing a novel lightweight fine-tuning method, DreamBooth. We also incorporate prior-preservation loss in DreamBooth to mitigate the forgetting phenomenon that occurs during fine-tuning. Eventually, we successfully generate high-quality anomaly images across 15 categories using the open-sourced datasets. Experimental results demonstrate that training with augmented anomaly data significantly improves model performance, achieving up to a 3.33% point increase in AUROC in certain scenarios. This almost reach or even surpass the state-of-the-art performance on the current anomaly detection model with the MVTec dataset.