少样本异常驱动生成用于异常分类与分割
Few-Shot Anomaly-Driven Generation for Anomaly Classification and Segmentation
May 14, 2025
作者: Guan Gui, Bin-Bin Gao, Jun Liu, Chengjie Wang, Yunsheng Wu
cs.AI
摘要
异常检测在工业检测中是一项实用且具有挑战性的任务,主要由于异常样本的稀缺性。现有的一些异常检测方法通过引入噪声或外部数据来合成异常以应对这一问题。然而,合成异常与真实异常之间始终存在较大的语义鸿沟,导致异常检测性能不佳。为解决此问题,我们提出了一种少样本异常驱动生成方法(AnoGen),该方法引导扩散模型仅利用少量真实异常生成逼真且多样化的异常,从而提升异常检测模型的训练效果。具体而言,我们的工作分为三个阶段。第一阶段,我们基于少量给定的真实异常学习异常分布,并将所学知识注入一个嵌入向量中。第二阶段,利用该嵌入向量及给定的边界框,指导扩散模型在特定对象(或纹理)上生成逼真且多样的异常。最后阶段,我们提出了一种弱监督异常检测方法,利用生成的异常训练更强大的模型。我们的方法以DRAEM和DesTSeg为基础模型,并在工业异常检测常用数据集MVTec上进行了实验。实验结果表明,我们生成的异常有效提升了模型在异常分类和分割任务上的性能,例如,DRAEM和DesTSeg在分割任务的AU-PR指标上分别提升了5.8%和1.5%。代码及生成的异常数据可在https://github.com/gaobb/AnoGen获取。
English
Anomaly detection is a practical and challenging task due to the scarcity of
anomaly samples in industrial inspection. Some existing anomaly detection
methods address this issue by synthesizing anomalies with noise or external
data. However, there is always a large semantic gap between synthetic and
real-world anomalies, resulting in weak performance in anomaly detection. To
solve the problem, we propose a few-shot Anomaly-driven Generation (AnoGen)
method, which guides the diffusion model to generate realistic and diverse
anomalies with only a few real anomalies, thereby benefiting training anomaly
detection models. Specifically, our work is divided into three stages. In the
first stage, we learn the anomaly distribution based on a few given real
anomalies and inject the learned knowledge into an embedding. In the second
stage, we use the embedding and given bounding boxes to guide the diffusion
model to generate realistic and diverse anomalies on specific objects (or
textures). In the final stage, we propose a weakly-supervised anomaly detection
method to train a more powerful model with generated anomalies. Our method
builds upon DRAEM and DesTSeg as the foundation model and conducts experiments
on the commonly used industrial anomaly detection dataset, MVTec. The
experiments demonstrate that our generated anomalies effectively improve the
model performance of both anomaly classification and segmentation tasks
simultaneously, \eg, DRAEM and DseTSeg achieved a 5.8\% and 1.5\% improvement
in AU-PR metric on segmentation task, respectively. The code and generated
anomalous data are available at https://github.com/gaobb/AnoGen.Summary
AI-Generated Summary