Classical machine vision — blob analysis, edge detection, template matching — has been the backbone of industrial inspection for three decades. Convolutional neural networks arrived more recently and now handle defect detection tasks that classical vision handles poorly. Understanding when to use which is not an academic question. It has direct consequences for false reject rate, escape rate, and model maintenance burden.
What Classical Machine Vision Does Well
Classical machine vision algorithms work by applying deterministic rules to pixel data. Blob analysis segments connected regions by intensity threshold and measures geometric properties — area, circularity, bounding box dimensions. Edge detection (Sobel, Canny) finds boundaries between regions by gradient magnitude. Template matching correlates an inspection image against a stored reference image or feature patch.
These methods are fast. A blob analysis pass on a 5MP image runs in under 3ms on current industrial vision hardware. They are also interpretable: when a part fails, the algorithm can report exactly which blob was out of specification, what its measured area was, and what the acceptance threshold was. For a QC engineer preparing a SCAR response, that interpretability matters.
Classical MV performs reliably when defects have consistent, well-defined geometry. Missing fastener holes on a stamped bracket — the hole is either present or absent. Dimensional deviation on a machined shoulder — measure the edge position against a calibrated reference. Label presence on a consumer goods package — the label is either in the correct zone or it is not. These are binary or threshold decisions against known geometry. A well-configured classical MV rule set achieves >99.5% accuracy on these defect types with sub-1% false reject rate.
Classical MV also has a low training data requirement. A template matching or dimensional check can be configured and validated with 20–50 known-good parts. No defect examples required. That matters on a new production line where defect samples do not yet exist.
Where Classical MV Breaks Down
Surface anomalies do not have consistent geometry. A surface scratch on a stamped aluminum panel can be 0.3mm wide or 3mm wide, 15mm long or 80mm long, oriented in any direction, and at any location on the part surface. A paint orange-peel defect is a texture variation with no sharp edges. A welding spatter artifact is a small bright blob that looks similar to specular reflections from legitimate surface features.
Classical MV handles these cases by setting pixel intensity thresholds or texture variance limits. The problem is that the threshold that catches 90% of scratches also catches 8% of acceptable parts with surface variation from lighting angle changes, part fixture position variation, or ambient reflection. Tightening the threshold catches more defects and generates more false rejects. Loosening it reduces false rejects and misses marginal defects. The optimal operating point on that tradeoff curve is difficult to find and unstable across production shifts as lighting ages and part surface finish varies batch to batch.
What CNN-Based Detection Adds
A convolutional neural network trained on labeled defect images learns to recognize defect class independently of specific geometry, position, or orientation. A CNN trained on 800 labeled scratch images — split roughly 70/30 between rejects and false-alarm borderline cases — learns the visual signature of a scratch as a texture pattern rather than a threshold rule. It generalizes to scratch orientations and sizes it has not seen during training, as long as they fall within the distribution of the training data.
For surface defect detection on stamped metal, painted plastic, or coated board, CNN-based classifiers reduce false reject rate by 40–60% compared to classical threshold methods, at equivalent or better defect recall rates — based on plant benchmarks from deployments on Midwest automotive Tier 2 lines. The physics of why is straightforward: the CNN represents defect class as a learned feature map rather than a handcrafted rule, and learned feature maps are more tolerant of surface appearance variation within the same defect class.
The architectures used in industrial surface inspection are not large foundation models. EfficientNet-B2 or EfficientNet-B3 run inference in 30–45ms on a mid-tier GPU at 1080p input resolution — fast enough for 100% inspection at most conveyor speeds. For anomaly detection on parts where labeled defect samples are scarce, PatchCore-based approaches train on normal-only images and score deviation from normalcy at inference time. PatchCore can be initialized with 200–400 normal-part images, making it practical for product families early in production where defect examples are not yet available.
The Real-World Defect Class Imbalance Problem
A practical complication that neither classical nor CNN-based approaches solve automatically: defect class imbalance. On a production line running 10,000 parts per day with a 0.1% defect rate, you generate 10 defective parts per day. After a week, you have 70 defective part images. After four weeks, you have 280 images — and those 280 images may span six different defect classes unevenly, with 180 images of the most common defect type and 8 images of the rarest.
A CNN trained on that distribution will be highly accurate on the common defect class and unreliable on the rare classes. Strategies for managing this:
- Defect augmentation: Synthetic augmentation of rare defect images — rotation, crop, brightness shift — to pad the minority classes. Augmentation helps, but fabricated variants cannot substitute for real defect diversity if the defect class has distinctive geometric characteristics that augmentation cannot reproduce.
- Few-shot learning: Prototypical networks and Siamese network architectures can learn to distinguish defect classes from 5–15 examples per class. These approaches are more sensitive to real borderline cases than augmented data training but require more careful threshold calibration at deployment.
- PatchCore for rare defects: When a defect class has fewer than 20 labeled examples, treating it as an anomaly (deviation from normal) rather than training a separate classifier class often performs better than a multi-class CNN.
We're not saying CNN always outperforms classical MV — that framing misses the point. For dimensional checks, presence/absence verification, and barcode reading, classical MV is faster, simpler to configure, and more interpretable. For surface texture anomalies and ambiguous visual defects, CNN-based approaches perform better and maintain that advantage across production variation that destabilizes threshold-based rules.
A Practical Decision Framework
The answer in production is almost always a hybrid inspection pipeline:
| Defect Type | Recommended Approach | Reason |
|---|---|---|
| Dimensional check (edge position, hole diameter) | Classical MV — caliper measurement | Deterministic, calibrated, no training data required |
| Feature presence/absence (clip, fastener, label) | Classical MV — blob analysis or template match | Binary decision, high accuracy, low latency |
| Surface scratch, pit, dent on metal or painted part | CNN classifier (EfficientNet or similar) | Learns appearance-based defect class, tolerant of surface variation |
| Texture defect (orange-peel, weld spatter pattern) | CNN or PatchCore anomaly detection | No sharp geometry; anomaly scoring handles appearance gradient |
| New part family, no defect history | PatchCore normal-only training | Initializes on good parts only; no defect labels required |
| Barcode / date code legibility | Classical MV — OCR or barcode decode | Deterministic string match against format spec |
The Eolvision inspection pipeline runs both subsystems in parallel for each part: the classical MV module handles dimensional and presence checks in under 15ms; the CNN module handles surface classification in 30–80ms depending on model size and GPU tier. The combined verdict is issued at the slower of the two, typically under 120ms total.
For more detail on how the inspection pipeline applies to specific part families, see the inspection capabilities page. For automotive-specific defect types and the line configurations where hybrid inspection has the strongest ROI case, see the automotive inspection page.