A model trained on good parts only, catching a defect family the detector never saw
DAGM Class 3 was held out of supervised training entirely — not down-weighted, not rare, absent. On screen 2 the detector scored close to nothing on it. This screen fits a different kind of model on 600 normal Class 3 images and no defective images of any kind, then asks it about the 150 defects.
Score distributions
Mahalanobis distance at the 99.5th percentile of the anomaly map, for 300 unseen normal images and 150 defective ones. The overlap is real and is why the AUC is 0.886 rather than 1.0.
The same images, scored by the supervised detector
Barely separated. The detector is not confused; it is answering a question it was never trained on.
Where the operating point comes from, and the mistake almost everyone makes
A plant that has not yet seen this defect family has no defective examples to tune on, so the threshold has to come from normal data alone. Which normal data decides whether the bench number survives contact with the line.
| Threshold chosen from | value | defects caught | good parts flagged | verdict |
|---|---|---|---|---|
| The 600 images the Gaussians were fitted to | 9.30 | 92.7% | 48.0% | optimistic |
| 100 further normals, unseen by the fit | 10.13 | 45.3% | 2.3% | honest |
Where it is looking
Mahalanobis distance per position, over the image. White boxes are the published ground truth, which the model has never seen.
The method, and its licence
- Method
- PaDiM (Defard et al. 2020), reimplemented in ~80 lines
- Backbone
- torchvision ResNet-18 ImageNet, BSD-3-Clause, frozen
- Statistics
- 32×32 position-wise Gaussians in 64 randomly selected feature dimensions, shrinkage-regularised
- Training
- None in the gradient-descent sense. One forward pass over the normal images, then a mean and a covariance per position.
precomputed Built by scripts/train_anomaly.py at 2026-08-09T19:32:21+00:00. Fitted on 600 normal images of DAGM Class 3; the same statistics serve live uploads on the Live inference screen. Re-run that script to regenerate it; nothing on this page is hardcoded.