
Updated July 2026 · 7 min read · Adente Vision Engineering Team
"AI inspection sounds good, but we don't have thousands of defect images to train it." This is the single most common objection to putting a learning model on a production line, and it is based on an outdated idea of how these systems work. You do not need a mountain of labelled defects. For most surface and anomaly tasks, about 20 good parts is enough to start.
This post explains why, how anomaly detection and few-shot learning make it possible, and where the real difficulty has moved now that data is no longer the wall.
Why the "thousands of images" belief is outdated
The belief comes from classic supervised deep learning, where a model is taught to recognise each defect class from many labelled examples of it. That approach genuinely does need large, balanced datasets, hundreds or thousands of images per class, each one labelled by hand.
The problem is that this is exactly the data a factory does not have. Defects are rare by design; if a line produces a 0.7% defect rate, you would run tens of thousands of parts just to collect a few hundred faulty ones, and you still would not have examples of the failure mode that has not happened yet. Building a supervised dataset up front is slow, expensive and always incomplete.
Anomaly detection turns the problem around. Instead of learning every way a part can be wrong, it learns what "right" looks like, and good parts are the one thing a healthy line produces in abundance.
How does anomaly detection work?
Anomaly detection learns the appearance of good parts and treats anything outside that learned distribution as a defect. You show it a small set of good examples, it builds a model of "normal", and at run time it scores each new part by how far it deviates.
| Supervised defect detection | Anomaly detection | |
|---|---|---|
| What it learns | Each named defect class | The appearance of "good" |
| Data needed | Many labelled defects per class | ~20 good parts to start |
| Catches unseen defects | No, only trained classes | Yes, flags any deviation |
| Best when | The defect catalogue is fixed and known | Defects are rare or unpredictable |
The practical upshot: anomaly detection catches the defect nobody photographed in advance, because it is not looking for a specific flaw, it is looking for anything that is not normal. Public benchmarks such as the MVTec Anomaly Detection dataset have made this a well-studied, measurable field rather than a marketing claim.
What is few-shot learning, and how do you add a new variant?
Few-shot learning is the ability to teach the model a new concept from a very small number of examples. In inspection, it is what lets you extend a working system to a new part or variant without starting the training over.
Say your line adds a second housing variant. Instead of collecting a fresh dataset, you show the system a handful of good examples of the new variant. It adapts its notion of "normal" to include the new part, and it is inspecting again the same day. The same mechanism handles seasonal changes, a new supplier's material, or a tweaked design, you top up the reference set rather than rebuild it.
This is the difference between a system that is usable on day one and one that needs a months-long data campaign before every change earns its keep.
A practical data plan: start, refine, adapt
You do not need a data strategy document. You need three moves.
- 01Start, collect about 20 good parts that represent the normal range of your production (natural colour and texture variation included). This is enough for anomaly detection to run.
- 02Refine, when you want the system to name a specific recurring defect rather than just flag it, add a small labelled set of that defect class. You are only labelling the defects you actually care to categorise.
- 03Adapt, for a new variant or a process change, add a handful of good reference images. The model updates its baseline instead of retraining from scratch.
In the field, a model trained this way can be ready quickly, on one delivered cap-inspection line, training completed in under 48 hours and ran at roughly 30 ms per part. The numbers that matter are still the F1-score and the false-negative rate measured on your part, but the point here is that reaching them no longer requires a data-collection project. (For how those accuracy metrics work, see the AI Visual Inspection guide.)
The real bottleneck isn't data, it's lighting and fixturing
Once training needs only ~20 images, the hardest part of a deployment is no longer the model. It is getting a clean, repeatable image of the part in the first place.
Lighting is usually the decisive factor. The right diffuse or coaxial light makes a defect obvious to the model; poor lighting hides the same defect no matter how good the algorithm is. Fixturing, presenting the part at a consistent position and angle, is the other half. An anomaly model learns "normal" from your reference images, so if the part wobbles or the light drifts with line speed, the model sees that instability as an anomaly and false rejects climb.
This is good news for buyers: it means the questions to ask a vendor are not "how many images do you need" but "how do you handle my lighting and part presentation", because that is where reliability is actually won or lost. See how Adente Vision matches the camera, lighting and compute to the part class before the unit ships.