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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π Drift Car Tracking & Zone Analysis Model
|
| 2 |
+
|
| 3 |
+
## π Overview
|
| 4 |
+
|
| 5 |
+
This project is a computer vision model designed to **track drifting cars and quantify driver performance** using aerial (drone) footage. The system detects and tracks vehicles during tandem runs and measures how they interact with predefined drift zones.
|
| 6 |
+
|
| 7 |
+
The current implementation is a **proof of concept**, developed specifically for footage from **Evergreen Speedway in Monroe, Washington**.
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
## π§ Model Description
|
| 12 |
+
|
| 13 |
+
This model uses a YOLO-based framework to:
|
| 14 |
+
|
| 15 |
+
- Detect drift cars in tandem runs
|
| 16 |
+
- Classify vehicles as:
|
| 17 |
+
- `leader`
|
| 18 |
+
- `chaser`
|
| 19 |
+
- Classify zones as:
|
| 20 |
+
- `FrontZone`
|
| 21 |
+
- `RearZone`
|
| 22 |
+
- Track vehicles across frames
|
| 23 |
+
- Enable downstream analysis of zone interaction and timing
|
| 24 |
+
|
| 25 |
+
### Training Details
|
| 26 |
+
|
| 27 |
+
- Fine-tuned from a pretrained YOLO model
|
| 28 |
+
- Custom dataset manually annotated
|
| 29 |
+
- Two datasets:
|
| 30 |
+
- **Cars:** Bounding boxes for leader and chaser
|
| 31 |
+
- **Zones:** Segmentation masks for drift zones
|
| 32 |
+
|
| 33 |
+
Zone interaction is computed using geometric methods (polygon overlap + time tracking), not learned directly by the model.
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## π― Intended Use
|
| 38 |
+
|
| 39 |
+
Designed for:
|
| 40 |
+
|
| 41 |
+
- Formula Drift-style competitions
|
| 42 |
+
- Grassroots drifting events
|
| 43 |
+
- Experimental motorsports analytics
|
| 44 |
+
|
| 45 |
+
### Example Applications
|
| 46 |
+
|
| 47 |
+
- Measuring time spent in drift zones
|
| 48 |
+
- Analyzing tandem behavior (leader vs. chaser)
|
| 49 |
+
- Supporting judging with quantitative insights
|
| 50 |
+
- Enhancing broadcast overlays
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## π Training Data
|
| 55 |
+
|
| 56 |
+
### π Source
|
| 57 |
+
|
| 58 |
+
- Formula Drift Seattle 2025 PRO, Round 6 - Top 32
|
| 59 |
+
https://www.youtube.com/watch?v=MuD-uxGQnrg&t=879s
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
### π’ Dataset Size
|
| 64 |
+
|
| 65 |
+
#### π Cars
|
| 66 |
+
- 1,204 original β 2,724 augmented
|
| 67 |
+
- Split: 84% train / 12% val / 5% test
|
| 68 |
+
|
| 69 |
+
#### π£ Zones
|
| 70 |
+
- 724 original β 1,666 augmented
|
| 71 |
+
- Split: 85% train / 9% val / 6% test
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
### π· Class Distribution
|
| 76 |
+
|
| 77 |
+
| Class | Count |
|
| 78 |
+
|-----------|------|
|
| 79 |
+
| Leader | 1,204 |
|
| 80 |
+
| Chaser | 1,201 |
|
| 81 |
+
| FrontZone | 137 |
|
| 82 |
+
| RearZone | 588 |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
### βοΈ Annotation
|
| 87 |
+
|
| 88 |
+
- Fully manual annotation
|
| 89 |
+
- Consistent labeling across frames
|
| 90 |
+
- Handled occlusion, overlap, and tandem proximity
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
### π§ Augmentation
|
| 95 |
+
|
| 96 |
+
- Rotation Β± 8Β°
|
| 97 |
+
- Saturation Β± 15%
|
| 98 |
+
- Brightness Β± 10%
|
| 99 |
+
- Blur 2px
|
| 100 |
+
- Mosaic = 0.2
|
| 101 |
+
- Scale Β± 15%
|
| 102 |
+
- Translate Β± 5%
|
| 103 |
+
- Hsv_h (Color tint) = 0.01
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
## βοΈ Training Procedure
|
| 107 |
+
- **Framework:** Ultralytics YOLO
|
| 108 |
+
- **Models:**
|
| 109 |
+
- Cars: YOLO26s
|
| 110 |
+
- Zones: YOLO26s-seg
|
| 111 |
+
### π» Hardware
|
| 112 |
+
- NVIDIA A100 (Google Colab)
|
| 113 |
+
### β± Training Time
|
| 114 |
+
- Cars: 80 epochs (~42 min)
|
| 115 |
+
- Zones: 140 epochs (~1h 14min)
|
| 116 |
+
### βοΈ Settings
|
| 117 |
+
- Batch size: 16
|
| 118 |
+
- Image size: 1024
|
| 119 |
+
- Workers: 8
|
| 120 |
+
- Cls: 2.5 (Only for Object Detection)
|
| 121 |
+
- No early stopping
|
| 122 |
+
- Default preprocessing
|
| 123 |
+
---
|
| 124 |
+
## π Evaluation Results
|
| 125 |
+
### π Car Model
|
| 126 |
+
| Metric | Value |
|
| 127 |
+
|----------|-------|
|
| 128 |
+
| Precision | 0.9904 |
|
| 129 |
+
| Recall | 0.9792 |
|
| 130 |
+
| mAP@50 | 0.9882 |
|
| 131 |
+
| mAP@50-95 | 0.8937 |
|
| 132 |
+
### π£ Zone Model
|
| 133 |
+
| Metric | Value |
|
| 134 |
+
|----------|-------|
|
| 135 |
+
| Precision | 0.9919 |
|
| 136 |
+
| Recall | 0.9952 |
|
| 137 |
+
| mAP@50 | 0.9948 |
|
| 138 |
+
| mAP@50-95 | 0.7064 |
|
| 139 |
+
---
|
| 140 |
+
## π Key Visualizations
|
| 141 |
+
**Car Results**
|
| 142 |
+
<img src='results_cars.png' width="800">
|
| 143 |
+
<img src='confusion_matrix_cars.png' width="800">
|
| 144 |
+
**Zone Results**
|
| 145 |
+
<img src='results_zone.png' width="800">
|
| 146 |
+
<img src='confusion_matrix_zone.png' width="800">
|
| 147 |
+
---
|
| 148 |
+
## π§ Performance Analysis
|
| 149 |
+
### π Cars
|
| 150 |
+
**Strengths:**
|
| 151 |
+
- Very high precision and recall
|
| 152 |
+
- Reliable detection and classification
|
| 153 |
+
- Strong tracking foundation
|
| 154 |
+
**Limitations:**
|
| 155 |
+
- Smoke occlusion affects detection
|
| 156 |
+
- Close tandem overlap can cause confusion
|
| 157 |
+
- Limited generalization beyond training conditions
|
| 158 |
+
---
|
| 159 |
+
### π£ Zones
|
| 160 |
+
- High detection accuracy (mAP@50)
|
| 161 |
+
- Lower boundary precision (mAP@50-95)
|
| 162 |
+
**Implication:**
|
| 163 |
+
- Good at identifying zones
|
| 164 |
+
- Less accurate for exact boundaries β impacts timing precision
|
| 165 |
+
**Note:** Since zones are static, polygon-based methods may be more reliable than segmentation.
|
| 166 |
+
---
|
| 167 |
+
## β οΈ Limitations and Biases
|
| 168 |
+
### π¨ Failure Cases
|
| 169 |
+
- Heavy smoke β missed or unstable detections
|
| 170 |
+
- Close tandem β overlap confusion
|
| 171 |
+
- Camera motion β inconsistent zone alignment
|
| 172 |
+
- Edge-of-frame β partial detections
|
| 173 |
+
---
|
| 174 |
+
### π Weak Areas
|
| 175 |
+
- Zone boundary precision
|
| 176 |
+
- Leader vs. chaser ambiguity in tight proximity
|
| 177 |
+
---
|
| 178 |
+
### π Data Bias
|
| 179 |
+
- Single track (Evergreen Speedway)
|
| 180 |
+
- Single event and lighting condition
|
| 181 |
+
- Fixed drone perspective
|
| 182 |
+
---
|
| 183 |
+
### π¦ Environmental Limits
|
| 184 |
+
Performance may degrade with:
|
| 185 |
+
- Smoke, blur, or occlusion
|
| 186 |
+
- Lighting changes
|
| 187 |
+
- Drone altitude variation
|
| 188 |
+
- Camera movement
|
| 189 |
+
---
|
| 190 |
+
### π« Not Suitable For
|
| 191 |
+
- Official judging systems
|
| 192 |
+
- General vehicle detection
|
| 193 |
+
- Different tracks without recalibration
|
| 194 |
+
- Other motorsports without adaptation
|
| 195 |
+
---
|
| 196 |
+
### π Dataset Limitations
|
| 197 |
+
- Underrepresented zone classes
|
| 198 |
+
- Limited diversity (track, cars, conditions)
|
| 199 |
+
- Few edge-case scenarios (spins, collisions)
|
| 200 |
+
---
|
| 201 |
+
## π Summary
|
| 202 |
+
This model performs strongly within a controlled environment but is highly specialized. It should be viewed as a **proof-of-concept system** for drift analytics rather than a fully generalized or production-ready solution.
|