Existing representation-based methods usually conduct industrial anomaly detection in two stages: obtain feature representations with a pre-trained model and perform distance measures for anomaly detection. Among them, K-nearest neighbor (KNN) retrieval-based anomaly detection methods show promising results. However, the features are not fully exploited as these methods ignore domain bias of pre-trained models and the difference of local density in feature space, which limits the detection performance. In this paper, we propose Reducing Biases (REB) in representation by considering the domain bias and building a self-supervised learning task for better domain adaption with a defect generation strategy (DefectMaker) that ensures a strong diversity in the synthetic defects. Additionally, we propose a local-density KNN (LDKNN) to reduce the local density bias in the feature space and obtain effective anomaly detection. The proposed REB method achieves a promising result of 99.5\% Im.AUROC on the widely used MVTec AD, with smaller backbone networks such as Vgg11 and Resnet18. The method also achieves an impressive 88.8\% Im.AUROC on the MVTec LOCO AD dataset and a remarkable 96.0\% on the BTAD dataset, outperforming other representation-based approaches. These results indicate the effectiveness and efficiency of REB for practical industrial applications. Code:https://github.com/ShuaiLYU/REB.
翻译:摘要:现有基于表征的方法通常通过两个阶段进行工业异常检测:利用预训练模型获取特征表征,并执行距离度量以实现异常检测。其中,基于K近邻检索的异常检测方法展现了优异性能。然而,此类方法因忽略预训练模型的领域偏差及特征空间中局部密度的差异,导致特征未被充分利用,限制了检测性能。本文提出表征偏差校正方法(REB),通过考虑领域偏差并构建自监督学习任务以提升领域适应性,同时设计缺陷生成策略(DefectMaker)确保合成缺陷的强多样性。此外,我们提出局部密度K近邻方法(LDKNN),以降低特征空间的局部密度偏差,实现有效的异常检测。所提出的REB方法在广泛使用的MVTec AD数据集上,采用Vgg11和Resnet18等轻量级骨干网络时,取得了99.5%的Image级AUROC;在MVTec LOCO AD数据集上达到88.8%的Image级AUROC,在BTAD数据集上达到96.0%的优异性能,优于其他基于表征的方法。这些结果表明REB在实际工业应用中的有效性与高效性。代码地址:https://github.com/ShuaiLYU/REB。