◇ Blog · Machine vision

AI visual inspection in 2026: what works on a real line, and what still doesn't.

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.

Relling Engineering
Published Updated 14 min read
On this page

    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.

    Key takeaways

    • AI inspection earns its place on variable surfaces, hard text and classification. Measurement still belongs to rule-based or 3D tools.
    • Label consistency beats image count once you're past a few hundred images per defect class.
    • Anomaly detection finds "different", not "defective", and it's weak on missing or misplaced parts.
    • Every threshold trades escapes against false rejects. Pick it from the cost of each error, then freeze it.
    • A pilot predicts production only with a blind test on unseen lots and a shadow run on the live line.

    How does AI visual inspection work?

    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).

    What can AI visual inspection detect?

    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.

    What are the limitations of AI visual inspection?

    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.

    How many images do you need to train an AI inspection model?

    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.

    Fig. 01AI visual inspection · training data vs performance
    Typical pilot 60% 70% 80% 90% 100% 50% 10 30 100 300 1,000 3,000 Labeled images per defect class (log scale) Defect recall at a fixed false-reject rate Consistent labels Inconsistent labels ceiling set by label disagreement Few images: works on easy, high-contrast defects only Illustrative shape, not measured data. Real curves depend on defect size, contrast and lighting.
    How much training data deep learning inspection needs depends on label quality. When labels agree, more images keep helping. When inspectors disagree on borderline parts, the curve flattens and extra data won't lift it. Illustrative shape based on typical behavior, not a measured curve.

    What is the difference between anomaly detection and supervised learning?

    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.

    Anomaly detection vs supervised deep learning vs rule-based inspection
    ApproachTrains onGood atWeak atUse it when
    Anomaly detectionGood parts onlyUnknown or rare surface defectsLogical defects; telling harmless variation from real defectsDefects are rare, varied or not yet cataloged
    ClassificationLabeled images per classSorting, grading, pass/fail on the whole imageLocating small defects; classes it hasn't seenThe categories are known and stable
    Detection / segmentationImages with outlined defectsFinding and sizing known defect typesLabeling effort; rare classesYou need to know where and how big
    Rule-based toolsNothing; set by an engineerMeasurement, presence, codes, alignmentVariable surfaces, subjective defectsThe 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.

    How accurate is AI visual inspection?

    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.

    Fig. 02AI defect detection threshold · escapes vs false rejects
    0 · looks normallooks anomalous · 1 Model score Number of parts Reject threshold Good parts Defective parts Escapesdefects shipped False rejectsgood parts scrapped Illustrative distributions. The defective hump is drawn larger than real defect rates so the overlap is visible.
    Set the AI defect detection threshold from the cost of each error, not the model's default. Moving it left catches more defects and rejects more good parts, and moving it right does the opposite. Better lighting and cleaner labels shrink the overlap. Tuning the threshold only picks where to stand inside it.

    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.

    How do you validate AI inspection and handle model drift?

    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.

    Fig. 03AI quality inspection drift · one year with retraining
    1% 2% 3% 4% 0% wk 0 wk 13 wk 26 wk 39 wk 52 False-reject rate Alarm limit Validated baseline Retrain + revalidate Retrain + revalidate 1 2 3 1LED panel replaced: slow drift 2Limit crossed: alarm 3New resin supplier: step Illustrative timeline, not data from a specific line.
    Model drift in AI quality inspection usually starts with a change someone made. A replaced light causes a slow creep and a new material supplier causes a step. Both get caught by trending the false-reject rate against a limit, and both get fixed by retraining on new images and rerunning the same validation, not by nudging the threshold. Illustrative.

    Should AI inspection run on the edge or in the cloud?

    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.

    How do you run an AI visual inspection pilot?

    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.

    Fig. 04Automated visual inspection pilot plan · seven steps
    Phase A · build the evidence Phase B · test it the way production will 1 Define defect book, limitsamples, criteria 2 Collect shifts, lots, lighting,real rare defects 3 Label two labelers,measure agreement 4 Freeze lock model versionand threshold 5 Blind test held-out lots neverseen in training 6 Shadow run live on the line,no rejects, audit 7 Go / no-go escapes and falserejects vs criteria Miss: fix data, not threshold Typical span: phase A two to six weeks, shadow run two to four weeks or long enough to see a lot change. Illustrative.
    An automated visual inspection pilot plan where the blind test and shadow run do the predicting. Everything before them builds evidence, and they test it on lots and days the model hasn't seen. When the blind test misses, fix the data and labels and retest on new lots. Adjusting the threshold until the numbers pass just hides the problem.
    1. Write the defect book, with pictures, limit samples and a ruling from the quality owner on each class. Put the acceptance criteria in numbers (maximum escape rate, maximum false-reject rate, cycle time).
    2. Collect across real variation. Multiple shifts, lots and operators, plus both ends of the lighting tolerance. Include every real defect you can find, and hold some lots back entirely for testing.
    3. Label twice. Have two people label a subset independently and see how often they agree. Low agreement is a defect book problem, and fixing it is the best return in the whole pilot.
    4. Freeze the model version and threshold.
    5. Blind test on the held-out lots plus a challenge set of borderline and known-bad parts. Count escapes and false rejects, with sample sizes.
    6. Shadow run. Put the station on the live line making decisions but not rejecting, and compare it with your current inspection and a periodic audit. Run long enough to see at least one material lot change.
    7. Go or no-go against the numbers from step 1, plus a named owner and a drift plan.

    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.

    Frequently asked questions

    How much does AI visual inspection cost?

    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.

    Is AI visual inspection better than human inspectors?

    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.

    Can AI visual inspection replace measurement and gauging?

    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.

    Do you need a GPU for AI visual inspection?

    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.

    Can I add AI inspection to my existing Cognex or Keyence camera?

    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.

    What is synthetic defect data, and does it help?

    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.

    Sources

    1. National Institute of Standards and Technology, Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1, 2023. Appendix B lists more frequent maintenance due to data, model or concept drift among AI-specific risks. nist.gov
    2. Cognex Corporation, Edge Learning Overview: basics and advantages, accessed October 2026. Source for five to ten training images for edge learning versus hundreds to thousands for deep learning. cognex.com
    3. Landing AI, LandingLens product page and Manage Label Books documentation, accessed October 2026. Sources for label books as a consistency tool and for cloud and edge deployment. LandingLens · Label books
    4. Bergmann, Fauser, Sattlegger and Steger, MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection, CVPR 2019, and the MVTec AD dataset page (MVTec Software). Source for dataset size, categories and defect-free training sets. mvtec.com
    5. Roth, Pemula, Zepeda, Schölkopf, Brox and Gehler, Towards Total Recall in Industrial Anomaly Detection (PatchCore), CVPR 2022. Reports image-level AUROC of up to 99.6% on MVTec AD. arXiv:2106.08265
    6. Heckler-Kram, Neudeck, Scheler, König and Steger, The MVTec AD 2 Dataset: Advanced Scenarios for Unsupervised Anomaly Detection, 2025; International Journal of Computer Vision, 2026. Reports state-of-the-art methods below 60% average AU-PRO, with lighting variation between training and test. arXiv:2503.21622
    7. Bergmann, Batzner, Fauser, Sattlegger and Steger, Beyond Dents and Scratches: Logical Constraints in Unsupervised Anomaly Detection and Localization, International Journal of Computer Vision, 2022. Introduces the MVTec LOCO AD dataset of structural and logical anomalies. Springer
    8. Overview.ai, product overview, company website, accessed October 2026. Source for on-device training and inference, data staying on the factory floor, and synthetic defect generation tools. overview.ai

    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.

    Pilot AI inspection the way production will run it.Bring Relling to your shop floor.

    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.