Machine vision quality inspection: Define the inspection before choosing AI
A vision project begins with the decision production needs, rather than a camera or a model score. This proposed planning method connects the inspection characteristic, image formation, evaluation data and the line's response. It provides a brief for a bounded feasibility test, with evidence that quality and operations teams can interpret together.

Key takeaways
- Agree defect classes and borderline cases with quality assurance.
- Stabilise image acquisition before comparing models.
- Assess escaped defects and false rejects separately.
1. Make the defect definition testable
Distinguish presence checks, surface defects, pose detection and dimensional measurement. Each requires different evidence. For every product family, define acceptable, defective and uncertain conditions, and identify who resolves disputed examples.
Collect borderline samples and legitimate surface variation. If experienced inspectors disagree, keep that uncertainty visible. Training does not automatically resolve an ambiguous quality specification. Establish a documented reference decision so the test assesses the intended task rather than one person's interpretation.
2. Treat the image as a measurement chain
NI and KEYENCE explain how lighting and the inspection setup affect visible contrast. For project planning, this means testing illumination, optics and presentation before committing to a model architecture. [1][2]
Compare images of the same reference parts under realistic positions and environmental conditions. Record camera settings, distance, trigger timing and cleaning. A model comparison is hard to interpret if acquisition changes at the same time. Freeze one reference setup for the comparison and document later changes separately.
3. Separate development and acceptance data
Do not randomly spread near-identical pictures of the same part across training and testing. Reserve independent lots or production periods for acceptance. Record product revision and imaging conditions so later differences have an explanation.
A test set can deliberately include rare faults, but document its composition. An artificially balanced set does not establish production defect prevalence. Report results by defect class so a good overall score cannot conceal a difficult but commercially important category.
4. Express the consequences of errors
An escaped defect and a falsely rejected good part have different consequences. Agree limits and a review route for uncertain cases. When faults are rare, a high overall accuracy can coexist with poor detection of the faults that matter.
Track four counts: correctly accepted good parts, correctly detected defects, false rejects and escaped defects. Report sample sizes alongside rates. The threshold is an operating decision involving quality and handling effort, rather than a setting that should be chosen to maximise a headline score.
5. Test the line's response
The classifier is one component. Verify triggering, part identity, processing time, physical rejection and confirmation that rejection occurred. A correct prediction assigned to the wrong workpiece is still a process failure.
Specify the response to missing images, camera faults and unknown variants. A second check during the pilot can help explain errors. Production release should record the data version, configuration, recovery method and approval process for future changes. That record makes the system maintainable after the initial team moves on.
A checklist for your next step
- Approve a defect catalogue including borderline samples.
- Record the reference setup and acquisition conditions.
- Reserve independent acceptance lots.
- Verify false rejects, escaped defects and physical rejection together.
Frequently asked questions
Does every inspection need deep learning?
No. Compare a simple rule-based baseline and a learned approach on the same representative task. Maintainability and sufficient performance matter more than model complexity.
Why is accuracy alone insufficient?
It can conceal defect categories and the different costs of errors. Acceptance needs sample counts and separate measures for escaped defects and false rejects.
Sources & further reading
- [1]NI β A Practical Guide to Machine Vision Lighting
- [2]KEYENCE β Machine Vision Lighting Selection Guide
AI-assisted technical guides for orientation. Sources are linked; planning examples are not customer references. Cover images are illustrative visuals from the NOEMA website.


