

Automated visual inspection uses cameras, controlled lighting and software to check every part on a production line for defects, without a person looking at each one. Older systems compare images against fixed rules. Newer ones use AI models trained on examples of good and bad parts, which lets them handle defects that never look the same twice.
The hard part is rarely the camera. It's choosing the right detection method for your defects and getting enough of the right images to train it. This guide covers how an inspection system works, how rule-based and AI inspection differ, a matrix that matches defect types to methods and data needs, and the steps from pilot to a system you trust on the line.
Automated visual inspection (AVI) is a quality control method in which industrial cameras capture images of products and software decides whether each one passes or fails. The software can be a set of hand-tuned rules, a deep learning model, or both. It runs at line speed, applies the same standard on every shift and records every decision.
You'll also see the terms machine vision inspection, automated optical inspection (AOI) and AI visual inspection. They overlap. AOI is the name electronics makers have used for decades for camera inspection of printed circuit boards, mostly rule-based. Machine vision is the broader engineering field. AI visual inspection refers specifically to systems where a trained model makes the call.
Manual inspection is still the default in many plants, and it has a known ceiling. A literature review from Sandia National Laboratories reports that error rates of 20 to 30 percent are common in human inspection tasks, and that missed defects happen more often than wrongly rejected good parts. The point of automation is not perfect detection. It's a consistent, measurable standard that doesn't drift at 3 a.m.
Every visual inspection system, whether it costs a few thousand dollars or runs a whole plant, follows the same sequence:
That last step matters more than it looks. The logged images become the dataset you use to retrain the model, audit an escape or answer a customer complaint months later.
Area scan cameras capture a full frame and suit discrete parts like castings, bottles or PCBs. Line scan cameras capture one row of pixels at a time and build the image as material moves past, which is why they're standard for continuous surfaces such as steel coil, paper, film and textiles. When height matters (warped parts, solder volume, missing threads), 3D sensors based on laser triangulation or structured light add depth to the picture.
Lighting decides what the camera can see at all. A backlight turns a part into a sharp silhouette, which is ideal for measuring outlines and holes. Dark field lighting comes in at a low angle, so flat surfaces stay dark while scratches and engravings light up. A diffuse dome removes glare on shiny, curved parts. Get the lighting wrong and no model will rescue the image, which is why experienced integrators test lighting on real samples before they pick a single piece of software.
Rule-based software uses tools such as edge detection, blob analysis, pattern matching and caliper measurement. An engineer sets thresholds: if the hole diameter falls outside tolerance, fail the part. AI software replaces some or all of those rules with a neural network that learned from labeled images what a defect looks like. Most production systems today mix the two. Rules handle measurement, where they are exact and explainable, and models handle cosmetic defects, where rules break.
Inspection decisions almost always run on the line, on a smart camera or an industrial PC with a GPU, not in the cloud. The reason is time. If a conveyor moves a part past the camera every few hundred milliseconds, the verdict has to arrive before the part reaches the reject gate. The edge device then talks to the PLC that controls the line. The cloud still has a role, mostly for storing images, comparing lines and retraining models, but it stays out of the real-time loop.
The three approaches are not rungs on a ladder where the top one always wins. Each fits a different kind of inspection problem.
| Manual inspection | Rule-based machine vision (AOI) | AI visual inspection | |
|---|---|---|---|
| How it decides | Inspector's judgment against a reference or limit sample | Fixed thresholds and measurements set by an engineer | Model trained on labeled example images |
| Best for | Low volume, frequent changeovers, complex judgment calls | Dimensions, presence and absence, alignment, barcodes, OCR | Cosmetic defects with variable shape: scratches, dents, stains, cracks |
| Consistency | Varies from one inspector to another | Identical every time, as long as conditions stay stable | Identical every time, can tolerate natural part variation |
| Weak spot | Missed defects are common; studies report 20 to 30 percent error rates | Floods operators with false rejects when parts or lighting vary | Needs enough training images, including defects you rarely see |
| Setup effort | Training people, writing work instructions | Programming and tuning rules per product | Collecting and labeling data, training and validating the model |
The AOI vs AVI debate mostly comes down to variation. A rule can say "a scratch is a dark line longer than 2 mm." Real scratches curve, fade and sit next to harmless machining marks, so the rule either misses them or rejects good parts. That gap is where AI models earn their place.
"AI inspection" covers several different model types, and they need very different training data. Picking the wrong one is the most common reason a pilot stalls.
A classification model answers one question per image: good or bad, or which defect class. An object detection model goes further and draws a box around each defect with a label, such as "porosity" or "chip." Both learn from images where people marked every defect, so they need examples of each defect type you want to catch. In return, they tell you what went wrong, which feeds root-cause analysis upstream.
Segmentation models label every pixel that belongs to a defect. That turns a vague "scratch found" into a measurement: 4.1 mm long, 0.2 mm wide, 1.3 percent of the visible surface. When your acceptance criteria depend on size or area, as they often do in automotive paint, glass or metal finishing, segmentation is the method that matches the spec. The catch is labeling cost, since someone has to outline each defect precisely. (Our guide to synthetic data for object detection and segmentation covers how generated images come with these masks built in.)
Anomaly detection flips the problem around. The model learns only from defect-free parts and flags anything that looks different from that learned normal. You don't need a single defect image to start training, which makes it attractive on new lines and for products where defects are rare by design.
The trade-offs are real, though. Anomaly detection says "something is off" but not what, so it can't sort defects by type. It also flags harmless variation, such as a slightly different supplier finish, unless that variation was in the training set. The public MVTec AD benchmark, built for exactly this setup, trains on defect-free images only and tests on parts with real scratches, cracks and contamination, which makes it a useful reference for how well these methods hold up.
The right method depends on the defect, not on which vendor demo looked best. This matrix maps common defect types to the method that usually fits and the data it needs before it can go live.
| Defect or check | Example | Usual method | Data needed before go-live |
|---|---|---|---|
| Dimensions and tolerances | Hole diameter, gap width, edge position | Rule-based measurement | A few reference parts for calibration; no training set |
| Presence and absence | Missing screw, clip, label or O-ring | Rules, or a simple classifier when parts vary | Good parts plus examples of each missing component |
| Assembly and orientation | Connector flipped, part mounted backwards | Object detection | Labeled images of correct and wrong assemblies, all product variants |
| Surface defects with known types | Scratches, dents, porosity, cracks | Supervised detection or classification | Labeled examples of every defect class, across lighting and part variants |
| Defects where size decides pass or fail | Paint runs, coating gaps, glass chips | Segmentation | Pixel-level masks for each defect, plus the size limits from your spec |
| Rare or unknown defects | Contamination, one-off damage on a new line | Anomaly detection | A large, clean set of good parts covering normal variation |
| Text and codes | Date codes, serial numbers, barcodes | OCR and code reading tools | Samples of each print style; little or no training |
Many real lines end up with two or three of these running side by side. A common pattern pairs anomaly detection as a safety net with a supervised model for the defects you know well, and rules for anything you can measure. The matrix also shows where projects get expensive: the last column. Every row that says "labeled examples" means someone has to collect and annotate defects, and the rarer the defect, the longer that takes.
Electronics is where automated optical inspection started, and it's still the most mature use. AOI machines check solder joints, component placement and polarity on every PCB, often paired with X-ray for joints hidden under chips. Automotive suppliers inspect castings for porosity, machined parts for burrs and painted body panels for runs and inclusions, usually with segmentation because paint specs are defined by defect size.
In pharmaceuticals, automated visual inspection is a regulated step. Injectable products are checked for particles, cracks and fill level, and the U.S. Food and Drug Administration has published draft guidance on how manufacturers should inspect injectables for visible particulates. Metals and flat materials such as steel strip, aluminum foil and glass rely on line scan cameras to cover surfaces moving at high speed. Food and packaging lines verify seals, labels, fill levels and foreign objects.
The common thread is a mix of measurable checks and cosmetic judgment calls. The measurable part has been automated for years. The cosmetic part is where AI is moving inspection into tasks that used to need a trained human eye.
Supervised models need examples of defects, and a well-run line produces very few of them. If a defect shows up once in 10,000 parts, collecting 200 real examples for training means waiting for two million parts to pass the camera. Some defect types never appear at all until after launch. Labeling adds its own delay, especially for segmentation masks, and labels drawn by tired people under deadline pressure are a common source of model errors.
Teams handle this in a few ways. They start with anomaly detection while defect images accumulate, deliberately create defective samples, augment the images they have, or generate synthetic training data. Synthetic data rendered from CAD models or 3D scans lets you place a defect of any type, size and position on a part under any lighting, with a pixel-perfect label created automatically. We cover the methods and their limits in detail in our guide to synthetic data for industrial defect detection, and the same approach applies to generating edge cases for computer vision models beyond inspection.
Synthetic images don't remove the need for real ones. The model still has to be tested on real production images before anyone trusts it on the line.
"Accuracy" on its own says little about an inspection system. Two errors matter, and they cost very different amounts.
An escape (a false negative) is a defective part the system passed. It reaches the customer, and the cost shows up as returns, warranty claims, recalls or a lost contract. A false reject (a false positive, sometimes called overkill) is a good part the system failed. It costs scrap, rework or an operator's time to re-inspect it. Tune a model to catch every defect and false rejects climb. Tune it to stop wasting good parts and escapes creep in.
Where you set that threshold is a business decision, not a data science one. A brake component and a decorative trim piece should not share the same balance. Ask for both numbers on your own parts during a pilot, and add a third: whether the system keeps up with line speed at peak, including the time to move the reject gate. A model that is right but late is still a missed part.
The false reject rate also decides whether people trust the system. If operators re-check a flood of good parts every shift, they start overriding the verdicts, and the system quietly turns back into manual inspection with extra steps.
Successful deployments tend to follow the same path, and they usually start narrower than the team first wants:
Shadow mode is the step teams most often skip and most often regret skipping. It's the only way to see how the model behaves on a Tuesday night with a new material batch, which no lab test can show.
Done well, automated visual inspection checks every part instead of a sample, holds one standard across shifts and sites, and leaves an image record for every decision. That record helps with traceability, customer audits and finding the upstream process that creates defects in the first place. Inspectors move from staring at parts to handling the uncertain cases and improving the process.
The limits are just as concrete. Systems are sensitive to changes nobody planned for: a new supplier's surface finish, a moved light, a product revision. AI models need data that a stable line struggles to produce, and they need maintenance as products and processes change. Transparent, reflective and very dark parts remain hard to image. And a system nobody owns after the integrator leaves tends to degrade until it gets switched off.
Vivid 3D works on the part of automated visual inspection that most often holds projects back: training data and the models built on it. Starting from your CAD files or 3D scans, the team generates labeled synthetic images of your parts with defects placed at the sizes, positions and lighting conditions your line actually sees, then uses them to train and evaluate inspection models alongside your real images.
See how the CAD to computer vision training data workflow works, or explore Vivid 3D for manufacturing to discuss an automated visual inspection pilot for one of your stations.
Visual inspection is a quality check in which a person or a camera system examines a product for visible defects such as scratches, cracks, missing parts or wrong labels. It's the most common form of quality inspection in manufacturing, because many defects that matter to customers are cosmetic or easy to see.
In an automated system the steps are trigger, image capture, preprocessing, analysis, decision and action, followed by logging the image and result. Manual inspection follows a similar order: position the part, examine it under set lighting, compare it with the specification or a limit sample, then accept, reject or escalate it.
A trained model runs on an industrial PC or smart camera next to the line. Each time a part arrives, the camera captures an image, the model finds and classifies any defects within milliseconds, and the result goes to the PLC, which triggers a reject mechanism for failed parts. Images are stored so the model can be checked and retrained over time.
AOI (automated optical inspection) usually refers to rule-based camera inspection, especially of printed circuit boards, where fixed thresholds and reference images decide pass or fail. AVI (automated visual inspection) is the broader term and today often implies AI models that learn from examples. Many modern AOI machines now include AI, so the line between them is blurring.
Manual visual inspection means trained people check parts by eye, sometimes with magnifiers, gauges or limit samples. It adapts well to new products and complex judgment, but results vary from one inspector to another, and published reviews put typical error rates in inspection tasks at 20 to 30 percent.
Use an area scan camera for discrete parts that stop or pass one at a time, and a line scan camera for continuous material such as sheet metal, film or textiles. Add a 3D sensor when height or volume matters. Resolution should be high enough that the smallest defect you must catch spans several pixels, and lighting usually matters as much as the camera itself.
