AI inspection is now dependable for cosmetic defects, hard-to-read text and sorting parts into classes. It's still the wrong tool for precise measurement, for defects you've never seen, and for any station nobody watches after go-live. Most pilots that stall don't fail on the model. They fail on the data.
AI visual inspection uses deep learning models trained on example images to decide whether a part is good or bad. In 2026 it's dependable on cosmetic defects, difficult OCR and classification. It works poorly for gauging to a tolerance, for defects with no examples, and on stations where lighting or materials change and nobody retrains the model.
We're Relling's applications engineers. We put cameras into robotic workcells, rule-based ones and AI ones, and this is the briefing we'd give you before an AI quality inspection pilot. If you're still deciding between approaches, our deep learning vs rule-based machine vision guide is the companion piece. This one is about making the AI side work on a real line.
A camera captures each part under controlled lighting, and a trained neural network scores the image. The model's learned what good and bad look like from labeled examples, or from good parts only in anomaly detection. A threshold turns the score into accept or reject, and a PLC acts on it.
What surprises people is how little of the work is the model. It's mostly everything around it. You still need the same optics as any vision station. That means the right lens (our guide on how to choose a machine vision lens helps), enough pixels on the defect (try the machine vision resolution calculator), good light, and a part that shows up in the same place every time. Then you need images, lots of them, from real production, labeled by people who agree with each other. The training button is the easy part. Every major vendor now trains from a browser or a camera menu, and a few sell AI-first systems built entirely around that workflow (we compare them in our roundup of Cognex and Keyence alternatives).
AI defect detection is strongest where "bad" isn't easy to describe in rules. That means scratches, stains and voids on surfaces that vary from part to part, OCR on poorly printed or curved text, and sorting parts or welds into categories a person recognizes instantly but would struggle to write down as measurements.
Take brushed aluminum. The grain changes on every part, so a contrast rule that catches a scratch also rejects half your good parts. A model trained on enough examples learns what normal grain looks like and flags what doesn't fit. The same logic covers textiles, wood, castings and molded texture. Our surface defect inspection guide covers the lighting that makes these jobs possible at all, and honestly, lighting fixes more surface jobs than models do.
OCR's the other big win. Dot-peen marks on curved metal and inkjet date codes on wrinkled film used to take days of font training. Pretrained deep learning OCR now reads a lot of them out of the box. See OCR and code reading for where the rule-based readers still win. And classification (which of twelve variants is this, is that connector seated) is a natural fit, since the categories are obvious to a person and tedious to describe in rules.
Four limits show up again and again. AI isn't a measuring instrument. It can't learn defects it has never seen. It drifts when lighting, materials or suppliers change. And its decisions are harder to explain to an auditor than a rule-based failure. None of these goes away with a bigger model.
Measurement first. A segmentation model can find a burr, but it shouldn't be the thing that certifies a bore at 12.00 ± 0.02 mm. That needs calibrated optics, subpixel edge tools and a gauge study, so use the model to find the feature and a rule-based or 3D tool to measure it. Our dimensional gauging guide covers the optics side.
Rare defects are next. A supervised model only learns classes it's seen, and if a defect shows up once in 50,000 parts you might have three pictures of it when the pilot starts. Anomaly detection helps, as we'll get to, but it has its own blind spots.
Then drift. Models learn the conditions they were trained in. Replace the LED panel, switch resin suppliers or bump the camera during a changeover and performance can slide without anyone noticing. NIST's AI Risk Management Framework says it plainly. AI systems may need more frequent maintenance because of data, model or concept drift.1
And explainability. A rule-based tool fails a part because an edge was 0.3 mm short. A model fails it because the score was 0.71. Heat maps help, but auditors in regulated industries often want a reason a person can check. Decide how you'll handle that before you pick the tool, not after the first customer complaint.
It depends on the job. Simple presence checks can work with five to ten images on some vendor tools. Subtle cosmetic defects on variable surfaces usually need hundreds per defect class, collected across shifts, lots and lighting conditions. Past a few hundred, label consistency matters more than raw volume.
Vendors are honest about both ends. Cognex says its edge learning tools can train on as few as five to ten images, and that its full deep learning tools need hundreds to thousands.2 The small number suits clear-cut jobs. A faint scratch on textured plastic sits at the other end.
What predicts the result better than the count is coverage. A thousand images from one Tuesday are worth less than two hundred spread over six weeks, because the six weeks include the second shift, the new material lot and the morning the ring light was a bit dimmer. Then there's labeling. If two inspectors disagree on whether a mark is a defect, the model learns the disagreement, and no amount of extra data fixes that. Landing AI builds its tooling around exactly this problem, with a label book that defines how each class gets labeled so everyone labels the same way.3 In our experience that matters more than which model architecture you pick.
The single most useful thing you can do is collect boundary samples on purpose. The scratch that's just acceptable, the one just over. Get your quality owner to rule on each, keep them as a reference set, and you've got both your training edge cases and your future drift check.
Anomaly detection trains only on good parts and flags anything that looks different from normal. Supervised learning trains on labeled examples of each defect and tells you which defect it is and where. Anomaly detection's useful when defects are rare. Supervised models are better when the defect classes are known and matter commercially.
Anomaly detection got credible largely thanks to public benchmarks. MVTec's MVTec AD dataset, over 5,000 high-resolution images across fifteen object and texture categories with defect-free training sets, gave everyone a common test.4 Methods got good fast, and the PatchCore paper reported image-level AUROC of up to 99.6% on it in 2022.5 That's real. It's also why you should be careful. When MVTec released the harder MVTec AD 2 in 2025, with lighting that changes between training and test, the authors reported that state-of-the-art methods averaged below 60% AU-PRO, a localization metric.6 Benchmarks saturate. Your line isn't a benchmark.
There's a second catch. Anomaly detection is good at structural defects like scratches, dents and contamination, and weaker at logical ones, like the right clip in the wrong place or a missing part. MVTec built its LOCO AD dataset specifically to measure that gap.7 If your defect is "the wrong clip is fitted", you probably want a supervised model or a rule-based assembly verification check instead.
| Approach | Trains on | Good at | Weak at | Use it when |
|---|---|---|---|---|
| Anomaly detection | Good parts only | Unknown or rare surface defects | Logical defects; telling harmless variation from real defects | Defects are rare, varied or not yet cataloged |
| Classification | Labeled images per class | Sorting, grading, pass/fail on the whole image | Locating small defects; classes it hasn't seen | The categories are known and stable |
| Detection / segmentation | Images with outlined defects | Finding and sizing known defect types | Labeling effort; rare classes | You need to know where and how big |
| Rule-based tools | Nothing; set by an engineer | Measurement, presence, codes, alignment | Variable surfaces, subjective defects | The defect is geometric and the part is consistent |
On most production stations we end up using a mix. Anomaly detection flags the unexpected, a supervised model handles the defect classes that matter commercially, and rule-based tools take anything with a tolerance. Most vendor platforms run all three in one job now, so you don't have to choose a camp.
As accurate as your lighting, data and threshold allow. Benchmark scores above 99% exist, and so do scores below 60% on harder sets. On a real line, you'll want accuracy stated as two numbers measured on held-out production lots. One is the escape rate, the other the false-reject rate.
Every model outputs a score, and a threshold turns that into accept or reject. Wherever you put the threshold, two errors trade against each other. False rejects are good parts scrapped or sent to re-inspection. Escapes are bad parts shipped. You can't remove both, because the scores of good and bad parts overlap.
So decide the threshold from money and risk. What does one escape cost you in warranty, recall or a customer audit, and what does one false reject cost in scrap and rework labor? For a safety-critical feature that's an easy call. For a cosmetic flaw on a cheap part it might go the other way. Whatever you choose, freeze it before the blind test, never after, or the test measures your tuning instead of the system.
And don't take your eyes off false rejects. Operators stop trusting a station that rejects good parts, and a station nobody trusts gets bypassed. The classic version is the threshold someone loosened at 2 a.m. to keep the line moving, which nobody put back. Our post on why vision systems reject good parts goes through the usual causes.
Validate it like any measuring system. Freeze the model and threshold, test on lots it hasn't seen, and report escape and false-reject rates with sample sizes. Then monitor for drift by trending the reject rate and score distribution, auditing accepted parts, and retraining whenever lighting, materials or the part change.
Validation proves the station works the day you sign off. Drift monitoring proves it still works on day 300, and that's where most AI stations fail quietly. If you work under IATF 16949, ISO 13485 or FDA rules, map the validation onto your existing IQ, OQ and PQ structure. Our guide to validating a vision inspection station shows how.
For drift, decide in advance what you'll watch and what triggers action. Trend the reject rate daily, along with the average score of good parts, since that often moves before the reject rate does. Have someone check a sample of accepted parts every week or so, so you find escapes before your customer does. Treat any change to lighting, camera, lens, material supplier, surface finish or part revision as a trigger to rerun the reference set, even if the numbers look fine. And when you retrain, version it, rerun the same blind test, and have a named person sign it off. Retraining is a change to a measuring system, so treat it like one. Our machine vision maintenance checklist covers the hardware side of that routine.
Run the reject decision on the edge, meaning the camera, a vision controller or an industrial PC next to the line. It has to arrive within the cycle time and can't depend on the internet. Use the cloud or a plant server for labeling, training, version control and comparing stations.
Plenty of plants won't send production images off site at all, and vendors have followed. Overview.ai, for example, trains and runs models on the camera and says production data never leaves the factory floor.8 LandingLens supports both cloud and edge deployment.3 If your IT team rules out public cloud, an on-premise server does the training job just as well. That's what our on-premise AI work is built around.
Whichever way you go, you'll want to ask every vendor where the images are stored, who owns the trained model, whether you can export it, and what happens to the station if the subscription lapses. The answers vary a lot more than the accuracy claims do.
Write the defect book and numeric acceptance criteria before you collect a single image. Collect images across real variation, label them twice, then freeze the model. Test it blind on held-out lots, run it in shadow mode on the live line, and decide against the numbers you wrote first.
Most AI pilots succeed. A lot of them then disappoint in production, because the pilot tested something easier than production. It only predicts month six if it sees month six's variation and gets scored the way production will score it.
Budget honestly for image collection and labeling. They're the line items plants underestimate almost every time. Our guide to machine vision system cost shows where the rest of the money goes. Our machine vision ROI guide shows how to put both kinds of error into the business case, and the Cognex vs Keyence comparison covers how the two biggest vendors package their AI tools. If the station also needs new optics, our machine vision lighting guide is the place to start.
It varies too much for one honest number. An AI smart camera on a simple station costs far less than a multi-camera system with a GPU PC, custom lighting and validation. The camera is usually the smaller part of the bill, and image collection and labeling are the part most plants underbudget. Our machine vision cost guide breaks down the tiers.
It's more consistent, and it doesn't get tired on the third hour of a night shift. But people still handle novel defects and judgment calls better, and they're quicker to retrain. Most plants that do this well use AI for the repetitive bulk and keep people for audits, borderline parts and anything new.
No. AI's good at finding features and judging appearance, but measuring to a tolerance needs calibrated optics, subpixel edge tools or 3D sensors, plus a gauge study. Use the model to locate or classify, and a rule-based or 3D tool to measure. Most stations that need both run them in the same job.
Not always. Many smart cameras now run deep learning models on board, which is enough for a lot of single-camera jobs. Multi-camera stations, high-resolution images or short cycle times often need an industrial PC with a GPU or other accelerator. Training is usually done on a PC, server or cloud service, separate from the line.
Sometimes. Some current Cognex and Keyence models run deep learning tools on the camera, often as a license upgrade, but older models usually can't. The other route is to keep the camera and send images to a PC running AI software. Check your exact model and firmware with the vendor first.
Synthetic defect data means generated images of defects, used when real examples are rare. Some vendors build tools for it. It can help a model see more variety, but it isn't proof the model will catch real defects. Always test on real, held-out defective parts before you trust a model trained partly on synthetic images.
Benchmark figures, the NIST text and vendor capabilities are sourced as listed, and vendor numbers are vendor claims. The figures are illustrative and don't show data from any specific line. Guidance on data collection, labeling, thresholds, drift monitoring and pilot design is Relling's engineering practice from commissioning inspection stations, not the result of a study.
Machine vision
How we split a station between trained models and classic tools, job by job.
Vision library↗
Blog
IQ, OQ, PQ and gage R&R for cameras, including AI models.
Machine vision↗
Blog
When a camera beats a person at the bench, and when it doesn't.
Machine vision↗We started Relling to help American manufacturers make more of what this country needs. Tell us about the part and we'll scope a cell to it.