Skip to content

Blog · Anomaly detection

The rare-defect problem: why you can never collect enough defect images.

Inspection camera checking a row of near-identical machined metal discs on a conveyor

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

Rare defect detection is hard because defects are rare by design: a line running at a few hundred PPM yields almost no defect images to learn from, and collecting enough stalls projects for months. Good-parts-only anomaly detection removes the dependency, training on about 20 good parts with a working model in under 48 hours.

Stalled AI-inspection projects tend to fail at the same step: collecting the defects. A supervised model learns each failure mode from labelled pictures, so it needs many of them. The trouble is structural, not a matter of effort. A line that runs well does not produce many defects, which is the whole point of running it well.

Why can you never collect enough defect images?

You can never collect enough defect images because, on a line that runs well, defects are rare by design. Quality improvement exists to drive the defect rate down, so the better the process, the fewer defect examples it produces. A supervised model that must learn each failure mode from labelled examples is therefore fighting the very thing the plant is trying to achieve. This is the class-imbalance or long-tail problem: a handful of defect images against a flood of good ones, spread across many possible defect types that each appear rarely.

Rare defect detection is the band where this bites hardest, because the defects that matter most, the intermittent, first-seen or safety-critical ones, are exactly the ones you have almost no examples of. 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, and it is built for this band: it trains on good parts only, so the scarcity of defect images stops being a blocker.

What does the math of a low-defect line look like?

The arithmetic is what makes the problem concrete. Take an illustrative line at a 0.1% defect rate, a thousand good parts for every bad one. A shift of 100,000 parts yields about 100 defect images, and those are spread across every defect type that can occur, so any single rare defect might show up two or three times, or not at all. At automotive-grade quality, measured in tens of parts per million, a full shift can produce almost no examples of a given defect. The defect rates below are illustrative industry figures, not Adente measurements.

Defect rate (illustrative)Good parts per defectDefect images in a 100k-part shift
1% (10,000 PPM)100~1,000
0.1% (1,000 PPM)1,000~100
100 PPM10,000~10
25 PPM (automotive-grade)40,000~2 to 3

The imbalance does more than starve the dataset, it also skews training. A model that sees a thousand good parts for every defective one can reach a high headline accuracy just by calling everything good, which is why accuracy is the wrong metric on an imbalanced line and the false-negative rate, the escape rate, is the honest one. For why that metric is the one to demand, see false-negative rate as an inspection metric.

Why does "collect enough defects" stall an inspection project?

Collect enough defects stalls a project because the collection phase has no fixed end. You cannot schedule the arrival of a rare defect, so the timeline is set by the line's failure rate, not by the team's effort. Managers wait for defects to occur, or worse, are asked to manufacture defective parts on purpose to feed the model, which produces staged flaws that may not match how the defect really appears.

There is a quieter cost while the team waits. During the months it takes to gather defects, the line either ships uninspected or leans on manual sampling, so the escapes the project was meant to stop keep happening while the data is being collected. The business case erodes before the model is even trained.

Even when enough images are finally gathered, the dataset only covers the defects that have already happened. The next new failure mode, a different contamination, a new supplier's material flaw, is still unseen, so the model that took months to train is already blind to it. This is why defect-first inspection projects so often stall between a promising pilot and a production rollout: the data requirement never actually closes.

How does good-parts-only anomaly detection remove the dependency?

Good-parts-only anomaly detection removes the dependency by not needing defect images in the first place. Instead of learning each defect, the model learns what a good part looks like from about 20 representative good images and flags anything that deviates. The scarce resource, defect examples, is no longer on the critical path, because the abundant resource, good parts, is what the model trains on. This deviation-scoring task is a benchmarked field in its own right; public datasets like the MVTec Anomaly Detection dataset and the Papers With Code anomaly-detection benchmark measure exactly this good-parts-only setup.

That inversion is what makes rare and first-seen defects tractable. A deviation-scoring model does not need to have seen a specific flaw to reject it, it only needs the part to fall far enough outside normal. The unit runs this as its Anomaly mode, one of four modes (Anomaly, Defect, Counting and Quality), and combines it with classical computer vision so a measurement result stays explainable. Training finishes under 48 hours, so even the first deployment is a two-day task rather than a data-collection marathon.

What the model does still need is a good set that captures the real spread of a good part: different lots, positions, surface finish and the lighting the line actually uses. Twenty pristine, identical images teach an unrealistically narrow normal and cause over-rejection, so the aim is representative good parts, not perfect ones. Built well, that good set is what lets a deviation-scoring model separate a genuine rare defect from ordinary in-spec variation, and it is a quality decision rather than a software setting.

Does rare-defect coverage hold up in production?

Rare-defect coverage holds up where it is measured. On a live cap-inspection line, an Adente Vision unit trained on good parts only runs at a 0.69% false-negative rate with a 99.65% F1-score at about 30 ms per part, catching broken, unclosed and hinge-damaged caps as they pass. The false-negative rate is the number that matters for rare defects, because it is the escape rate: the share of bad parts that slip through.

The catalogue bound is 0.5 s per part at 100+ parts per minute, and the 30 ms is the measured field figure. As always, the escape rate you can commit to on your own parts needs an application-specific measurement, but the point stands: a model that never collected a defect image is catching defects at line speed. See where good-parts-only inspection fits across real applications.

Frequently asked questions

Fighting a rare defect you cannot collect enough of?

Send us your good parts and a description of the escape you need to catch, and we show what a good-parts-only model flags before quoting. See how Adente Vision detects rare defects on the edge.