Home / Insights / AI and Machine Learning
AI and Machine Learning
Computer Vision for Visual Inspection in Manufacturing: A Checklist Before You Build
Automated visual inspection can catch defects and missing parts consistently across shifts, but most projects that struggle do so because of lighting, sample images or unclear acceptance criteria rather than the model. This checklist covers what to settle before building.
TopicsAI and Machine LearningBusiness Operations and Integration
Key takeaways
- Fix the imaging setup first. Consistent lighting, camera position and resolution often matter more than the choice of model.
- Agree in writing what counts as a defect, with example images, before anyone labels data. Inspectors frequently disagree at the margins.
- Defects are rare, so collect them deliberately. Plan how to gather enough examples of each defect type.
- Decide the acceptable miss rate and false-reject rate with quality and production leads; they pull in opposite directions.
- Run in parallel with human inspection before any automatic reject, and keep a review path for uncertain results.
On this page
Visual inspection is a natural fit for computer vision: a repetitive task, done at speed, where human attention fades over a long shift. Typical targets include surface defects such as scratches, dents or discolouration; assembly verification such as missing screws, labels or components; and dimensional checks against tolerances.
In computer vision development projects, the first step we recommend is reviewing sample images and setting a target accuracy. That step exposes most of the risks early. This checklist expands on it for manufacturing and quality leads who are scoping an inspection system. For the system that typically consumes inspection results, see our guide to manufacturing execution systems.
1. Define the inspection task precisely
“Detect defects” is too broad. Each inspection point should have a short specification:
- Which part or product, at which station, and at what line speed.
- Which defect types, each with a name, description, and several example images.
- The visual task: classify (good or bad), detect and locate (where is the defect), segment (exact area), read (a label or code), or measure.
- The action on failure: reject automatically, divert for manual check, alert an operator, or log for trend analysis.
- Grading rules: minimum defect size, positions where defects are acceptable, cosmetic versus functional defects.
The grading rules are where projects often stall. Experienced inspectors make borderline calls from tacit knowledge. Bring two or three inspectors together to label the same sample set; where they disagree, the specification needs work before a model can learn it.
2. Get the imaging conditions right
A model can only find what the camera can see. Before collecting training data, stabilise the physical setup.
| Factor | Questions to answer | Typical fixes |
|---|---|---|
| Lighting | Does ambient light change across shifts or seasons? Do reflective surfaces cause glare? | Enclosures, controlled LED lighting, diffuse or angled lighting to reveal surface texture |
| Camera position | Is the part always in the same place and orientation? | Fixtures, guides, triggers from sensors so images are captured at a consistent moment |
| Resolution | Is the smallest relevant defect clearly visible in pixels? | Higher-resolution camera, closer mounting, or multiple cameras per part |
| Motion | Does line speed cause blur? | Faster shutter, strobe lighting, or capturing when the part is momentarily stationary |
| Coverage | Can defects appear on surfaces the camera does not see? | Additional cameras, mirrors, or rotating the part |
Time spent here reduces the amount of training data needed, because the model does not have to learn to ignore irrelevant variation. If you plan to reuse existing cameras, test whether their images actually show the defects at the required size before committing.
3. Plan how to collect defect examples
Good parts are plentiful; defective ones are rare by design. That imbalance shapes the data plan.
- Collect continuously from the line for a period and have inspectors label the defective images.
- Use the scrap and rework area. Rejected parts can be re-imaged under the production setup.
- Create controlled samples where safe and realistic, for example deliberately omitting a component in assembly.
- Record variation: different batches, suppliers, colours and shifts, so the model does not overfit to one condition.
- Consider anomaly-style approaches where defect types are many and rare: train on good parts and flag anything that departs from them, then route those flags for human review.
Keep a separate, untouched test set that reflects real production conditions, including borderline cases. This is the set on which acceptance will be judged.
4. Agree acceptable error rates with quality and production
An inspection system makes two kinds of mistakes, and different stakeholders feel each one:
| Error | What happens | Who feels it |
|---|---|---|
| Missed defect (false accept) | A defective part ships or moves to the next stage | Quality, customers, warranty costs |
| False reject | A good part is scrapped or sent for re-inspection | Production yield and throughput |
The decision threshold trades one against the other. Agree targets jointly, expressed in operational terms (“no more than a set number of manual re-checks per shift, while catching all examples of critical defect type A in the test set”). Different defect types may warrant different thresholds: a safety-critical missing component is not the same as a minor cosmetic mark.
Also decide what happens to low-confidence results. A three-way outcome (pass, fail, send to human) is usually more practical than forcing every image into pass or fail.
5. Choose where the model runs and how it integrates
- Edge hardware near the line (for example an industrial PC or an embedded GPU module) suits strict latency requirements and sites with limited connectivity.
- On-premises server suits several cameras on one site with central management.
- Cloud suits lower-speed inspection, central analytics and retraining, but depends on network reliability.
Integration points to plan: the trigger from the line, the reject mechanism or PLC signal, the operator display, image storage for audits and retraining, and reporting into quality or MES systems. Our article on choosing cloud, edge or on-device vision compares the deployment options in more depth.
6. Roll out in stages and keep improving
- Offline evaluation on the held-out test set against the agreed targets.
- Shadow mode on the line: the system records decisions while human inspection continues. Compare results daily.
- Assisted mode: the system flags parts for inspectors, who confirm. Their decisions are captured as labels.
- Automatic decisions for defect types and products where performance is consistently proven, with human review for uncertain cases.
- Monitoring: track reject rates, review outcomes and image quality. A sudden change in reject rate often means a lighting or camera problem, a new supplier batch or a product change.
Plan for change: new product variants, new defect types and line modifications all require new images and retraining. Build the review loop and labelling tool as part of the system, not as an afterthought.
Frequently asked questions
How many images do we need to start?
It depends on the number of defect types, how visible they are, and how consistent the imaging is. A controlled setup needs far fewer images. Reviewing a sample set early gives a realistic estimate for your case.
Can we use our existing CCTV or line cameras?
Sometimes. Test whether the defects are clearly visible at the required size and whether lighting is consistent. Many inspection projects need dedicated cameras and lighting for reliable results.
What if inspectors disagree on what counts as a defect?
Resolve it before training. Run a labelling session with several inspectors on the same images, discuss disagreements, and update the written specification with examples.
Will the system work when we introduce a new product?
Usually only after collecting and labelling images of the new product. Plan retraining into your product introduction process.
Related reading
Continue your research
Can your cameras actually see the defects you need to catch?
Send us sample images from your line. We will review imaging conditions and defect examples and suggest a realistic target accuracy and pilot scope.
