This repository contains a project on car license plate detection using advanced computer vision techniques. The project leverages the YOLO (You Only Look Once) object detection framework to detect car license plates in various environmental conditions.
- Introduction
- Dataset
- Installation
- Usage
- Model Architecture
- Results
- Challenges and Considerations
- Future Work
- Contributing
- License
The goal of this project is to develop a robust system for detecting car license plates from images and videos. The project includes the following key components:
- Exploratory Data Analysis (EDA)
- Image Preprocessing
- Data Augmentation
- Model Training using the YOLO framework
- Hyperparameter Tuning
- Deployment for real-time detection
The primary dataset used in this project is sourced from the Car License Plate Detection dataset. Additional data is integrated from public datasets, traffic surveillance footage, and synthetic datasets to improve the model's performance.
To run the project locally, please follow these steps:
- Clone the repository:
git clone https://github.com/saboye/car_license_plate_detection.git
- Navigate to the project directory:
cd car_license_plate_detection
- Install the required dependencies:
pip install -r requirements.txt
To use the license plate detection model, follow these steps:
- Ensure your dataset is prepared and placed in the
data/
directory. - Run the training script to train the model:
python train.py
- Use the
detect.py
script to perform detection on new images or videos:python detect.py --input path_to_input_file --output path_to_output_file
The model architecture is based on the YOLO object detection framework, which is known for its speed and accuracy in detecting objects in images. The architecture includes:
- Convolutional layers for feature extraction (as part of YOLO)
- Bounding box regression layers for license plate localization
- Object classification layers to identify license plates within the detected bounding boxes
The model's performance was evaluated using several metrics, including Precision, Recall, and F1-Score. The following key results were obtained:
-
F1-Confidence Curve: The F1-Score peaks at 0.97 when the confidence threshold is set at 0.511. This curve illustrates the trade-off between confidence and F1-Score, demonstrating that the model maintains a high F1-Score across a wide range of confidence levels.
-
Precision-Recall Curve: The model achieves a mean Average Precision (mAP) of 0.985 at an IoU threshold of 0.5. The Precision-Recall curve is nearly perfect, indicating that the model is highly precise and recalls most instances of license plates.
-
Precision-Confidence Curve: The model achieves a Precision of 1.00 at a confidence level of 0.919. This curve demonstrates the model's reliability in making predictions at high confidence levels.
-
Recall-Confidence Curve: The Recall remains high across various confidence levels, with a perfect score of 1.00 achieved at lower confidence thresholds.
-
Exploratory Data Analysis (EDA): The EDA visualizes the distribution of bounding box parameters (x, y, width, height) for license plates, providing insights into their spatial characteristics in the dataset.
-
Training and Validation Loss Curves: The loss curves for both training and validation show a consistent decrease, indicating effective learning during the training process. The metrics also indicate that the model generalizes well to unseen data.
These results indicate that the model is highly effective in detecting license plates with high precision and recall. The model's performance metrics confirm its suitability for deployment in real-time applications.
This project faced several challenges, including:
- Handling incomplete or low-quality images
- Integrating data from multiple sources
- Addressing biases in the dataset
- Ensuring model scalability
Potential future improvements include:
- Enhancing detection accuracy in various lighting and weather conditions
- Expanding the dataset with more diverse license plates
- Deploying the model in a mobile or edge computing environment
Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.