FR-PatchCore: An Industrial Anomaly Detection Method for Improving Generalization

Zhiqian Jiang,Yu Zhang,Yong Wang,Jinlong Li,Xiaorong Gao
DOI: https://doi.org/10.3390/s24051368
IF: 3.9
2024-02-22
Sensors
Abstract:In recent years, a multitude of self-supervised anomaly detection algorithms have been proposed. Among them, PatchCore has emerged as one of the state-of-the-art methods on the widely used MVTec AD benchmark due to its efficient detection capabilities and cost-saving advantages in terms of labeled data. However, we have identified that the PatchCore similarity principal approach faces significant limitations in accurately locating anomalies when there are positional relationships between similar samples, such as rotation, flipping, or misaligned pixels. In real-world industrial scenarios, it is common for samples of the same class to be found in different positions. To address this challenge comprehensively, we introduce Feature-Level Registration PatchCore (FR-PatchCore), which serves as an extension of the PatchCore method. FR-PatchCore constructs a feature matrix that is extracted into the memory bank and continually updated using the optimal negative cosine similarity loss. Extensive evaluations conducted on the MVTec AD benchmark demonstrate that FR-PatchCore achieves an impressive image-level anomaly detection AUROC score of up to 98.81%. Additionally, we propose a novel method for computing the mask threshold that enables the model to scientifically determine the optimal threshold and accurately partition anomalous masks. Our results highlight not only the high generalizability but also substantial potential for industrial anomaly detection offered by FR-PatchCore.
engineering, electrical & electronic,chemistry, analytical,instruments & instrumentation
What problem does this paper attempt to address?
The problem that this paper attempts to solve is that in industrial anomaly detection, the existing self - supervised anomaly detection algorithms (such as PatchCore) have limitations when dealing with samples with spatial transformation relationships. Specifically, when there are positional relationships such as rotation, flipping, or pixel misalignment between samples, existing methods are difficult to accurately locate anomalies. This is a common problem in actual industrial scenarios because samples of the same category may appear in different positions, and when training data is scarce, using data augmentation techniques (such as rotation, mirror flipping, etc.) to expand the data set will introduce "spatial transformation categories", thus affecting the effect of anomaly detection and leading to an increase in the missed detection rate and false alarm rate. To meet this challenge, the paper proposes the Feature - level Registered PatchCore (FR - PatchCore) method. By introducing feature - level registration as a pre - task, it enhances the model's understanding of features and emphasizes spatial and positional differences. The FR - PatchCore method is implemented through the following steps: 1. **Feature Extraction and Registration**: Use a convolutional neural network (CNN) and a spatial transformation network (STN) to extract features, and perform feature registration by maximizing the negative cosine similarity loss, enabling the model to learn the spatial transformation relationships between samples. 2. **Memory Bank Update**: Store the extracted fused features in the memory bank, and continuously update the features in the memory bank through the negative cosine similarity loss, eliminate overlapping features, and incorporate the features ignored during the training process. 3. **Pixel Relationship Strengthening**: Construct a module similar to pyramid pooling to increase the receptive field, strengthen the relationships between pixels, and improve the accuracy of anomaly detection. 4. **Threshold Optimization**: Propose an innovative method to enable the model to scientifically determine the optimal threshold and accurately segment the abnormal area. Experimental results show that the FR - PatchCore method has achieved an image - level anomaly detection AUROC score of up to 98.81% in the MVTec AD benchmark test, significantly improving the generalization performance and reducing the false alarm rate.