Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Industrial anomaly detection methods and benchmark papers
.claude/skills/brycewang-stanford-anomaly-detection-papers-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 45% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 72% | 0% |
Industrial anomaly detection uses machine learning to identify defects, faults, and anomalies in manufacturing and quality inspection. This curated collection covers methods from reconstruction-based (autoencoders) to memory-bank approaches (PatchCore), normalizing flows, knowledge distillation, and foundation model-based detectors. Includes benchmark datasets, evaluation metrics, and real-world deployment considerations.
Anomaly Detection Methods
├── Reconstruction-based
│ ├── Autoencoder (AE, VAE)
│ ├── GAN-based (AnoGAN, GANomaly)
│ └── Diffusion-based (AnoDDPM)
├── Embedding-based
│ ├── Memory bank (PatchCore, PaDiM)
│ ├── Knowledge distillation (STPM, RD4AD)
│ └── Self-supervised (CutPaste, DRAEM)
├── Normalizing Flows
│ ├── FastFlow, CFLOW-AD, CS-Flow
│ └── DifferNet
├── Foundation Models
│ ├── CLIP-based (WinCLIP, AnomalyCLIP)
│ ├── SAM-based (GroundedSAM-AD)
│ └── Vision-language (AnomalyGPT)
└── 3D Anomaly Detection
├── Point cloud methods
└── Multi-modal (RGB + 3D)| Method | Year | Approach | MVTec AUROC | |--------|------|----------|-------------| | PatchCore | 2022 | Memory bank | 99.1% | | PaDiM | 2021 | Multivariate Gaussian | 97.9% | | RD4AD | 2022 | Knowledge distillation | 98.5% | | FastFlow | 2022 | Normalizing flow | 99.4% | | SimpleNet | 2023 | Feature adaptation | 99.6% | | WinCLIP | 2023 | CLIP zero-shot | 95.2% | | AnomalyGPT | 2024 | Vision-language | 96.3% |
pythonbenchmarks = { "MVTec AD": { "categories": 15, "images": 5354, "type": "Product/texture defects", "annotation": "Pixel-level masks", }, "MVTec 3D-AD": { "categories": 10, "images": 4147, "type": "3D point cloud + RGB", }, "VisA": { "categories": 12, "images": 10821, "type": "Complex structure anomalies", }, "BTAD": { "categories": 3, "images": 2830, "type": "Industrial body/surface", }, "MPDD": { "categories": 6, "images": 1064, "type": "Metal parts defects", }, } for name, info in benchmarks.items(): print(f"{name}: {info['categories']} categories, " f"{info['images']} images — {info['type']}")
python# PatchCore-style anomaly detection from anomalib.data import MVTec from anomalib.models import Patchcore from anomalib.engine import Engine # Setup dataset datamodule = MVTec( root="./datasets/MVTec", category="bottle", image_size=(256, 256), ) # Initialize model model = Patchcore( backbone="wide_resnet50_2", layers=["layer2", "layer3"], coreset_sampling_ratio=0.1, ) # Train and test engine = Engine() engine.fit(model=model, datamodule=datamodule) results = engine.test(model=model, datamodule=datamodule) print(f"Image AUROC: {results[0]['image_AUROC']:.3f}") print(f"Pixel AUROC: {results[0]['pixel_AUROC']:.3f}")
python# Standard anomaly detection metrics from sklearn.metrics import roc_auc_score import numpy as np # Image-level: Is this image anomalous? image_auroc = roc_auc_score(y_true_image, y_score_image) # Pixel-level: Where is the anomaly? pixel_auroc = roc_auc_score( y_true_pixel.flatten(), y_score_pixel.flatten() ) # PRO metric: Per-Region Overlap # Better than pixel AUROC for small anomalies # Weights each connected anomaly region equally
markdown### Active Directions (2024-2025) 1. **Zero/few-shot AD** — Detect anomalies without normal training data 2. **Multi-class unified** — One model for all product categories 3. **Foundation model AD** — CLIP/SAM/LLM-based detection 4. **Logical anomalies** — Structural/contextual defects 5. **Continual learning** — Adapt to new defect types 6. **3D anomaly detection** — Point cloud and multi-modal 7. **Real-time deployment** — Edge device optimization
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | pass→pass | 15,944 | 20,258 | +27% | 1 | 1 | 0% | 2,199 | 4,535 | +106% | 0 | 0 | — |
case-12 | pass→pass | 18,783 | 19,986 | +6% | 1 | 1 | 0% | 3,180 | 5,081 | +60% | 0 | 0 | — |
case-01 | fail→pass | 39,964 | 55,346 | +38% | 1 | 1 | 0% | 7,281 | 9,106 | +25% | 0 | 0 | — |
case-02 | fail→pass | 23,510 | 27,276 | +16% | 1 | 1 | 0% | 3,973 | 5,745 | +45% | 0 | 0 | — |
case-03 | pass→pass | 19,099 | 27,581 | +44% | 1 | 1 | 0% | 3,085 | 6,041 | +96% | 0 | 0 | — |
case-04 | fail→pass | 17,848 | 17,732 | -1% | 1 | 1 | 0% | 2,660 | 4,176 | +57% | 0 | 0 | — |
case-05 | pass→pass | 16,860 | 17,115 | +2% | 1 | 1 | 0% | 2,429 | 4,071 | +68% | 0 | 0 | — |
case-06 | pass→pass | 10,208 | 9,507 | -7% | 1 | 1 | 0% | 2,011 | 3,452 | +72% | 0 | 0 | — |
case-07 | pass→pass | 10,891 | 6,036 | -45% | 1 | 1 | 0% | 1,892 | 2,381 | +26% | 0 | 0 | — |
case-08 | pass→pass | 9,409 | 3,776 | -60% | 1 | 1 | 0% | 1,758 | 1,939 | +10% | 0 | 0 | — |
case-09 | pass→pass | 12,746 | 12,808 | +0% | 1 | 1 | 0% | 1,660 | 3,527 | +112% | 0 | 0 | — |
case-10 | pass→pass | 9,248 | 4,780 | -48% | 1 | 1 | 0% | 1,526 | 2,250 | +47% | 0 | 0 | — |
case-11 | fail→pass | 19,273 | 22,018 | +14% | 1 | 1 | 0% | 3,424 | 5,393 | +58% | 0 | 0 | — |
case-14 | fail→pass | 11,529 | 12,496 | +8% | 1 | 1 | 0% | 2,136 | 3,668 | +72% | 0 | 0 | — |
case-15 | pass→pass | 14,949 | 11,220 | -25% | 1 | 1 | 0% | 2,467 | 3,319 | +35% | 0 | 0 | — |
case-16 | pass→pass | 11,166 | 2,777 | -75% | 1 | 1 | 0% | 1,838 | 1,887 | +3% | 0 | 0 | — |
case-17 | pass→pass | 18,498 | 23,449 | +27% | 1 | 1 | 0% | 2,909 | 5,500 | +89% | 0 | 0 | — |
case-18 | pass→pass | 11,434 | 12,433 | +9% | 1 | 1 | 0% | 1,725 | 3,531 | +105% | 0 | 0 | — |
case-19 | pass→pass | 12,269 | 14,519 | +18% | 1 | 1 | 0% | 2,299 | 4,073 | +77% | 0 | 0 | — |
case-20 | fail→pass | 20,768 | 14,938 | -28% | 1 | 1 | 0% | 4,112 | 4,255 | +3% | 0 | 0 | — |
case-21 | pass→pass | 10,547 | 7,316 | -31% | 1 | 1 | 0% | 1,749 | 2,571 | +47% | 0 | 0 | — |
case-22 | pass→pass | 3,658 | 3,065 | -16% | 1 | 1 | 0% | 566 | 1,939 | +243% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.