Rare defect synthesis is the practice of turning scarce, restricted, or unusable manufacturing defect data into a balanced, learnable dataset that preserves the statistical structure of the real production line, so a machine vision inspection model can actually learn to catch the failures that almost never happen.
On a mature production line, a critical defect might show up in fewer than one part in ten thousand. That scarcity is exactly what makes the defect dangerous and exactly what starves the model meant to detect it. The class-imbalance problem is old enough to have a canonical answer: SMOTE, published in JAIR in 2002, corrects imbalance by generating synthetic examples of the minority class. In manufacturing quality, the data is rarely missing. It is imbalanced, locked to the shop floor, or too sparse in the classes that matter.

Why rare defects break machine vision inspection models
A machine vision inspection model learns from what it sees. When 9,999 of every 10,000 images are good parts, the model can score 99.99% accuracy by predicting “pass” every single time and still miss the one failure that triggers a recall. The metric looks excellent. The model is useless.
Class imbalance is the surface problem. Underneath it sit three harder ones. Real defect images are often tied to a specific customer’s product and cannot leave the plant. Historical defect records are thin because good engineering made the defects rare in the first place. And the defects that do appear cluster around specific process conditions, so a model trained on last quarter’s failures does not generalize to a new material lot or a retooled station. That decay is well documented: models trained under one set of conditions often degrade as those conditions shift.
Simple fixes fall short. Oversampling the minority class just shows the model the same handful of images repeatedly, which teaches it to memorize rather than generalize. Generic augmentation (rotate, flip, adjust brightness) changes pixels without adding a genuinely new defect. What a quality model needs is more true variation in the rare class, not more copies of what already exists.
What rare defect synthesis actually produces
Rare defect synthesis produces new, plausible examples of the failure modes that are underrepresented, while keeping the relationships that define a real defect intact: the way a crack propagates along a grain boundary, the co-occurrence of a surface scratch with a specific coating thickness, the sensor signatures that accompany a solder void. The point is not to draw more pictures. The point is to give the model examples that behave, statistically, like defects it will meet in production.
This is where DTS, CUBIG’s data preparation engine, does its work. DTS treats the rare class as a distribution to synthesize from, not a folder of images to be copied. It uses Structure-Preserving Synthesis to hold the correlations that make a defect a defect, then applies rare-pattern augmentation to expand the thin class into a range a model can actually learn from. Differential privacy can be applied during synthesis to limit what the synthesized set can reveal about any single real part or customer record, which is what lets the data move beyond the plant at all.

Diagnosing and synthesizing defect data
DTS takes the same approach on manufacturing data that it takes anywhere: diagnose the data, then synthesize the cases and conditions the task needs. The order matters because you cannot fix well what you have not measured.
Diagnose. Before touching anything, DTS profiles the dataset: which defect classes are present, how badly they are imbalanced, which features carry signal, and where the gaps are. On a real line this is often the first time a quality team sees, in numbers, just how thin their worst classes are.
Transform. DTS then synthesizes more examples of the scarce classes using Structure-Preserving Synthesis, so the synthetic defects respect the joint distribution of the originals rather than inventing artifacts a physicist would laugh at. This is a different thing from a generic synthetic data generator that optimizes for realistic-looking pixels; here the target is statistical fidelity to the failure mode.
Assemble. Finally DTS assembles a balanced, model-ready dataset that combines real good parts, real rare defects, and synthesized rare defects, ready to hand to your training pipeline. Because DTS uses a non-access architecture, it operates on the structure of the data without pulling raw parts or images out of the controlled environment. The caution fits the territory: a production line is operational technology, which NIST covers with a dedicated security guide, SP 800-82 Rev. 3, built around the performance, reliability, and safety constraints the domain runs under.
Rare defect synthesis versus the usual workarounds
Quality teams have tried several ways to feed a starving model. Here is how rare defect synthesis compares to the common alternatives on the things that decide whether a defect model ships.
| Approach | Adds real variation to rare class | Preserves defect structure | Can leave the plant safely |
|---|---|---|---|
| Do nothing (raw imbalanced data) | No | Yes | No |
| Oversample / duplicate minority class | No | Partial | No |
| Generic image augmentation | Partial | Partial | No |
| Generic synthetic data generator | Yes | No | Partial |
| Rare defect synthesis (DTS) | Yes | Yes | Yes |
The column that usually surprises people is the third one. A model that never leaves a single plant is a science project. Because DTS can apply differential privacy during synthesis, the synthesized defect data can often be shared across sites, vendors, or a central AI team without exposing the underlying parts, subject to your own review, which is often what turns a pilot into a program.
Is your defect data ready to train on?
Run this quick check against your own quality dataset before you spend another sprint tuning a model that cannot see enough failures.
- Does your worst defect class have fewer than a few hundred genuine examples?
- Would your model score above 99% accuracy simply by predicting “pass” on everything?
- Are your defect images or records locked to one plant because of customer or regulatory constraints?
- Do new material lots or retooled stations produce failures your current model has never seen?
- Are you oversampling or duplicating the minority class to force class balance?
Two or more yes answers suggests the data is a likely bottleneck alongside the model, so check the data state and the model together before spending another sprint on tuning.
Where rare defect synthesis fits in the CUBIG stack
DTS is the engine that turns restricted, scarce, or unusable data into AI-ready data a model can learn on. Rare defect synthesis is DTS pointed at the hardest version of that problem: a class so thin the model has almost nothing to study. On manufacturing data, DTS diagnoses the imbalance, synthesizes more examples of the rare classes with Structure-Preserving Synthesis and rare-pattern augmentation, and hands back a balanced dataset, all under a non-access architecture so raw parts stay where they belong.
If you want the deeper mechanics, start with what DTS is, then read how Structure-Preserving Synthesis keeps the statistics honest, how the Diagnose step measures your gaps first, and how DTS validation checks whether the synthesized set behaves like the real one before you train on it.

A note on expectations: treat any result from a model trained on synthesized defect data as an example until you reproduce it on your own line, under the same task, model and evaluation conditions. That is the point of testing on your own data rather than trusting a benchmark from someone else’s factory.
Try it on your data for free. Run a sample proof and see it on your own workflow.
