Machine vision for quality control: guide 2026

What defects machine vision can detect, how many images you need, how to run a plant pilot, and what to check before buying cameras or software.

CAPABILITIES·OCTOBER 2026·9 MIN
Quality inspector examines metal parts on a production line
Arturo Sánchez Gándara

By Arturo Sánchez Gándara · CEO

Digital consultant with more than 20 years of experience in AI, e-commerce, and digital business. I apply technology to simplify work processes.

Published: OCTOBER 2026 · LinkedIn ↗

Manufacturing contributes more to the Mexican economy than any other sector: in 2025, it generated 21.3% of the country's gross value added, according to the INEGI 2025 Goods and Services Accounts. At many of these plants, the last barrier before a defect reaches the customer is still a person inspecting parts by eye.

This guide is for plant directors, quality managers, and manufacturing business owners evaluating machine vision for quality control who want to know what to expect, what data they need, and how to avoid a project that never gets beyond the demo.

In this article:

  • What computer vision for quality control is and what it can detect
  • Why manual inspection has its limits
  • How many images and what data you need
  • Traditional vision or deep learning: which is the right fit?
  • How to run a plant pilot, step by step
  • What to check before choosing a vendor, software, and licenses

# What is machine vision for quality control?

It's a system that captures images of each part or product on the line and decides, in milliseconds, whether it meets the quality criteria. It has four parts: a camera and lens, lighting, a model or algorithm that analyzes the image, and an integration that acts on the result—for example, a signal to the PLC to reject the part and a record with the image for traceability.

AI is only one of the four parts. In practice, poor lighting or an improperly mounted camera can ruin more projects than the model. That's why it's best treated as a process project, not as the purchase of a smart camera.

# What defects can it detect?

Anything a person can see in a well-lit image, and some things they can't catch at line speed. The most common applications on the plant floor are:

Inspection typeExamplesTypical approach
Surface defectsScratches, dents, stains, porosity, burrsDeep learning or anomaly detection
Presence and positionMissing screw, misplaced connector, missing labelClassical vision or object detection
MeasurementDiameters, distances, clearances within toleranceClassical vision with a calibrated camera
ReadingBarcodes, 2D codes, lot number and expiration dateCode readers and OCR
Color and foreign matterProduct with off-color appearance, contaminants in foodClassical vision or deep learning, depending on the variation

A documented Mexican example: La Próxima Estación, an Irapuato packing plant that exports close to 98% of its production, uses vision sensors to detect off-color product and foreign matter and remove it with an ejector, according to the case published by KEYENCE México. The important thing about this case is that they didn't stop at detection: they connected the camera to a rejection mechanism and an operator screen.

# Why isn't manual inspection enough?

Because visual inspection is mentally demanding and has its limits. In a Sandia National Laboratories study, 82 experienced inspectors reviewed 140 precision parts: they detected 85% of defective parts, but mistakenly rejected 35% of good parts. The authors compare that result with the 80% detection rate commonly reported in the industry (See, 2015, Human Factors) comes in.

That doesn’t mean inspectors are no longer needed. It means their judgment is more valuable for defining what counts as a defect, reviewing borderline cases, and improving the model than for inspecting thousands of identical parts. Machine vision handles the repetitive work, while people focus on judgment.

# How many images do you need to train a model?

Fewer defect images than many people think, but more organization than most teams have. There are two approaches:

  • Anomaly detection: the model learns what a good part looks like and flags anything that deviates from it. The MVTec AD benchmark dataset, used in industrial inspection research, trains only on defect-free images (3,629) and tests on 1,725 images that include 73 defect types (Bergmann et al., International Journal of Computer Vision). This works when defects are rare or varied.
  • Supervised detection or classification: the model learns from labeled examples of each defect. It is more accurate for known defects, but requires collecting and labeling enough real examples of each type.

In both cases, what matters most is the quality of the dataset: images taken at the actual station, under the same lighting, including borderline parts (the ones that currently spark debate between quality and production) and written acceptance criteria. If your team can’t agree on what counts as a defect, neither will the model.

# Classical machine vision or deep learning: which is right for you?

They aren’t competitors; they work together. Classical machine vision (rules, thresholds, and measurements on the image) is precise, explainable, and inexpensive when the part and defect are consistent: measuring, counting, checking for presence, or reading a code. Deep learning is a better fit when a defect varies in shape, size, or texture and is hard to describe with rules, such as scratches on surfaces or defects in natural materials.

The useful question isn’t which technology is more modern, but how much variation there is in what you want to detect. If you can measure it with a ruler, measure it. If only an experienced inspector can recognize it, that’s where AI comes in. It’s the same logic we explain in RPA vs. artificial intelligence: rules where there are rules, models where judgment is needed.

# How do you run a pilot at a plant?

A well-designed pilot answers one question: Can this system detect this defect at this station, with an error rate the business can accept? The steps we recommend:

  1. Choose one station and one or two defects that are costing you money today: rework, scrap, claims, or returns.
  2. Write the acceptance criteria with quality and production, using photos of good, defective, and borderline parts.
  3. First, get image capture right: fixed positioning, controlled lighting, and a trigger synchronized with the production line.
  4. Gather real images from multiple shifts and batches, not samples prepared for the demo.
  5. Run the system in parallel with the current inspection process without rejecting parts, and compare the results.
  6. Track two numbers: defects that get through and good parts that are rejected. Both are costly.
  7. Use the data to decide whether to scale up, adjust, or stop. If you scale up, define who will retrain the model when the product changes.

Most AI projects don’t fail because of the model, but in the transition from testing to day-to-day operations. We explain this in from AI pilot to production and in how to measure the ROI of artificial intelligence.

# What should you review before choosing a vendor and software?

In addition to accuracy in your pilot, review what will determine costs and risks over the next three or five years:

  • Integration: how it communicates with your PLC, what happens to rejected parts, and where images and results are stored.
  • Retraining: who adds new cases when the product, raw material supplier, or lighting changes, and how much it costs.
  • Licensing: some popular detection models are released under licenses that require you to make your application’s code available if you use them in a closed-source product. Ultralytics, for example, distributes YOLO under AGPL-3.0 and offers an enterprise license for proprietary commercial use (Ultralytics license) comes in.
  • Platform continuity: cloud services are discontinued, too. AWS ended support for Amazon Lookout for Vision, its visual inspection service, on 31 October 2025 (AWS, services being fully discontinued). Ask how you can export your images, labels, and models if you switch providers.
  • On-site or cloud processing: if the line needs a decision in milliseconds or the plant has an unstable internet connection, the model must run on local equipment.

For a general budget reference for AI projects, see how much it costs to implement AI at a midsize company.

Assess your production lineAt ai¹, we design and implement computer vision for quality control: we define the defect and criteria with your team, run the pilot with your parts, and integrate it into your production line.

# Frequently asked questions

# Does computer vision replace quality inspectors?

Not entirely. It takes over the repetitive inspection of each part, but the quality team still defines what counts as a defect, reviews questionable cases, and supplies the model with new examples. Their work shifts from inspecting parts to supervising the system.

# How long does a computer vision pilot take?

It depends on how quickly image capture is set up and real parts from multiple shifts are collected. The slowest part is usually gathering defect examples and agreeing on acceptance criteria, not training the model.

# Do I need a lot of photos of defective parts?

Not always. With anomaly detection, the model learns primarily from good parts and flags anything that deviates. If you need to classify each type of defect, you do need labeled examples of each one.

# Does it work in a small or midsize plant?

Yes, if there is a visible defect that costs money and a station where the part always passes in the same position. It’s best to start with a single station and scale up only based on measured results.

# Can it run without internet?

Yes. Many systems process images on local equipment next to the production line, which also reduces latency. The cloud can be used to store images, review results, and retrain the model.

# Conclusion: start with the defect, not the camera

  • Computer vision inspects 100% of production using the same criteria on every shift; inspectors can focus on judgment.
  • Lighting, mounting, and integration with the production line matter as much as the model.
  • Anomaly detection for rare defects; supervised models for known, recurring defects.
  • A parallel pilot should measure defects that slip through and good parts that are rejected.
  • Before buying, check retraining, licenses, and how to retrieve your data if you switch platforms.

If you want to bring it to your plant, learn about our industrial computer vision service or read how to automate processes with artificial intelligence in other areas of your business.

# About the author

Arturo Sánchez Gándara is CEO of ai¹, an applied AI consultancy based in Guadalajara that helps companies in Mexico and the United States assess, implement, and operate AI solutions, from automation and agents to computer vision.

# Referenced sources

View all insights
WhatsApp