YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

πŸš— Optimized Vehicle Detection using Ensemble YOLO + Weighted Boxes Fusion

M.Tech Thesis Project β€” Vehicle detection in adverse weather (fog, rain, snow, sand) using the DAWN dataset with a Self-Adaptive 3-Tier WBF ensemble of YOLO11m + YOLO26m.

πŸ“ Repository Contents

File Description
kaggle_notebook.py Complete Kaggle-ready pipeline β€” copy-paste into a Kaggle notebook with dual T4 GPUs and run. Includes all 7 phases: data prep β†’ HP search β†’ training β†’ fine-tuning β†’ WBF ensemble β†’ evaluation β†’ results export.
prepare_data.py Standalone data preparation script β€” downloads DAWN from HuggingFace, converts to YOLO format, augments minority classes, creates 60/20/20 split
train_pipeline.py Alternative pipeline for HuggingFace Jobs execution

πŸ—οΈ Architecture

Models

  • YOLO11m (20M params) β€” Ultralytics YOLO11 medium, COCO pretrained
  • YOLO26m (20.4M params) β€” Ultralytics YOLO26 medium, COCO pretrained

Self-Adaptive 3-Tier WBF Ensemble

Input Image
    β”œβ”€β”€β†’ YOLO11m ──→ Detections₁
    β”œβ”€β”€β†’ YOLO11m_ft ──→ Detectionsβ‚‚  
    └──→ YOLO26m_ft ──→ Detections₃
                          β”‚
                    β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”
                    β”‚  Tier 1   β”‚  Per-class F1-based weights (static)
                    β”‚  Tier 2   β”‚  Per-image confidence modulation (dynamic)
                    β”‚  Tier 3   β”‚  Log-dampened count normalization
                    β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                          β”‚
                    Weighted Boxes Fusion
                          β”‚
                    Fused Detections

Tier 1 β€” Performance-Calibrated Base Weights: For each model mα΅’ and class cβ±Ό, compute F1 on validation set. Normalize so weights sum to 1 per class.

wi,jbase=Fi,jβˆ‘kFk,jw^{base}_{i,j} = \frac{F_{i,j}}{\sum_{k} F_{k,j}}

Tier 2 β€” Per-Image Confidence Modulation: Dynamically shift weights based on each model's average confidence on the current image.

Ο•i(I)=1+Ξ±β‹…(sΛ‰iβˆ’0.5),Ξ±=0.1\phi_i(I) = 1 + \alpha \cdot (\bar{s}_i - 0.5), \quad \alpha = 0.1

Tier 3 β€” Box Count Normalization (Fixed): Log-dampened normalization prevents volume dominance without destroying score calibration.

s^d=sdβ‹…wi,jbaseβ‹…Ο•i(I)log⁑2(max⁑(ni,j,2))\hat{s}_d = \frac{s_d \cdot w^{base}_{i,j} \cdot \phi_i(I)}{\log_2(\max(n_{i,j}, 2))}

πŸ“Š Dataset

  • Source: DAWN Dataset (Kenk & Hassaballah, 2020)
  • Weather: Fog (250), Rain (250), Snow (250), Sand (250) = 1000 base images
  • Classes: Bicycle, Bus, Car, Motorcycle, Pedestrian, Truck
  • Augmentation: Mirror + rotation for minority classes β†’ ~1800+ total images
  • Split: 60% train / 20% val / 20% test

Class Distribution (Original)

Class Count %
Car 6,454 82.2%
Truck 646 8.2%
Person 477 6.1%
Bus 161 2.1%
Motorcycle 81 1.0%
Bicycle 26 0.3%

πŸ”§ Bug Fixes Applied

This pipeline fixes all 3 known bugs from the original Kaggle execution:

1. NoneType HP Search Error

Problem: T01: failed β€” 'NoneType' object has no attribute 'results_dict' Cause: model.train() returns None on silent crash (OOM, NaN loss) Fix: Null-check before accessing results + bounded HP ranges + torch.cuda.empty_cache() between trials

2. _thread.lock Pickling Error

Problem: ensemble.pkl failed: cannot pickle '_thread.lock' object Cause: YOLO objects contain CUDA contexts and thread locks Fix: save_config() / load_config() using JSON β€” only serializes paths and weights, reconstructs YOLO objects on load

3. Ensemble Metric Drop

Problem: Ensemble P/R lower than individual models despite strong per-class scores Causes & Fixes:

  • sqrt(count) normalization too aggressive β†’ changed to log2(count)
  • scores / scores.max() re-normalization destroyed weight signal β†’ removed entirely
  • conf_alpha=0.3 caused over-modulation β†’ reduced to 0.1
  • Macro average included 0-support classes β†’ now averages active classes only
  • conf_type='avg' ignored model weights β†’ changed to 'box_and_model_avg'

πŸš€ Quick Start (Kaggle)

  1. Create a new Kaggle Notebook
  2. Select GPU T4 x2 accelerator
  3. Create a single code cell and paste the contents of kaggle_notebook.py
  4. Run β€” fully autonomous, ~4-6 hours
  5. Results in /kaggle/working/results/

πŸ“– Citation

@article{kenk2020dawn,
  title={DAWN: Vehicle Detection in Adverse Weather Nature Dataset},
  author={Kenk, Mourad Ambarka and Hassaballah, M.},
  journal={arXiv preprint arXiv:2008.05402},
  year={2020}
}

@article{solovyev2021wbf,
  title={Weighted boxes fusion: Ensembling boxes from different object detection models},
  author={Solovyev, Roman and Wang, Weimin and Gabruseva, Tatiana},
  journal={Image and Vision Computing},
  year={2021}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for AmeenAktharT/dawn-yolo-wbf-ensemble