SoftPatch: Unsupervised Anomaly Detection with Noisy Data
Xi JiangJianlin LiuJinbao WangQiang NieKai WuYong LiuChengjie WangFeng Zheng
Proposes SoftPatch, a patch-level denoising and memory re-weighting method that prevents defective training samples from distorting decision boundaries in real-world unsupervised anomaly detection.
Industrial quality inspection and sensory anomaly detection rely heavily on automated visual models trained without labeled defect examples. Standard unsupervised methods build reference distributions from baseline training sets under the rigid assumption that all training images are entirely clean and defect-free. In practical manufacturing environments, however, defective parts and mislabeled data inevitably contaminate nominal training collections due to human error and operational drift. When conventional models ingest these corruptions, their reference memory banks become overconfident and misinformed, causing them to overlook identical defects during operational testing and sharply degrading quality assurance.
The article demonstrates that memory-based visual inspection systems can maintain high detection accuracy even when training data contains significant noise, introducing a robust unsupervised inspection approach called SoftPatch to address label-level noise in visual inspection tasks.
To evaluate this framework, the authors conducted empirical experiments using standard industrial inspection benchmarks, including MVTecAD (15 categories across 5,354 images) and BTAD (three categories across 1,799 images). They systematically injected varying ratios of defective images (up to 15%) into nominal training data across two evaluation setups: one where injected anomaly types differed from test targets, and an overlap setup where identical defect types appeared in both training noise and test sets. SoftPatch addresses contamination by extracting position-grouped patch features from a standard neural network backbone, calculating local outlier scores to prune the most anomalous image regions rather than discarding entire images, and applying soft anomaly re-weighting factors to remaining reference samples.
The evaluation revealed several key findings:
- Conventional state-of-the-art methods collapse under realistic noise: In the presence of a 10% noise overlap, standard memory baseline PatchCore suffered a severe accuracy drop of approximately 30 to 40 percentage points across image-level and pixel-level defect localization.
- SoftPatch preserves robust detection across noisy conditions: Utilizing Local Outlier Factor (LOF) patch-level filtering, SoftPatch achieved a 0.982 image-level Area Under the ROC Curve (AUROC) and a 0.969 localization AUROC under 10% noise overlap, exhibiting virtually no performance drop compared to noise-free baselines.
- Native industrial datasets already harbor performance-limiting noise: On the unpolluted BTAD industrial benchmark, SoftPatch outperformed prior state-of-the-art models (achieving an average AUROC of 0.977 versus 0.957 for PatchCore) because it naturally identified and filtered preexisting minor scratch defects in the benchmark's baseline training images.
- Patch-level denoising outperforms whole-image filtering: Removing specific defective regions while retaining non-defective patches from contaminated images maximized training data utilization without sacrificing structural context.
These findings indicate that manufacturing operations can deploy visual quality inspection models directly into new production lines without requiring extensive, costly, and error-prone manual data-cleaning phases. By mitigating the vulnerability of greedy memory-bank selection to outlier contamination, industrial systems substantially reduce the operational risk of missed defects, compliance failures, and false-positive shutdowns.
For practical deployment, organizations should adopt patch-level outlier filtering alongside local density-based re-weighting when building memory-based vision systems. Operating teams can safely implement fixed parameter defaults (such as a 15% patch elimination threshold) without needing prior knowledge of exact factory noise levels. Future technical development should explore fully unsupervised deployments and assess model performance when defective distributions change dynamically across continuous inspection streams.
While the reported results demonstrate high statistical confidence across multiple repeated trials on established industrial benchmarks, slight performance trade-offs were observed on select image categories where spatial features naturally exhibit wide misalignment. Inspection teams deploying this architecture on highly unconstrained or shifting visual scenes should validate spatial density thresholds during initial pilot phases.
- Paper: Towards Total Recall in Industrial Anomaly Detection, Karsten Roth et al. (2021). PatchCore establishes the core patch-level memory-bank framework that SoftPatch directly adapts and enhances to tolerate noisy training data.
- Paper: PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localization, Thomas Defard et al. (2020). PaDiM introduces localized patch-level feature modeling from pre-trained networks, providing essential conceptual foundations for spatial patch representations in industrial anomaly inspection.
- Paper: MVTec AD — A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection, Paul Bergmann et al. (2019). This paper establishes the standard MVTec AD industrial anomaly detection benchmark on which SoftPatch evaluates its noise-injection and anomaly localization methods.
- Paper: Learning From Noisy Labels With Deep Neural Networks: A Survey, Hwanjun Song et al. (2020). This survey provides a comprehensive taxonomy of deep learning under label noise, establishing the context for handling label corruptions that SoftPatch addresses in unsupervised visual quality inspection.
- Paper: Making Deep Neural Networks Robust to Label Noise: A Loss Correction Approach, Giorgio Patrini et al. (2016). This work formulates key principles of loss correction and sample re-weighting under label noise, which motivate SoftPatch's soft re-weighting strategies.
- Paper: Anomaly Detection with Robust Deep Autoencoders, Chong Zhou et al. (2017). This paper examines robust unsupervised anomaly detection when training data is contaminated by noise, laying foundational background for denoising uncurated baseline datasets.
- Paper: Latent Outlier Exposure for Anomaly Detection with Contaminated Data, Chen Qiu et al. (2022). This paper extends the challenge of anomaly detection under contaminated training distributions through a domain-independent latent outlier exposure framework.
- Paper: Explicit Boundary Guided Semi-Push-Pull Contrastive Learning for Supervised Anomaly Detection, Xincheng Yao et al. (2023). This work explores pushing beyond purely unsupervised nominal training by leveraging limited abnormal samples with explicit boundary guidance for semi-supervised anomaly detection.
- Paper: Prototypical Residual Networks for Anomaly Detection and Localization, Hui Zhang et al. (2023). This study extends localized industrial anomaly detection and localization by learning multi-scale prototypical residuals from few-shot defective patterns.
- Paper: AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection, Qihang Zhou et al. (2024). This paper generalizes industrial anomaly detection to zero-shot scenarios using object-agnostic prompt learning in vision-language models without target-domain training data.
