
Sanchalan AI - Traffic Management System
Smart India Hackathon 2025 project with AI-powered traffic management and Green Corridor for emergency vehicles
Timeline
Completed
Role
Full Stack AI Engineer
Status
CompletedTechnology Stack
Sanchalan AI - Traffic Management System
Smart India Hackathon 2025 (Problem ID: 25050) - An AI-powered traffic management system with Green Corridor for emergency vehicles, real-time detection, and intelligent signal control.
Project Overview
Sanchalan AI is a comprehensive traffic management solution that leverages computer vision and machine learning to optimize traffic flow while prioritizing emergency vehicle response.
Key Features
- Automatic Ambulance Detection: Real-time detection and identification of emergency vehicles
- Smart Signal Control: AI-powered signal management with manual override capability
- Real-time Web Dashboard: Live traffic monitoring and analytics visualization
- Traffic Analytics: Comprehensive vehicle analytics and corridor performance metrics
- Green Corridor: Automatic lane clearance for emergency vehicles
How It Works
Green Corridor Flow
- CCTV detects ambulance
- AI identifies optimal lane
- Signal turns green automatically
- Dashboard alerts operators in real-time
Technical Architecture
Backend
- Detection Engine: Enhanced YOLO-based detection with color analysis
- Vehicle Analysis: Attribute extraction and real-time analytics
- Emergency Override: Green corridor logic for priority vehicles
- Video Streaming: Multi-feed MJPEG streaming capability
Frontend
- Dashboard: Real-time traffic visualization and monitoring
- Live Feeds: Multiple camera feed display
- Analytics: Vehicle statistics and corridor performance metrics
Database
- MySQL 8.0: Persistent data storage
- Drizzle ORM: Type-safe database operations
Tech Stack
Model Performance
- Dataset: 13,986 images (car, bus, bike, person, ambulance)
- Performance: 30 FPS (CPU), 60+ FPS (GPU)
- Model Path:
backend/models/detect/train3/weights/best.pt
Project Structure
backend/
├── caa/
│ ├── yolo_detector/
│ │ ├── __init__.py
│ │ └── yolo_detector.py
│ ├── attribute_analysis_detector/
│ │ ├── __init__.py
│ │ ├── color_detector.py
│ │ └── vehicle_attribute.py
│ ├── config.py
│ ├── enhanced_detector.py
│ ├── enhanced_green_corridor.py
│ └── enhanced_video_stream_server.py
│
frontend/SanchalanAI/
├── client/src/components/
│ └── Dashboard.tsx
└── setup_mysql.sql
Quick Start
Setup Backend
cd backend
python green_corridor.py --setupRun Detection Demo
python green_corridor.py --video ambulance_video.mp4Setup Database
mysql -u root -p < frontend/SanchalanAI/setup_mysql.sqlOr manually create database sanchalan_ai in MySQL and update credentials in .env.
Start Video Server
cd backend
python enhanced_video_stream_server.pyServer runs on http://127.0.0.1:5001
Start Dashboard
cd frontend/SanchalanAI
npm install
npm run devDashboard: http://localhost:5000
Note: MySQL and Backend must be running first!
API Endpoints
GET /video_feed/{feed_id}- MJPEG stream per feedGET /api/feeds/status- Feed statuses and corridor stateGET /api/feeds/detections- Current detections summaryGET /api/feeds/analytics- Vehicle analytics data
Configuration
- Lane Polygons: Edit
backend/lanes.jsonto customize detection zones - Model Paths: Update
backend/config.pyfor model paths and CORS settings
Key Achievements
- Real-time multi-feed video processing
- Accurate emergency vehicle detection
- Intelligent signal control logic
- Comprehensive traffic analytics
- Production-ready dashboard interface
Repository: github.com/SHREY275/sanchalan_ai
Competition: Smart India Hackathon 2025 - Problem ID: 25050
