SoftPatch+: Fully Unsupervised Anomaly Classification and Segmentation

Chengjie Wang,Xi Jiang,Bin-Bin Gao,Zhenye Gan,Yong Liu,Feng Zheng,Lizhuang Ma
DOI: https://doi.org/10.1016/j.patcog.2024.111295
2024-12-30
Abstract:Although mainstream unsupervised anomaly detection (AD) (including image-level classification and pixel-level segmentation)algorithms perform well in academic datasets, their performance is limited in practical application due to the ideal experimental setting of clean training data. Training with noisy data is an inevitable problem in real-world anomaly detection but is seldom discussed. This paper is the first to consider fully unsupervised industrial anomaly detection (i.e., unsupervised AD with noisy data). To solve this problem, we proposed memory-based unsupervised AD methods, SoftPatch and SoftPatch+, which efficiently denoise the data at the patch level. Noise discriminators are utilized to generate outlier scores for patch-level noise elimination before coreset construction. The scores are then stored in the memory bank to soften the anomaly detection boundary. Compared with existing methods, SoftPatch maintains a strong modeling ability of normal data and alleviates the overconfidence problem in coreset, and SoftPatch+ has more robust performance which is articularly useful in real-world industrial inspection scenarios with high levels of noise (from 10% to 40%). Comprehensive experiments conducted in diverse noise scenarios demonstrate that both SoftPatch and SoftPatch+ outperform the state-of-the-art AD methods on the MVTecAD, ViSA, and BTAD benchmarks. Furthermore, the performance of SoftPatch and SoftPatch+ is comparable to that of the noise-free methods in conventional unsupervised AD setting. The code of the proposed methods can be found at <a class="link-external link-https" href="https://github.com/TencentYoutuResearch/AnomalyDetection-SoftPatch" rel="external noopener nofollow">this https URL</a>.
Computer Vision and Pattern Recognition
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is: in industrial scenarios, how to achieve fully unsupervised anomaly detection (AD) in the presence of noisy data, that is, not relying on clean training data for anomaly classification and segmentation. ### Problem Background Existing unsupervised anomaly detection methods perform well on academic datasets, but they usually assume that the training data is clean, which is not realistic in practical applications. The training data in actual industrial scenarios often contains noise (such as defective samples), which will lead to a decline in model performance. Therefore, it is of great significance to study how to perform effective anomaly detection on data containing noise. ### Paper Contributions 1. **Propose fully unsupervised industrial anomaly detection for the first time**: - Existing unsupervised AD methods rely too much on the cleanliness of training data, and their performance will decline significantly under noise interference. This paper focuses on fully unsupervised industrial anomaly detection for the first time, which is a more practical but rarely studied area. 2. **Propose a patch - level denoising strategy**: - In order to improve data utilization and reduce the impact of noise on the model, this paper proposes a patch - level denoising strategy. Specifically, the SoftPatch and SoftPatch+ methods identify and exclude abnormal patches by assigning an outlier factor to each patch. Compared with traditional image - level denoising, this method can better handle local anomalies. 3. **Introduce multiple discriminators to enhance robustness**: - Considering the limitations of a single discriminator under a high noise ratio, SoftPatch+ further introduces a multi - discriminator fusion method, thereby improving the model's robustness and performance, especially in cases where the noise ratio is high (from 10% to 40%). 4. **Establish benchmarks and verify effectiveness**: - This paper conducts extensive experiments in various noise scenarios. The results show that SoftPatch and SoftPatch+ outperform the existing state - of - the - art AD methods on the MVTecAD, VisA, and BTAD benchmarks, and their performance is comparable to that of methods in traditional noise - free environments. ### Method Overview - **Feature Extraction**: Use a pre - trained backbone network to extract image features. - **Core Set Construction**: Select normal patches through a denoising algorithm to construct a core set. - **Anomaly Detection**: In the test phase, calculate the anomaly score through nearest - neighbor search, and re - weight the anomaly score according to the soft weight to determine the final anomaly detection result. Through these improvements, the SoftPatch and SoftPatch+ methods proposed in this paper can perform anomaly detection more effectively in the presence of noise, providing a new solution for industrial quality inspection.