Every deep learning detection project opens with the same question: how many pictures are enough? Collect too few and the model fails on the conditions you skipped; collect too many and you spend days drawing boxes that change nothing. The working number for industrial part detection is 100 to 300 labeled images per class, captured under the lighting, lens and exposure the line will run. This guide shows you how to split that budget across the poses, finishes and lighting states your parts really appear in, how to turn it into capture and labeling hours, and when to stop collecting and start training. The counts are planning targets for a first production model; a short round of hard-example mining afterwards does the fine tuning.
Start at 200 images per class
Plan on 200 labeled images per class as the default, with 100 as the floor and 300 as the useful ceiling for a first production model. The driver is appearance range, not part count: a detector learns the spread of conditions a class appears in, and most industrial classes cover that spread within a few hundred frames. Past roughly 300 per class, accuracy gains flatten while labeling hours keep adding linearly.
Budget by condition bins — the distinct appearances the line can produce:
A bracket seen in four orientations and two surface finishes makes 8 bins; at 25 images per bin that is 200 images. A part that always sits in one fixture pose under enclosed light is 1 bin, but the 100-image floor still applies, because position in frame, part-to-part marks and background clutter are variation too.
That is the per-class view. For the whole-set questions — total size, class balance, train and test splits — see how many images to train an object detection model; the rest of this guide stays on the per-class budget.
What moves the count up or down
Two things move the number: how many ways the part can look, and how much of that variety the lighting already removes.
| Situation | Plan per class |
|---|---|
| One fixture pose, matte part, enclosed light | 100 |
| Pose spread within ±30°, two finishes | 200 |
| Curved or shiny part, four or more poses | 300 |
| Transparent or randomly textured | 300, after the lighting is fixed |
Read the last row as an order of operations, not a bigger budget: a shiny or transparent part shot under ambient ceiling light defeats any dataset size, while the same part under a diffuse or dark-field light often drops back to the 200 row. Fix the optics first, then collect; the sequence in stable 2D vision inspection: lighting, lens, exposure first is the order that works.
Scarcity moves the count differently: a class with 20 images among 200-image neighbors fails quietly even when the overall score looks fine — when one rare class fails in detection training shows the failure and the fix. Defect classes follow a different sampling curve again, worked out in deep learning defect inspection: how many samples.
Worked example: a five-class cell
An indexing table presents five machined parts to one camera: bracket, cover, cap, gasket, clip. Each part appears in four rotations and two finishes, so every class carries 8 bins.
- Images per class: 8 bins × 25 = 200
- Part frames: 5 classes × 200 = 1,000
- Background frames at 15%: 0.15 × 1,000 = 150, kept without labels
- Dataset total: 1,000 + 150 = 1,150 frames
- Holdout before training: 15% per bin ≈ 30 images per class, leaving 170 per class to train on
Time, at one part presented every 2 seconds:
- Capture: 200 × 2 s = 400 s ≈ 7 minutes per class, about 35 minutes for all five
- Labeling: 45 s per frame for one or two boxes → 200 × 45 = 9,000 s = 2.5 hours per class, 12.5 hours for the set
- Background review, no boxes to draw: 150 × 10 s = 1,500 s ≈ 25 minutes
Capture is a coffee break; labeling is most of two working days. Plan the project around labeling effort. Bins you cannot afford to label are bins to remove with a fixture or an enclosed light, not bins to hope the model tolerates.
Capture on the line, not on the desk
Collect with the optics the cell will run: same camera family, same lens and working distance, same light and controller settings as deployment. A set captured under a desk lamp with a 50 mm lens, then deployed under a ring light at twice the working distance, is a different dataset — the model will meet images you never showed it. Collect across at least two part lots when you can; lot-to-lot finish shifts are a bin you would otherwise meet in production.
The MV-CU020-90GC is a sound capture baseline for color part classes: 2.5 MP, global shutter, color, GigE output, C-mount, on a 1/1.7-inch sensor.
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- Up to 3 MP
Where a class is decided by fine texture — brushed grain, engraving, small print — the LS-CMR-0166 buys 4000 × 3000 pixels at 30 fps over USB3.
| Specification | MV-CU020-90GC | LS-CMR-0166 |
|---|---|---|
| Sensor model | GMAX4002 | Sony IMX226 |
| Pixel size | 4 μm × 4 μm | 1.85 μm |
| Resolution | 2048 × 1200 | 4000 × 3000 (12MP) |
| Max. frame rate | 49 fps @ 2048 × 1200 Bayer GB 8 | 30 fps |
| Data interface | Gigabit Ethernet (1000 Mbit/s), compatible with Fast Ethernet (100 Mbit/s) | USB 3.0 |
| Price | $309.00 | $560.00 |
All 2 share: Sensor size 1/1.7". Values as printed in each product's data sheet; open a part for its drawing and full specifications.
Log the settings with every frame: exposure, gain, light intensity, part presentation. When the model misbehaves in round two, that log tells you whether the world changed or the data did.
Check pixels and exposure before you collect
Dataset size cannot rescue undersampled images. Set the pixel scale before frame one: the smallest feature the detector must see needs about 3 to 5 pixels across. Sizing camera resolution by the pixel rule works the general case in full.
Worked check at the 12 MP tier: the LS-CMR-0166 delivers 4000 × 3000 pixels over USB3. Give it a 240 mm field of view.
- 240 mm ÷ 4000 px = 0.06 mm per pixel
- a 0.5 mm flaw spans 0.5 ÷ 0.06 ≈ 8 px — comfortable
- a 0.2 mm punch mark spans 0.2 ÷ 0.06 ≈ 3 px — at the floor, workable but not generous
Below 3 px, shrink the field, move the camera closer or add pixels. The calculator runs the same check on your own field:
The pixel size also sets motion exposure. With 0.06 mm pixels on a belt at 300 mm/s:
At 0.2 ms the blur stays under one pixel. A static indexing table has no such limit: expose as long as the light allows and keep sensor gain low.
Label quality costs more than image count
A widely used industry rule of thumb: if 10% of training images are mislabeled, correcting the model afterwards takes roughly three times more data. On this budget that is 20 bad boxes in a 200-image class, and 600 images to repair what 200 clean ones would have built.
Spend the first hour on labeling rules instead of buying that repair: one class list, one box-tightness convention (write down whether boxes touch the part edges and when an occluded part gets a box), one decision on ambiguous frames. Then audit: pull 20 random frames per class per labeling session, and two or more errors means stop, re-agree, and re-check that session's work.
Clean 200 beat noisy 600. That ratio is the largest saving available in the whole plan.
Grow with hard examples, not bulk
Train the first model on the 1,150 frames, then let its failures steer collection. Run it over an hour of real production frames, save every miss and false positive, label 50 to 100 of them per class, retrain.
- Round 1: 200 per class — first working model
- Round 2: +50 to 100 hard examples per class, covering what round 1 missed
- Round 3: optional; if it keeps finding new failure modes, the problem is optics or presentation, not data volume
Two rounds settle most stations. A model that needs four or more is telling you the scene is not stable enough to learn.
The hard-example loop is also where background frames earn their keep: frames where the model invents a part on a clamp or a fixture edge are exactly the negatives worth keeping, and they need no boxes — why background images need no labels.
Validate per condition, then deploy
Hold out the 30-image reserve per class before training, then score per bin rather than as one mean: a 0.95 average can hide a 0.6 score on the shiny bin, and the shiny bin is the one your line runs on Fridays. Per-condition generalization metrics shows the scorecard to use.
Deploy the passing model where the cycle already runs. A vision sensor keeps the whole loop on the device: the MV-SC3050XC-16M-ATN-H carries 5 MP color, a global shutter and an M12 lens mount, communicating over Fast Ethernet.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
Where the detector feeds a picker, its output becomes robot targets, and the hand-off from detector frame to controller coordinates is its own architecture; the deep learning integration with industrial robots guide walks that path. Later changes are new bins, not rebuilds: a new finish supplier or a worn fixture deserves its own 20 to 25 captured images and one retrain.
When deep learning is the wrong tool
A part in a hard fixture, one pose, enclosed light and a matte finish needs no dataset: calibrated matching, blob and edge tools tune on a dozen sample images in an afternoon and run deterministically for years. Deep learning earns its labeling hours when appearance genuinely varies — pose drift, mixed finishes, unstructured presentation, bins and clutter. AI versus rule-based smart camera inspection: how to choose lays out the decision.
The 100 to 300 images per class in this guide are the cost of that variation. Scenes without the variation should not pay it.
Before you collect: the checklist
- Write the class list and the bin matrix — poses × finishes × lighting states — before touching a camera; the bins set the budget.
- Check the pixel rule at the production working distance: smallest must-see feature spanning 3 to 5 px.
- Lock lighting, lens, exposure and gain to deployment values, and log them with every frame.
- Capture 25 images per bin, 100 floor per class, from real production parts under production light.
- Add background frames to 10-20% of the part count from the live scene, unlabeled.
- Reserve 15% of each bin as holdout before the first training run.
- Agree labeling rules in writing; audit 20 random frames per class per session.
- After round 1, mine 50-100 hard examples per class instead of bulk capture.
Size the capture side with the camera finder, or start at the camera step of the configurator to pair camera, lens and light in one pass. The GigE and USB3 models used above sit in area scan cameras; the on-device options sit in smart cameras. Every order carries free expert support, so send the bin matrix over before the labeling run starts, and browse the wider dataset and integration topics on the systems topic page.
Questions
How many images per class does a first object detection model need?
Plan on 200 labeled images per class and adjust from the bin count: 100 is enough when the part shows one pose under enclosed light, 300 when it is curved, shiny or presented in four or more orientations. Keep every condition bin at 20 images or more, add background frames to 10-20% of the part count, and reserve 15% of each bin as holdout before training.
Can flips and rotations replace real captures?
Augmentation stretches a set at almost no extra effort, but a mirrored image adds no new physics: light direction, shadows and surface finish do not flip with the pixels. Use flips, crops and brightness jitter to widen pose and position variety, and spend real captures on what augmentation cannot fake — light angle, reflections, finish variation and part-to-part differences.
How long does a 1,150-frame dataset take to collect and label?
At one part every 2 seconds, the 1,000 part frames take about 35 minutes of presentation time. Labeling dominates: 45 seconds per frame works out to 2.5 hours per 200-image class, roughly 12.5 hours across five classes, plus 25 minutes to review the 150 unlabeled background frames. Budget the labeling effort, not the capture time.
What should I do when a class is too rare to collect 100 images?
Photograph every genuine example available, spread across the same bins the frequent classes use, and treat the class as a flagged risk: a 20-image class among 200-image neighbors drags its own score down even when the mean looks healthy. If the parts stay scarce, let an anomaly-detection or template-matching tool carry that class instead of forcing a detector.
Does a higher resolution camera reduce the number of training images needed?
No. Resolution changes what each image shows, not how many conditions a class spans. Pixels only need to satisfy the 3-to-5-pixel rule on the smallest must-see feature; beyond that, extra pixels add labeling area and bandwidth without adding variety. Collect per condition bin first, and spend on pixels only where the pixel check fails.

