Choosing a model type
Selecting the right model type is crucial for your computer vision task. Each type is designed for specific use cases and provides different types of information.
Quick decision guide
Need to classify entire images? → Classification
Need object contours? → Segmentation or Instance Segmentation
Need to count separate objects? → Instance Segmentation
Need precise boundaries? → Segmentation / Instance Segmentation
| Task Type | When to Use | Key Benefits |
|---|---|---|
| Instance Segmentation (Default Recommendation) | Start with this for most industrial applications | Most versatile and informative Can always simplify analysis if needed Provides geometric and spatial information More robust than classification |
| Segmentation | Single object or non-overlapping regions Don't need to count instances Need faster inference | Faster processing Simpler than instance segmentation Good for region identification |
| Classification | Truly just need image-level decision No localization needed whatsoever Very simple pass/fail scenario AND segmentation would be overkill | Fastest inference Simplest approach Minimal computational requirements |
When in doubt between Segmentation and Instance Segmentation, choose Instance Segmentation. It's more capable and the performance difference is usually negligible on modern hardware.
Comparison table
| Feature | Classification | Segmentation | Instance Segmentation |
|---|---|---|---|
| Localization | ❌ | ✅ (regions) | ✅ (per object) |
| Object counting | ❌ | ❌ | ✅ |
| Multiple classes | ❌ | ✅ Multiple regions | ✅ Multiple objects |
| Precise contours | ❌ | ✅ | ✅ |
| Overlapping objects | N/A | ❌ Cannot separate | ✅ Can separate |
| Size measurement | ❌ | ⚠️ Total area only | ✅ Per object |
| Position data | ❌ | ⚠️ Region center | ✅ Per object |
| Speed | Fastest | Fast | Moderate |
| Complexity | Simple | Moderate | Complex |
Real-world examples
Task: Inspect bottles for defects
Wrong choice: Classification → "Defective" / "Good"
Problem: Cannot tell where the defect is or how many defects exist
Better choice: Instance segmentation → Detects each scratch, dent, crack separately
Benefit: Know exactly what defects exist, where they are, and their severity
Task: Check if a product is present on the line
Option A: Classification → "Present" / "Absent"
Option B: Segmentation → Segment the product region
Recommendation: Use Segmentation
- More robust (uses shape and position)
- Can also tell you if product is correctly positioned
- Provides size information
- Can be converted to simple presence/absence
Task: Count pills in a tray
Wrong choice: Classification → Cannot count
Wrong choice: Segmentation → Blends touching pills together
Correct choice: Instance segmentation
Why: Separates each pill individually, enabling accurate counting even when pills touch