Home / Blog / Factory edge vision
Industrial AI and Quality Engineering

Edge Vision for Factory Quality Control: From Camera to Verified Reject

A vision model does not inspect a product in isolation. It receives pixels produced by a camera, lens, lighting, fixture, trigger and line state. If those change, the model sees a different problem. A production inspection system therefore needs controlled image acquisition, a traceable decision and a safe path for uncertain parts.

Map the complete inspection path

Every stage needs a measurable contract and failure behavior
1 / TriggerPLC or encoder ties capture to the correct part and station.
2 / AcquireCamera, lens, exposure, optics and lighting create repeatable pixels.
3 / InferVersioned model returns class, score and defect location.
4 / DecideCalibrated policy accepts, reviews or rejects within time budget.
5 / ReconcilePLC confirms actuation; operator and quality records close the loop.

Start with the inspection requirement, not a model architecture: which defect matters, on which surface, at what size and line speed? Lock focus, working distance, field of view, exposure, lighting geometry and fixture. Diffuse, dark-field, backlight or polarized illumination can reveal different features; changing a light or camera mount should be managed as a process change, not a harmless maintenance tweak.

Make acquisition reproducible

Capture a recipe with camera serial, lens, light intensity, exposure, gain, trigger mode, product variant and station identifier. Use hardware triggers or encoder position when timing matters; an asynchronous software request can photograph the previous or next part. GenICam provides a common camera feature interface across supported transport technologies, but it does not make optics, timing or vendor-specific behavior identical. Test the actual camera/driver combination and keep a known-good acquisition fixture.

At the edge, record image hash or durable image ID, part ID, model and preprocessing versions, decision threshold, inference time and actuator acknowledgement. Store full images according to quality policy and privacy constraints; if retention is limited, keep a traceable sampled set plus decision metadata. Never let a network timeout silently turn into “pass.”

Scores are not factory decisions

Model outputOperational policyControl to validate
High-confidence known defectReject or divert only when the PLC confirms the matching part.Measure escape rate and reject actuation accuracy.
Borderline score or unfamiliar anomalyRoute to a staffed review lane; keep production state explicit.Track review queue, disposition and time-to-clear.
Low-quality image or camera faultReacquire once if safe, otherwise hold or stop per line procedure.Detect blur, occlusion, saturation and trigger loss.
Model or edge service unavailableUse the approved fallback; never infer “good” from no result.Exercise watchdog, bypass authorization and recovery.

Choose thresholds using the cost of a missed defect, false reject, rework and line stop. A single accuracy score hides class imbalance and operating point. Measure per-defect recall, false rejects per shift, precision, review volume, latency percentiles and drift by product variant, lot, lighting and station. Preserve the threshold and calibration set used for each release.

Benchmark data is not production approval

MVTec AD 2 is a useful anomaly-detection benchmark because it includes difficult scenes and changing illumination. Its training and validation sets contain defect-free images, which reflects settings where failures are scarce. But public benchmark results do not demonstrate performance on your camera, product, takt time or defect economics. Its published dataset license is CC BY-NC-SA and prohibits commercial use; do not put it into a commercial training pipeline without confirming permission.

Build a site-specific validation set from representative lots, shifts and lighting states. Separate data by time or production batch to avoid near-duplicate leakage. Have quality experts define defect labels and adjudicate disagreements. Run shadow mode before actuation, compare model decisions with the existing inspection process and document the release gate with manufacturing and quality owners.

Operate the model like a production service

Version model, preprocessing, camera recipe and threshold as one release bundle. Monitor input quality, score distributions, reject/review rates, queue depth, inference latency, edge temperature and storage. A scheduled model update must not bypass validation simply because software deployment is automated. Provide rollback to the last approved bundle and retain the decision trail needed to investigate a disputed part.

What I would build

I would begin with one defect on one station, a fixed optical setup and a read-only shadow deployment. A local service would associate encoder-triggered images with part IDs, infer on an edge GPU or industrial PC, and publish a structured result to a PLC gateway. Only after threshold calibration, human review workflow and fault handling passed witnessed trials would the line enable a reject actuator.

In summary

Factory vision is an imaging and operations system with a model inside it. Control the optics, bind every inference to the right part, treat uncertain output as a workflow state, measure escapes and false rejects, and validate on production-representative data. The safe reject is the one that can be traced and verified.

Sources