Skip to main content

Using a Classifier (Single-ROI Example)

Using the Classifier (Single-ROI Example)

This tutorial walks you through creating your first classification model on the OV80i camera system. You'll learn to set up a single Region of Interest (ROI) classifier to automatically identify and categorize different types of objects - in this example, different sizes of drill bits.

What You'll Build: A working classification model that can automatically identify and sort different drill bit sizes with configurable pass/fail logic.

Estimated Time: 45-60 minutes

Skill Level: Beginner

Prerequisites: OV80i camera system set up and connected

Download Sample Recipe

Before starting, download the sample recipe to follow along:

Sample Recipe: Contact support@overview.ai for sample recipes

This sample recipe contains pre-configured settings that you can use as a reference throughout this tutorial.

Step 1: Create a New Classification Recipe

1.1 Access Recipe Creation

  1. Navigate to All Recipes page in your OV80i interface
  2. Click + New Recipe in the top-right corner

1.2 Configure Recipe Settings

The Add A New Recipe modal will appear:

  1. Enter Recipe Name: Use a descriptive name like "Drill_Bit_Classification_v1"
    • Naming Tip: Include the object type and version for easy identification
  2. Select Recipe Type: Choose "Classification" from the dropdown menu
  3. Click OK to create the recipe

1.3 Activate the Recipe

  1. Locate your new recipe in the All Recipes list (it will show as "Inactive")
  2. Click Actions > Activate on the right side of the recipe entry
  3. Click Activate to confirm

Checkpoint: Your recipe should now appear as "Active" in the recipe list.

Step 2: Access the Recipe Editor

2.1 Enter Edit Mode

  1. Click Edit next to your active recipe
  2. Click Open Editor to confirm and launch the recipe editor

You'll now see the Recipe Editor interface with multiple configuration sections.

Step 3: Configure Camera Imaging Settings

3.1 Open Imaging Configuration

  1. Click Configure Imaging in the lower left-hand side of the Recipe Editor

3.2 Adjust Focus Settings

Focus is critical for accurate classification:

  1. Position your drill bits in the camera's field of view
  2. Adjust Focus using either:
    • The slider control, OR
    • Manual value entry
  3. Test different focus positions until drill bit edges are sharp and clear

Focus Tips:

  • Use the live preview to see focus changes in real-time
  • Focus on the most important features (drill bit flutes, tip geometry)
  • Ensure the entire depth of your objects is in focus

3.3 Optimize Exposure Settings

Proper exposure ensures consistent image quality:

  1. Adjust Exposure using the slider or manual entry
  2. Aim for balanced lighting where:
    • Object details are clearly visible
    • No areas are overexposed (pure white)
    • Shadows don't obscure important features

3.4 Configure LED Lighting

Lighting significantly impacts classification accuracy:

  1. Select LED Light Pattern based on your objects:
    • Bright Field: General purpose illumination
    • Dark Field: Highlights edges and surface defects
    • Side Lighting: Reveals texture and height variations
  2. For drill bits, try:
    • Bright field for general shape classification
    • Side lighting to emphasize flute geometry

3.5 Adjust Gamma Settings

Gamma controls image contrast:

  1. Adjust Gamma to enhance feature visibility
  2. Lower values brighten dark areas
  3. Higher values increase contrast

3.6 Save Imaging Settings

  1. Review all settings in the live preview
  2. Click Save Imaging Settings to apply configuration

Checkpoint: Your camera should now produce consistent, well-lit images of your drill bits.

Step 4: Configure Template Image and Alignment

4.1 Navigate to Alignment

  1. Click "Template Image and Alignment" in the breadcrumb menu, OR
  2. Use the dropdown menu to select "Template Image and Alignment"

4.2 Skip Aligner (For This Tutorial)

Since drill bits will be placed consistently:

  1. Select Skip Aligner
  2. Click Save to apply changes

When to Use Aligner: Use the aligner when parts arrive in varying positions or orientations. For this tutorial, we assume consistent part placement.

Step 5: Set Up Inspection ROI

5.1 Navigate to Inspection Setup

  1. Click "Inspection Setup" in the breadcrumb menu

5.2 Define Region of Interest

The ROI defines where classification will occur:

  1. Position a drill bit in the camera view
  2. Drag the ROI corners to frame the drill bit
  3. Ensure the ROI:
    • Completely contains the drill bit
    • Excludes unnecessary background
    • Is large enough for your largest drill bit variant

5.3 ROI Best Practices

DoDon't
Include all important featuresMake ROI too large (includes noise)
Leave small border around objectCut off parts of the object
Center the expected object positionInclude multiple objects in one ROI
Keep consistent ROI size across imagesChange ROI between captures

5.4 Save ROI Configuration

  1. Verify ROI positioning with different drill bit sizes
  2. Click Save to apply ROI settings

Checkpoint: Your ROI should consistently frame drill bits regardless of their specific size.

Step 6: Train Classification Model

6.1 Navigate to Classification Block

  1. Click "Classification Block" in the breadcrumb menu

6.2 Create Classification Classes

You'll create classes for different drill bit sizes:

Example Classes:

  • Small Bits (1-3mm)
  • Medium Bits (4-6mm)
  • Large Bits (7-10mm)

6.3 Capture Training Images

For each class, capture at least 5 different images:

Class 1: Small Bits

  1. Place a small drill bit in the ROI
  2. Click capture to take training image
  3. Label the image as "Small"
  4. Repeat with 4 more small bits (different orientations/positions)

Class 2: Medium Bits

  1. Place a medium drill bit in the ROI
  2. Capture and label as "Medium"
  3. Repeat 4 more times with different medium bits

Class 3: Large Bits

  1. Place a large drill bit in the ROI
  2. Capture and label as "Large"
  3. Repeat 4 more times with different large bits

6.4 Training Image Best Practices

Best PracticeWhy Important
Use different examplesImproves model generalization
Vary orientationsHandles real-world positioning variation
Include edge casesBetter boundary detection between classes
Maintain consistent lightingReduces lighting-dependent errors
5+ images minimumProvides sufficient training data

6.5 Review and Verify Labels

  1. Double-check all labeled images
  2. Ensure correct class assignments
  3. Remove any incorrectly labeled examples

6.6 Start Model Training

  1. Click Train Classification Model
  2. Choose training mode:
    • Fast: Quick training for testing (2-5 minutes)
    • Accurate: Production-quality training (10-20 minutes)
  3. Select iteration count:
    • More iterations = Better accuracy
    • More iterations = Longer training time
  4. Click Start Training

6.7 Monitor Training Progress

The training progress modal shows:

  • Current iteration number
  • Training accuracy percentage
  • Estimated completion time

Training Controls:

  • Abort Training: Stop training if needed
  • Finish Training Early: Stop when accuracy is sufficient

Training Tips:

  • Training automatically stops when target accuracy is reached
  • 85%+ accuracy is typically good for production use
  • You can retrain with more images if accuracy is low

Checkpoint: Your model should achieve >85% training accuracy.

Step 7: Test Your Classifier

7.1 Access Live Preview

  1. Click Live Preview after training completes
  2. Place different drill bits in the ROI
  3. Observe classification results:
    • Predicted class name
    • Confidence percentage
    • Classification timing

7.2 Validation Testing

Test each class systematically:

Test TypeExpected ResultAction if Failed
Known Small BitClassified as "Small" >80% confidenceAdd more training images
Known Medium BitClassified as "Medium" >80% confidenceReview labeling accuracy
Known Large BitClassified as "Large" >80% confidenceRetrain with more examples
Empty ROINo classification or low confidenceAdjust confidence thresholds

7.3 Troubleshooting Classification Issues

ProblemPossible CausesSolutions
Low confidenceInsufficient training dataAdd more training images
Wrong classificationsPoor image qualityImprove lighting/focus
Inconsistent resultsROI includes background noiseReduce ROI size
Classes confusedSimilar-looking objectsAdd more distinguishing examples

Step 8: Configure Pass/Fail Logic

8.1 Navigate to IO Block

Ensure all AI blocks are trained (green status) before proceeding:

  1. Click "IO Block" in breadcrumb menu, OR
  2. Select "Configure I/O" from Recipe Editor

8.2 Locate Classification Logic Node

  1. Find the "Classification Block Logic Node" (purple node)
  2. If missing: Drag from the nodes menu on the left

Node Colors: Purple nodes represent Overview Logic Blocks for AI operations.

8.3 Configure Classification Logic

  1. Double-click the Classification Logic Node
  2. Configure settings:

ROI Selection

  • Select your ROI from the "Inspection Region" dropdown

Confidence Threshold

  • Set confidence threshold (typically 70-85%)
  • Higher threshold = More strict classification
  • Lower threshold = More permissive classification

Target Class Selection

  • Choose target class for "pass" results
  • Example: Select "Medium" if only medium bits should pass

Multiple ROI Logic (Advanced)

  • Add more ROIs if needed
  • Choose logic: "Any" or "All" rules must pass

8.4 Example Pass/Fail Configurations

Configuration 1: Size-Specific Pass

ROI: Drill_Bit_ROI
Target Class: Medium
Confidence: 80%
Logic: Pass only medium drill bits

Configuration 2: Size Range Pass

ROI: Drill_Bit_ROI
Target Classes: Medium OR Large
Confidence: 75%
Logic: Pass medium or large bits

Configuration 3: Reject Small Bits

ROI: Drill_Bit_ROI
Target Class: NOT Small
Confidence: 85%
Logic: Fail if classified as small

8.5 Deploy Logic Configuration

  1. Click Done in the top-right corner
  2. Click Deploy in the top-right corner of Node-RED editor
  3. Verify deployment success message

✅ Step 9: Final Testing and Validation

9.1 End-to-End Testing

Test the complete inspection workflow:

  1. Place test objects in the inspection area
  2. Trigger inspection (manual or automatic)
  3. Verify results:
    • Correct classification displayed
    • Proper pass/fail indication
    • Consistent timing performance

9.2 Production Validation Checklist

Test CaseExpected Result
Target class objectPass result
Non-target class objectFail result
Empty ROIFail result
Partially obscured objectAppropriate confidence level
Poor lighting conditionsConsistent performance

9.3 Performance Optimization

If results aren't satisfactory:

  1. Add more training images (especially edge cases)
  2. Adjust confidence thresholds
  3. Improve lighting consistency
  4. Refine ROI positioning
  5. Retrain with "Accurate" mode

Congratulations!

You've successfully created your first classification model! Your OV80i system can now:

  • Automatically identify different drill bit sizes
  • Apply pass/fail logic based on classification results
  • Provide confidence scores for each classification
  • Integrate with production workflows through I/O controls

Next Steps

Now that you've mastered single-ROI classification, consider exploring:

Advanced Classification Techniques

  • Multi-ROI classification for complex parts
  • Hierarchical classification for detailed categorization
  • Combination inspection (classification + defect detection)

Production Integration

  • PLC communication for automated sorting
  • Data logging for quality tracking
  • Recipe management for multiple product lines

Model Optimization

  • Transfer learning for similar products
  • Active learning for continuous improvement
  • Performance monitoring and retraining schedules
  • Tutorial: Multi-ROI Classification Setup
  • Tutorial: Combining Classification with Defect Detection
  • Tutorial: Production Integration and PLC Communication
  • How-To: Optimizing Classification Performance
  • Reference: Node-RED Logic Blocks Guide

Troubleshooting Guide

Common Issues and Solutions

IssueSymptomSolution
Poor accuracyClassifications frequently wrongAdd more diverse training images
Slow performanceLong processing timesReduce ROI size, optimize lighting
Inconsistent resultsSame object gives different resultsImprove part positioning, check focus
False positivesEmpty ROI shows classificationIncrease confidence threshold
Training failsModel won't train successfullyCheck image quality, ensure 5+ images per class

Getting Help

If you encounter issues not covered in this tutorial:

  1. Check the troubleshooting guides in the documentation
  2. Review system logs for error messages
  3. Contact Overview support with:
    • Recipe export file
    • Sample images showing the issue
    • System configuration details

Tutorial Complete! You now have a working classification system ready for production use. Remember to regularly validate performance and retrain your model as needed to maintain accuracy over time.