Visual inspection

Visual inspection is the use of cameras and AI models to check products, parts, or structures for defects, such as cracks, scratches, dents, contamination, or missing components. Also called automated optical inspection (AOI) or machine vision inspection, it runs on production lines and in field inspection of infrastructure, using defect detection, segmentation, or anomaly detection models trained on images of good and defective examples.

What is visual inspection?

Visual inspection is quality control by sight. For a long time, that meant a person at the end of a line. Automated visual inspection replaces or assists that person with cameras and models that check every part at line speed and flag the ones that do not meet spec. The same approach works outside the factory, in inspecting bridges, pipes, power lines, and other infrastructure from photos and video.

Key takeaways

  • Visual inspection uses cameras and models to find defects on products, parts, or structures.
  • It relies on detection, segmentation, or anomaly detection, depending on how many defect examples exist.
  • Defects are rare and varied, so the dataset is usually the hardest part to get right.

How it works

Cameras capture each part or surface under controlled lighting, and a model makes the call. The right kind of model depends on the data:
  • Object detection draws boxes around known defect types, such as scratches or dents.
  • Semantic segmentation outlines defects pixel by pixel, which helps when size or area decides pass or fail.
  • Anomaly detection learns what a good part looks like and flags anything different, which works when defect examples are too rare to train on.
The decision usually feeds back to the line by rejecting the part, alerting an operator, or adjusting the process.
Defect classes are tiny next to good parts, so the rarest one is the easiest to miss. Counts are illustrative.

Find the rare defects before your model misses them

Inspection datasets look balanced until you count. Watch for:
  • defect types with only a handful of examples
  • near-duplicate images of the same surface
  • defects whose edges are hard to pin down, such as where a crack ends
In Voxel51, the Concrete Defects dataset holds 1,200 inspection photos of cracks, spalling, exposed rebar, and corrosion, ready for a labeling agent.

Concrete Defects

1,200 images

Concrete inspection photos, ready for a labeling agent to outline cracks, spalling, exposed rebar, and corrosion with polygons, or box them faster.

Try this: Scroll the grid until you find three photos of exposed rebar, and notice how many other defect photos you pass on the way.

Explore Concrete in Voxel51

Free with a work or .edu email.

Go deeper

Why it matters

Defects are rare, and that makes inspection a data problem. A dataset can hold thousands of good parts and a handful of each defect type, with near-duplicate images of the same surface and labels that disagree on where a crack ends. A model trained on that data looks accurate on average and misses exactly the defects that matter. Curating for class imbalance, edge cases, and annotation quality is often what moves an inspection model from a demo to the line, as covered in From Prototype to Production.
Inspection data is mostly good parts, and the defects are what matter.

Frequently asked questions

What is the difference between visual inspection and anomaly detection?

Visual inspection is the task of checking parts for defects. Anomaly detection is one way to do it, by learning what normal looks like and flagging anything that deviates. Other approaches detect or segment specific defect types directly.

What defects does visual inspection find?

Cracks, scratches, dents, corrosion, contamination, misalignment, and missing or extra components. In infrastructure inspection, common ones include cracking, spalling, and exposed rebar in concrete.

Why do visual inspection models fail in production?

Usually because of the data. Real defects are rare and varied, lighting and camera setups change over time, and the training set rarely covers every defect type with enough examples.
black and white photo of Jesse Mostipak
Director of Growth
Jesse Mostipak is the Director of Growth at Voxel51, where the work is helping humans find and trust what the brand knows, and teaching the Google knowledge graph and the LLMs answering on their behalf to do the same. That question, how knowledge gets built inside a system, is one Jesse has been chasing for years. Earlier versions of it ran through a New York City high school science classroom, data science and machine learning, and developer relations at Kaggle, Posit (formerly RStudio), and Baseten. The answer doesn't change much depending on whether the learner is a teenager, a software engineer, or a knowledge graph. Jesse holds a Master's in Education from CUNY Hunter College. LinkedIn
See all articles by Jesse Mostipak
Last updated November 19, 2026

Building visual or physical AI?

Let's talk.