RikuMatsu commited on
Commit
a5378a8
Β·
verified Β·
1 Parent(s): adcf3e9

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +202 -0
README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.