从单张图像中提取内在正常原型,实现无需外部参考的通用异常检测
Exploring Intrinsic Normal Prototypes within a Single Image for Universal Anomaly Detection
- 在测试图像内部挖掘正常特征,避免传统方法对齐难题
- 在MVTec-AD等3个数据集上达到顶尖性能,支持少样本和零样本检测
- 适合工业质检场景,尤其适用于无正常样本或样本难对齐的情况
异常检测在工业质检中至关重要,但现有方法通常依赖训练集中正常样本与测试图像进行比对。然而外观与位置差异常导致对齐困难,限制检测精度。我们观察到大多数异常表现为局部变化,即使在异常图像中仍保留有价值的正常信息。这些信息源自同一图像,与异常更匹配。因此,我们提出INP-Former,直接从测试图像中提取内在正常原型(INPs)。通过线性组合正常令牌构建INPs,并引入一致性损失保证其代表性。随后,由INP引导解码器仅重建正常令牌,重建误差作为异常分数。此外,设计软挖掘损失优化难样本训练。INP-Former在单类、多类及少样本异常检测任务中,在MVTec-AD、VisA、Real-IAD上均达当前最优,具备通用性。尤为突出的是,该方法展现一定零样本检测能力。代码已开源。
原文摘要 · Abstract (English)
Anomaly detection (AD) is essential for industrial inspection, yet existing methods typically rely on ``comparing'' test images to normal references from a training set. However, variations in appearance and positioning often complicate the alignment of these references with the test image, limiting detection accuracy. We observe that most anomalies manifest as local variations, meaning that even within anomalous images, valuable normal information remains. We argue that this information is useful and may be more aligned with the anomalies since both the anomalies and the normal information originate from the same image. Therefore, rather than relying on external normality from the training set, we propose INP-Former, a novel method that extracts Intrinsic Normal Prototypes (INPs) directly from the test image. Specifically, we introduce the INP Extractor, which linearly combines normal tokens to represent INPs. We further propose an INP Coherence Loss to ensure INPs can faithfully represent normality for the testing image. These INPs then guide the INP-Guided Decoder to reconstruct only normal tokens, with reconstruction errors serving as anomaly scores. Additionally, we propose a Soft Mining Loss to prioritize hard-to-optimize samples during training. INP-Former achieves state-of-the-art performance in single-class, multi-class, and few-shot AD tasks across MVTec-AD, VisA, and Real-IAD, positioning it as a versatile and universal solution for AD. Remarkably, INP-Former also demonstrates some zero-shot AD capability. Code is available at:https://github.com/luow23/INP-Former.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。