Skip to main content

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

  1. Review your model configuration once more to ensure everything is set correctly
  2. Click the Start Training button in the top toolbar
  3. In the confirmation dialog:
    • Select available GPU resources (if prompted)
    • Set training priority (if you have multiple jobs)
  4. 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.

Start Training 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:

  1. 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
  2. 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

Training Progress 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:

  1. 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
  2. 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
  3. 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

Evaluation Results 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:

  1. 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
  2. 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
  3. 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
  4. 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:

  1. Click the version dropdown and select "Create New Version"
  2. Modify parameters or attach updated datasets
  3. Train again and compare results with previous versions

Model Improvement Creating an improved version of your defect detection model