Visual inspection looks like the easiest AI project in a factory: point a camera at the part, label good and bad, deploy. In practice most failures come from the physical setup - lighting, part presentation, trigger timing - not from the model.

That is why a serious inspection project starts with the defect and the cell, and only then discusses neural networks.

Start with the defect, not the camera

List the defect classes you actually need to catch, with examples and where they occur:

AreaTypical defectsWhat makes detection hard
Paint and bodyRuns, orange peel, dust, dents, scratches, gap and flushReflections and lighting angle change the appearance
WeldingSpatter, porosity, incomplete weldGlare and hidden geometry
Moulding and trimShort shots, flash, sink marks, colour variationSubtle contrast against a textured surface
AssemblyMissing clip, wrong fastener, misrouted harnessMany variants on one line
Labels and packagingWrong label, unreadable code, missing documentUsually solvable with OCR and rules, not vision models

For each class, answer three questions: how often does it occur, who catches it today, and what does a miss cost? A defect that appears once a month cannot train a model on its own. Use a checklist, a gauge or a poka-yoke fixture instead.

The physics of a reliable inspection cell

  • Lighting: fixed, diffused and shielded from daylight. Most "model failures" are lighting changes between shifts.
  • Presentation: the part must sit in the same position and orientation every cycle. Fixturing beats a more complex model.
  • Resolution: enough pixels across the smallest defect you must see, with margin.
  • Trigger: from the PLC or an encoder, not a timer.
  • Reject: a mechanism that removes or marks the part, with confirmation that it happened.
  • Golden samples: physical reference parts for setup and drift checks.

No amount of model tuning fixes a blurry image or a part that is rotated 20 degrees differently each cycle.

Data and labelling

Collect images under real production conditions, across shifts and part variants. Include good parts - a dataset of only defects teaches the model nothing about normal variation.

Write the accept/reject standard down with photographs of the boundary cases. Two inspectors labelling the same part differently will produce a model that cannot be trusted, and the disagreement is a quality-management problem before it is a data problem.

Split the test set by production day or part batch, not by random frame. Otherwise near-identical frames from the same part appear in both training and test, and the reported accuracy is inflated.

Accuracy claims to interrogate

Ask any vendor for defect prevalence, dataset size, false reject rate, escape rate, and how the threshold was chosen. A single "99.8% accuracy" on a balanced test set says almost nothing about a line where defects are rare.

Report performance per defect class, plus the share of frames sent to human review. A system that is accurate because it defers half the parts to a person is not the same as one that inspects them.

Architecture

Edge inference on a line PC or industrial GPU keeps latency predictable and avoids depending on the internet. The cell needs a deterministic handshake with the PLC, results written to the MES with an image reference, and a review station for flagged parts.

Decide what happens when the model service fails. Fail open to human inspection with an alarm is usually safer than stopping the line silently; never fail silently and let parts pass unchecked.

Human in the loop

Inspectors must be able to override a decision and label why. Those overrides are the most valuable training data you will get. Review the disagreement queue weekly, and treat an operator switching the system off as a signal that the cell or the threshold is wrong, not that the operator is difficult.

Standards and traceability

Automotive supply chains expect quality-management discipline: control plans, approval of production parts, traceability and documented change control. The vision system has to fit that system, not run beside it. A model update is a process change and should be approved and recorded like one, especially where IATF 16949 obligations apply.

Pilot design

One station, one part family, eight to twelve weeks. Baseline escape rate, false reject rate, rework hours, inspection cycle time and scrap. Run in shadow mode for two weeks - flag but do not reject - so inspectors can compare the system against their own judgement before it has authority.

Costs

Cameras, lenses, lighting and fixtures; edge hardware; PLC/MES integration; labelling effort, which is routinely underestimated; and ongoing retraining when parts or processes change. A single-station pilot is a very different budget from a plant rollout, and the second station is usually cheaper than the first because the integration pattern is already proven.

Failure modes

  • Lighting drift and daylight contamination.
  • A new part geometry or paint colour without retraining.
  • Rare defect classes with too few examples.
  • Operators bypassing the system because false rejects slow the line.
  • No one owns the model after the project ends.
  • Integration that halts production on an error.

Questions we get asked

Can we use our existing cameras?

Sometimes, if they are fixed, well-lit and positioned consistently. In many cases the camera is fine and the lighting and fixture are not. Assess the cell before buying new hardware.

How many defect images do we need?

It depends on the defect variety, not a fixed number. Start with what you can collect across shifts and variants, and expect to keep collecting after go-live.

Will it work for a low-volume, high-mix line?

It can, but each variant needs representation in the data and a clear change process. High-mix lines usually need a configuration layer as much as a better model.

Can it inspect 100% of parts?

Yes, if the cycle time and cell design allow it. The constraint is usually part presentation and takt time, not inference speed.

Fix the light, the fixture and the trigger first. Then measure how much of the defect problem is left for a model to solve.