Skip to content

Blog · Few-shot & anomaly

Unsupervised defect detection: how a model flags a defect it has never seen.

Machine-vision camera scanning assorted parts on a factory conveyor

Updated July 2026 · 6 min read · Adente Vision Engineering Team

An unsupervised model never learns defects. It learns the appearance of a good part and scores how far a new part deviates, so a first-seen flaw sits far from normal and is flagged. It rejects by deviation, not by matching a known defect, which is why about 20 good images are enough to start.

The most common objection to AI inspection is a fair one: how can a model catch a defect it has never seen? If it learns from examples, and the defect was not in the examples, surely it is blind to it. The answer is that a well-built inspection model does not learn defects in the first place.

What does the model actually learn?

It learns normal. Shown about 20 good parts, the model builds an internal picture of what a good part looks like across its natural variation. It is not memorising flaws to look for, it is learning the shape of "acceptable" so tightly that anything outside it stands out.

How does deviation scoring flag an unseen defect?

At run time, each new part is compared to that learned normal and given a deviation score: how far it sits from a good part. A scratch, a short-shot, a missing component, none of these were in the training set, but each pushes the part away from normal, and a threshold turns that distance into a pass or fail signal to the PLC. Because the decision is distance-from-good rather than match-to-defect, the flaw does not need to have been seen before. For how the confidence and threshold work, see the AI visual inspection guide.

Rule-based vs unsupervised on known and unknown defects

CaseRule-based / supervisedUnsupervised (anomaly)
Known defect, seen in trainingCatches itCatches it
First-seen or one-off defectMisses it, no rule or label existsFlags it as a deviation
What it learnsA list of defined defectsThe appearance of a good part
Data neededMany labelled defect imagesAbout 20 good images
Decision basisMatch to a known defectDistance from normal

The second row is the whole argument. A rule or a supervised label can only catch what someone defined in advance; deviation scoring catches the defect nobody anticipated. For when a fixed rule is still the better tool, see rule-based vs AI machine vision.

What are its limits, and is it proven?

Anomaly detection tells you a part deviates, not always why, and lighting is the real constraint: a defect that never appears in the image cannot be scored. For a precise known measurement, classical computer vision is better, which is why the unit runs both. On a live cap-inspection line the approach reached a 99.65% F1-score with a 0.69% false-negative rate at about 30 ms per part. Adente Vision is an edge-AI visual inspection unit built by ADENTE Advanced Engineering Technologies, part of the Aden Group, sold through automation system integrators. See where it fits across real applications.

Frequently asked questions

Worried a new defect will slip through?

Send us about 20 good parts or a short video of your line, and we test how the model handles a first-seen defect before quoting. See how Adente Vision scores deviation, not a defect catalogue.