ChatPaper.aiChatPaper

少樣本異常驅動生成用於異常分類與分割

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和DseTSeg在分割任務的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

PDF42May 16, 2025