The cheapest accuracy you'll ever get

When an inspection system misses defects, the first instinct is a bigger model or more training data. Very often the defect simply isn't visible in the image. No model can find a scratch that the light washed out. Fixing the lighting is usually cheaper, faster, and more reliable than anything you can do in software.

Ring light: the default, and its trap

A ring light around the lens is the most common setup because it's simple and bright. On matte parts it works well. On shiny metal it reflects straight back into the camera, and that glare hides exactly the fine surface marks you care about. In the figure, the ring shows the raised burr but the scratch disappears in the glare.

Dark field: make the defect the brightest thing

Dark field lighting comes in from a very low angle. A flat, polished surface reflects it away from the camera and looks dark. Anything that breaks the surface, a scratch, a dent, an edge, scatters light upward and glows. It's the go-to for scratches and engraving on metal and glass.

Dome and backlight

A dome light bathes the part in even, diffuse light from every direction. There are no reflections, so it's good for reading print, checking colour, or inspecting curved shiny parts, but subtle surface marks fade too. A backlight sits behind the part and only shows its outline. That's perfect for measuring size and shape, or checking that holes are where they should be, and useless for anything on the surface.

How I approach it on a new line

  • Start from the defect list: which defects matter, and what each one physically looks like.
  • Test several lights on real good and bad parts before choosing a camera or a model.
  • Shield the station from daylight and overhead lights, so the image is the same on every shift.
  • Use a short exposure with a bright, strobed light on moving lines to avoid blur.
  • Only then collect training data, with the lighting fixed.