Guide · Practical AI education

Setting up computer vision inspection on the line

A practical guide to cameras, lighting, part presentation, labeling, edge hardware and acceptance testing for AI-based visual inspection.

Key takeaways

  • Define each defect type, the minimum size that matters and the action on a reject before choosing hardware.
  • Calculate resolution from the smallest defect and field of view, and treat lighting and part presentation as primary design choices.
  • Write a labeling guide and measure agreement between human labelers before training.
  • Accept the system on a blind test of escape rate, false reject rate, repeatability and throughput against the current method.

Define the inspection task precisely

Vision projects go wrong most often at the definition stage. “Find defects” is not a specification. Before choosing hardware, write down every defect type you need to catch, the smallest size that matters, where on the part it can occur, and what currently counts as acceptable. Collect physical limit samples: good parts, clearly bad parts and borderline parts that inspectors disagree about. Those borderline samples will define the hardest part of the project.

Also decide what the system must do with a result. Flag a part for human review, divert it automatically, stop the line, or log a measurement for process control? Each implies different requirements for speed, reliability and integration with the PLC.

Cameras and optics

Image quality sets the ceiling for any model. Work out resolution from the smallest defect you need to see. A common rule of thumb is that a defect should span several pixels in each direction to be detected reliably.

Example: if the field of view is 200 mm wide and the smallest defect that matters is 0.5 mm, and you want that defect to cover at least four pixels, you need 200 / 0.5 x 4 = 1,600 pixels across the field of view. A sensor with somewhat more than that gives margin for positioning variation. Run this calculation for your own part before talking to anyone about cameras.

  • Area scan cameras suit discrete parts that stop or move slowly through the field of view.
  • Line scan cameras suit continuous material such as web, sheet, film or coil, and cylindrical parts that rotate.
  • 3D sensors, using laser triangulation, structured light or stereo, suit height, flatness, volume and dents that do not show up in 2D contrast.
  • Lens choice matters as much as the sensor. Telecentric lenses remove perspective error for measurement; standard lenses are cheaper and fine for many surface checks.

Account for exposure time and motion. A moving part blurs if the exposure is too long, which pushes you toward strobed lighting and faster sensors.

Lighting and part presentation

Lighting is where experienced vision engineers spend their time, because a defect that is not visible in the image cannot be found by any model. Different lighting geometries reveal different defects.

LightingGood for
Diffuse dome or on-axisShiny or curved surfaces where glare hides defects
Low-angle or dark fieldScratches, embossing, surface texture and raised features
BacklightSilhouettes, hole presence, edge profiles and dimensional checks
Structured or line light3D shape and surface height
Specific wavelengths, including infrared or ultravioletContrast on certain materials, fluorescent markers, seeing through some packaging

Enclose the station to block ambient light from windows, overhead fixtures and forklift lights. Present parts consistently: fixtures, guides or a robot that places each part in the same position and orientation. Every bit of variation you remove mechanically is variation the model does not have to learn. Test with real parts from production, including dirty, oily and off-color ones, not just clean samples from the lab.

Collecting and labeling images

Deep learning models need examples of both good and defective parts, and defects are usually rare. Plan how you will collect enough of them. Options include saving images from production over weeks, pulling known defective parts from quarantine, and using parts from the scrap bin. Some approaches train mainly on good parts and flag anything unusual, which helps when defects are rare, but you still need defect examples to test the system.

Labeling deserves more attention than it usually gets:

  • Write a labeling guide with photos of each defect class and clear rules for borderline cases.
  • Have experienced inspectors label, and have two people label a sample independently to measure how often they agree. If humans disagree, the model will inherit that confusion.
  • Track which images came from which line, shift, lot and lighting setup so you can check that the training set covers real variation.
  • Keep a held-out test set that is never used for training, and add to it as new defect types appear.

Edge hardware and integration

Most inline inspection runs on hardware near the line rather than in the cloud, because the decision must arrive within the cycle time and the line must keep running if the network goes down. Options range from smart cameras with built-in processing, to industrial PCs with GPUs, to compact accelerator modules. Size the hardware for the inference time you need, with margin, and for the environment: temperature, dust, washdown and vibration.

Plan integration with controls early. The vision system typically receives a trigger from a sensor or PLC, captures and processes the image, and returns a pass, fail or class result, often over a fieldbus or industrial Ethernet protocol. Decide how rejects are tracked so the right part is diverted, how images and results are stored for traceability, and how model updates are deployed and rolled back under change control.

Acceptance testing

Do not accept a vision system on a demo. Run a formal test with a blind sample set that includes good parts, each defect type, and borderline parts, with the true status of every part established by expert review. Measure:

  • Escape rate: defective parts the system passed. For critical defects, this is usually the number that matters most.
  • False reject rate: good parts the system failed. High false rejects create rework, scrap and operator distrust.
  • Repeatability: run the same parts through several times and check that results are consistent.
  • Throughput: confirm the system keeps up at full line rate, including at the start of a shift and after a changeover.

Compare against the current inspection method on the same parts. If manual inspection is the baseline, measure its escape and false reject rates too; they are often worse than people assume. For regulated products, align the test with your validation procedures and document the protocol before running it.

Keeping it working after go-live

Vision systems drift. Lights age, lenses get dirty, suppliers change material, and new defect types appear. Schedule lens cleaning and lighting checks, keep a set of golden parts to run at shift start, monitor the reject rate over time for unexplained changes, and save images of uncertain results for periodic review and retraining. Assign an owner who is responsible for the station after the integrator leaves.

Related use cases

Quality

Visual quality inspection

Cameras and computer vision models inspect parts on the line to catch surface, assembly and dimensional defects consistently.

Computer visionMachine learning
Proven, scaling8 software companies

Operations & production

Manual assembly analytics & operator guidance

Cameras and sensors guide operators step by step and verify each manual assembly step, catching errors before the part moves on.

Computer visionMachine learningIndustrial IoT & edge
Proven, scaling3 software companies

Put AI to work

Find the AI opportunities hiding in your plant.

Genvo, our implementation partner, works with manufacturers to pick the right first project, connect the systems you already run and put AI agents and tools into daily use, with people approving what goes out.

Assessments and consultations are provided by Genvo. How our partnership works.