models / README.md
Amir
Calibrate YOLO11n thresholds on the validation split (0.15/0.15) and re-export the ONNX with them baked in
61cfb23
|
Raw History Blame Contribute Delete
4.67 kB
# Fire/smoke classifier checkpoints (weights only)
Four-way image classifier: `fire`, `smoke`, `both`, `neither`. Input 192x192, SwinV2 (HuggingFace `Swinv2ForImageClassification`).
Each `best.pt` is a PyTorch dict with the optimizer state removed, so these files are for inference/export only
(they cannot resume training). The weights are bit-identical to the training checkpoints. `manifest.json` has sizes,
SHA-256 hashes, the saved epoch and the validation score of every file.
```
models/
README.md
manifest.json
teachers/ SwinV2-L (195M params), one per domain, 745 MB each
fasdd_cv/ best.pt history.json val acc 0.9505 (ground-level camera images)
fasdd_rs/ best.pt history.json val acc 0.8947 (remote sensing)
fasdd_uav/ best.pt history.json val acc 0.9556 (UAV)
students/ SwinV2-B (87M params), 332 MB each
seed42/
kd_routed/ best.pt history.json avg val 0.9293 KD, only the in-domain teacher gives the soft target
kd_uniform/ best.pt history.json avg val 0.9093 KD, teachers aggregated uniformly
nokd/ best.pt history.json avg val 0.9174 cross-entropy only baseline, trained WITH AMP (original run)
nokd_noamp/ best.pt history.json nokd_noamp_seed42.onnx (+ .manifest.json) avg val 0.9146 same, trained WITHOUT AMP
seed43/
kd_routed/ best.pt history.json kd_routed_seed43.onnx avg val 0.9257
kd_uniform/ best.pt history.json kd_uniform_seed43.onnx avg val 0.9105
nokd_noamp/ best.pt history.json nokd_noamp_seed43.onnx avg val 0.9151
seed44/
kd_routed/ best.pt history.json kd_routed_seed44.onnx avg val 0.9257
kd_uniform/ best.pt history.json kd_uniform_seed44.onnx avg val 0.9079
nokd_noamp/ best.pt history.json nokd_noamp_seed44.onnx avg val 0.9154
```
Student scores are the average validation accuracy over the three domains (cv, rs, uav) at the saved best epoch.
**AMP.** The KD students are trained in FP32 (their trainer has no mixed-precision path). The original seed-42 `nokd`
run used AMP, so for a like-for-like comparison the no-KD student was retrained without AMP for seeds 42, 43 and 44
(`nokd_noamp`). Use `nokd_noamp` for every KD vs no-KD comparison; `students/seed42/nokd` is kept only for the record.
All seeds use batch 8, 20 epochs, and the same seed-42 teachers. Every `.onnx` here has a manifest with a verified
top-1 match against its PyTorch checkpoint (opset 17, input `pixel_values` [batch,3,192,192], output `logits` [batch,4]).
The seed-42 KD students have no ONNX in this repo (they were exported separately for the earlier Jetson runs).
## Baselines
```
baselines/
mobilenet_v3_large/seed42/ MobileNetV3-Large (4.2M params), 16 MB each, test macro acc 0.9095
best.pt mobilenet_v3_large_seed42.onnx mobilenet_v3_large_seed42.onnx.manifest.json history.json README.md
resnet50/seed42/ ResNet-50 (23.5M params), 90 MB each, test macro acc 0.9014
best.pt resnet50_seed42.onnx resnet50_seed42.onnx.manifest.json history.json README.md
yolo11n/seed42/ YOLO11n detector (2.6M params), 5 MB, checkpoint + thresholds.json + ONNX (val-calibrated thresholds 0.15/0.15 baked in), val mAP50-95 0.509
best.pt thresholds.json yolo11n_seed42.onnx yolo11n_seed42.onnx.manifest.json results.csv train_summary.json args.yaml README.md
```
See `baselines/<model>/seed42/README.md` (MobileNetV3-Large, ResNet-50, YOLO11n) for preprocessing, the ONNX interface, test results and loading code.
## Plume fine-tuned models
```
plume_finetune/
README.md how they were made, validation results (not test), loading
seed42/ teacher_rs, teacher_rs_noplume, kd_routed, kd_routed_noplume, kd_uniform, nokd,
mobilenet_v3_large, mobilenet_v3_large_noplume, resnet50 (each: best.pt history.json summary.json)
```
The models above fine-tuned for 5 epochs with extra Sentinel-2 industrial smoke plume images, and controls fine-tuned without them.
Weights only (PyTorch) plus a verified ONNX export of each; test-set results are still to come. Details in `plume_finetune/README.md`.
## Loading (project repo `firecls`)
```python
from pathlib import Path
from firecls.models.teacher import load_teacher_checkpoint
model, classes, model_name = load_teacher_checkpoint(Path("students/seed42/kd_routed/best.pt"))
```
Without the repo: build `Swinv2ForImageClassification` from `model_name` (stored in the file) with 4 labels, then
`model.load_state_dict(torch.load(path, map_location="cpu")["model"])`.