Skip to content

Application

AI defect inspection

Surface and cosmetic defect detection with deep learning on area scan cameras and the right lighting.

AI defect inspection

Some defects can be written down as rules. A hole must be present, an edge must be straight, a label must sit within a tolerance box. Cosmetic and surface defects are usually not like that. Scratches, dents, blooms, contamination, weave faults, casting porosity, coating flaws and a hundred other 'you know it when you see it' problems vary in shape, size, position and contrast from one part to the next. Writing a rule that catches every variant without flooding the line with false rejects is, in practice, close to impossible.

This is the gap that deep-learning visual inspection fills. Instead of describing the defect, you show the system examples of good and bad parts and let it learn the boundary. That changes the economics of difficult inspection tasks, but it does not change the laws of imaging: an AI model can only classify what the optics and lighting actually rendered into the image. The hardware on this page exists to put the defect on the sensor with high, repeatable contrast so the model has something to learn from.

This guide frames the inspection problem, explains where AI is the right tool (and where it is not), and walks through the camera, lighting and lens decisions that decide whether your defect detection works on the line or only in the demo.

When AI is the right tool — and when it is not

Deep-learning inspection earns its place when the defect is hard to describe with explicit rules: variable appearance, low contrast against a busy or textured background, many acceptable part variants, or a defect catalogue that keeps growing as production reveals new failure modes. In these cases a learned model generalises from examples far better than a hand-tuned threshold pipeline, and it can be retrained as new defect types appear rather than rebuilt from scratch.

It is the wrong tool when a deterministic measurement will do the job more cheaply and with full traceability. Reading a code, gauging a dimension to a tolerance, checking presence or absence, or confirming a fixed pattern is usually better served by classical machine vision or a smart-camera tool, which give a precise, auditable pass/fail without a training set. A good system often combines both: rule-based logic for the measurable checks and a deep-learning stage for the cosmetic defects that defy rules.

The honest test is whether you can write down, unambiguously, what makes a part bad. If you can, start with classical vision. If every attempt produces either escapes or false rejects, the problem is a defect-class problem and AI is the appropriate approach. Either way, the imaging chain in front of it has to be solid first.

  • Good fit for AI: scratches, dents, stains, contamination, texture and weave faults, porosity, coating and finish defects, variable natural products.
  • Better with classical vision: code reading, dimensional gauging, presence/absence, fixed-pattern verification, anything you can specify as a tolerance.
  • Common reality: a hybrid pipeline — rules for the measurable, deep learning for the cosmetic.

Why the imaging makes or breaks the model

The single biggest cause of disappointing AI inspection is not the model — it is the image. If a defect is barely visible to a trained operator under the chosen lighting, it will be barely visible to the network, and no amount of training data will reliably recover it. The objective of the optical setup is to maximise the contrast between defect and background while keeping the appearance of good parts stable and repeatable, frame after frame, shift after shift.

Repeatability matters as much as raw contrast. A model trained on images captured under one lighting and exposure regime degrades quickly if the production images drift — ambient light leaking in, lamps ageing, exposure auto-adjusting, parts presented at varying angles. Locking down the geometry (fixed working distance, fixed part presentation), shrouding ambient light, using stable controlled illumination and fixing camera gain and exposure are what let a model trained today keep working in six months.

This is why the recommended hardware is a system, not a camera. The area scan camera, the lens and the lighting are chosen together against the specific defect, and the deep-learning software sits on top of an image that was engineered to reveal it. Sending representative sample images for evaluation early is the fastest way to find out whether the defect is separable at all — and what lighting it takes to make it so.

Choosing the area scan camera

For discrete parts and most cosmetic inspection, an area scan camera is the natural choice: it captures a full 2D frame in a single exposure, which suits parts that index into position and stop, or that can be frozen with a short exposure or a strobe. The starting point is spatial resolution — how many pixels land on the smallest defect you must reliably catch. A useful rule of thumb is to spread the smallest defect across several pixels (roughly three to five), then work back to the sensor resolution given your field of view. Under-resolve the defect and the model has nothing to learn; massively over-resolve it and you pay in data, bandwidth and cost without benefit.

Monochrome sensors are the default for defect work: they have no Bayer colour filter, so they deliver higher effective resolution and sensitivity, and most surface defects are contrast features rather than colour features. Choose colour only when the defect is genuinely defined by colour (for example discoloration, wrong shade, or colour-coded components). For any part that moves during exposure, prefer a global-shutter sensor, which exposes all pixels simultaneously and avoids the geometric skew a rolling shutter introduces on moving objects. Modern global-shutter CMOS sensors (for example the Sony Pregius family used across Basler, iRAYPLE and Omron/Sentech (STC) cameras) are the workhorses here.

Interface follows resolution and speed. GigE Vision is the practical default for cable length and easy integration; USB3 Vision suits short, single-camera high-bandwidth links; CoaXPress and Camera Link are for the highest data rates and very high-resolution or high-frame-rate sensors. The catalog spans these interfaces across Basler, iRAYPLE and Omron/Sentech, so the camera can be matched to the bandwidth the inspection actually needs rather than over- or under-specified.

  • Target several pixels (≈3–5) across the smallest defect, then size sensor resolution from the field of view.
  • Default to monochrome for contrast defects; use colour only when colour defines the defect.
  • Use a global shutter for moving parts to avoid motion skew.
  • Match the interface (GigE / USB3 / CoaXPress / Camera Link) to the real bandwidth, not the headline number.

Lighting: the highest-leverage decision

Lighting is where most defect-inspection projects are won or lost, because the geometry of the illumination decides whether a defect shows up at all. The aim is to make the defect bright where the background is dark, or dark where the background is bright — a separable, repeatable signal. The right technique depends on the defect's physical nature, not on the part: a scratch, a dent and a stain on the same surface may each demand a different lighting geometry.

A few well-established techniques cover most surface and cosmetic work. Low-angle or dark-field lighting grazes the surface so that scratches, embossing, engraving and edge defects scatter light and appear bright against a dark background — ideal for topographic defects that a flat front light would wash out. Diffuse dome (cloudy-day) lighting eliminates glare on curved, shiny or specular parts and gives an even field that suppresses nuisance reflections, useful before an AI stage so the model does not learn the reflections. Coaxial / on-axis lighting flattens flat reflective surfaces such as metal, glass and printed labels. Backlighting throws edges and through-holes into sharp silhouette for shape and contour defects. DCM Sistemes supplies ring, bar, coaxial/axial, dome and dark-field families for exactly this range of techniques, and the catalog also carries lighting from Basler and Omron for camera-matched kits.

Two further points decide repeatability. First, wavelength and filtering: a monochromatic source (often red, or blue/UV to lift fine surface texture) paired with a matching bandpass filter on the lens rejects ambient light and stabilises contrast — the filter is part of the lighting design, not an afterthought. Second, control: strobing the light in sync with a moving part and driving it from a stable controller keeps brightness constant as lamps age. For an AI model, that stability is what keeps the training set valid in production.

  • Dark-field / low-angle: scratches, embossing, engraving, edges and other topographic defects.
  • Diffuse dome: glare-free imaging of curved, shiny and specular surfaces.
  • Coaxial / on-axis: flat reflective surfaces — metal, glass, printed labels.
  • Backlight: edge, contour and through-hole defects in silhouette.
  • Add a bandpass filter matched to a monochromatic source to reject ambient light and lock down contrast.

Lens and filters: delivering the detail to the sensor

The lens forms the image the sensor samples; software cannot recover detail the optics never delivered. Size the focal length from your field of view and working distance, confirm the lens image circle covers the sensor diagonal, and — critically for high-resolution defect work — choose a lens whose resolving power (read from its MTF curves, not a megapixel headline) keeps up with the sensor's pixel pitch. Pairing an ordinary lens with a fine-pitch, high-resolution sensor quietly throws away the resolution you paid for, and the soft image that results gets wrongly blamed on the camera or the model.

Aperture and depth of field are a balance with the lighting. Stopping down deepens depth of field and cleans up the corners, which matters when parts vary in height or sit at an angle, but it costs light — so good controlled lighting is what lets you work at the sharp aperture sweet spot rather than wide open. For pure defect detection a quality fixed-focal-length lens is usually right; reserve telecentric optics for cases where edge position must stay exact regardless of part height.

Treat the optical filter as part of the optical design. A bandpass filter matched to the illumination wavelength suppresses ambient light and stabilises contrast; a polariser cuts specular glare on shiny parts; UV or IR work needs glass corrected for that band. The catalog's lenses and filters span the C-mount and large-format optics and the filters these cameras need, so the whole chain — sensor, lens, filter, light — can be specified as one coherent system.

Where the AI runs, and proving it on your parts

Where the deep-learning model executes is an architecture decision, not just a hardware one. A smart camera integrates sensor, optics, processing and often lighting into one rugged unit, and modern AI-capable smart cameras (for example the Omron FHV7 family, and Datalogic/Datasensing smart cameras) can run trained models at the edge. They suit single-view inspections, tight enclosures, lower part rates and applications where wiring and footprint matter more than raw compute. A PC-based system, by contrast, pairs industrial cameras with a workstation for far more processing headroom: larger models, multiple cameras fused across one part, high resolution and throughput, and free retraining as the defect catalogue evolves.

A pragmatic route is to prove feasibility on a PC-based setup with full-resolution images and a flexible training loop, then decide — once the defect classes and the required model are understood — whether the production deployment can be condensed onto a smart camera or needs to stay on a PC. Either way, the imaging hardware in front of the model is what determines whether the project succeeds, so the lowest-risk first step is an imaging feasibility check on real samples: capture representative good and bad parts under candidate lighting and confirm the defect shows up with stable, separable contrast.

Where the inspection genuinely needs AI — variable, low-contrast or hard-to-describe cosmetic defects, or text and characters that vary in print quality — the practical move is to send sample images so they can be evaluated with Rosepetal, the group's deep-learning visual-inspection software, to confirm the defect classes are learnable and to gauge expected performance. From there, AIS Vision can integrate the full system: camera, lens, filter and lighting selection, mechanical and ambient-light control, model training and the line integration that turns a working demo into a stable production inspection.

  • Smart camera: compact, rugged, integrated edge AI; best for single-view, lower-rate, space-constrained installs.
  • PC-based: maximum compute, multi-camera fusion, large or frequently retrained models, high resolution and throughput.
  • Common path: prove the application PC-based, then condense onto a smart camera if the production case allows.
  • Lowest-risk first step: an imaging feasibility check on real good and bad samples before committing hardware.

Recommended hardware

Categories commonly used to solve this application.

Products for this application

A selection from 4,079 products. Open a category above to compare them all.

  • Basler ace 2 a2A1920-51gcPRO machine vision camera
    BaslerBasler ace 2 a2A1920-51gcPROa2A1920-51gcPRO

    GigE area scan camera with a 2.3 MP Sony IMX392 global shutter CMOS sensor delivering 51 fps in color.

    • Area scan
    • GigE Vision, PoE
    • 2.3 MP
    • Global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • DCM Sistemes ALB0804A-630i/AM machine vision lighting

    Compact high-powered direct LED ringlight for machine vision with built-in iBlueDrive driver, here in the 630nm red, medium-angle iBlueDrive configuration.

    • Ring light (direct high-powered ringlight)
    • Red, 630 nm (also available 365/400/470/525/850 nm and white)
    • 40 mm
    • iBlueDrive: continuous, strobe and overdrive modes
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Basler Lens C125-1620-5M machine vision lens

    Standard-line C-mount fixed focal lens with 16 mm focal length, 5 MP resolution, and 1/2.5" image circle, designed for Fujinon-cooperated optics with minimal distortion.

    • C-mount
    • 16 mm
    • F2.0–F22
    • 5 MP
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Omron FHV7 0.4 MP color C-mount machine vision smart camera
    OmronOmron FHV7 0.4 MP colour C-mount smart cameraFHV7 0.4 MP color C-mount

    High-speed, high-accuracy inspection and measurement. This 0.4 MP colour C-mount configuration covers 1 order code.

    • Presence / absence, Pattern matching / position, Measurement / dimension, Color, Counting, OCR / OCV, Code reading, Defect / surface
    • 0.4 MP (720 × 540 px)
    • Interchangeable C-mount lens (no optics included)
    • None (external lighting)
    • Recommended by AIS Vision
    On request
    View
  • iRAYPLE A7500MG20E machine vision camera
    iRAYPLEiRAYPLE A7500MG20EA7500MG20E

    5MP monochrome GigE Vision area scan camera built on the Sony IMX264 global shutter sensor, delivering 2448 x 2048 resolution at 20 fps.

    • Area scan
    • GigE Vision, PoE
    • 5.01 MP
    • Global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Basler Light Ring-100OD-White machine vision lighting
    BaslerBasler Standard Light Ring-100OD-WhiteLight Ring-100OD-White

    White-LED machine-vision ring light with 67-101 mm luminous area, an internal 2-mode LED controller, and a 100-250 mm recommended working distance for bright-field illumination around a camera.

    • Ring light
    • White (5000 K)
    • 67-101 mm
    • Continuous and strobe (internal LED controller, 2 operating modes)
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • iRAYPLE A9-1228-6MP machine vision lens

    12mm fixed focal C-mount lens designed for 6MP cameras on sensors up to 1/1.8", featuring ultra-low distortion and high edge sharpness for industrial machine vision inspection.

    • C-Mount
    • 12mm
    • F2.8–F16
    • 6MP
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • iRAYPLE DH-MV-SI5500MG002E machine vision smart camera

    iRAYPLE DH-MV-SI5500MG002E smart camera: 5 MP mono global shutter, C-mount lens (not included), Windows 10, IP67.

    • Pattern matching / position, Measurement / dimension, Defect / surface (feature list)
    • 5 MP (2448 × 2048)
    • Interchangeable C-mount lens (not included)
    • Ethernet, RS-232, RS-485, PROFINET, Modbus TCP, Digital I/O
    • Recommended by AIS Vision
    On request
    View
  • Omron / Sentech Sentech STC-MCS510U3V machine vision camera
    Omron / SentechOmron Sentech STC-MCS510U3VSTC-MCS510U3V

    5 MP color USB3 Vision area scan camera with a 2/3" Sony IMX250 global shutter CMOS sensor, 2448 x 2048 resolution at up to 75.7 fps.

    • Area scan
    • USB3 Vision
    • 5 MP
    • Global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Omron / Sentech FLV-BR21222 machine vision lighting
    Omron / SentechOmron / Sentech FLV-BR21222 Bar LightFLV-BR21222

    Omron FLV-series LED bar light with a 212 x 22 mm aluminum-alloy housing that uniformly illuminates wide rectangular surfaces for machine-vision inspection.

    • Bar (linear) light
    • White (also Red ~635 nm / Blue ~465 nm variants)
    • Lighting area 199 x 18 mm
    • Continuous or trigger (strobe) lighting via controller, digital intensity control
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Omron / Sentech 3Z4S-LE SV-1214H machine vision lens

    12mm fixed-focal-length, high-resolution, low-distortion C-mount lens optimized for megapixel machine-vision cameras up to 2/3-inch sensors.

    • 12 mm
    • C-mount
    • F1.4–F16
    • 2/3" (≈ 11 mm diagonal)
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Hikrobot MV-SC6250M-00C-NNN machine vision smart camera
    HikrobotHikrobot MV-SC6250M-00C-NNNMV-SC6250M-00C-NNN

    Hikrobot MV-SC6250M-00C-NNN: SC6000 series AI smart camera, 25 MP mono, C-mount (lens not included).

    • Hikrobot: "Adopts AI deep learning algorithm to achieve OCR, object recognition, defect detection, etc."
    • Adopts AI deep learning algorithm to achieve OCR, object recognition, defect detection, etc.; function module: Vision Master Platform (include deep learning module)
    • 25 MP (5120 × 5120 px)
    • C-mount (lens not included)
    • Recommended by AIS Vision
    On request
    View
  • Datasensing E101 (CAM-E101-GE) machine vision camera
    Datalogic / DatasensingDatasensing E101 (CAM-E101-GE)E101

    VGA-resolution monochrome GigE area scan camera with a 1/4-inch CMOS sensor, global shutter and 300 fps frame rate.

    • Area scan
    • GigE Vision, PoE
    • 0.3 MP
    • Global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Lumher RD1-5000K machine vision lighting
    LumherLumher RD1 White 5000KRD1-5000K

    Lumher RD1 ring LED luminaire (Ring series), White 5000K. Luminaire designed for machine vision applications where direct illumination is required and space is limited, hence its dimensions of 135mm x 135mm.

    • Ring
    • White 5000K
    • Continuous (1x) / Strobe (4x)
    • Semidiffuse 110° / Ultradiffuse 110°
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • DCM Sistemes VPF Series Polarizer Filter machine vision optical filter
    DCM SistemesVPF Series Polarizer FilterVPF Series

    Linear polarizer filter accessory for DCM Sistemes LED machine vision lighting systems that polarizes emitted light to eliminate undesirable glare and brightness.

    • protector
    • Match companion lighting unit footprint (from approx. 40×34 mm to 307×292 mm depending on model)
    • 0–40°C
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Omron FHV7 0.4 MP color autofocus machine vision smart camera
    OmronOmron FHV7 0.4 MP colour autofocus smart cameraFHV7 0.4 MP color autofocus

    High-speed, high-accuracy inspection and measurement. The new FHV7-series Smart Camera combined with illumination and image processing functionality for advanced vision inspections. This 0.4 MP colour autofocus configuration covers 7 order codes.

    • Presence / absence, Pattern matching / position, Measurement / dimension, Color, Counting, OCR / OCV, Code reading, Defect / surface
    • 0.4 MP (720 × 540 px)
    • Autofocus lens module (high-speed liquid lens / motorized)
    • White LED / Multi-coloured LED (model-dependent)
    • Recommended by AIS Vision
    On request
    View
  • Hikrobot MV-CH120-10CM machine vision camera
    HikrobotHikrobot MV-CH120-10CMMV-CH120-10CM

    Hikrobot MV-CH120-10CM: 12MP Area Scan Camera, Camera Link, IMX253, Mono.

    • Area scan
    • Camera Link
    • 12 MP
    • CMOS, global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • DCM Sistemes ALB1716A-470C/AW machine vision lighting

    Large high-powered direct LED ringlight for machine vision with multisector capability, here in the 470nm blue, continuous, wide-angle configuration.

    • Ring light (direct high-powered ringlight)
    • Blue, 470 nm (also available 365/400/525/630/850 nm and white)
    • 76 mm
    • Continuous (C) drive; iBlueDrive (i) strobe/overdrive variant also offered
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Datalogic / Datasensing LENS-50-FM-M52 x0.75 machine vision lens

    A 50 mm fixed focal length, F-mount, large-format machine vision lens covering a 43.3 mm image circle with an aperture range of F2.8–16 and M52x0.75 filter thread.

    • F-Mount
    • 50 mm
    • F2.8–F16
    • 43.3 mm (large format)
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • iRAYPLE DH-MV-SI5600MG002E machine vision smart camera

    iRAYPLE DH-MV-SI5600MG002E smart camera: 6.3 MP mono rolling shutter, C-mount lens (not included), Windows 10, IP67.

    • Pattern matching / position, Measurement / dimension, Defect / surface (feature list)
    • 6.3 MP (3072 × 2048)
    • Interchangeable C-mount lens (not included)
    • Ethernet, RS-232, RS-485, PROFINET, Modbus TCP, Digital I/O
    • Recommended by AIS Vision
    On request
    View
  • Basler ace 2 a2A2048-37gcPRO machine vision camera
    BaslerBasler ace 2 a2A2048-37gcPROa2A2048-37gcPRO

    GigE area scan camera with a 3.2 MP Sony IMX900 global shutter CMOS sensor delivering 37 fps in color, sensitive in visible and NIR.

    • Area scan
    • GigE Vision, PoE
    • 3.2 MP
    • Global shutter
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Basler Light Bar-10x165-White machine vision lighting
    BaslerBasler Standard Light Bar-10x165-WhiteLight Bar-10x165-White

    White-LED machine-vision bar light with a 10 x 165 mm luminous area and internal 2-mode LED controller, usable for bright-field and dark-field/line illumination at 10-200 mm working distance.

    • Bar light
    • White (5000 K)
    • 10 x 165 mm
    • Continuous and strobe (internal LED controller, 2 operating modes)
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • FUJINON CF8ZA-1S machine vision lens

    FUJINON CF8ZA-1S is an 8 mm C-mount machine vision lens from the FUJINON CF-ZA-1S Series (“4D High Resolution” lenses), aperture F1.8–F16, rated for sensors up to 1.2" (2.74 µm pixel pitch), minimum working distance 100 mm.

    • 100 mm min. (focus range ∞ – 100 mm)
    • 8 mm
    • F1.8–F16
    • C-mount
    • Rosepetal compatible
    • Recommended by AIS Vision
    On request
    View
  • Hikrobot MV-SC6050C-16M-XBN machine vision smart camera
    HikrobotHikrobot MV-SC6050C-16M-XBNMV-SC6050C-16M-XBN

    Hikrobot MV-SC6050C-16M-XBN: SC6000 series AI smart camera, 5 MP colour, 16 mm M12 lens, built-in light.

    • Hikrobot: "Adopts AI deep learning algorithm to achieve OCR, object recognition, defect detection, etc."
    • Adopts AI deep learning algorithm to achieve OCR, object recognition, defect detection, etc.; function module: Vision Master Platform (include deep learning module)
    • 5 MP (2432 × 2048 px)
    • Red light, green light, blue light, white light (switching by software)
    • Recommended by AIS Vision
    On request
    View

Frequently asked questions

Related technical guides

Request a technical quote

Share the key data about your part, speed and environment and we propose a configuration.