Urban traffic systems still rely largely on fixed timer traffic lights. These timers do not adapt to real-time traffic conditions, which often leads to congestion, unnecessary waiting time, and increased fuel consumption.
To explore a more intelligent approach, I built the Metropolitan AI Control Center, a traffic signal optimization system that combines Deep Reinforcement Learning, Computer Vision, and traffic simulation.
The goal of the project is to replace static traffic signal timers with an AI agent that continuously learns how to manage intersections based on real-time traffic conditions.
Project Overview
The system operates on a simulated 10-intersection city grid using Eclipse SUMO (Simulation of Urban Mobility). A Deep Q-Network (DQN) agent learns how to control signal phases in order to reduce overall waiting time and prevent congestion from spreading across intersections.
Vehicle density is estimated using YOLOv8-based computer vision, while the entire system is monitored through a Flask-based web dashboard.
This setup allows the AI to interact with a realistic traffic environment and continuously improve its signal control strategy.
Technology Stack
AI and Learning
Python 3.9+
PyTorch
Deep Q-Network (DQN)
Computer Vision
Ultralytics YOLOv8 for vehicle detection and classification
Traffic Simulation
Eclipse SUMO
TraCI API
Web Interface
Flask
HTML5
CSS3
JavaScript
Analytics
NumPy
Matplotlib
Key Features
Deep Reinforcement Learning Signal Control
A Deep Q-Network agent learns optimal traffic signal policies by interacting with the SUMO simulation environment. The objective is to minimize waiting time across all intersections while preventing traffic spillback.
Computer Vision Traffic Monitoring
Simulated camera feeds are processed using YOLOv8, which detects different types of road users such as cars, trucks, buses, bikes, and pedestrians. This information is used to estimate traffic load.
Emergency Vehicle Priority
The system includes logic to detect emergency vehicles such as ambulances and temporarily prioritize their routes by adjusting signal phases.
Environmental Impact Monitoring
The simulation also tracks metrics such as:
CO2 emissions
fuel consumption
acoustic noise levels
This helps evaluate the environmental impact of improved traffic flow.
Comparative Testing Mode
The dashboard includes a testing feature that compares traditional traffic control with the AI system.
Phase 1 – Baseline Simulation
A SUMO simulation runs with traditional fixed traffic timers.
Phase 2 – AI Optimization
A new isolated SUMO instance runs with the trained DQN agent controlling the signals.
The dashboard then visualizes differences in:
average waiting time
traffic flow efficiency
CO2 emissions
Repository
Top comments (0)