Skip to content
Hakan KaracaENGINEERING JOURNAL
AI & Intelligent AutomationEki 8, 20264 min read

Computer Vision for Quality Inspection: From a Convincing Demo to a Validated Process

A production vision system is not just a model. Lighting, optics, mechanics and data quality determine whether the inspection works.

A camera sees pixels; a production line needs a dependable quality decision. Between those two statements lie illumination, optics, trigger timing, representative data, acceptance criteria, traceability and the less glamorous question of what the line should do when the inspection computer stops responding.

Computer vision can support presence checks, orientation verification, surface-defect screening, label reading, dimensional estimation and many other inspection tasks. A demonstration can be impressive while hiding the conditions that will determine performance after deployment.

Write the inspection specification before collecting images

Define the defect or condition in operational terms. What precisely counts as a defect? Which product variants are in scope? What tolerance applies? Is the system required to detect every instance, or is it an assistive screen followed by human review? Who owns the final acceptance decision? “Looks wrong” is an understandable operator comment but not yet a testable specification.

Then define the cost of error. A false reject can reduce yield and create rework; a false accept can release a defective product. Their relative consequences differ by product, process and risk class. That asymmetry should shape the decision threshold, sampling strategy and escalation route.

Optics and process control often outperform model tuning

Stabilise the image before optimising the network. Fix the field of view, exposure, illumination geometry, focus, distance and part positioning. Reflections from glossy surfaces, ambient-light variation, dust on a lens and motion blur can shift the input distribution more dramatically than a modest model architecture change.

Synchronise image acquisition with the physical process. If the trigger arrives late, the camera may inspect the previous part while the result is assigned to the next one. The model can have excellent accuracy and still make a terrible production decision. Tie each image and result to a reliable part or cycle identifier, and define how retries or missing frames are handled.

Dataset design is a production engineering task

Collect images across expected variants, shifts, suppliers, lighting conditions and normal process variation. Include representative defects, but do not create a training set that consists only of dramatic failures photographed under ideal laboratory conditions. Rare defect classes are especially vulnerable to optimistic metrics when the test set is too small.

Keep training, validation and test partitions independent at the level that matters. Randomly splitting near-duplicate frames from the same production run across both train and test can overstate generalisation. A stronger test may hold out time periods, batches, production lines or equipment configurations that were not used during training.

Metrics should match the quality decision

  • Recall / sensitivity: how many true defect cases were detected?
  • Precision: how many flagged cases were actual defects?
  • False-accept rate: how often did defective items pass?
  • False-reject rate: how often were conforming items held or rejected?
  • Latency and throughput: can the full image-to-decision path meet line timing with margin?
  • Stability by subgroup: do results differ across product variants, shifts, surfaces or suppliers?

A single “accuracy” figure hides the class balance and error costs. If 99.5% of products are conforming, a model that always predicts “good” achieves 99.5% accuracy and is completely useless for defect detection. The metric has passed; the engineering has not.

Define the runtime state machine

Do not integrate the vision system as a naked Boolean if the process needs richer behaviour. A useful interface may distinguish PASS, FAIL, INCONCLUSIVE, NO_IMAGE, TIMEOUT and MODEL_UNAVAILABLE. For every state, define the machine response, operator message, retry policy and traceability record.

For high-consequence decisions, an “inconclusive” result should not silently become “pass”. Use a controlled hold, a repeat image or a qualified manual inspection according to the approved process. Keep the model’s version, camera configuration and relevant decision evidence with the result so an investigation can reconstruct what happened.

Monitor drift after release

Monitor lighting changes, camera fouling, input distribution, false-reject rates, manual overrides and product variants. Ground-truth feedback may arrive only after downstream inspection or quality review, so monitoring cannot rely solely on the model’s own confidence. Establish requalification criteria and a controlled process for changing weights, thresholds, optics or preprocessing.

Deployment checklist

Before production release, test ordinary parts, known defect classes, borderline cases, misalignment, missing images, communication interruption, restart, model-version mismatch and worst-case line rate. Confirm evidence retention and operator training. A vision model should be assessed as one component in the inspection process—not treated as the process itself.

The best production vision system is not the one that gives the most confident demo. It is the one whose limits are known, whose failures are handled deliberately and whose decisions can be explained during a quality investigation.

References and further reading

  1. NIST AI Risk Management Framework