https://github.com/saif-gitreps/alpd-for-bd-plates
Automatic License Plate Detection and Recognition System for Challenging Bangladeshi License Plate using YOLOv8, fine-tuned EfficientNetB0 model and EasyOCR hybrid recognition.
https://github.com/saif-gitreps/alpd-for-bd-plates
cnn efficientnetb0 keras matplotlib opencv python yolov8
Last synced: 9 months ago
JSON representation
Automatic License Plate Detection and Recognition System for Challenging Bangladeshi License Plate using YOLOv8, fine-tuned EfficientNetB0 model and EasyOCR hybrid recognition.
- Host: GitHub
- URL: https://github.com/saif-gitreps/alpd-for-bd-plates
- Owner: saif-gitreps
- Created: 2025-06-17T15:10:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-18T15:12:18.000Z (9 months ago)
- Last Synced: 2025-09-18T18:13:30.710Z (9 months ago)
- Topics: cnn, efficientnetb0, keras, matplotlib, opencv, python, yolov8
- Language: Jupyter Notebook
- Homepage:
- Size: 62.2 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bangladeshi License Plate Detection & Recognition 🚘
**Automatic License Plate Recognition (ALPR) system** tailored for Bangladeshi vehicles.
It combines **YOLOv8** for plate detection with a hybrid recognition pipeline using **EfficientNetB0** and **EasyOCR**, supported by preprocessing and confidence-based voting mechanisms.
---
## 📖 Overview
License plate recognition is a crucial component in **traffic management, automated toll collection, parking systems, and vehicle surveillance**.
Unlike English or numeric plates, Bangla license plates present unique challenges due to:
- Complex **Bangla script morphology** (consonants, vowels, compound characters).
- **Inconsistent fonts** and plate designs.
- **Lighting variations, noise, and occlusion** in real-world scenarios.
This project addresses these challenges through a robust, deep-learning-based pipeline.
---
## 🏗️ System Architecture
1. **Input Image** → Raw vehicle image.
2. **Detection Module** → YOLOv8 detects the license plate region.
3. **Plate Extraction** → Cropped region passed to preprocessing.
4. **Preprocessing Pipelines** → Thresholding (Otsu, Adaptive Gaussian, Adaptive Mean).
5. **Dual Recognition** →
- **EfficientNetB0 CNN** (character recognition).
- **EasyOCR** (end-to-end text extraction).
6. **Confidence-Based Voting** → Final license plate prediction.
## 
## 🛠️ Methodology
### 🔍 Detection (YOLOv8)
- Small variant (`yolov8s`) trained on **785 annotated images**.
- Achieved **99% detection accuracy**.
### 🧠 Recognition (EfficientNetB0 + EasyOCR)
- **EfficientNetB0** trained on ~17,000 cropped character images across **29 Bangla classes**.
- **EasyOCR** used as a complementary OCR method for robustness.
- Final results fused using **confidence-based voting**.
### 🖼️ Preprocessing
- Image Enhancement (unsharp masking, bilateral filtering).
- Grayscale & contrast adjustment (top-hat, black-hat filtering).
- Multi-thresholding (Otsu, Adaptive Gaussian, Adaptive Mean).
- Noise removal & morphological operations.
- Character segmentation & resizing (64×64).
---
## 📊 Results
Tested using 722 unseen vehicle images.
- **YOLOv8 Detection**:
- mAP@0.5: **98.79%**
- Precision: **96.13%**
- Recall: **98.73%**
- **EfficientNetB0 CNN**:
- Character classification accuracy: **99%**
- Full plate recognition: **73.84%**
- **EasyOCR**:
- Full plate recognition: **74.79%**
- **Hybrid Ensemble (CNN + EasyOCR)**:
- Full plate recognition: **94.90%**

---
## Full working
1. Detection:

2. Cropping using detected bounding box:

3. Preprocessing steps for EfficientNet:

4. Contour detection and classification:

5. Preprocessing and Recongition for EasyOCR

6. Ensemble voting between EfficientNetB0 and EasyOCR
7. Final Text Extraction:

## 📂 Dataset
The system was trained and tested using publicly available **Bangladeshi license plate datasets**:
- [Bangladeshi Vehicle License Plate (Kaggle)](https://www.kaggle.com/datasets/sifatkhan69/bangladeshi-vehicle-license-plate)
- [Bangla License Plate Dataset with Annotations](https://www.kaggle.com/datasets/mirzamahfujhossain/bangla-license-plate-dataset-with-annotations)
- [Bangladeshi Bus & Truck Plates](https://www.kaggle.com/datasets/mdfahimbinamin/bangladeshi-bus-and-truck-license-plate-dataset)
---
## 🔮 Future Work
- Expand dataset with more diverse conditions (rain, night, low quality).
- Adaptive preprocessing selection based on input quality.
- Transformer-based OCR to directly predict full plates (reducing segmentation dependency).
---
## 🙌 Acknowledgments
- Kaggle contributors for open datasets.
- Ultralytics YOLO & EasyOCR community.