Single-pass detection of Bangladeshi (Bangla) vehicle license plates with YOLOv9-C, trained from scratch on Bangla LPDB-A
Automatic license plate recognition (ALPR) is a core building block of intelligent transportation systems, but Bangla plates are harder than Latin-script plates: they contain two text lines, Bangla words, letters and digits, and many different layouts and vehicle types. This project trains YOLOv9-C (Wang et al., ECCV 2024) to localise Bangla license plate regions using the public Bangla LPDB-A dataset (Shomee & Sams, DICTA 2021). After merging both parts of the dataset (4,592 images, 24,174 boxes) and training for 50 epochs on a single Tesla T4, the best model reaches precision 0.980, recall 0.976, mAP@50 0.992 and mAP@50-95 0.645 on the validation split, at about 14 ms per image. The repository contains the full Kaggle notebook, reusable scripts for data preparation, training and inference, all training graphs and a critical discussion of the results and their limitations.
| Task | Object detection of Bangla license plate regions (1 class) |
| Model | YOLOv9-C, 25.5 M parameters, 103.7 GFLOPs, trained from scratch |
| Data | Bangla LPDB-A, 4,592 images / 24,174 boxes, split 70 / 20 / 10 |
| Result | mAP@50 0.992, mAP@50-95 0.645, F1 0.98 (validation) |
| Speed | 12.7 ms inference per 640 px image on a Tesla T4 |
| Next step | OCR of the detected plate for full Bangla ALPR |
License plate detection is the first stage of an ALPR pipeline: detect → crop → recognise characters. Its quality limits everything that follows, because a missed or badly cropped plate cannot be read. Applications include traffic law enforcement, toll collection, smart parking, access control and vehicle tracking.
Bangladeshi plates follow the BRTA standard: the top line holds the city name, "Metro" and a vehicle class letter, and the bottom line holds the class number and vehicle number in Bangla digits. Detection must cope with motion blur, dirty or damaged plates, uneven lighting, varied camera angles and the wide range of vehicles on Bangladeshi roads.
Research question: how well does a modern single-stage detector, YOLOv9-C trained from scratch, localise Bangla license plate regions on a public benchmark dataset with modest compute (one free Kaggle GPU)?
| Work | Approach | Notes |
|---|---|---|
| Rahman et al., 2018 (arXiv:1809.00905) | CNN-based Bangla license plate recognition | Early CNN system with its own collected dataset of plate images |
| Shomee & Sams, DICTA 2021 | Multi-step pipeline: YOLOv4 detection → ESRGAN super-resolution → YOLO character recognition | Introduced Bangla LPDB-A, the dataset used here |
| Cognition.ai, 2022 (Zenodo 7110401) | Bangla License Plate Dataset 2.5k | 2,519 images of legible Bangla plates for detection and recognition |
| Hasin, 2026 (arXiv:2603.10267) | YOLO detection + vision–language OCR | Recent work moving recognition to transformer-based OCR |
| This project | YOLOv9-C (PGI + GELAN), single class | Newer detector generation than YOLOv4; detection stage only |
YOLOv9 introduces Programmable Gradient Information (PGI), an auxiliary reversible branch that keeps gradients reliable through deep networks, and the GELAN backbone for better accuracy per parameter. Both make it attractive for training from scratch on a small domain-specific dataset. See docs/MODEL.md for details.
Bangla LPDB-A has two parts: (1) full vehicle images with one box per
plate, and (2) cropped plates annotated at word, letter and digit level (102 classes). Both parts were
merged and all labels were mapped to a single class, license_plate.
| Split | Images | Boxes |
|---|---|---|
| Train (70 %) | 3,214 | 17,069 |
| Validation (20 %) | 918 | 4,841 |
| Test (10 %) | 460 | 2,264 |
| Total | 4,592 | 24,174 |
More details, including an important note on what the merged labels contain: docs/DATASET.md.
flowchart LR
A[Bangla LPDB-A<br/>part 1 + part 2] --> B[Merge and<br/>rename files]
B --> C[Random split<br/>70 / 20 / 10]
C --> D[Relabel to class 0<br/>validate boxes]
D --> E[Train YOLOv9-C<br/>50 epochs, 640 px]
E --> F[Validate and<br/>select best.pt]
F --> G[Detect plates<br/>crop regions]
G -.-> H[OCR<br/>future work]
| Setting | Value |
|---|---|
| Framework | Ultralytics 8.4.58, PyTorch 2.12, Python 3.12 |
| Hardware | Kaggle, NVIDIA Tesla T4 (15 GB) |
| Model | yolov9c.yaml, from scratch |
| Epochs / image size / batch | 50 / 640 / 16 |
| Optimiser | AdamW, lr 0.002, momentum 0.9, weight decay 0.0005, 3 warm-up epochs |
| Augmentation | Mosaic (off for the last 10 epochs), horizontal flip 0.5, HSV jitter, translate 0.1, scale 0.5, RandAugment, random erasing 0.4 |
| Mixed precision | AMP enabled |
| Loss | CIoU box loss + BCE class loss + Distribution Focal Loss |
| Training time | 2.5 hours |
The complete configuration is in results/training_config.yaml.
Metrics of the best checkpoint (epoch 46) on the validation split:
| Metric | Value |
|---|---|
| Precision | 0.980 |
| Recall | 0.976 |
| F1 | 0.978 (best 0.98 at confidence 0.45) |
| mAP@50 | 0.992 |
| mAP@50-95 | 0.645 |
| Inference speed (T4) | 12.7 ms / image (~69 FPS end-to-end) |
Confusion matrix: 4,777 true positives, 64 false negatives and 142 false positives, so 98.7 % of the ground-truth boxes are detected.
mAP@50 crosses 0.95 by epoch 8 and saturates near 0.99; mAP@50-95 keeps rising slowly until the end, which suggests that longer training could still tighten the boxes.
| Precision–Recall | F1–Confidence |
|---|---|
![]() |
![]() |
| Precision–Confidence | Recall–Confidence |
![]() |
![]() |
| Confusion matrix | Normalised confusion matrix |
![]() |
![]() |
![]() |
![]() |
![]() |
A full analysis with the per-epoch table is in docs/RESULTS.md.
These results should be read with the following points in mind:
- Label granularity. Part 2 of LPDB-A is annotated at word, letter and digit level. Mapping all 102 classes
to one
license_plateclass means most training boxes (about 5.3 per image) are text regions inside a plate, not whole plates. The model therefore learns "plate text region" as well as "plate", and the very high mAP@50 partly reflects these easy, high-contrast regions on cropped plates. - Validation-only evaluation. Reported metrics come from the validation split, which was also used to pick
the best epoch. The 460-image test split was created but not evaluated in the notebook.
src/train.pynow runs a test-split evaluation automatically. - Reproducibility. The notebook split used
random.shufflewithout a seed.src/prepare_dataset.pyuses a fixed seed (42), so its split differs from the original run but is repeatable. - Possible leakage. Part 2 includes plates cropped from part 1 images, so the same physical plate can appear in both train and validation.
- Strict-IoU localisation. mAP@50-95 (0.645) is much lower than mAP@50 (0.992): boxes are found but are not always tight, which matters for the OCR stage.
- OCR not evaluated. Tesseract (
ben+eng) was installed and run on sample plates, but recognition accuracy was not measured.
- Train a plate-only detector on part 1 (
--plates-only) and compare it with the merged-label model - Report metrics on the held-out test split and with grouped splits that keep each plate in one split
- Start from COCO-pretrained
yolov9c.ptand compare with training from scratch - Add a second-stage recogniser using part 2's 102 classes or a transformer OCR, and report character / plate accuracy
- Test robustness on night, rain, blur and low-resolution images
- Export to ONNX / TensorRT and build a real-time demo with Streamlit or Flask
# 1. Clone and install
git clone https://github.com/feroz-afm/Bangla-License-Plate-Detection-using-YOLOv9.git
cd Bangla-License-Plate-Detection-using-YOLOv9
pip install -r requirements.txt
# 2. Download Bangla LPDB-A (Zenodo 4718238 or Kaggle "bangla-lpdb-a"), then prepare it
python src/prepare_dataset.py --src "path/to/Bangla LPDB - A" --out data/LPDB_split
# 3. Train (same settings as the reported run) and evaluate on the test split
python src/train.py --data configs/data.yaml
# 4. Detect plates (and optionally read them with Tesseract OCR)
python src/predict.py --weights runs/detect/yolov9c_bangla_lp/weights/best.pt --source path/to/images --ocr
# 5. Re-draw the summary graphs
python scripts/plot_metrics.pyPrefer the original workflow? Open notebooks/bangla-license-plate-detection-yolov9.ipynb
on Kaggle with a GPU and the bangla-lpdb-a dataset attached.
Bangla-License-Plate-Detection-using-YOLOv9/
├── notebooks/
│ └── bangla-license-plate-detection-yolov9.ipynb # full Kaggle notebook with outputs
├── src/
│ ├── prepare_dataset.py # merge, split (seeded) and relabel LPDB-A
│ ├── train.py # train YOLOv9-C and evaluate on the test split
│ └── predict.py # detect, crop and optionally OCR plates
├── scripts/
│ └── plot_metrics.py # draw epoch_metrics, epoch_losses and dataset_split graphs
├── configs/
│ └── data.yaml # dataset config (1 class: license_plate)
├── results/
│ ├── metrics_per_epoch.csv # validation metrics and training losses for all 50 epochs
│ └── training_config.yaml # exact settings of the reported run
├── assets/
│ ├── graphs/ # all training and evaluation graphs
│ ├── samples/ # sample plate images
│ └── brta_license_plate_layout.png
├── docs/
│ ├── MODEL.md # YOLOv9 architecture and configuration
│ ├── DATASET.md # dataset description and pre-processing
│ └── RESULTS.md # detailed results and analysis
├── requirements.txt
├── CITATION.cff
└── LICENSE
Python · PyTorch · Ultralytics YOLOv9 · OpenCV · NumPy · Pandas · Matplotlib · Tesseract OCR · Kaggle Notebooks (Tesla T4)
- C.-Y. Wang, I-H. Yeh and H.-Y. M. Liao, "YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information," ECCV 2024. arXiv:2402.13616 · code
- H. H. Shomee and A. Sams, "License Plate Detection and Recognition System for All Types of Bangladeshi Vehicles Using Multi-step Deep Learning Model," DICTA 2021, pp. 1–7. doi:10.1109/DICTA52665.2021.9647284
- Bangla LPDB-A dataset, Zenodo, 2021. zenodo.org/records/4718238
- M. M. S. Rahman, M. S. Nasrin, M. Mostakim and M. Z. Alom, "Bangla License Plate Recognition Using Convolutional Neural Networks (CNN)," 2018. arXiv:1809.00905
- Cognition.ai, "Bangla License Plate Dataset 2.5k," Zenodo, 2022. zenodo.org/records/7110401
- N. Hasin, "A Robust Deep Learning Framework for Bangla License Plate Recognition Using YOLO and Vision–Language OCR," 2026. arXiv:2603.10267
- G. Jocher et al., Ultralytics YOLO. github.com/ultralytics/ultralytics
If this project helps your work, please cite it using CITATION.cff (GitHub's Cite this repository button) and cite the YOLOv9 and Bangla LPDB-A papers above.
Code is released under the MIT License. The Bangla LPDB-A dataset belongs to its authors; follow their terms and cite their paper when you use it.
Md Feroz Ahmed · CSE, Pundra University of Science & Technology · GitHub @feroz-afm
⭐ If you find this project useful, please give it a star.












