EfficientViT-B0 Finetuned on BDD100K Period (Time-of-Day) Classification


Task Framework Base Model
Macro F1 Top-1 Params
License Source

Fine-tuned EfficientViT-B0 image classifier on the BDD100K Period (Time-of-Day) 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.

4-class time-of-day classification (daytime / night / dawn or dusk / unknown) derived from BDD100K's per-image attributes.timeofday field. Unofficial task; follows the Kaggle dataset of the same name.


Usage

import timm, torch
from huggingface_hub import hf_hub_download
from PIL import Image
from torchvision import transforms as T

ckpt = torch.load(
    hf_hub_download("dronefreak/bdd100k-period-efficientvit_b0", "best.pt"), map_location="cpu", weights_only=True
)
model = timm.create_model(
    ckpt["model_name"], pretrained=False, num_classes=len(ckpt["class_names"])
)
model.load_state_dict(ckpt["state_dict"])
model.eval()
prep = T.Compose(
    [T.Resize((ckpt["imgsz"],) * 2), T.ToTensor(), T.Normalize(ckpt["mean"], ckpt["std"])]
)
with torch.no_grad():
    probs = model(prep(Image.open("street.jpg").convert("RGB"))[None]).softmax(1)[0]
print(ckpt["class_names"][probs.argmax()], f"{probs.max():.1%}")

Results

Evaluated on the test split (10000 images).

Metric Value
Macro F1 80.98%
Balanced accuracy 77.14%
Macro precision 86.44%
Macro recall 77.14%
Top-1 accuracy 93.71%

Per class

Class Precision Recall F1 Test images
dawn or dusk 70.13% 50.39% 58.64% 778
daytime 93.11% 96.58% 94.81% 5258
night 97.93% 98.73% 98.33% 3929
unknown 84.62% 62.86% 72.13% 35 (few)

Model Zoo

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 94.01% 83.19% 79.63% 87.95%
EfficientViT-L1 93.98% 82.68% 78.45% 88.75%
ConvNeXt-Atto 93.95% 80.75% 76.82% 86.39%
EfficientViT-B2 93.92% 82.53% 78.88% 87.49%
RepViT-M2.3 93.89% 82.35% 78.49% 87.72%
YOLO11n 93.79% 80.13% 75.19% 88.20%
EfficientViT-B1 93.77% 82.63% 78.93% 88.38%
EfficientViT-B3 93.77% 81.04% 76.29% 88.43%
YOLO11s 93.73% 81.22% 77.49% 86.42%
EfficientViT-B0 93.71% 80.98% 77.14% 86.44%
YOLO26n 93.61% 80.41% 77.72% 83.88%
MobileNetV4-Conv-Small 93.57% 80.22% 76.22% 86.06%
YOLOv8n 93.56% 80.85% 76.26% 87.87%
MobileNetV4-Conv-Large 93.46% 80.21% 74.88% 89.57%
YOLOv8s 93.46% 79.94% 75.66% 86.39%
YOLO26s 93.36% 80.10% 75.74% 86.84%
RepViT-M1.5 93.33% 81.97% 78.35% 86.95%
ResNet-18 93.32% 80.50% 76.72% 85.87%
EfficientFormerV2-L 93.31% 81.65% 78.36% 86.02%
EfficientFormerV2-S2 93.01% 80.38% 76.79% 85.35%

Training

Setting Value
Epochs (max) 50
Epochs (trained) 17
Best epoch (best.pt) 7
best.pt chosen by macro_f1 on the valid split
Early stopping patience 10
Batch size 128
Image size 224
Optimizer auto, resolved to AdamW (peak lr 3e-04)
Weights EMA

Dataset

dronefreak/BDD100K-Period-Classification holds the prepared splits these models were trained and evaluated on.


Limitations

  • Unofficial task: labels are BDD100K's per-image attributes, not a benchmark with a public leaderboard, so scores are only comparable with other models evaluated on this split.
  • Not the official test set: 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.
  • Heavily imbalanced: rare classes have very few test images, so their per-class scores are noisy. Prefer macro F1 over accuracy.
  • Images are US dashcam frames; generalization to other regions or camera setups is untested.
  • BDD100K is released for non-commercial research and education. Check its license before any use of these weights beyond research.
  • dawn or dusk is a transitional, subjectively labelled class that sits between daytime and night.

License

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.


Citation

Model

@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}
}

Dataset

@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}
}

Files

  • best.pt
  • metrics.json
  • results.csv
  • assets/demo_banner.mp4
  • assets/demo_banner_poster.jpg
  • README.md

Reproduce

Trained and evaluated with BDD100K-Toolkit: bdd100k-evaluate --dataset bdd100k-period --checkpoint <weights> --data-dir <prepared dir> --split test.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for dronefreak/bdd100k-period-efficientvit_b0

Finetuned
(7)
this model

Dataset used to train dronefreak/bdd100k-period-efficientvit_b0

Collections including dronefreak/bdd100k-period-efficientvit_b0

Papers for dronefreak/bdd100k-period-efficientvit_b0

Evaluation results

  • Top-1 accuracy (test split) on BDD100K Period (Time-of-Day) Classification
    BDD100K-Toolkit
    93.710
  • Macro F1 (test split) on BDD100K Period (Time-of-Day) Classification
    BDD100K-Toolkit
    80.980
  • Macro precision (test split) on BDD100K Period (Time-of-Day) Classification
    BDD100K-Toolkit
    86.440
  • Macro recall (test split) on BDD100K Period (Time-of-Day) Classification
    BDD100K-Toolkit
    77.140