Zero-shot image anomaly classification (AC) and segmentation (AS) are vital for industrial quality control, detecting defects without prior training data. Existing representation-based methods compare patch features with nearest neighbors in unlabeled test images but struggle with consistent anomalies -- similar defects recurring across multiple images -- resulting in poor AC/AS performance. We introduce Consistent-Anomaly Detection Graph (CoDeGraph), a novel algorithm that identifies and filters consistent anomalies from similarity computations. Our key insight is that normal patches in industrial images show stable, gradually increasing similarity to other test images, while consistent-anomaly patches exhibit abrupt similarity spikes after exhausting a limited set of similar matches, a phenomenon we term ``neighbor-burnout.'' CoDeGraph constructs an image-level graph, with images as nodes and edges connecting those with shared consistent-anomaly patterns, using community detection to filter these anomalies. We provide a theoretical foundation using Extreme Value Theory to explain the effectiveness of our approach. Experiments on MVTec AD with the ViT-L-14-336 backbone achieve 98.3% AUROC for AC and AS performance of 66.8% (+4.2%) F1 and 68.1% (+5.4%) AP over state-of-the-art zero-shot methods. Using the DINOv2 backbone further improves segmentation, yielding 69.1% (+6.5%) F1 and 71.9% (+9.2%) AP, demonstrating robustness across architectures.
翻译:零样本图像异常分类与分割对于工业质量控制至关重要,其可在无需先验训练数据的情况下检测缺陷。现有的基于表示的方法通过将图像块特征与未标注测试图像中的最近邻进行比较来实现检测,但难以处理一致异常——即相似缺陷在多幅图像中重复出现的现象——导致异常分类与分割性能不佳。本文提出一致异常检测图,这是一种新颖的算法,可从相似度计算中识别并滤除一致异常。我们的核心洞见是:工业图像中的正常图像块与其他测试图像的相似度呈现稳定且逐渐增加的趋势,而一致异常图像块在耗尽有限的相似匹配后会出现相似度骤增的现象,我们称之为“邻域耗尽”。该算法构建了一个图像级图,其中图像作为节点,边则连接那些共享一致异常模式的图像,并利用社区检测技术来滤除这些异常。我们基于极值理论提供了该方法有效性的理论依据。在MVTec AD数据集上使用ViT-L-14-336骨干网络的实验表明,异常分类的AUROC达到98.3%,异常分割性能相比最先进的零样本方法在F1分数上提升4.2%至66.8%,平均精度提升5.4%至68.1%。使用DINOv2骨干网络进一步提升了分割性能,F1分数达到69.1%(提升6.5%),平均精度达到71.9%(提升9.2%),证明了该方法在不同架构间的鲁棒性。