Step 4: Train Your AI Model
Time: 5–10 minutes
Your inspection regions are set. Now it's time to teach the AI what "good" and "bad" look like.
The three cardinal rules of training
Before anything else, internalize these three rules. They apply whether you're training a classifier or a segmenter, with 5 images or 500.
Rule 1: Label from the image only
Never look at the physical part (or put it under a microscope) to decide whether it's good or bad. If you can't see the defect in the camera image, the AI cannot learn it.
The AI is not magic. It can only work with what the camera sees. If you label a part as "defective" based on something you noticed by touching it or zooming in under a magnifier, but the camera image looks fine, you're teaching the AI to see something that isn't there.
If you can't label it from the image alone, go back to the Install step and fix the physical setup: better lens, better lighting, closer mounting, different angle.
Rule 2: Double and triple check your labels
Mislabels happen to everyone; experienced engineers do it too. But one bad label in a small dataset can destroy your results.
With 5 training images, one mislabel corrupts 20% of your training data. That's catastrophic.
Before every training run: Click View All ROIs and verify every single annotation. This is the easiest thing to fix and the most impactful.
Rule 3: Start small, iterate fast
Don't label 50 images and hit train. Instead, create a tight loop: Label 3-5 images per class, train in development mode (approximately 30 seconds), test and try to break it, then add targeted data where it fails. Repeat this cycle 2-4 times in development mode, then switch to production mode.
This loop is your fastest path to a good model. Run it 2-4 times in development mode, then switch to production mode.
Step-by-step training workflow
1. Capture initial training images
With your recipe active and parts flowing (or placed manually), capture images. You need a minimum of 3-5 images per class to start.
For a simple pass/fail inspection:
- 3-5 images of good parts
- 3-5 images of defective parts
2. Label the images

For each ROI in each image, assign the correct class label:
- Classifier: Select the class from a dropdown (e.g., "pass" or "fail")
- Segmenter: Use the brush tool to paint the defective areas pixel by pixel
If you're not sure whether to use classification or segmentation, start with classification. It's much faster to label and good for most pass/fail scenarios. See Classifier vs. Segmenter for guidance.
3. Train in Development Mode
Click Train and select Development Mode. This takes about 30 seconds and produces a model that's roughly 20x less accurate than production, but it's enough to check the signal.
What "checking the signal" means: Is the AI starting to learn the difference between good and bad? Or is it getting everything completely wrong?
- If it's mostly right → great signal, keep going
- If it's completely wrong → something is off. Check for mislabels, check ROI size, check image quality
4. Test with Live Preview

Click Live Preview Mode and run parts through. Watch the results:
- Is it getting easy cases right?
- Where does it struggle?
- What are the borderline cases?
Try to break it. Find the cases where it fails. These failures are your roadmap for improvement.
5. Add targeted data
Don't add random new images. Add images specifically targeting the failure modes you found:
- If it confuses scratches with reflections, add more examples of both
- If it misses small defects, add more images of small defects
- If it fails on parts in the corners, add more corner examples
6. Retrain and retest
Repeat steps 3-5 two to four times. Each iteration should improve accuracy.
7. Switch to Production Mode
When development mode is working reasonably well, switch to Production Mode. This takes 5-10 minutes but produces a model that's roughly 20x more accurate than development mode.
If development mode was getting 80% of cases right, production mode will likely get 95%+ right.
Augmentations: teaching the AI to handle variation
Augmentations randomly modify your training images during the training process, adjusting brightness, adding rotation, tweaking contrast, etc. Each image gets fed to the AI hundreds of times with slightly different augmentations, but the label stays the same.
This is incredibly powerful for building robustness. If your lighting varies between shifts, brightness augmentation teaches the AI to handle it. If parts can arrive at any angle, rotation augmentation makes orientation irrelevant.
When to use augmentations
| Augmentation | Use when... | Example scenario |
|---|---|---|
| Brightness | Lighting varies (day/night, shadows) | Factory overhead lights change throughout the day |
| Rotation | Part can arrive at any angle | Screw holes, where orientation doesn't matter |
| Motion blur | Parts are moving fast or camera vibrates | High-speed conveyor |
| Saturation | Color isn't part of your inspection | Same part in different colors should pass equally |
| Contrast | Environmental lighting fluctuates | Seasonal light changes through windows |
When NOT to use augmentations
This is a double-edged sword. If you add rotation augmentation but you're inspecting whether parts are oriented correctly, you'll teach the AI that upside-down parts are still "good."
- Inspecting for color consistency? Don't use saturation augmentation
- Inspecting for blur/focus? Don't use motion blur augmentation
- Inspecting for orientation? Don't use rotation augmentation
The rule: Augment everything except the specific property you're inspecting.
Data diversity matters
Your training data should represent the full range of what the AI will see in production:
- Different times of day (if lighting varies)
- Different part batches (surface finish may vary slightly)
- Parts in different positions within the frame
- Both easy and hard cases
Focus on the hardest cases. If your training data includes the 10 most difficult-to-classify parts, then the 90% of easy parts will be trivial for the AI.
High learning capacity
The OV camera's AI is designed to keep improving with more data. Unlike many AI systems that plateau after 20 images, this model continues to improve with 50, 100, even 500+ images. Most inspections work great with 5-10 images, but if you have a complex multi-defect problem, don't hesitate to keep adding data.
Accelerate with synthetic data: Defect Studio
What if you need to train for a defect you rarely see? A missing screw you'd have to intentionally remove, a scratch you'd have to create, a crack that happens once per thousand parts? Waiting months to collect enough examples isn't practical.
The OV Auto-Defect Creator Studio at tools.overview.ai solves this. It generates photorealistic synthetic defect images, up to 10,000x faster than waiting for real defects to appear on the production line.
How it works: 5 simple steps
- Upload a good image of your part
- Mark the area where the defect should appear
- Describe the defect in plain English (e.g., "deep scratch across the surface" or "missing solder joint")
- Generate the defect variations (the AI creates photorealistic results)
- Export the synthetic images directly into your training set
Why synthetic data works
The generated images aren't just "pasted on" artifacts. They're photorealistic variations that match your actual lighting, camera angle, and part surface. The AI understands the physics of how defects look under your specific imaging conditions.
Use cases:
- Rare defects: Train for failure modes you've never (or rarely) seen
- New product launches: Build an inspection before the first defective part rolls off the line
- Edge cases: Generate borderline examples to improve the AI's decision boundary
- Data augmentation: Supplement small datasets with synthetic variety
See it in action
The best approach: train with your initial 3-5 real images first, identify where the AI struggles, then use Defect Studio to generate targeted synthetic examples for those specific failure modes. Real data teaches the baseline; synthetic data fills the gaps.
Training checklist
Before moving on, confirm:
- Initial images captured, 3-5 per class minimum
- All labels double-checked (View All ROIs)
- Development mode trained and tested with Live Preview
- Failure modes identified and targeted data added
- 2-4 iterations of label → train → test completed
- Production mode trained; results meet expectations
Model trained and looking good? Move to Step 5: Setting Up Outputs.