Quality Inspection
The application where computer vision is most mature and least contentious: a controlled scene, a defined defect, and no people in frame.
Procedure
Inspecting manufactured items is where machine vision has worked reliably for decades, and where the modern learned approaches have added genuine capability.
Why it works here
The scene is controlled. Fixed camera, fixed distance, fixed lighting, consistent background.
The object is presented consistently.
The defect classes are definable, because someone already inspects for them.
Ground truth exists, because the item can be examined afterwards.
No people in frame, which removes the entire privacy and fairness question.
Almost every difficulty described elsewhere in these notes is absent, which is why this application succeeds where others disappoint.
Rule-based against learned
Both are current and they suit different problems.
Rule-based measurement — dimensions, presence, alignment, colour within tolerance — is deterministic, explainable and does not need training data. For anything measurable, prefer it.
Learned models handle variable appearance: surface finish, textile flaws, natural materials, defects that vary in form.
A learned model where a measurement would do adds opacity and a data requirement for no benefit.
Many production systems use both: measurement for the specifiable checks, a model for the ones that resist specification.
The data problem
Defects are rare, which is the point and the difficulty.
A line running at high yield produces very few examples of each defect class.
Options: collect over a long period; deliberately produce defective samples; augment; or use anomaly detection trained only on good examples.
Anomaly detection is attractive here because it needs no defect examples, and it flags anything unusual rather than a named class — which means it also flags a change in lighting.
Expect the data collection to take longer than the model work.
Setting the operating point
Two error types with very different costs, and the ratio is a business decision.
A missed defect reaches a customer.
A false rejection scraps a good unit.
Compute both costs and choose the threshold deliberately, rather than accepting a default.
A common arrangement: tune for high recall and route rejections to human review, which converts false rejections from scrap into inspection time.
Evaluating it properly
Against physical ground truth, by examining a sample of both accepted and rejected units.
Rejections alone are not enough: they tell you about false positives and nothing about what got through.
Sample the accepted stream, which is the only way to measure escapes.
Per defect class, because overall performance hides a class the system never catches.
Continuously, because the process drifts: new supplier, new batch, new tooling.
What changes over time
Material and supplier changes alter appearance.
Tooling wear changes defect characteristics.
Line speed changes the blur.
Lighting ages, which shifts colour and brightness.
Re-evaluate after every process change, and treat unexplained changes in reject rate as a model question before assuming the line got worse.
Sampling the accepted stream
The evaluation step that measures escapes, and the one almost nobody does.
Rejections tell you about false positives only.
Sample accepted units and inspect them physically.
That sample is the only measure of what got through, which is the error that reaches a customer.
Size it to the defect rate, which for a rare defect means a large sample or a long period.
Report escapes alongside the reject rate, because a system tuned to reduce rejections is a system letting more through.
Prefer a measurement to a model
Where the property is measurable, a rule beats a learned model.
Dimensions, presence, alignment, count, colour within tolerance are all deterministic.
A rule is explainable, needs no training data, and does not drift.
A learned model where a measurement would do adds opacity, a data requirement and a maintenance burden for no benefit.
Reserve learned models for what resists specification: surface finish, natural materials, defects that vary in form.
Most production systems use both, and the split should be a decision rather than a default.