Skip to content

AI Development · 3 min read

Computer vision inspection on a production line: what it takes

By Harshvardhan Basude, AI Engineer

Manual inspection gets tired towards the end of a shift and varies from one inspector to the next. A camera with a trained model checks every part the same way, all day. But vision projects succeed or fail on details that have little to do with the AI model itself.

Start with the defect

Write down exactly what a defect looks like and how small it can be: a missing component on a board, a crack in a casting, a wrong label, a chipped edge. If two experienced inspectors disagree about whether a part is bad, the model will not do better than they do. Agree the rules first.

The smallest defect decides the camera. As a rule of thumb, it should cover several pixels in the image. That sets the resolution, the lens and how close the camera sits to the part.

Light is half the job

Most failed vision projects are really lighting problems. Daylight through a shed roof changes every hour, so a model trained in the morning fails in the afternoon. Enclose the inspection point and control the light: diffuse light for shiny surfaces, low-angle light to show scratches and dents, backlight for outlines and holes.

On a moving conveyor, use a short exposure or a strobe so parts don’t blur, and trigger the camera from a sensor so every part is captured in the same position.

Data: fewer images than you think, but the right ones

Detection models such as YOLO can start learning from a few hundred well-labelled images per defect type. The images must come from the real line under the real lighting, and include the awkward cases: borderline defects, dust, reflections and product variants.

Defects are rare, which is good for production and hard for training. Collect them on purpose over a few weeks, and set rejected parts aside to photograph.

Run it at the line

The decision has to be made in the time between two parts. That usually means running the model on an edge device next to the line rather than in the cloud. It also keeps working if the internet drops.

Decide what happens to a bad part: a reject gate, an air jet, a stop signal to the PLC or an alert to the operator. A vision system is only as useful as this last step.

Measure it honestly

Before go-live, run the system alongside human inspection for a few weeks. Count the defects it caught, the defects it missed and the good parts it rejected. Missed defects cost quality; false rejects cost money and trust. Tune the balance with the people who own quality, and keep checking as products and suppliers change.

Done well, inspection also becomes data: defect rates by shift, batch and supplier. That shows where defects come from, not only where they are caught.

All insights