⚠️ Restricted Deployment Notice
This project is NOT publicly deployable.
The complete system is accessible only to authorized Government officials and agencies.
However, the primary detection model is available for research, academic contribution, and controlled collaboration.
This repository presents a custom-trained YOLOv5-based emergency vehicle detection model, developed as a core vision module for an AI-powered Smart Traffic Management System. The model operates in real time, identifying emergency vehicles in live traffic feeds and enabling intelligent traffic signal prioritization.
The objective is simple but critical:
detect emergency vehicles instantly, clear their path dynamically, and reduce response time where every second matters.
This model is engineered for urban intersections, highway junctions, and smart city deployments, forming the perception layer of a larger government-grade traffic control infrastructure.
The model is trained to detect five vehicle categories, with emphasis on emergency response units:
| Class ID | Vehicle Type |
|---|---|
| 0 | Ambulance |
| 1 | Fire Truck |
| 2 | Police Car |
| 3 | Bus |
| 4 | Van |
Emergency vehicles are given priority inference handling in downstream systems.
- Model Architecture: YOLOv5s (Small Variant)
- Framework: PyTorch
- Inference Type: Real-time object detection
- Optimization Target: Low latency + high recall for emergency vehicles
- Training Platform: Google Colab (GPU: NVIDIA T4)
-
Source: Custom dataset curated and annotated using Roboflow
-
Annotation Format: YOLOv5-compatible
-
data.yamlincludes class names and dataset paths -
Balanced samples with targeted augmentation for emergency vehicles
| Metric | Value |
|---|---|
| mAP@0.5 | 53.5% |
| mAP@0.5:0.95 | 37.0% |
| Ambulance Precision | 64% |
| Ambulance Recall | 84% |
🧪 Trained for 100 epochs, optimized for maximum recall to avoid missed emergency detections.
- Live Traffic Feed Input
- YOLOv5 Inference Engine
- Emergency Vehicle Classification
- Confidence Threshold Filtering
- Trigger-Based Signal Logic
- Traffic Signal Override
This modular pipeline allows easy integration with:
- Traffic controllers
- Edge devices
- City-wide monitoring systems
When an emergency vehicle is detected:
- 🔊 Audio alert is triggered
- 🚥 Traffic signal override is activated
- 🟢 Emergency lane receives green priority
- ⏱️ Cooldown timer prevents repeated triggers
- 🧠 Failsafe logic restores normal flow post-clearance
Designed to prevent signal abuse while guaranteeing emergency clearance.
python detect.py \
--weights path/to/best.pt \
--source path/to/image_or_video \
--conf 0.25 \
--save-txt \
--save-conf \
--device 0 # use 'cpu' if GPU unavailable