AI-POWERED DOCS
What do you want to know?
Step 4: Train Your AI Model
Your regions of interest (ROIs) 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 10-15 images per class, train (approximately 30 seconds), test and try to break it, then add targeted data where it fails. Repeat this cycle 2-4 times.
This loop is your fastest path to a good model.
Step-by-step training workflow
The OV20i web interface was redesigned in v2026.5. Check your software version in the top-right corner of the camera UI and pick the matching tab. Your choice carries across every page in this setup flow.
- Older versions
- v2026.5 and newer
Follow the numbered steps below to capture, label, train, and iterate.
1. Capture initial training images
With your recipe active and parts flowing (or placed manually), capture images. You need a minimum of 10-15 images per class to start.
For a simple pass/fail inspection:
- 10-15 images of good parts
- 10-15 images of defective parts
2. Define your classes
Pick the model type you're training, then read the matching instructions. The toggle below stays in sync between Step 2 and Step 3, and your choice is preserved in the URL so it survives a refresh or share.
- Classifier
- Segmenter
In the labeling interface, add the classes each inspection type needs. Common classifier class sets:
- Pass / Fail
- Present / Absent
- Good / Scratched / Cracked
Keep it simple at first. You can always add classes later.
In the labeling interface, add classes for the defects (or features) you want the AI to mask. Common segmenter class sets:
- Defect / Background
- Scratch / Crack / Stain
- Foreground / Background
Keep the class list short at first. Each class needs its own brush color and its own labeled examples, so adding more classes upfront multiplies your labeling work.
3. Label the images
- Classifier
- Segmenter

Each ROI gets its own classification class, pick the class that describes that ROI in that image (e.g., "pass" or "fail").
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.

For each ROI in each image, use the brush tool to paint the defective areas pixel by pixel. The painted regions are what the AI learns to detect, anything you don't paint is treated as background.
Segmenter labels require pixel-level brushwork, which is slower than classifier dropdown selections but gives you precise defect maps with location and shape. Start with a small set of clearly-defined defects, and only add more classes once your first model is working.
4. Train the model
- Classifier
- Segmenter
Click Train. The classifier offers two training modes:
- Fast mode, about 30 seconds to a minute. Best for quick iteration during setup, sanity-checking your labels, and easy/well-separated parts. Accuracy is lower than production mode but it lets you see the signal fast.
- Production mode, takes longer but produces a noticeably more accurate model. Always use Production mode before deploying to the line. For tricky parts, hard-to-distinguish defects, or anything you'll trust in production, Production mode is the right answer.
A good rhythm: iterate in Fast mode while you're cleaning up labels and adding data, then run Production once the result looks good, and again before deploying.
Click Train. Segmentation has only one training mode, Production, because pixel-level masks need the more thorough training pass to be reliable. Training time scales with the number of images and the number of ROIs you've labeled, so a small initial set (10-15 images per class) trains in a few minutes; bigger datasets take longer.
There's no "fast" sanity-check option here, so make sure your labels are clean before you train (use View All ROIs to review every mask).
A segmenter only learns the defects you actually paint and show it. The more examples you include, covering the different sizes, shapes, and locations a defect can take, the more reliably it will mask them in production.
Short on defect samples? Use the Defect Creator Studio to generate more training images of the same defect in different sizes, shapes, and positions, so you don't have to wait for them to come down the line.
5. 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.
- Classifier
- Segmenter

The Test panel shows the predicted class and confidence score for each ROI. Run a few captures through and look for low-confidence verdicts (often under 70%), those are your borderline cases and the parts most worth labeling next.

Live Preview overlays the predicted defect mask directly on the image. Watch for masks that are too small, too large, or appearing where there's no real defect, those are the failure modes you'll target with the next round of labeled data.
6. 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
7. Retrain and retest
Repeat steps 4-6 two to four times. Each iteration should improve accuracy. For a deeper walkthrough, including how to add new images to an existing model without losing your previous training, see Adding Data & Retraining.
The model you chose when you created the recipe gets its own step: Step 4: Classification for a classifier, or Step 4: Segmentation for a segmenter. Your classes were defined back in the Region of Interest (ROIs) step, so this step is where you capture images, label, train, and test. Both share the same six sub-tabs across the top. Pick your model type:
- Classifier
- Segmenter
About Classification
A short playbook for getting an accurate model. It lays out the iterate-to-accuracy loop (train fast, find weak spots in Live Preview, add targeted data, retrain, then promote to the high-accuracy Production model) and the per-class best practices that matter most: balance your classes, keep the signal-to-noise high, and cover the extremes of what you want to detect. For a deeper explanation of how a classifier turns each ROI into a verdict, read Understanding the Classifier.

Capture & Label
Build your dataset here. Use Capture to Label to grab frames from the live camera, or Import to Label to pull in saved images. The Navigation controls (Previous, Next, Search by Capture ID, and the total capture count) move you through the set. For each capture, assign every ROI to one of its classes. The per-class tally (for example, Pass 17 / Fail 16) shows at a glance how balanced your dataset is, and Manage classes jumps to where the classes are defined.

Review Labeling
Shows every labeled ROI crop in a single grid, each tagged with its class, so you can scan for mislabels fast. Use Filters and Select all to work through them in bulk. This is where the "check every label before training" habit lives in v2026.5.

Train
Pick a preset and start training on your labeled dataset:
- Development runs in about 30 seconds. Lower accuracy, but it is the fast loop you use while cleaning up labels and adding data.
- Production takes 8 to 15 minutes. It is the high-accuracy model you deploy to the line.
Advanced Settings opens augmentations (brightness, contrast, hue, rotation, flip, Planckian, Gaussian noise, motion blur) and training parameters. See Augmentations below for when to use each. Retrain runs training again after you add data, and the last training time is shown beside it.


Live Preview
Runs the trained model on the live feed in real time. It shows each ROI's predicted class alongside the alignment confidence and matched angle, and breaks down processing time per block (classification, ROIs, template and alignment) so you can see where cycle time goes. Run parts through and look for low-confidence verdicts; those borderline parts are the ones worth labeling next.

Test
Re-runs the trained model against a fixed set of saved captures (Select From Library or Upload Captures) so you can sanity-check it on tough parts without waiting for them to come down the line. Toggle Bounding Boxes, Labels, and Heatmap to see how the model is deciding.

About Segmentation
The same iterate-to-accuracy playbook as the classifier, with mask-specific best practices: paint clean masks, prefer a slight overlap at a defect's edge over leaving a gap, and cover the full range of defect sizes and textures you expect. For a deeper explanation of how a segmenter produces pixel masks, counts, and measurements, read Understanding the Segmenter.

Capture & Label
You build the dataset the same way, but instead of picking a class per ROI you paint a mask. Use Capture to Label or Import to Label, then step through captures with the Navigation controls. Pick the class you're labeling (each one has its own brush color), then paint over the defect on the image. The painted pixels are what the model learns; everything you leave unpainted is background.
The annotation toolbar gives you a tool for every situation:
| Tool | What it does |
|---|---|
| Pan | Move around the image without painting (use it while zoomed in) |
| Brush | Free-paint the mask; adjust the brush size for fine or broad strokes |
| Polygon | Click points to enclose a region with straight edges, useful for hard-edged defects |
| Eraser | Remove paint from a mask you've already drawn |
| AI | AI-assisted labeling: click on a defect and the tool proposes a mask you can accept or refine |
A few more controls speed things up:
- Predict runs your trained model on the capture and drops its predicted mask in as a starting point, so you clean it up instead of painting from scratch. This only works once you've trained the model at least once.
- Undo steps back the last stroke.
- Clear All wipes the mask on the current capture.
- Manage classes jumps to the class list.

Review Annotations
Shows every captured ROI with its painted mask so you can check coverage before training. Drag the Mask opacity slider to compare the mask against the image, and use Filters to narrow the set. This is the segmenter's version of the "check every label before training" habit.
Train
Segmentation has a single preset, Production (about 8 to 15 minutes). There is no fast option, because pixel-level masks need the full training pass to be reliable. Advanced Settings exposes augmentations and parameters, and Retrain runs again after you add data.

Live Preview
Runs the trained model on the live feed and overlays the predicted defect masks in real time. Turn on Blob Stats for per-blob counts and areas, set the Confidence Score Threshold (how sure the model must be to assign a pixel to a class), and use Limit Blob Area to ignore blobs below or above a size you set. Watch for masks that are too small, too large, or land where there is no real defect.

Test
Re-run the trained model against a fixed set of saved captures (Select From Library or Upload Captures) to verify mask quality offline. Toggle Bounding Boxes, Labels, and Heatmap to see how the model is deciding.

A segmenter only learns the defects you actually paint and show it. Include as many examples as you can, covering the different sizes, shapes, and locations a defect can take. If you're short on samples, generate more with the Defect Creator Studio.
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 how you make a model robust to real-world conditions without having to capture an example of every possible variation.
What to turn on by default
A small amount of brightness variation is almost always worth turning on, even the most controlled factory has overhead lights that flicker, shadows that shift through the shift, and minor LED drift over time. Brightness augmentation makes the model resilient to all of that essentially for free.
Rotation: useful, but watch your ROI shape
Rotation augmentation is great if your parts can actually arrive at different angles (loose screws on a conveyor, hand-placed parts, anything not held in a fixture). But it interacts with ROI shape:
- Square ROI: rotation augmentation works cleanly, the rotated image still fits inside the ROI box.
- Non-square ROI on a classifier: rotation can clip the image. When a tall, narrow ROI gets rotated 45°, the corners of the rotated content fall outside the box and the model trains on a partial image. If your part can rotate, either make the ROI square or rely on the Aligner to handle rotation upstream so you don't need rotation augmentation here.
- Segmenter: the same clipping concern applies, but segmentation is less sensitive because it learns from pixel masks rather than the whole ROI shape.
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.
How much data you actually need
You need far less data than most AI systems. Most inspections work great with just 5 to 10 images per class. For a harder, multi-defect problem, 15 to 20 images per class is usually plenty. Start small, find where the model struggles in Live Preview, and add targeted images only where it needs them, rather than collecting hundreds upfront.
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, 10-15 per class minimum
- All labels double-checked (View All ROIs)
- Trained and tested with Live Preview
- Failure modes identified and targeted data added
- 2-4 iterations of label → train → test completed
- Results meet expectations
Model trained and looking good? Move to Step 5: Setting Up Outputs.