Anomaly Detection for Visual Inspection: Training on Good Parts Only

By Johnson on July 16, 2026

anomaly-detection-visual-inspection-training-good-parts-only

Traditional AI defect detection systems require 5,000-10,000 labeled defect samples per defect class to reach production accuracy — creating a chicken-and-egg deployment problem for new products, low-defect processes, and high-mix manufacturing where labeled defect libraries simply don't exist yet. Teams either wait 6-12 months collecting defects before deploying inspection, ship products blind to potential quality issues, or invest in synthetic defect generation that rarely matches real production failure modes. iFactory's anomaly detection platform inverts this pattern completely: trained exclusively on good parts, unsupervised models learn what "normal" looks like and flag any statistically significant deviation as anomalous — catching known defects, rare variants, and completely novel failure modes without ever seeing a single defect example during training. Book a Demo to see how iFactory deploys visual inspection in 2-4 weeks where labeled defect data does not yet exist.

0
Defect samples required to train the anomaly detection model

98%+
Detection rate on rare and never-seen-before defect types

2-4wks
Deployment timeline vs 6-12 months for supervised approaches

All
Defect types covered by a single model without per-class training
No Defect Data? No Problem. Train on Good Parts Only.
iFactory's anomaly detection engine learns the visual signature of normal from your defect-free parts and flags every deviation as anomalous — deploying visual inspection on brand-new production lines in 2-4 weeks with detection rates that supervised approaches cannot match on rare or novel defect types.

Three Barriers Blocking Traditional Supervised AI Inspection Deployment

Every supervised AI inspection project hits the same three barriers early in deployment — barriers that anomaly detection sidesteps entirely by training only on good parts. Understanding why these barriers exist explains why 60% of enterprise supervised inspection programs miss deployment deadlines by 3+ months. See how anomaly detection eliminates all three barriers in a live technical walkthrough with iFactory engineers.

Barrier 01
6-12mo
Data Collection Trap
Supervised AI needs 5,000-10,000 labeled samples per defect class. For 15 defect types that means 75,000-150,000 annotations across 6-12 months. Products often launch or reach end-of-life before defect libraries mature enough to deploy.
Barrier 02
500M
Rare Defect Impossibility
Rare defects occur once every 100,000+ parts. Collecting 5,000 supervised examples means waiting for 500 million parts before the model can detect defects that damage brand reputation the very first time they escape to customers.
Barrier 03
0%
Novel Defect Blind Spot
Supervised models detect only defects present in training data. New failure modes from tooling wear, material changes or process drift appear as normal to the model and escape detection until months of production data reveal the pattern retroactively.

How Anomaly Detection Builds a Normality Model From Good Parts Only

Anomaly detection replaces the learn-defects paradigm with learn-normal — a mathematically equivalent goal reached through completely different training data. The four-stage pipeline below transforms 500-1,000 good-part images into a production-ready inspection model with pixel-level anomaly localization. Watch a full technical walkthrough showing feature extraction, memory bank construction and anomaly scoring on your production images.

01
Good Parts Ingestion
500-1,000 quality-verified defect-free samples captured under normal production lighting, angles and material variation. No defect examples needed — clean parts are the only input requirement. Collection typically takes 1-2 shifts on active production lines.

02
Deep Feature Extraction
Pretrained convolutional backbones (WideResNet, EfficientNet, DINOv2 vision transformers) extract 512-2,048 dimensional feature vectors from every patch of every good-part image. Features capture texture, geometry and semantic content invariant to lighting variation.

03
Normality Memory Bank
Feature vectors from all good parts populate a searchable memory bank representing the manifold of normal appearance. PatchCore coreset selection compresses millions of features into 10,000 representative samples without accuracy loss — enabling real-time inference.

04
Real-Time Anomaly Scoring
Every production frame extracts features and computes nearest-neighbor distances against the memory bank. Distances above the auto-calibrated threshold indicate anomaly; a spatial anomaly map localizes the exact pixel region deviating from normal for operator review.

Six Anomaly Detection Capabilities That Supervised AI Cannot Match

Anomaly detection is not supervised AI without labels — it is an architecturally different approach that unlocks capabilities no amount of supervised training data can replicate. These six capabilities translate directly to production advantages measured in deployment speed, defect coverage and total cost of ownership. Review capability details with iFactory engineers and map them to your inspection priorities.

01
Zero Defect-Sample Deployment
Trains exclusively on 500-1,000 good parts captured during normal production. No engineered defects, no waiting for defect libraries, no annotation campaigns. Deployment begins immediately on new product lines before any defective sample exists.
02
Universal Defect Coverage
A single model detects all defect types simultaneously: scratches, dents, contamination, discoloration, deformation, missing components, misalignment. No per-class training or class-imbalance rebalancing — one normality model covers 100+ defect variants.
03
Pixel-Level Anomaly Localization
Beyond binary detection: spatial anomaly maps highlight the exact pixel region deviating from normal. Operators see precisely where and how the part differs from good baseline, enabling root-cause diagnosis and process correction on the line.
04
Novel Defect Discovery
Catches failure modes that have never occurred before — new tooling wear patterns, material contamination from supplier changes, novel misassembly geometries. Any deviation from learned normal triggers detection regardless of whether the defect existed at training time.
05
Automatic Threshold Calibration
Statistical analysis of anomaly scores on good parts auto-calibrates the detection threshold to your target false-positive rate. No manual tuning per line, per shift or per product variant — thresholds adapt automatically to production distribution shifts.
06
Cross-Product Generalization
One trained model handles product variants and new SKUs with minimal retraining — just add fresh good-part samples to the memory bank. High-mix manufacturers deploy anomaly detection across dozens of SKUs at a fraction of supervised cost.

Anomaly Detection vs Supervised AI Inspection Head-to-Head

The choice between supervised and anomaly detection is not marginal — the two approaches deliver fundamentally different capabilities, deployment timelines and defect coverage profiles. This comparison reflects MVTec-AD industrial anomaly detection benchmark data and iFactory customer deployments. Get the full technical comparison document customized for your inspection use case.

Capability Supervised AI Inspection iFactory Anomaly Detection
Training Data Required 5,000-10,000 labeled samples per defect class. 15 classes means 75,000-150,000 total annotations required. 500-1,000 good parts only. Zero defect samples required at training time — clean parts are the only input.
Deployment Timeline 6-12 months including defect collection, annotation, model training, validation and threshold tuning. 2-4 weeks from first good-part capture to production-grade inspection with pixel-level anomaly localization.
Rare Defect Detection Cannot detect defects with occurrence rate below training-data collection feasibility (1 in 100,000+). Detects rare defects on first occurrence — no minimum-frequency requirement since normality is the reference.
Novel Defect Detection Zero — supervised models only detect defect types explicitly present in training data. New failures escape silently. Detects any deviation from normal regardless of prior occurrence. Novel failure modes flagged on first appearance.
Defect Type Coverage Requires per-class training and rebalancing. New defect types force complete retraining and validation cycles. A single model covers all defect types simultaneously. New defect categories detected automatically without retraining.
New Product Introduction 6-12 month lag between product launch and inspection deployment while the defect library matures over time. Inspection deploys concurrently with product launch using good-part samples from prototype and qualification builds.
Data Annotation Effort 1,500-3,000 annotator hours per model plus ongoing effort for new defect types and drift compensation. Zero annotation effort. Good parts are self-labeling — quality-verified samples require no additional marking or tagging.
Deploy Inspection in 2-4 Weeks. No Defect Library Required.
iFactory's fixed-scope program means no defect collection campaigns, no annotation coordination, and no supervised model retraining cycles — just anomaly detection running on your inspection lines catching known, rare and novel defects within a month of engagement start.

iFactory Anomaly Detection 8-Week Deployment Program

Every iFactory anomaly detection engagement follows a structured 8-week program transitioning from initial good-parts capture to production inspection with pixel-level anomaly localization — with detection running on critical stations by week 4 and full portfolio coverage by week 8.


01
Good Parts Capture
500-1,000 defect-free samples captured under normal production lighting and material variation

02
Feature Extraction
Pretrained backbones extract 512-2,048 dim feature vectors from every patch of every good part

03
Memory Bank Build
Coreset selection compresses features into a searchable normality manifold for real-time inference

04
Threshold Calibration
Statistical analysis of good-part scores auto-calibrates anomaly threshold to false-positive target

05
Live Validation
Shadow-mode deployment on critical stations validates detection rate and localization accuracy

06
Portfolio Rollout
Anomaly detection live across all inspection lines with continuous good-part memory updates
Weeks 1-2
Good Parts & Backbone
Camera setup, lighting standardization, and 500-1,000 good-part image capture on target inspection stations
Pretrained feature backbone selected and validated on your production images — WideResNet, EfficientNet or DINOv2
Feature quality validation: cluster analysis confirms good parts form a tight normality cluster in feature space
Weeks 3-4
Memory Bank & Scoring
PatchCore coreset selection compresses feature bank to 10,000 representative samples for real-time inference
Anomaly scoring pipeline deployed: nearest-neighbor distance computation with GPU acceleration for line speed
First anomaly detection running on live production — 98%+ detection rate validated on known defect samples
Weeks 5-6
Threshold & Validation
Threshold auto-calibration based on statistical analysis of good-part score distribution and false-positive target
Shadow-mode A/B validation against existing inspection baseline confirms detection rate and false-positive improvements
Pixel-level anomaly localization validated by production QA team on 200+ representative defect samples
Weeks 7-8
Portfolio Rollout
Anomaly detection deployed across all inspection stations with automated good-part memory updates enabled
Operator interface and root-cause diagnosis workflow trained across quality and production teams
ROI report delivered — detection rate improvement, novel defects caught, and deployment cost avoided quantified
ROI IN 4 WEEKS: DETECTION EVIDENCE FROM WEEK 3
Manufacturers completing the 8-week program report an average of $1.8M in avoided costs within the first 8 weeks of deployment — through eliminated supervised training campaigns, faster new-product inspection deployment, and novel defect prevention worth $150-350K per incident avoided.
$1.8M
Avoided costs in the first 8 weeks
98%+
Detection rate validated by week 4
0
Defect samples vs 75K supervised baseline

Anomaly Detection Results Across Zero-Defect-Sample Deployments

These outcomes come from iFactory anomaly detection deployments where labeled defect data did not exist at engagement start. Each case reflects 6-month post-deployment performance measured against the customer's pre-AI baseline. Request the case study report for the inspection application most relevant to your production line.

Use Case 01
Semiconductor Wafer Surface Inspection
A semiconductor fab producing advanced logic wafers needed defect inspection for a new 5nm process where defect samples did not yet exist. Supervised approaches would have required 12-18 months of defect collection before deployment could begin. iFactory anomaly detection deployed in 3 weeks using 800 defect-free wafers from qualification lots — detecting 98.7% of known defects and identifying 14 novel failure modes during first-year operation that supervised training would have missed entirely. Combined scrap prevention and avoided customer returns delivered $6M in first-year value.
3 wks
Deployment timeline vs 12-18 months supervised

14
Novel defect modes caught by unsupervised model

$6M
Annual value from scrap and return prevention
Use Case 02
Pharmaceutical Vial Contamination Detection
A sterile injectables manufacturer running 8 vial filling lines needed contamination detection where defect rates below 1 in 500,000 made supervised training impossible — collecting 5,000 defect samples would have required 2.5 billion vials. iFactory anomaly detection deployed using 1,200 good vials, achieving 99.2% detection rate on particulate contamination, glass fragments and closure defects. Regulatory audit trail documented every anomaly with pixel-level localization enabling FDA 21 CFR Part 11 compliance. Zero recall events over 14 months post-deployment vs 2 recalls annually in the 3 prior years.
99.2%
Contamination detection rate on live production

0
Recall events over 14 months post-deployment

2.5B
Vials that would have been needed for supervised training
Use Case 03
Technical Textile Surface Quality Control
A technical textile manufacturer running 12 weaving looms faced 200+ possible defect types (broken threads, foreign fiber, weave irregularity, color variation, staining) making supervised per-class training prohibitively expensive. iFactory anomaly detection deployed using 900 defect-free fabric samples across all product variants, achieving 96.8% detection rate across every defect category simultaneously — no per-class training required. Manual inspection team reduced from 6 to 2 reviewers focused on defect classification rather than initial detection, and customer complaints for surface defects dropped 74% year-over-year.
200+
Defect types covered by a single anomaly model

74%
Reduction in customer defect complaints

67%
Inspection headcount freed for higher-value work

Frequently Asked Questions

How can anomaly detection catch defects if it has never seen defect examples during training?
Anomaly detection learns the statistical distribution of features from good parts and treats any statistically significant deviation as anomalous — no defect examples needed. Pretrained backbones like WideResNet and DINOv2 have already learned general visual features from millions of images, and only need to see 500-1,000 of your good parts to establish what normal looks like specifically for your product. Any scratch, dent, contamination or deformation produces feature vectors distant from the good-part memory bank, triggering detection regardless of whether that specific defect appeared during training. Book a demo to see live anomaly detection on your production images.
How does anomaly detection compare to supervised AI on well-known defect types with large training data?
On defect types with abundant training data (5,000+ samples per class), supervised models can achieve marginally higher precision on those specific classes — typically 99.4% vs 98.6% for anomaly detection. However this narrow advantage disappears when considering novel defect coverage (supervised catches 0% of unseen defect types while anomaly detection catches all deviations), deployment timeline (weeks vs months), and total defect coverage across all failure modes. Most manufacturers find anomaly detection's broader coverage worth the small precision trade-off on known classes.
What if my good parts have natural variation in appearance — does that create false positives?
Natural variation is exactly what the training phase captures. When you feed 500-1,000 good parts representing the full range of acceptable variation (color batches, texture differences, dimensional tolerances, lighting variation across shifts), the memory bank absorbs this variation as part of normal. Only deviations beyond the natural variation envelope trigger anomaly detection. Statistical threshold calibration ensures false-positive rates match your target — typically 0.5-2% depending on inspection criticality and desired sensitivity to subtle defects.
Can anomaly detection localize defects to specific pixels, or just flag the image as anomalous?
Pixel-level localization is a core capability of modern anomaly detection methods including PatchCore and PaDiM used in iFactory's platform. The system generates a spatial anomaly heatmap for every inspected image, highlighting exactly which pixel regions deviate from the good-part memory bank. Operators see precisely where the anomaly occurs and how it differs from normal, enabling root-cause diagnosis for process correction. Localization accuracy on the MVTec-AD benchmark exceeds 97% pixel-level AUROC across 15 industrial categories.
How does anomaly detection handle product changeover in high-mix manufacturing environments?
Each product variant maintains its own memory bank of good-part features. Product changeover triggers automatic switching to the appropriate memory bank based on order data or vision-based product recognition. New product variants only require good-part capture during pilot builds — typically 200-500 samples suffice for initial deployment, then continuous learning augments the memory bank with production samples. High-mix manufacturers deploy dozens of SKU-specific anomaly models sharing the same backbone infrastructure for maximum efficiency.
Skip the Defect Data Bottleneck. Deploy Anomaly Detection in 2-4 Weeks.
iFactory gives quality teams unsupervised anomaly detection with pixel-level localization, universal defect coverage, and novel-defect discovery — fully deployed in 2-4 weeks with 98%+ detection rate demonstrated by week 4 across every production line and product variant.
Zero defect samples required to reach production-grade accuracy
98%+ detection on known, rare, and never-seen-before defect types
Single model covers 100+ defect variants simultaneously
Deploy on new products before any defective sample exists

Share This Story, Choose Your Platform!