- Home
- Insights
- Robotics & Automation
- Computer Vision for Quality Inspection: Building a Reliable Defect Detection Pipeline
Computer Vision for Quality Inspection: Building a Reliable Defect Detection Pipeline
Visual inspection projects succeed or fail on lighting, data and thresholds — the model is only one part of the system.

Manual visual inspection is tiring, inconsistent across shifts and hard to scale. Computer vision can inspect every item at line speed and record evidence for each decision. But automated inspection projects frequently underperform when teams focus on the model and neglect imaging conditions, defect data and how decisions flow into production. This article describes the full pipeline.
The inspection pipeline
- ImagingCamera, lens, lighting, trigger
- Pre-processingCrop, align, normalise
- ModelClassify, detect or segment defects
- DecisionThresholds and rules
- ActionReject, flag or log
- ReviewHumans audit edge cases
Get the imaging right first
Consistent images make everything easier. Key decisions include:
- Lighting: diffuse lighting reduces glare on shiny parts; backlighting highlights outlines; low-angle light reveals scratches.
- Camera and lens: resolution must capture the smallest defect you care about.
- Triggering: sensors or PLC signals capture parts in the same position each time.
- Enclosure: shielding from ambient light changes improves stability.
A day spent improving imaging can save weeks of model tuning.
Collect defect data deliberately
Defects are rare by design, so datasets are imbalanced. Strategies include:
- Collect images over weeks to capture natural variation.
- Keep known-defective samples for controlled imaging.
- Agree on defect definitions with quality engineers and label consistently.
- Consider anomaly detection approaches that learn "normal" appearance when defect examples are scarce.
Choosing a model approach
| Approach | Output | Fits when |
|---|---|---|
| Classification | Pass / fail or defect type | Whole-image decisions |
| Object detection | Boxes around defects | Location matters, multiple defects |
| Segmentation | Pixel-level defect areas | Size or area thresholds |
| Anomaly detection | Deviation from normal | Few defect examples |
Classical rule-based vision (measurements, template matching) remains effective for dimensional checks and should not be discarded.
Thresholds and the cost of mistakes
A false reject wastes a good part; a false accept ships a defective one. Set thresholds based on the relative cost of each, and consider a "review" band between pass and fail where uncertain items go to a person.
Human review and continuous improvement
Operators review flagged items and confirm or overturn decisions. Those decisions become new labelled data. Track false-accept and false-reject rates by shift and product variant to spot drift — for example after a lighting change or new material supplier. Our vision inspection concept dashboard illustrates a review workflow.
Integration with the line
Inspection results must reach the systems that act on them: PLCs for rejection, MES for traceability, dashboards for supervisors. See manufacturing software and MES.
Benefits and limitations
Automated inspection provides consistent checks, full traceability and data for root-cause analysis. Limitations include sensitivity to environmental changes, difficulty detecting defect types never seen before, and the upfront effort in imaging and labelling.
Implementation considerations
- Run a feasibility study on real parts before committing to a full rollout.
- Plan compute at the edge for low latency — see edge AI.
- Store images with decisions for audits and retraining, within retention policies.
Frequently asked questions
Can one model inspect several product variants?
Often, if variants share appearance. Very different products may need separate models or configurations.
How long does a vision inspection pilot take?
It depends on imaging complexity and data availability. Feasibility studies on sample parts are typically the quickest way to estimate effort.
What happens when the product design changes?
Expect to collect new images and update or retrain the model. Plan this into change processes.
Explore vision inspection with ALPIXN
ALPIXN builds computer vision pipelines and operator review tools. Learn about our computer vision development or request a feasibility discussion.
This article was drafted by the ALPIXN Editorial Team with AI assistance and edited for accuracy and clarity. It is general guidance, not legal, financial or medical advice.



