Anomaly detectors are widely used in industrial production to detect and localize unknown defects in query images. These detectors are trained on nominal images and have shown success in distinguishing anomalies from most normal samples. However, hard-nominal examples are scattered and far apart from most normalities, they are often mistaken for anomalies by existing anomaly detectors. To address this problem, we propose a simple yet efficient method: \textbf{H}ard Nominal \textbf{E}xample-aware \textbf{T}emplate \textbf{M}utual \textbf{M}atching (HETMM). Specifically, \textit{HETMM} aims to construct a robust prototype-based decision boundary, which can precisely distinguish between hard-nominal examples and anomalies, yielding fewer false-positive and missed-detection rates. Moreover, \textit{HETMM} mutually explores the anomalies in two directions between queries and the template set, and thus it is capable to capture the logical anomalies. This is a significant advantage over most anomaly detectors that frequently fail to detect logical anomalies. Additionally, to meet the speed-accuracy demands, we further propose \textbf{P}ixel-level \textbf{T}emplate \textbf{S}election (PTS) to streamline the original template set. \textit{PTS} selects cluster centres and hard-nominal examples to form a tiny set, maintaining the original decision boundaries. Comprehensive experiments on five real-world datasets demonstrate that our methods yield outperformance than existing advances under the real-time inference speed. Furthermore, \textit{HETMM} can be hot-updated by inserting novel samples, which may promptly address some incremental learning issues.
翻译:异常检测应用在工业生产中被广泛使用,用于检测和定位待检测图像中的未知缺陷。这些检测器是在正常样本上训练的,已经在区分异常和大部分正常样本方面取得了成功。然而,硬正样例分散且与大多数正常情况相去甚远,因此常常被现有的异常检测器误判为异常。为解决这个问题,我们提出了一种简单而有效的方法:Hard Nominal Example-aware Template Mutual Matching (HETMM) (硬正样例感知模板互匹配方法)。具体来说,HETMM旨在构建一个健壮的基于原型的决策边界,能够精确区分硬正样例和异常,从而产生更少的误报和漏报。此外,HETMM在查询和模板集之间互相探索异常,因此能够捕捉到逻辑异常。这是比大多数异常检测器频繁失败的逻辑异常检测的一个显著优点。此外,为了满足速度和准确性的要求,我们进一步提出了Pixel-level Template Selection (PTS) (像素级模板选择),以优化原始模板集。PTS选择聚类中心和硬正样例形成一个小集合,保持原始决策边界。在五个真实世界数据集上的综合实验表明,我们的方法在实时推理速度下优于现有的方法。此外,HETMM可以通过插入新样本快速更新,从而迅速解决一些增量学习问题。