Training & Testing
Now it's time to train your model and monitor its progress in learning to identify product defects.
Step 1: Start the Training Process
- Review your model configuration once more to ensure everything is set correctly
- Click the Start Training button in the top toolbar
- In the confirmation dialog:
- Select available GPU resources (if prompted)
- Set training priority (if you have multiple jobs)
- Click Start to begin training your defect detection model
The training process will begin immediately. For a typical defect detection model with 50-100 images, training might take 30-60 minutes, depending on the complexity of your defects and available computing resources.
Starting the training process for your defect detection model
Step 2: Monitor Training Progress
During training, closely monitor how well your model is learning to detect product defects:
In the Progress section, observe these key metrics:
- Training Loss: Should steadily decrease, indicating the model is learning
- Validation Loss: Should follow a similar pattern to training loss
- mAP (mean Average Precision): The primary metric for detection quality
- Values above 0.7 (70%) generally indicate good defect detection
- Higher values mean better detection accuracy
- Class-specific metrics: Performance for each defect type
Watch for these patterns in the training curves:
- Ideal scenario: Both training and validation loss decrease steadily, and mAP increases
- Overfitting warning: If validation loss starts increasing while training loss continues decreasing
- Underfitting sign: If both losses plateau at a high value early in training
For defect detection specifically, pay attention to:
- How quickly the model starts detecting each type of defect
- Whether some defect types are learned faster than others
- If the model struggles with particular defect categories
Monitoring the training progress for defect detection
Step 3: Evaluate Defect Detection Results
Once training completes (or stops via early stopping), evaluate how well your model detects defects:
Review the final metrics:
- Overall mAP: Should be at least 0.7 (70%) for a usable defect detector
- Per-class AP: Look for any defect types with significantly lower detection rates
- Precision and Recall: Balance between false positives and missed defects
Go to the Tests section to test with new images:
- Click Upload Test Images
- Select product images that weren't used in training or validation
- Observe how well the model identifies defects
- Check for any systematic errors in detection
Specifically analyze:
- False positives: Normal product features incorrectly identified as defects
- False negatives: Actual defects that weren't detected
- Localization accuracy: How precisely the model pinpoints defect boundaries
- Confidence scores: Whether the model is appropriately confident in its detections
Evaluating defect detection performance on test images
Step 4: Iterate and Improve (If Needed)
If your defect detection results aren't satisfactory, consider these improvements:
If accuracy is too low overall:
- Add more training images with clearly labeled defects
- Try a more powerful backbone (e.g., ResNet101)
- Increase input resolution to 800×800
- Extend training time by increasing epochs
If specific defect types are poorly detected:
- Add more examples of those particular defect types
- Ensure consistent labeling for those defects
- Consider creating a separate, specialized model for difficult defect types
If false positives are common:
- Add more negative examples (defect-free products)
- Add more diverse examples of normal product variations
- Adjust confidence thresholds during inference
If the model misses subtle defects:
- Ensure subtle defects are clearly labeled in training data
- Try reducing learning rate (0.0001) for more precise learning
- Consider using a focused dataset of just subtle defect examples
To implement these changes, create a new version of your model with adjusted settings:
- Click the version dropdown and select "Create New Version"
- Modify parameters or attach updated datasets
- Train again and compare results with previous versions
Creating an improved version of your defect detection model