An AI-powered traffic surveillance system that detects multiple types of traffic violations using computer vision and deep learning models. Each violation type is handled by a separate, independently optimized model to allow flexibility, better benchmarking, and modular updates.
- 🎯 Helmet Detection – Detects riders without helmets using YOLOv8.
- 😷 Face Mask Detection – Identifies whether individuals are wearing masks (ResNet).
- 🧍 Triple Riding Detection – Detects more than 2 people on a bike (YOLO/ResNet).
- 🚫 Red Light Violation Detection – Detects vehicle movement beyond stop-line (OpenCV logic).
- 🔍 Modular Architecture – Each model runs independently; combine or deploy separately.
helmetdetection-using-yolo8m-opencv/
├── datafortesting-and-trainning/
├── testing/
├── train/
├── models/
├── scr/
├── main.py
├── dynamic signal handling.py
├── helmetvc.py
├── requirements.txt
└── README.md
-
Clone the repo
git clone https://github.com/sairam-s0/Smart-Traffic-Violation-Detection-System.git cd Smart-Traffic-Violation-Detection-System -
Install dependencies
pip install -r requirements.txt
-
Download model weights (Place your YOLO and other model weights in the appropriate folders)
Each module runs independently:
# Helmet detection
cd Helmet-Detection
python helmet_detect.py --source your_video.mp4
# Mask detection
cd ../seatbelt-Detection
python mask_detect.py --source your_video.mp4
# Red light violation detection
cd ../Red-Light-Violation
python redlight_detect.py --source your_video.mp4| Model | Precision | Recall | mAP@0.5 | mAP@0.5:0.95 | Notes |
|---|---|---|---|---|---|
| License Plate | ~0.925 | ~0.95 | ~0.967 | ~0.815 | High-performing, best across all metrics |
| Seatbelt Detection | ~0.84 | ~0.80 | ~0.85 | ~0.45 | Stable training, real-world usable, tighter IoU weaker |
- 📈 All models show smooth learning curves with no signs of overfitting.
- ✅ License Plate model is the strongest — highly accurate and stable.
- 🚧 Seatbelt model performs well in general, but tighter localization (mAP@0.5:0.95) could be improved.
Instead of a single monolithic pipeline, this system treats each violation type as a separate module for:
- Easier maintenance and debugging
- Model-specific training & optimization
- Scalable deployment (microservices, edge devices)
Instead of a single monolithic pipeline, this system treats each violation type as a separate module for:
- Easier maintenance and debugging
- Model-specific training & optimization
- Scalable deployment (microservices, edge devices)
This project is licensed under the MIT License. See LICENSE for details.
Sairam GitHub: @sairam-s0
Pull requests, suggestions, and bug reports are welcome. Please open an issue or submit a PR with improvements or additional models.