pyronear / pyronear/temporal-model
Early stopping may cut training short: val/f1 ties don't reset patience, LR schedule never matures
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 12h 43m
- Merged PRs (30d)
- 7
Description
Observed (v4.1.0 retrain, 2026-08-14)
Training the ViT-DINOv2 finetune on pyro-dataset v4.1.0 stopped after 8 of 30 epochs, keeping the epoch-2 checkpoint:
| epoch | val_loss | val/f1 |
|---|---|---|
| 2 | 0.1268 | 0.9585 (best, kept) |
| 5 | 0.1132 | 0.9585 (exact tie — did not reset patience) |
| 7 | 0.1379 | 0.9494 (stop: 5 non-improvements since epoch 2) |
Why this is suspect
- Early stopping and checkpointing monitor
val/f1withmin_delta=0, and a tie counts as no improvement. With only ~300 val tubes, F1 is quantized in ~0.003 steps, so plateaus-with-ties are common and patience burns through them. Epoch 5 tied epoch 2's F1 exactly whileval_losswas still improving (0.1132, the run's best), yet the counter kept running. - The cosine-with-warmup LR schedule is laid out over
max_epochs: 30; stopping at epoch 7 means the model only ever trained in the high-LR region. - Epochs cost ~70 s on a 4070 Ti Super — a larger patience is nearly free.
Counterpoints
- The same config produced the current production model, and the real gate is the downstream protocol eval (sequence-level), not tube-level F1.
- Not changed in the v4.1.0 retrain PR on purpose: that PR keeps training config identical so the old-vs-new comparison isolates the dataset change.
Suggested directions (pick after a small sweep)
- Monitor
val/loss(smoother, not quantized) for early stop, keepval/f1for checkpoint selection — or monitor both with patience on loss. - And/or raise
early_stop_patience(e.g. 8–10) so the schedule can mature. - Sanity-check any change against the packaged-model protocol eval, not just tube-level metrics.
Config lives in train/params.yaml (_train_defaults.early_stop_patience, currently 5); callbacks in train/src/temporal_model/train/train.py.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with train/params.yaml to inspect _train_defaults.early_stop_patience and then read the callbacks in train/src/temporal_model/train/train.py. Run a small comparison of the proposed monitoring or patience changes, and check completion against the packaged-model protocol eval as well as tube-level metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100