Real-time adaptive model selection system that dynamically switches between YOLOv8 models (nanoβxlarge) based on tracking difficulty, achieving 93.5% tracking success with 62% computational savings.
Comprehensive analysis showing model switching patterns, confidence evolution, and efficiency metrics
MOT17-04_adaptive_tracking.webm
- 398 consecutive frames tracked before loss
- 10 model switches including 3 bidirectional (scaling down)
- Color-coded models: π’Green=nano, π‘Yellow=small, π Orange=medium, π£Magenta=large, π΄Red=xlarge
adaptive_tracking_demo.webm
- 75 frames tracked with 5 model switches
- Demonstrates initial adaptive concept
| Metric | Performance |
|---|---|
| Tracking Success Rate | 93.5% (373/399 frames) |
| Longest Tracking | 398 consecutive frames |
| Model Switches | 10 (including 3 scale-downs) |
| Average Parameters | 25.9M (vs 68.2M for YOLOv8x) |
| Computational Savings | 62% reduction |
| Bidirectional Adaptation | β Yes (scales both up AND down) |
uncertain_skip/
βββ scripts/
β βββ evaluation/ # Main evaluation scripts
β βββ testing/ # Quick test scripts
β βββ debugging/ # Debug and diagnostic tools
βββ src/
β βββ evaluation/ # Core evaluation modules
β β βββ baseline_mot_evaluation.py
β β βββ scene_complexity.py
β βββ tracking/ # SORT tracking implementation
β βββ utils/ # MOT format utilities
β βββ visualization/ # Results plotting
βββ results/
β βββ baseline/ # Evaluation outputs and metrics
βββ data/
β βββ MOT17/ # Dataset location
βββ requirements.txt # Dependencies
- Adaptive Model Selection: Dynamically switches between 5 YOLOv8 models based on tracking difficulty
- Bidirectional Switching: Scales both up (nanoβxlarge) and down (xlargeβnano) based on confidence
- Single Object Tracking: Focused tracking of individual objects with uncertainty metrics
- Real-time Performance: Achieves 30+ FPS with adaptive model selection
- Video Generation: Color-coded visualization showing model switches in real-time
- YAML Configuration: Easy customization of thresholds and parameters
- Install Dependencies
pip install -r requirements.txt- Dataset Setup
# MOT17 dataset already available at: data/MOT17/- Run Adaptive Tracking Demo
python run_adaptive_demo.py- Customize Configuration (Optional)
Edit
run_adaptive_demo.pyto change:
- Dataset/sequence (MOT17-02, MOT17-04, etc.)
- Starting model (nano, small, medium, large, xlarge)
- Object selection strategy (high_confidence, medium_confidence, largest)
Frame 3: nano β small β (confidence: 0.823)
Frame 28: small β nano β (SCALE DOWN, confidence: 0.859)
Frame 50: small β nano β (SCALE DOWN, confidence: 0.859)
Frame 70: small β nano β (SCALE DOWN, confidence: 0.869)
Frame 222: small β medium β (confidence: 0.675)
Frame 307: medium β large β (confidence: 0.476)
Frame 317: large β xlarge β (confidence: 0.259)
| Model | Frames Used | Percentage | When Used |
|---|---|---|---|
| YOLOv8n | 46 | 11.5% | High confidence (>0.85) |
| YOLOv8s | 176 | 44.1% | Good confidence (0.70-0.85) |
| YOLOv8m | 85 | 21.3% | Medium confidence (0.50-0.70) |
| YOLOv8l | 10 | 2.5% | Low confidence (0.35-0.50) |
| YOLOv8x | 82 | 20.6% | Very low confidence (<0.35) |
- Bidirectional model switching logic
- Uncertainty-based adaptation
- Video generation with color-coded models
- Real-time confidence tracking
- Calculates tracking difficulty metrics
- Determines optimal model based on scene
- Implements hysteresis to prevent oscillation
- Easy customization of thresholds
- Model selection parameters
- Video generation settings
- Dataset configuration
- Object Selection: Selects an object to track based on strategy (high_confidence, medium_confidence, largest)
- Confidence Monitoring: Continuously evaluates tracking confidence and uncertainty
- Model Switching: Dynamically switches models based on thresholds:
- High confidence (>0.85) β Use smaller model (nano/small)
- Medium confidence (0.50-0.85) β Use medium models
- Low confidence (<0.35) β Use larger models (large/xlarge)
- Hysteresis: Prevents rapid switching with cooldown periods
- Video Output: Generates color-coded visualization of the tracking process
- Python 3.8+
- PyTorch with CUDA support
- Ultralytics YOLOv8
- OpenCV
- MOT17 dataset
- Dataset: MOT17-04 (1050 frames available)
- Frames Tracked: 398 consecutive frames
- Success Rate: 93.5% (373/399 frames)
- Model Switches: 10 (including 3 bidirectional scale-downs)
- Computational Savings: 62% reduction in parameters
- Average FPS: 30+ with adaptive selection
- Multi-object adaptive tracking
- Learned switching policies
- Hardware-aware adaptation
- Predictive model switching
MIT