SoftPatch
SoftPatch detects image anomalies with a patch memory bank that is denoised and soft-weighted for noisy training data.
Detection and tracking · 169 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 68.9M
- Operations
- 169
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2022
- Cited by
- 68 (as of 24 October 2026)
- Authors
- Xi Jiang, Ying Chen, Qiang Nie and others
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m20488
- Graph hash
- 3f473a4da729360dd1bca023aafa86fe04536065f78171853b6b590e5de579b5
- Skeleton hash
- 6374391b9f8bf3573f0f8a0f0b6b23e64bdebd3680f37049d1bb29317ca23f8b
- Architecture hash
- dbfdeaca440b28c2e0f6c4cf9b3b7a952f09d7160dfac881af3e20c2498ac2c6
- Diagram SHA-256
- 7b069d13bf8e53ecb775a1c64865ecf1eebadc8bb1bbff90b405a6ff8886b988
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
SoftPatch is a memory-based method for unsupervised anomaly detection in images that denoises its training data at the patch level. The paper's starting point is that training with noisy data is an inevitable problem in real-world anomaly detection but is seldom discussed.
It builds on PatchCore, which stores sub-sampled patch features in a memory bank and uses the nearest neighbor distance between a test feature and that coreset as the anomaly score. SoftPatch inserts a noise discriminator before the coreset is built: it scores every patch, removes the noisy patches and keeps the rest of the image so that the data is still used. The outlier scores of the selected patches are stored in the memory bank as soft weights, which scale the anomaly score at inference. Feature extraction, dimension reduction, coreset sampling and nearest neighbor search follow PatchCore.
The paper tests three noise discriminators and finds that the Local Outlier Factor (LOF) gives the best performance. In its experiments the feature extractor backbone is Wide-ResNet50 and the coreset sampling ratio is 10%. The threshold and the LOF neighbor count are held at 0.15 and 6 for all noise scenarios and classes, because the noise ratio is unknowable in practice.
Key idea. SoftPatch filters noisy patches before building the coreset and keeps outlier scores in the memory bank as soft weights, for anomaly detection with noisy training data.
- SoftPatch
- SoftPatch+
- anomaly detection
- unsupervised anomaly detection
- noisy training data
- industrial defect detection
- memory bank
- coreset
- patch-level denoising
- MVTecAD
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{jiang2024softpatchunsupervisedanomalydetection,
title={SoftPatch: Unsupervised Anomaly Detection with Noisy Data},
author={Xi Jiang and Ying Chen and Qiang Nie and Yong Liu and Jianlin Liu and Bin-Bin Gao and Jun Liu and Chengjie Wang and Feng Zheng},
year={2024},
eprint={2403.14233},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2403.14233},
}