Table of Contents
Fetching ...

SoftPatch+: Fully Unsupervised Anomaly Classification and Segmentation

Chengjie Wang, Xi Jiang, Bin-Bin Gao, Zhenye Gan, Yong Liu, Feng Zheng, Lizhuang Ma

TL;DR

This work tackles the practical problem of fully unsupervised industrial anomaly detection when the training set may be contaminated with defects. It introduces SoftPatch and SoftPatch+—patch-level denoising approaches that build a memory-augmented coreset using noise discriminators, with SoftPatch using a single discriminator and SoftPatch+ fusing multiple discriminators. The methods demonstrate robustness across high noise regimes ($10\%$–$40\%$) and consistently outperform state-of-the-art AD methods on MVTecAD, VisA, and BTAD, approaching the performance of noise-free baselines. The work also defines realistic no-overlap and overlap settings to reflect real production lines and discusses practical considerations, limitations, and avenues for future research.

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 https://github.com/TencentYoutuResearch/AnomalyDetection-SoftPatch.

SoftPatch+: Fully Unsupervised Anomaly Classification and Segmentation

TL;DR

This work tackles the practical problem of fully unsupervised industrial anomaly detection when the training set may be contaminated with defects. It introduces SoftPatch and SoftPatch+—patch-level denoising approaches that build a memory-augmented coreset using noise discriminators, with SoftPatch using a single discriminator and SoftPatch+ fusing multiple discriminators. The methods demonstrate robustness across high noise regimes () and consistently outperform state-of-the-art AD methods on MVTecAD, VisA, and BTAD, approaching the performance of noise-free baselines. The work also defines realistic no-overlap and overlap settings to reflect real production lines and discusses practical considerations, limitations, and avenues for future research.

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 https://github.com/TencentYoutuResearch/AnomalyDetection-SoftPatch.
Paper Structure (26 sections, 10 equations, 6 figures, 10 tables)

This paper contains 26 sections, 10 equations, 6 figures, 10 tables.

Figures (6)

  • Figure 1: Illustration of SoftPatch/SoftPatch+. Unlike previous methods that construct coreset without considering the negative effect of noisy data, SoftPatch identifies and excludes outliers using an outlier score. When there is excessive noise, a single outlier discriminator's capability is limited. So, SoftPatch+ further improves robustness by using the fusion of multiple discriminators.
  • Figure 2: Overview of the proposed method. In the training phase, the noises are distinguished at patch-level at each position of the feature map by a single discriminator (SoftPatch) or multiple discriminators (SoftPatch+). The deeper color a patch node has, the higher probability that it is a noise patch. After achieving outlier scores for all patches, the top $\tau$% patches with the highest outlier score are removed. The coreset is a subset of remaining patches after denoising. Different from other methods, our memory bank consists of the samples in coreset and their outlier scores which are stored as soft weights. Soft weights will be further utilized to re-weight the anomaly score in inference.
  • Figure 3: Noisy examples and corresponding anomaly samples in BTAD-02.
  • Figure 4: The comparison of performance trends on MVTec and VisA with the proposed SoftPatch and SoftPatch+, and the state-of-the-art methods with the noise ratio increases from 2% to 40%, e.g., {2%, 5%, 10%, 15%, 20%, 25%, 30%, 35%, 40%}.
  • Figure 5: The performance trends of fully unsupervised anomaly classification and segmentation with the threshold $\tau$ increase (from 0.05 to 0.7) in SoftPatch+ when using different noisy ratios.
  • ...and 1 more figures