What defect detection is
Defect detection is the use of cameras and software to find faults on products as they are made: scratches, cracks, dents, chips, contamination, misprints, missing components and anything else that puts a part outside its specification. A camera images each item, software decides whether it is good, and the line rejects and logs the faulty ones.
The term covers the decision itself. Automated visual inspection is the whole station around it, from part handling and triggers to PLC reject signals and quality records. This page looks at how the software finds the defect, and what that asks of the cameras and the computer.
Defect detection is older than AI. Rule-based machine vision has measured edges, blobs and gaps for decades, and it is still the fastest and most exact tool for anything that can be measured. Deep learning added the ability to judge defects that are easy to recognize but hard to describe, such as a scratch on a textured surface.
Four ways to find a defect
Defect detection software falls into four broad approaches, and most lines use more than one.
| Approach | How it decides | What set-up needs | Output | Suits |
|---|---|---|---|---|
| Rule-based vision | Measures edges, blobs, gaps, color and position against set tolerances | An engineer programming each tool | Pass or fail with measurements | Dimensions, presence, alignment, print checks |
| Object detection | A model trained on labeled examples boxes each known defect type | Images of every defect type, boxed and labeled | Class, confidence and box per defect | Known defects that vary in look, such as cracks or dents |
| Segmentation | A model outlines each defect pixel by pixel | Defect images with traced outlines | A mask, giving the area and length of each defect | Defects judged by size, such as stains or coating gaps |
| Anomaly detection | A model learns what good parts look like and flags any departure | Images of good parts, plus some defects to set the threshold | A score and a heat map of where | Rare or unpredictable defects and new products |
Image classification, one good or bad label per image, is the simplest AI option. It works where each image shows a single part and the defect type does not matter, but it cannot say where the defect is.
Choosing the right approach
The choice follows from the defects themselves and from how many examples of them you can collect.
-
//
Start with rules where you can. If a defect can be measured, such as a hole position, a gap or a missing label, a rule-based tool is quicker to validate and easy to explain to an auditor.
-
//
Use detection for known, varied defects. A detector needs many labeled examples of each defect type across the ways it appears, so it suits defects that turn up often enough to collect.
-
//
Use segmentation when size decides the verdict. If a 2 mm scratch passes and a 5 mm scratch fails, the model has to measure the defect, not only find it.
-
//
Use anomaly detection when bad parts are rare. On a good line, defects may be one in thousands. An anomaly model trains on good parts and catches defect types nobody labeled, but it does not name them.
Lighting and cameras come first
No model can find a defect the image does not show, so lighting is chosen to make each defect type stand out from the surface around it. Low-angle light catches scratches, dents and embossing by throwing their edges into shadow or highlight. A backlight shows a part as a silhouette, which suits holes, outlines and fill levels. Diffuse dome lighting suppresses glare on shiny, curved parts, and coaxial lighting shows marks on flat reflective surfaces.
Resolution follows from the smallest defect, which needs to cover several pixels in the image, not one. Moving parts need short exposures and usually global shutter cameras, which capture the whole frame at once and avoid skew. Continuous material such as film, sheet or textiles is usually imaged with line-scan cameras.
False rejects and missed defects
Every defect detection system makes two kinds of mistake. A false reject throws away a good part, which wastes material and erodes trust in the system. A missed defect, sometimes called an escape, lets a faulty part reach the customer, which usually costs far more. Moving the decision threshold trades one against the other: a stricter setting catches more defects and rejects more good parts.
Measure both rates per defect type, on a validation set the model has never seen, including borderline samples that quality and production have agreed on. A single accuracy figure hides the trade-off. Many lines send borderline results to a person, keep the image of every reject, and re-check performance after any change of product, material, lighting or camera, because a model only knows the conditions it was trained on.
Edge hardware at the line
The decision has to arrive before the part reaches the reject gate. At 600 parts a minute, each part has 100 ms for capture, transfer, inference and the signal to the PLC, and every camera on the station works within that budget. That is why defect detection runs on a computer beside the line rather than in the cloud.
A single camera running one model fits a Jetson module, and our Jetson comparison and module selector sets out the memory, AI performance and camera inputs of each one. Stations with several high-resolution cameras, or with rule-based tools and AI models side by side, often suit industrial GPU computers, with GigE cameras connected through Ethernet and PoE frame grabbers that carry power and data on one cable.
Quick answers on defect detection
Defect detection: common questions
How does AI defect detection work in production?
It scores each part against what it has learned. A camera images every item, a model trained on example images scores it, and parts past the threshold are rejected with their images stored for review.
What are the main types of defect?
Quality systems usually grade them as critical, major or minor. Critical defects make a product unsafe, major ones stop it working or selling, and minor ones are cosmetic. The grade sets how strict the threshold should be.
Can defect detection work with only good samples?
Yes, with an anomaly detection model. It learns from defect-free parts and flags anything unusual. You still need some defective samples to set and check the threshold.
How many images does a defect detection model need?
It depends on the method and how varied the defects are. Anomaly models can start from a modest set of good parts, while supervised models need labeled examples of every defect type in all the ways it appears.
Is defect detection the same as automated visual inspection?
It is the core of it. Defect detection is the software decision. Automated visual inspection is the whole station, from part handling and lighting to the reject mechanism and quality records.
We integrate the vision computer, frame grabbers and camera interfaces for each inspection station as standard, so the system arrives ready for your cameras and software.