Short answer
Anomaly detection learns what normal looks like from defect-free images and flags deviations, so it needs plentiful, consistent normal samples and a small labeled test set. Supervised defect classification needs examples of each defect class with labels, which are scarce for rare defects. The two approaches call for different purchases, labels, and evaluation sets, and many programs combine them.
The buyer's problem
An inspection model has to be trained on something. Quality systems hold large numbers of images of acceptable parts and very few images of each failure mode. A data lead specifying a purchase has to decide whether to ask for mostly normal images, mostly defect images, or both, and what labeling the budget must cover.
Choosing the wrong framing wastes the purchase. A pile of unlabeled normal images cannot teach a classifier what a crack looks like, and a small set of labeled cracks cannot define normal variation on a production line.
Two approaches, two data shapes
PatchCore is a cold-start method that fits a memory bank of patch features from nominal, defect-free images only, and reports image-level AUROC up to 99.6% on MVTec AD (Roth et al., 2021). That is a result on one research benchmark; it says what the method can do when the normal data is clean and the test defects resemble those in the benchmark, not what it will do on your line.
The benchmark's structure is the useful model for buyers. MVTec AD contains 5,354 images across 15 categories, with a training set of defect-free images only, a test set containing defects, and pixel-precise ground truth for the anomalies (Bergmann et al., 2021). Normal data trains; labeled defects are used to measure.
Supervised approaches flip this. A segmentation-based network for surface defects, evaluated on electrical commutators, is trained with pixel-level defect annotation and was designed to learn from few defective samples (Tabernik et al., 2019). It needs labeled defect examples, but not a large count.
| Dimension | Anomaly detection | Supervised defect classification |
|---|---|---|
| Training images | Normal, defect-free | Normal and defective, labeled |
| Labels for training | None or image-level "normal" | Class, location or mask per defect |
| Labels for evaluation | Defect masks or flags on test set | Held-out labeled defects |
| Handles unseen defect types | Often flags them as anomalies | Only classes seen in training |
| Output | Anomaly score, heat map | Defect class, severity, location |
| Main data risk | Hidden defects or drift in the "normal" set | Too few examples per class; label inconsistency |
| Typical purchase | Many reference images, fixed conditions | Curated defect images with an agreed taxonomy |
Where the boundary blurs
Real-IAD, a multi-view industrial dataset with 150K high-resolution images of 30 objects, proposes a fully unsupervised setting in which the training data may contain defective images (Wang et al., 2024). That matters commercially: production archives are rarely clean. If normal images may include unflagged defects, the buyer should know the estimated contamination rate and how it was checked.
Hybrid designs are common. A team might use an anomaly model for screening and a supervised classifier to name the defect once found, or fine-tune an anomaly model with a few labeled defects. The data requirement is then the union, with a shared evaluation set.
Decision criteria
- Choose anomaly-first when defects are rare or varied, new failure modes appear often, and normal parts are plentiful and consistently imaged.
- Choose supervised-first when the defect classes are known and stable, disposition depends on defect type, and there are enough labeled examples per class or ways to obtain them. See rare defects and class imbalance.
- Choose both when you need screening plus classification, or want a supervised model to refine the anomaly model's false alarms.
- Neither suffices when the task requires handling the part to expose the defect; see active inspection by humanoids.
What this means for what you buy
For anomaly detection, specify the normal set tightly: one part type per set, fixed imaging conditions, a stated process for excluding defective parts, and enough variation in lighting, fixture position and lot to represent real normal. Golden samples and reference images covers the reference side.
For supervised classification, specify the taxonomy before collection, since labels cannot be reconstructed later. Mask-level annotation is covered in pixel-level defect segmentation, and the broader sourcing picture is in defect image datasets.
For both, specify the evaluation set separately. It should include defects the training data did not contain, and be held out by line, lot or time, as described in defect detection evaluation sets.
Illustrative requirement block
# Illustrative only - synthetic values
inspection_target: part_family_A (single SKU)
approach: anomaly_detection_with_supervised_refinement
normal_set:
source: in-line camera, station_03
exclusion_rule: parts passing final QC only
contamination_check: 200-image manual audit by two inspectors
variation: 3 lots, 2 shifts, 2 fixture positions
defect_set:
taxonomy: supplied (12 classes)
labels: class + bounding box; masks for 3 priority classes
min_examples_per_class: buyer-defined, stated per class
eval_set:
holdout: separate lot and date range
includes_unseen_defect_types: yes
imaging: resolution, lens, lighting recorded per image
rights: training and evaluation; no redistribution
The numbers in a real requirement depend on the architecture, defect sizes and tolerance for false alarms. Do not copy figures from published benchmarks as targets.
Limits of both approaches
Neither approach decides whether a flagged item is acceptable. That depends on acceptance criteria, often written in standards and customer specifications; see acceptance standards as label definitions. Both are sensitive to domain shift when cameras, lighting or products change; see domain shift across lines. Public datasets have license limits: MVTec AD, for instance, carries a non-commercial share-alike license, which matters before you train a commercial model on it.
Questions to ask suppliers
- Are the "normal" images verified defect-free, and how?
- How many parts, lots, shifts and fixtures do the normal images cover?
- What defect classes exist, how many examples of each, and who labeled them?
- Are labels image-level, boxes or masks, and how were disagreements resolved?
- Were defective parts physically retained so images can be re-taken?
- Are camera, lens, lighting and exposure recorded per image?
- Can the supplier provide a held-out set from a different lot or line?
- Do images show customer parts, branding or process details that restrict licensing?
Discuss your requirements
If you can state the part, defect classes and imaging conditions, describe your inspection data requirement to SourceX. SourceX investigates whether US businesses hold suitable images, checks the data and the supplier's licensing permissions, and follows up about potential sources; a request does not guarantee a match. Start from the humanoid training data guide or the inspection and defect data hub, or see the catalog entries for images and inspection photos and manufacturing quality records.
Explore sourcing and licensing options with SourceX
Sources
- Towards Total Recall in Industrial Anomaly Detection — nominal-only fitting and the reported benchmark result.
- The MVTec Anomaly Detection Dataset — defect-free training set, labeled test set, license.
- Segmentation-Based Deep-Learning Approach for Surface-Defect Detection — supervised pixel-level approach that learns from few defective samples.
- Real-IAD: A Real-World Multi-View Dataset for Benchmarking Versatile Industrial Anomaly Detection — multi-view dataset and a setting with defective training images.