How many defect images do you need to train an inspection model?
There isn’t one number, and anyone who gives you one without seeing your part is guessing. What you need depends on your defects, your part and your model, and you can measure it. Here’s how.
What Visynex isVisynex makes synthetic defect images for training machine vision inspection models. Each image is made from one photograph of a good part, and every defect image ships only if a separate detection pass finds the defect ordered.
What it depends on
- How varied the defect looks. A defect that always looks the same, in the same place, needs fewer examples than one that varies in size, shape, colour and position.
- How different it is from a good part. A dark burn on a bright surface is easy. A hairline scratch on brushed metal is hard, and needs more.
- How much your good parts vary. If finish, colour or position varies from part to part, the model has to learn what isn’t a defect too.
- The task. Telling defective from good is easier than locating the defect with a box, which is easier than outlining it pixel by pixel.
- The model you start from. Starting from a model pre-trained on general images usually needs far fewer examples than training from scratch.
- What a miss costs you. If a missed defect reaches a customer, you’ll want more examples of the defects that matter most, and a stricter test.


How to find your number
Measure it with a learning curve:
- Set aside a test set of real parts, defective and good, that the model never trains on.
- Train on a small set and measure performance on the test set, with recall on the defects you care about first.
- Double the training set and measure again. Repeat.
- When doubling stops improving the result meaningfully, you’ve found roughly where your number is. Look at the classes that are still weak and add examples of those.
This costs a few training runs and replaces a guess with a measurement.
Where synthetic data fits
The learning curve usually shows that the rare classes are holding you back: you can’t double what you don’t have. That’s the gap synthetic data fills. Some defect classes also survive our detection pass more often than others, so we size how many images to generate per class rather than assuming every attempt succeeds.
Questions
Is there a standard number of images per defect class?
No. It depends on how varied the defect is, how visible it is, how much your good parts vary, the task, and the model. Measure it with a learning curve on a real test set.
Should the test set be synthetic?
No. Test on real parts. A model that does well on synthetic images has only shown it learned synthetic images.
What if I have no real defective parts to test on?
Then the first real defects your line produces are the most valuable images you’ll have. Keep them for testing, not training.
Try it on your own part
Sign in with your work email, upload one photograph of a good part, and get up to 10 images of it back, labelled in YOLO and COCO. Each takes about a minute. Free, once per email address.
Try it freeTalk to an engineer
Thirty minutes with someone who built the pipeline. No upload, no account.
Book a call