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.
翻译:异常检测器广泛应用于工业生产中,用于检测并定位查询图像中的未知缺陷。这些检测器是针对正常图像进行训练的,已经在区分大多数正常样本与异常方面取得了成功。然而,硬类别实例是分散且与大多数正常情况相距甚远的,它们经常被现有的异常检测器误认为是异常。为解决这个问题,我们提出了一种简单而高效的方法:硬类别实例感知的模板互匹配方法 (HETMM)。具体而言,HETMM旨在构建一个强健的基于原型的决策边界,能够精确地区分硬类别实例和异常,从而减少虚警率和漏警率。此外,HETMM在查询和模板集之间以两个方向共同探索异常,因此能够捕捉逻辑异常。这是大多数异常检测器无法检测到的重要优势。此外,为满足速度与准确性的需求,我们进一步提出了像素级模板选择(PTS)来优化原始模板集。PTS选择聚类中心和硬类别实例形成一个小集合,保留原有的决策边界。五个真实数据集上的全面实验表明,我们的方法在保持实时推理速度的情况下,能够超越现有技术的表现。此外,HETMM可以通过插入新样本进行热更新,这可能能够迅速解决一些增量学习问题。