This scientific research project, conducted at Duy Tan University (DTU), aims to develop a robust system for detecting traffic violations using YOLOv5 models in conjunction with OpenCV.
Link: https://youtu.be/ddhAg65acd0
The project leverages three distinct YOLOv5 models to address different components of traffic violation detection:
- Vehicle Detection: Identifies vehicles on the road.
- Helmet Detection: Identifies helmet on the road.
- Plate Detection: Extracts the license plate from the detected vehicle.
- Number Plate Detection: Extracts the numeric characters from the license plate.
The detection pipeline involves the following steps:
- Vehicle Detection: Locating the vehicle on the road.
- Helmet Detection: (If applicable) Identifying whether the rider is wearing a helmet.
- License Plate Detection: Isolating the vehicle’s license plate.
- Number Extraction: Extracting numeric values from the license plate.
Given that real-world images often lack the clarity of training images, pre-processing is crucial. We apply a blurring technique to improve the performance of the Number Plate Detection model.
Model training is performed on Kaggle using YOLOv5. More details can be found in the Kaggle Notebook.
For a deeper dive into YOLOv5, refer to the official documentation.
A pipeline integrates the three models, where each model's output serves as the input for the next.
-
Vehicle Detection:
- Input: Images, Mask, Separation Line (for Lane Encroachment Detection).
- Output: Images highlighting the detected violations.
-
Plate Detection:
- Output: Cropped images containing the vehicle's license plate.
-
Number Plate Detection:
- Output: Extracted numeric values, e.g.,
59N12345, 76E152202, ...
- Output: Extracted numeric values, e.g.,
You can view and explore the dataset used in this project on Kaggle.
Pre-trained weights for the helmet detection model can be downloaded here.