Skip to main content

Configure the Model

Now that our datasets are ready, let's create and configure an object detection model specifically optimized for finding product defects.

Step 1: Create a Defect Detection Model

  1. Navigate to the Models tab in your project
  2. Click Create Model
  3. Configure the basic settings:
    • Name: "ProductDefectDetector_v1" (descriptive name with version)
    • Type: "Object Detection" (matches our dataset type)
    • Description: "Model to detect scratches, dents, and discoloration on products"
  4. Click Create to generate your model

Create Model Creating a model for defect detection

Step 2: Configure Input Settings

For optimal defect detection, configure your model's input settings:

  1. In your model's Definition section:
    • Set Input Dimensions to 640×640 (good balance of detail and speed for defect detection)
    • Keep Channels as "RGB" (color information helps identify certain defects)
    • Enable Patch Mode only if your product images are very large (>1000px)
    • You can leave Region of Interest blank unless you want to focus on specific areas

Note: For defect detection, higher resolution (640×640 or 800×800) is often beneficial since defects can be small or subtle. The tradeoff is slightly longer training time.

Input Configuration Configuring input settings for the defect detection model

Step 3: Set Up Output Configuration

Define what your model will predict:

  1. In the Outputs section, verify that:
    • The system has automatically created bounding box outputs for your defect labels
    • All three defect types (Scratch, Dent, Discoloration) are included
    • The output types match your label types (Bounding Box)

For defect detection models, the outputs directly correspond to the different types of defects you want to identify.

Output Configuration Verifying output configuration for each defect type

Step 4: Attach Your Defect Datasets

Connect your prepared datasets to the model:

  1. Navigate to the Datasets section of your model
  2. Click Attach Dataset
  3. In the dialog that appears:
    • Select "Product_Defects_Training" from the dropdown
    • Set the Role to "Training"
    • Ensure defect labels are correctly mapped to outputs
    • Click Attach
  4. Repeat the process for your validation dataset:
    • Select "Product_Defects_Validation"
    • Set the Role to "Validation"
    • Verify label mappings
    • Click Attach

Both datasets must be attached before you can start training your defect detection model.

Attaching Datasets Attaching training and validation datasets to your model

Step 5: Optimize Parameters for Defect Detection

Configure model parameters that work well for defect detection tasks:

  1. Go to the Parameters section

  2. Under Model Architecture:

    • Select Backbone: "ResNet50" (good balance of accuracy and speed for defect detection)
    • Verify Feature Dimension is set to an appropriate value (usually the default works well)
    • For defect detection, standard classification and regression loss functions work well
  3. Under Dataset Parameters:

    • Enable these Data Augmentations:
      • Horizontal Flip
      • Vertical Flip
      • Rotation (±15°)
      • Brightness/Contrast adjustments
      • Slight zoom variations
    • These augmentations help the model learn to detect defects under different conditions
  4. Under Training Parameters:

    • Set Learning Rate to 0.001 (standard starting point)
    • Set Batch Size to 16 (adjust based on your available GPU resources)
    • Set Epochs to 50-100 (defect detection often requires more training)
    • Enable Early Stopping with patience of 5-10 epochs
    • Consider enabling Class Balancing if your defect types appear with different frequencies

Expert Tip: For defect detection, where some defects may be rare, consider using a lower learning rate (0.0005) and longer training time to help the model learn subtle patterns.

Parameter Configuration Configuring optimal parameters for defect detection

Step 6: Save Your Configuration

Once you've configured all settings:

  1. Review all parameters to ensure they're appropriate for defect detection
  2. Make any final adjustments based on your specific defect types
  3. Your settings are automatically saved as you make changes