Skip to content

Commit af6b52a

Browse files
authored
feat(training): add controlled 40-epoch baseline (#12)
1 parent ba206a6 commit af6b52a

3 files changed

Lines changed: 157 additions & 0 deletions

File tree

configs/training_balanced_e40.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Controlled 40-epoch balanced CPU training experiment.
2+
# Only the training duration differs from the 20-epoch baseline.
3+
4+
version: 1
5+
6+
model:
7+
weights: yolo11n.pt
8+
task: detect
9+
10+
dataset:
11+
yaml: configs/bdd100k_balanced.yaml
12+
13+
training:
14+
epochs: 40
15+
image_size: 320
16+
batch_size: 4
17+
device: cpu
18+
workers: 0
19+
fraction: 1.0
20+
seed: 42
21+
deterministic: true
22+
amp: false
23+
cache: false
24+
validate: true
25+
plots: true
26+
class_weight_power: 0.0
27+
28+
output:
29+
project_directory: reports/training
30+
run_name: cpu_balanced_baseline_e40
31+
exist_ok: false
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Controlled 40-Epoch Balanced Training Experiment
2+
3+
## Objective
4+
5+
This experiment tested whether extending the balanced CPU baseline
6+
from 20 to 40 epochs improved validation performance while keeping
7+
all other controlled training parameters unchanged.
8+
9+
## Controlled setup
10+
11+
| Setting | Value |
12+
|---|---|
13+
| Model | `yolo11n.pt` |
14+
| Training images | 2,000 |
15+
| Validation images | 500 |
16+
| Validation annotations | 9,615 |
17+
| Image size | 320 |
18+
| Batch size | 4 |
19+
| Device | CPU |
20+
| Seed | 42 |
21+
| Class weighting | Disabled |
22+
| Control duration | 20 epochs |
23+
| Experimental duration | 40 epochs |
24+
25+
Only the training duration changed between the two checkpoints.
26+
27+
## Training completion
28+
29+
- Completed epochs: 40
30+
- Best epoch: 40
31+
- Final epoch: 40
32+
- Best mAP50 from training results: `0.14125`
33+
- Best mAP50-95 from training results: `0.07566`
34+
35+
The best result occurring at epoch 40 indicates that the model had
36+
not clearly plateaued before the experiment ended.
37+
38+
## Structured validation comparison
39+
40+
| Metric | Epoch 20 | Epoch 40 | Relative change |
41+
|---|---:|---:|---:|
42+
| Precision | 0.519271 | 0.456200 | -12.15% |
43+
| Recall | 0.144212 | 0.155435 | +7.78% |
44+
| mAP50 | 0.117928 | 0.141271 | +19.79% |
45+
| mAP50-95 | 0.064557 | 0.075606 | +17.11% |
46+
47+
The longer run improved recall and both mAP measurements while
48+
reducing aggregate precision.
49+
50+
## Class-level AP50-95 changes
51+
52+
| Class | Epoch 20 | Epoch 40 | Delta |
53+
|---|---:|---:|---:|
54+
| truck | 0.14351 | 0.17536 | +0.03185 |
55+
| bus | 0.11718 | 0.14479 | +0.02761 |
56+
| motorcycle | 0.00525 | 0.02344 | +0.01819 |
57+
| car | 0.24789 | 0.25933 | +0.01144 |
58+
| person | 0.05249 | 0.05971 | +0.00722 |
59+
| traffic sign | 0.04890 | 0.05344 | +0.00454 |
60+
| bicycle | 0.00213 | 0.00657 | +0.00444 |
61+
| rider | 0.01104 | 0.01441 | +0.00337 |
62+
| traffic light | 0.01718 | 0.01901 | +0.00183 |
63+
| train | 0.00000 | 0.00000 | 0.00000 |
64+
65+
All evaluated classes except train improved in AP50-95. Train
66+
remained undetected because the pilot training split contains very
67+
few train annotations.
68+
69+
## Confidence-threshold comparison
70+
71+
Both checkpoints were compared using the same validation set at
72+
confidence thresholds from `0.05` through `0.50`.
73+
74+
| Model | Best confidence | Precision | Recall | Micro F1 | TP | FP | FN |
75+
|---|---:|---:|---:|---:|---:|---:|---:|
76+
| Epoch 20 | 0.20 | 0.5259 | 0.3041 | 0.38537 | 2,924 | 2,636 | 6,691 |
77+
| Epoch 40 | 0.20 | 0.5197 | 0.3273 | 0.40166 | 3,147 | 2,908 | 6,468 |
78+
79+
Epoch 40 improved the best tested micro F1 by `0.016289`, which is
80+
approximately `4.23%` relative to the epoch-20 operating point.
81+
82+
Epoch 40 also produced a higher F1 at every tested confidence
83+
threshold.
84+
85+
## Engineering decision
86+
87+
The 40-epoch checkpoint replaces the 20-epoch checkpoint as the
88+
deployment-oriented PyTorch baseline.
89+
90+
- Selected checkpoint:
91+
`reports/training/cpu_balanced_baseline_e40/weights/best.pt`
92+
- Selected initial confidence threshold: `0.20`
93+
- Epoch-20 checkpoint status: superseded baseline
94+
- Epoch-40 checkpoint status: selected baseline
95+
96+
The selected threshold is an initial validation-set operating point
97+
and may require recalibration for a different deployment dataset.
98+
99+
## Reproduction
100+
101+
```powershell
102+
edge-traffic-train --config configs/training_balanced_e40.yaml
103+
```
104+
105+
Generated weights, plots, logs, and evaluation reports are excluded
106+
from Git and must be regenerated locally.

docs/training.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,23 @@ The deployment-oriented selection therefore remains:
221221

222222
The complete controlled comparison is documented in
223223
[Partial Rare-Class Weighting Experiment](rare_class_weighting_results.md).
224+
225+
## Controlled 40-epoch balanced training result
226+
227+
Extending the controlled balanced baseline from 20 to 40 epochs
228+
increased structured-validation mAP50 by 19.79% and mAP50-95 by
229+
17.11%.
230+
231+
At the best tested confidence threshold of `0.20`, the 40-epoch
232+
checkpoint achieved a micro F1 of `0.40166`, compared with
233+
`0.38537` for the 20-epoch checkpoint.
234+
235+
The deployment-oriented baseline is now:
236+
237+
- checkpoint: `cpu_balanced_baseline_e40/weights/best.pt`
238+
- initial confidence threshold: `0.20`
239+
- image size: `320`
240+
- class weighting: disabled
241+
242+
The full controlled comparison is documented in
243+
[Controlled 40-Epoch Balanced Training Experiment](longer_balanced_training_results.md).

0 commit comments

Comments
 (0)