arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.01960cs.CVcs.AI
收藏

AnomalySD:基于 Stable Diffusion 模型的少样本多类别异常检测

AnomalySD: Few-Shot Multi-Class Anomaly Detection with Stable Diffusion Model

Sun Yat-Sen University(中山大学)

Zhenyu Yan, Qingqing Fang, Wenxi Lv, Qinliang Su

AI总结:

本文提出 AnomalySD 框架,利用 Stable Diffusion 的少样本修复能力,通过层级文本、前景微调及多尺度与原型引导掩码实现多类别异常检测,并在 MVTec-AD、VisA 上取得优异 AUROC。

摘要:

异常检测是工业制造中的一项关键任务,旨在识别产品的缺陷部件。大多数工业异常检测方法都假设可获得充足的正常数据用于训练。由于标注成本或数据隐私政策,这一假设可能并不成立。此外,主流方法需要针对不同对象训练定制模型,这会带来高昂成本,并且在实际中缺乏灵活性。为解决这些问题,我们借助 Stable Diffusion(SD)模型,因为它具备零样本/少样本图像修复能力,可用于将异常区域修复为正常状态。本文提出了一种采用 Stable Diffusion 模型的少样本多类别异常检测框架,名为 AnomalySD。为使 SD 适应异常检测任务,我们设计了不同的层级文本描述和前景掩码机制来微调 SD。在推理阶段,为准确掩蔽待修复的异常区域,我们提出多尺度掩码策略和原型引导掩码策略,以处理多样的异常区域。层级文本提示也被用于在推理阶段引导修复过程。异常分数基于所有掩码的修复结果进行估计。在 MVTec-AD 和 VisA 数据集上的大量实验证明了本方法的优越性。在多类别和单样本设置下,我们在 MVTec-AD 数据集上取得了 93.6%/94.8% AUROC 的异常分类和分割结果,在 VisA 数据集上取得了 86.1%/96.5% AUROC 的结果。

英文摘要:

Anomaly detection is a critical task in industrial manufacturing, aiming to identify defective parts of products. Most industrial anomaly detection methods assume the availability of sufficient normal data for training. This assumption may not hold true due to the cost of labeling or data privacy policies. Additionally, mainstream methods require training bespoke models for different objects, which incurs heavy costs and lacks flexibility in practice. To address these issues, we seek help from Stable Diffusion (SD) model due to its capability of zero/few-shot inpainting, which can be leveraged to inpaint anomalous regions as normal. In this paper, a few-shot multi-class anomaly detection framework that adopts Stable Diffusion model is proposed, named AnomalySD. To adapt SD to anomaly detection task, we design different hierarchical text descriptions and the foreground mask mechanism for fine-tuning SD. In the inference stage, to accurately mask anomalous regions for inpainting, we propose multi-scale mask strategy and prototype-guided mask strategy to handle diverse anomalous regions. Hierarchical text prompts are also utilized to guide the process of inpainting in the inference stage. The anomaly score is estimated based on inpainting result of all masks. Extensive experiments on the MVTec-AD and VisA datasets demonstrate the superiority of our approach. We achieved anomaly classification and segmentation results of 93.6%/94.8% AUROC on the MVTec-AD dataset and 86.1%/96.5% AUROC on the VisA dataset under multi-class and one-shot settings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑