Fine-tuned EfficientViT-B3 image classifier on the BDD100K Weather Classification dataset, trained and evaluated as part of BDD100K-Toolkit, a dependency-clean toolkit for preparing BDD100K, training models on it and evaluating them with the same metrics on the same splits.
7-class weather classification (clear / partly cloudy / overcast / rainy / snowy / foggy / unknown) derived from BDD100K's per-image attributes.weather field. Unofficial task; follows the Kaggle dataset of the same name.
import timm, torch
from PIL import Image
from torchvision import transforms as T
model = timm.create_model("hf-hub:dronefreak/bdd100k-weather-efficientvit_b3", pretrained=True).eval()
cfg = model.pretrained_cfg # input size, mean/std and label_names come from config.json
prep = T.Compose(
[T.Resize(cfg["input_size"][1:]), T.ToTensor(), T.Normalize(cfg["mean"], cfg["std"])]
)
with torch.no_grad():
probs = model(prep(Image.open("street.jpg").convert("RGB"))[None]).softmax(1)[0]
print(cfg["label_names"][probs.argmax()], f"{probs.max():.1%}")
The original training checkpoint (best.pt, with EMA weights and training metadata) is still available via
hf_hub_download("dronefreak/bdd100k-weather-efficientvit_b3", "best.pt").
Evaluated on the test split (10000 images).
| Metric | Value |
|---|---|
| Macro F1 | 68.17% |
| Balanced accuracy | 66.34% |
| Macro precision | 81.75% |
| Macro recall | 66.34% |
| Top-1 accuracy | 83.51% |
| Top-5 accuracy | 99.85% |
| Class | Precision | Recall | F1 | Test images |
|---|---|---|---|---|
| clear | 91.21% | 92.57% | 91.89% | 5346 |
| foggy | 100.00% | 7.69% | 14.29% | 13 (few) |
| overcast | 68.27% | 68.60% | 68.44% | 1239 |
| partly cloudy | 69.24% | 61.92% | 65.38% | 738 |
| rainy | 87.50% | 71.14% | 78.48% | 738 |
| snowy | 85.18% | 79.97% | 82.49% | 769 |
| unknown | 70.88% | 82.45% | 76.23% | 1157 |
All runs below were evaluated on the same test split, sorted by top-1 accuracy.
| Model | Top-1 | Macro F1 | Balanced acc | Macro precision |
|---|---|---|---|---|
| TinyViT-21M | 83.90% | 68.65% | 67.15% | 74.81% |
| EfficientViT-B3 | 83.51% | 68.17% | 66.34% | 81.75% |
| EfficientViT-B2 | 83.46% | 66.07% | 65.04% | 67.54% |
| EfficientFormerV2-L | 83.27% | 65.93% | 65.03% | 67.12% |
| RepViT-M1.5 | 83.19% | 67.78% | 65.71% | 81.56% |
| EfficientViT-L1 | 83.13% | 65.70% | 65.11% | 66.46% |
| RepViT-M2.3 | 83.02% | 65.46% | 64.33% | 67.02% |
| ConvNeXt-Atto | 83.00% | 67.44% | 65.25% | 81.38% |
| EfficientFormerV2-S2 | 82.90% | 65.50% | 64.68% | 66.98% |
| EfficientViT-B0 | 82.79% | 65.10% | 63.62% | 67.11% |
| EfficientViT-B1 | 82.67% | 64.95% | 63.59% | 66.83% |
| MobileNetV4-Conv-Large | 82.20% | 66.62% | 64.68% | 80.26% |
| ResNet-18 | 82.19% | 64.30% | 62.97% | 66.08% |
| MobileNetV4-Conv-Small | 82.16% | 66.51% | 64.37% | 80.44% |
| YOLO26n | 82.04% | 64.09% | 62.46% | 66.57% |
| YOLO11s | 81.91% | 63.81% | 62.05% | 66.35% |
| YOLO26s | 81.46% | 65.14% | 62.61% | 69.75% |
| YOLOv8s | 81.40% | 66.34% | 63.52% | 71.54% |
| YOLO11n | 81.32% | 62.91% | 61.19% | 65.68% |
| YOLOv8n | 81.22% | 63.07% | 61.42% | 65.52% |
| Setting | Value |
|---|---|
| Epochs (max) | 50 |
| Epochs (trained) | 14 |
Best epoch (best.pt) |
4 |
best.pt chosen by |
macro_f1 on the valid split |
| Early stopping patience | 10 |
| Batch size | 32 |
| Image size | 224 |
| Optimizer | auto, resolved to AdamW (peak lr 3e-04) |
| Weights | EMA |
dronefreak/BDD100K-Weather-Classification holds the prepared splits these models were trained and evaluated on.
test here is BDD100K's official validation split (the official test labels are not released) and valid is a seeded 15% slice of the official train split.clear, partly cloudy and overcast are subjective annotator calls, so expect label noise between neighbouring classes.The weights are released under the license in the metadata above. They were trained on BDD100K, which is free for non-commercial research and education; commercial use needs separate permission (see https://www.bdd100k.com/). The prepared dataset on the Hub is tagged license: other, and the original BDD100K terms still apply.
@article{cai2022efficientvit,
title={EfficientViT: Multi-Scale Linear Attention for High-Resolution Dense Prediction},
author={Cai, Han and Li, Junyan and Hu, Muyan and Gan, Chuang and Han, Song},
journal={arXiv preprint arXiv:2205.14756},
year={2022}
}
@article{yu2018bdd100k,
title={BDD100K: A Diverse Driving Dataset for Heterogeneous Multitask Learning},
author={Yu, Fisher and Chen, Haofeng and Wang, Xin and Xian, Wenqi and Chen, Yingying and Liu, Fangchen and Madhavan, Vashisht and Darrell, Trevor},
journal={arXiv preprint arXiv:1805.04687},
year={2018}
}
model.safetensors + config.json (timm Hub format)best.ptmetrics.jsonresults.csvassets/demo_banner.mp4assets/demo_banner_poster.jpgREADME.mdTrained and evaluated with BDD100K-Toolkit: bdd100k-evaluate --dataset bdd100k-weather --checkpoint <weights> --data-dir <prepared dir> --split test.
best.pt 185 MBmodel.safetensors 185 MB