Transforming vehicles into collaborative smart-city sensors that detect, verify, and share road hazards in real time.
RoadGuard AI is an intelligent road safety system designed to detect road hazards in real time, specifically optimized for Indian road conditions.
The system combines:
Computer Vision
- Sensor Fusion (Accelerometer + Gyroscope)
- Cloud-Based Hazard Intelligence
- Navigation Integration
Vehicles act as mobile sensing nodes that detect hazards and share them with nearby drivers through a real-time alert network. This enables the creation of a collaborative road hazard intelligence system for smart cities.
Figure: Overview of the proposed system
India reports over 150,000 road accident fatalities annually, many caused by poor road infrastructure such as:
- Unmarked speed breakers
- Potholes
- Uneven road surfaces
- Poor visibility during rain or night
Traditional navigation systems do not detect temporary road hazards.
RoadGuard AI aims to improve driver awareness and reduce accidents using real-time hazard intelligence.
Drivers frequently encounter unexpected hazards due to:
- Faded or unmarked speed breakers
- Potholes and damaged road surfaces
- Low visibility at night
- Rain, fog, or flooded roads
These hazards often remain undetected by existing navigation systems, leading to:
- Vehicle damage
- Sudden braking accidents
- Unsafe driving conditions
| System | Vision Only | Sensor Only | RoadGuard AI |
|---|---|---|---|
| Hazard Detection | ✓ | ✗ | ✓ |
| Works in Low Visibility | ✗ | ✓ | ✓ |
| False Positive Reduction | ✗ | ✓ | ✓ |
| Early Hazard Prediction | ✓ | ✗ | ✓ |
RoadGuard AI combines both approaches to increase reliability.
RoadGuard AI uses a hybrid AI + sensor fusion approach to detect and verify road hazards.
The system combines:
- 1️⃣ Computer Vision Detection
- 2️⃣ Sensor Fusion Verification
- 3️⃣ Cloud-Based Hazard Intelligence
- 4️⃣ Real-Time Navigation Alerts
This improves reliability compared to vision-only systems.
A vehicle-mounted camera captures road frames continuously.
The AI model analyzes frames using the ** yolov8+cbam ** model trained to detect:
- Speed breakers
- Potholes
- Road bumps
This allows the system to predict hazards before the vehicle reaches them.
Computer vision may fail under certain conditions:
- Poor lighting
- Rain or fog
- Water-covered roads
- Camera occlusion
To improve reliability, RoadGuard AI integrates accelerometer and gyroscope sensors.
These sensors detect:
- Vertical acceleration spikes
- Sudden tilt changes
- Road bump patterns
If a bump pattern matches a pothole or speed breaker, the system confirms the hazard.
This reduces false positives and missed detections.
RoadGuard AI uses IMU sensor data (accelerometer + gyroscope) to verify hazards detected by the computer vision model. This helps reduce false positives and detect hazards when visual detection fails.
flowchart TD
B[IMU Data Acquisition]
B --> C[Low Pass Filtering]
C --> D[Delta Acceleration Calculation]
D --> E[Gyroscope Motion Rejection]
E --> F[Event Duration Validation]
F --> G[Hazard Confirmation]
G --> H[Cloud Storage]
Algorithm Steps
-
Read accelerometer and gyroscope data from the MPU6050 sensor.
-
Apply calibration offsets to remove sensor bias.
-
Apply a low-pass filter to the vertical acceleration (Az) to remove vibration noise.
-
Compute vertical acceleration change:
delta_g = 1 - Az_filtered
-
If delta_g exceeds the threshold, a potential bump event is detected.
-
Compute gyroscope magnitude:
gyro_mag = sqrt(Gx² + Gy² + Gz²)
-
If gyroscope magnitude exceeds the rotation threshold, reject the event.
-
Measure event duration.
-
If duration is within the valid range, confirm the bump event.
-
Send the hazard location to the cloud database.
Read IMU data
Apply calibration offsets
Filter vertical acceleration
delta_g = 1 - Az_filtered
IF delta_g > threshold
compute gyro magnitude
IF gyro < rotation_threshold
measure event duration
IF duration valid
confirm road hazard
send GPS location to cloud
| Parameter | Value | Purpose |
|---|---|---|
| Sampling Rate | 200 Hz | Sensor data acquisition |
| Delta G Threshold | 0.20 g | Detect vertical drop |
| Gyro Threshold | 10 deg/s | Reject turns |
| Min Duration | 0.08 s | Remove noise |
| Max Duration | 1.2 s | Reject long events |
| Debounce | 1000 ms | Avoid duplicates |
Case 1: Vision detects hazard → warning issued Case 2: IMU confirms → hazard confidence increases Case 3: Both detect → high confidence hazard stored
Figure: Collaborative hazard map generated using Folium showing detected road hazards.
Once a road hazard is detected and verified, the system shares the information through a collaborative hazard intelligence network.
For the MVP implementation, hazard locations are visualized using Folium, a Python open-source library for interactive map generation.
1️⃣ Hazard location is stored in the cloud hazard database
2️⃣ The hazard is added to a shared road hazard map
3️⃣ Nearby drivers receive real-time navigation alerts
This enables vehicles to act as mobile sensing nodes, continuously contributing hazard information to improve road safety.
Different marker colors on the map represent the source of hazard verification:
| Marker Color | Meaning |
|---|---|
| 🔵 Blue Marker | Hazard confirmed using YOLOv8 computer vision detection |
| 🟢 Green Marker | Hazard detected using IMU sensor module (MPU6050) |
| 🟡 Yellow Marker | Hazard confirmed using both YOLOv8 and IMU sensor fusion |
This multi-source confirmation improves reliability by combining vision-based detection with sensor-based verification.
By aggregating hazard reports from multiple vehicles:
- Frequently detected hazards gain higher confidence
- Municipal authorities can identify damaged road segments
- Drivers receive early warnings about upcoming road hazards This transforms vehicles into distributed smart-city sensors, enabling real-time road safety intelligence.
Camera Input
↓
Computer Vision Model
↓
Hazard Prediction
↓
Sensor Fusion Verification
(Accelerometer + Gyroscope)
↓
Hazard Confirmation
↓
Cloud Hazard Database
↓
Navigation Integration
↓
Real-Time Driver Alerts
The dataset used for training the road hazard detection model consists of speed breaker images captured from real vehicle-mounted cameras.
- Class: Speed Breakers
- Source: Images captured using a vehicle mirror-mounted camera during real driving conditions
- Total Images Collected: 300 images
- Sample images
- Class: potholes
- Source: https://share.google/0Z1qXmfYXiApXi4zz
- Total Images Collected: 665 images
- Sample images
Figure: Sample annotated image of pothole
To improve model robustness across different environmental conditions, the dataset was augmented to simulate multiple road scenarios:
- 🌧️ Rain conditions
- 🌫️ Fog conditions
- ☀️ Sunny daylight conditions
- 🌙 Night-time driving conditions
Data augmentation techniques help the model generalize better for real-world deployment on Indian roads, where lighting and weather conditions vary significantly.
The augmented dataset was used to train the YOLOv8 + CBAM based road hazard detection model, enabling reliable detection of speed breakers, potholes under diverse environmental conditions.
| Model | Accuracy | Inference Time | Notes |
|---|---|---|---|
| YOLOv8 Baseline | 92% | 1–2 sec / image | Initial training evaluation |
| YOLOv8 + CBAM | 93% | 8.8 ms / image | Optimized real-time inference |
- CBAM attention mechanism improves feature representation by helping the model focus on important spatial and channel features.
- This results in a slight accuracy improvement (~1%) in detecting road hazards.
- After optimization, the model achieves real-time inference performance (~8.8 ms per frame), making it suitable for edge deployment in vehicles.
- Attention mechanisms improve feature extraction and robustness
- The optimized model supports real-time deployment for autonomous systems
- Suitable for vehicles, robotics, and smart-city sensing applications CBAM improved feature attention, allowing better detection and reduced inference latency.
- 🚗 Real-time road hazard detection
- 📷 AI-based computer vision model
- 📊 Accelerometer + gyroscope verification
- ☁️ Cloud hazard intelligence network
- 📡 Real-time driver alerts
- 🗺️ Navigation integration
- 🌧️ Works in poor visibility and flooded roads
- 🇮🇳 Designed for Indian road infrastructure
- Python
- OpenCV
- PyTorch
- CNN-based object detection models
- Jetson Nano
- Camera module
- Accelerometer
- Gyroscope
- FastAPI
- Node.js
- AWS / Firebase / Supabase
- Python-based map system
- Real-time alert interface
1️⃣ Camera captures road frames continuously 2️⃣ AI model detects potential hazards 3️⃣ Sensor fusion verifies physical bumps
4️⃣ Confirmed hazards are stored in the cloud 5️⃣ Drivers approaching the location receive alerts
RoadGuard AI uses a lightweight object detection model optimized for edge deployment.
Model: YOLOv8
Attention Mechanism used: CBAM
Framework: PyTorch
Input Resolution: 640×640
Classes:
- pothole
- speed breaker
- road bump Edge Optimisation:
- Quantised inference for Jetson Nano
AI model architecture of the system with Yolov8+CBAM
The YOLOv8 + CBAM model was trained using the following parameters.
| Parameter | Value |
|---|---|
| Epochs | 100 |
| Batch Size | 16 |
| Image Size | 640 × 640 |
| Learning Rate | 0.001 |
| Optimizer | Adam |
| Device | GPU (NVIDIA RTX 4060) |
| Workers | 8 |
| Classes | 2 (Speed Breaker, pothole) |
RoadGuard AI requires the following hardware components:
| Component | Purpose |
|---|---|
| Jetson Nano / Raspberry Pi | Edge AI inference |
| Camera Module | Road image capture |
| Accelerometer (IMU) | Detect bumps |
| Gyroscope | Motion verification |
| Power Supply | Vehicle power source |
Optional:
- GPS module for precise hazard location
- 4G/LTE module for cloud communication
Make sure the following are installed:
- Python 3.10+
- PyTorch
- OpenCV
- FastAPI
- NumPy
- Ultralytics YOLOv8
pip install -r requirements.txtStart the hazard detection pipeline:
python main.pyThe pipeline will:
- Capture frames from the camera
- Detect hazards using YOLOv8 + CBAM
- Store hazards in the cloud database
- Send alerts to the navigation interface
Run the map interface:
cd navigation
python map_display.pyThis will display hazards using Folium maps.
https://www.youtube.com/playlist?list=PLwEJWj5T2m4wNl4kYch85MUhYL58WsrF_
Figure: Road Hazard Detection using YOLOv8 + CBAM
Figure: Speed breaker and pothole detection using IMU module
Map integration of the road hazards found
- Integration with Google Maps API
- City-scale hazard analytics dashboard
- Large crowdsourced road dataset
- Mobile app for drivers
- Smart city infrastructure integration
If deployed at scale, RoadGuard AI could:
• Detect road hazards across entire cities in real time
• Reduce accident risks caused by unmarked speed breakers
• Help municipalities identify damaged roads faster
• Enable collaborative smart-city infrastructure
- Uber / Ola fleets
- Logistics companies
- Smart city municipalities
- Real-time hazard detection using computer vision
- Sensor fusion verification using accelerometer + gyroscope
- Cloud-based hazard storage and mapping
- Edge deployment on Jetson Nano / Raspberry Pi
- Deploy the system in logistics vehicles and cab fleets
- Vehicles act as mobile sensing nodes across the city
- Even with 10–20 drivers, coverage expands to most urban routes
- Continuous data collection improves hazard detection reliability
Logistics drivers and cab drivers travel across different parts of the city daily, creating a natural distributed sensing network.
This enables large-scale hazard data collection without installing infrastructure everywhere.
- Integration with Folium maps
- Real-time alerts for upcoming hazards
- Mobile dashboard for drivers
- Hazard confidence scoring using crowdsourced data
- Municipal road monitoring dashboard
- City-wide road quality analytics
- Automatic identification of high-risk road segments
- Data insights for infrastructure planning and maintenance
Vehicle Edge Device
↓
Camera + Sensors
↓
Jetson Nano (AI Inference)
↓
FastAPI Backend
↓
Cloud Hazard Database
↓
Navigation Alert System (Folium Maps)
Team Name
- Member 1 — Vishal Hariharan K K
- Member 2 — Sreyas Sanil Kumar
- Member 3 — Shriyaa S K
Hackathon Track: Smart Cities & Urban Innovation
⭐ If you found this project useful, please star the repository


