Few-Shot Anomaly-Driven Generation for Anomaly Classification and Segmentation
作者: Guan Gui, Bin-Bin Gao, Jun Liu, Chengjie Wang, Yunsheng Wu
分类: cs.CV, cs.AI
发布日期: 2025-05-14
备注: Accepted by ECCV 2024
🔗 代码/项目: GITHUB
💡 一句话要点
提出基于少量样本异常驱动生成的异常检测与分割方法,提升工业质检性能。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 异常检测 异常分割 少量样本学习 扩散模型 生成对抗网络 工业质检 弱监督学习
📋 核心要点
- 工业异常检测面临异常样本稀缺的挑战,现有合成异常的方法与真实异常存在语义差距。
- AnoGen通过少量真实异常驱动扩散模型生成逼真多样的异常,用于训练更强大的异常检测模型。
- 实验表明,该方法在MVTec数据集上显著提升了DRAEM和DesTSeg等模型的异常分类和分割性能。
📝 摘要(中文)
由于工业检测中异常样本的稀缺性,异常检测是一项实用且具有挑战性的任务。现有方法通过合成噪声或外部数据来解决此问题,但合成异常与真实异常之间存在较大的语义差距,导致检测性能不佳。为解决此问题,我们提出了一种基于少量样本的异常驱动生成(AnoGen)方法,该方法仅使用少量真实异常来引导扩散模型生成逼真且多样化的异常,从而有利于训练异常检测模型。具体来说,我们的工作分为三个阶段。第一阶段,我们基于少量给定的真实异常学习异常分布,并将学习到的知识注入到嵌入中。第二阶段,我们使用嵌入和给定的边界框来引导扩散模型在特定对象(或纹理)上生成逼真且多样化的异常。最后,我们提出了一种弱监督异常检测方法,以利用生成的异常训练更强大的模型。我们的方法以DRAEM和DesTSeg为基础模型,并在常用的工业异常检测数据集MVTec上进行了实验。实验表明,我们生成的异常有效地提高了异常分类和分割任务的模型性能,例如,DRAEM和DseTSeg在分割任务上的AU-PR指标分别提高了5.8%和1.5%。
🔬 方法详解
问题定义:工业异常检测任务中,异常样本数量通常远少于正常样本,这使得训练一个鲁棒的异常检测模型变得困难。现有的方法,例如使用噪声或外部数据合成异常样本,往往无法生成足够逼真、具有代表性的异常,导致模型在真实场景下的泛化能力较差。
核心思路:AnoGen的核心思路是利用少量真实异常样本,学习异常的分布特征,并将其注入到扩散模型中,从而引导扩散模型生成与真实异常更接近的合成样本。这种方法旨在缩小合成异常与真实异常之间的语义差距,提高模型对真实异常的检测能力。
技术框架:AnoGen方法包含三个主要阶段:1) 异常分布学习:利用少量真实异常样本学习异常的分布特征,并将这些特征编码到一个嵌入向量中。2) 异常生成:使用第一阶段得到的嵌入向量和给定的边界框,引导扩散模型在特定对象或纹理上生成逼真且多样化的异常。3) 弱监督训练:利用生成的异常样本,结合弱监督学习方法,训练一个更强大的异常检测模型。
关键创新:AnoGen的关键创新在于利用少量真实异常样本驱动扩散模型生成异常,而不是像传统方法那样依赖噪声或外部数据。这种方法能够更好地捕捉真实异常的特征,从而生成更逼真的合成样本。此外,该方法还结合了弱监督学习,进一步提升了模型的性能。
关键设计:在异常分布学习阶段,可以使用各种自编码器或生成对抗网络来学习异常的分布特征。在异常生成阶段,需要设计合适的扩散模型架构和引导策略,以确保生成的异常具有多样性和逼真度。在弱监督训练阶段,可以使用各种损失函数,例如对比损失或三元组损失,来鼓励模型区分正常样本和异常样本。
🖼️ 关键图片
📊 实验亮点
实验结果表明,AnoGen方法在MVTec数据集上显著提升了异常检测和分割的性能。例如,基于DRAEM的AnoGen方法在分割任务上的AU-PR指标提升了5.8%,基于DesTSeg的AnoGen方法在分割任务上的AU-PR指标提升了1.5%。这些结果表明,该方法生成的异常样本能够有效提高模型的泛化能力。
🎯 应用场景
该研究成果可广泛应用于工业质检领域,例如产品表面缺陷检测、零部件异常识别等。通过生成逼真的异常样本,可以有效解决异常样本稀缺的问题,提高自动化检测系统的准确性和可靠性,降低人工检测成本,提升生产效率。未来,该方法还可扩展到医疗影像分析、安全监控等领域。
📄 摘要(原文)
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.