Inspiration

Urban traffic congestion is one of the most common and frustrating problems in modern cities. Traditional traffic signals operate on fixed timers, which fail to adapt to real-time traffic conditions. This leads to unnecessary waiting, longer queues, and inefficient traffic flow.

We wanted to explore how Artificial Intelligence can make traffic systems smarter, more adaptive, and efficient—moving toward the vision of autonomous smart cities.


What it does

Our project is an AI-powered traffic signal optimization system that dynamically adjusts traffic lights based on real-time traffic conditions.

Instead of fixed timing, the system:

  • Analyzes traffic density across multiple lanes
  • Prioritizes the most congested directions
  • Continuously adapts signal timings

It also provides a side-by-side comparison between:

  • Traditional fixed-timing system
  • AI-based adaptive system

This makes the impact of AI visually clear and measurable.


How we built it

We built the system using a combination of simulation, machine learning, and interactive visualization:

  • Traffic Simulation
    A custom simulation models a 4-way intersection with dynamic vehicle flow.

  • AI Model
    A Reinforcement Learning-based approach where:

    • State → traffic density in each lane
    • Action → signal decision (which direction gets green)
    • Reward → minimizing total waiting time
  • Frontend (UI)
    Built using Streamlit to create a clean and interactive dashboard that displays:

    • Traffic conditions
    • Signal decisions
    • Performance comparison
  • Visualization
    Real-time traffic bars and metrics make the system intuitive and easy to understand.


Challenges we ran into

  • Designing a reward function that improves traffic flow instead of causing unstable behavior
  • Balancing simplicity and realism in the simulation
  • Making the UI understandable for non-technical users
  • Ensuring the AI consistently performs better than the baseline system
  • Avoiding overly complex visuals while still showing meaningful differences

Accomplishments that we're proud of

  • Successfully built a fully working AI-driven traffic optimization system
  • Achieved significant reduction in traffic waiting time in simulation
  • Created a clean and beginner-friendly UI
  • Demonstrated a practical smart city use case with scalability potential
  • Delivered a project that balances technical depth and usability

What we learned

  • Applying Reinforcement Learning to real-world optimization problems
  • Importance of clear visualization in AI systems
  • Balancing performance, simplicity, and usability
  • How UI design impacts understanding of complex systems
  • Building end-to-end systems from simulation to user interface

What's next for AI Traffic Signal Optimization System

  • Extend to multi-intersection and city-wide optimization
  • Integrate real-time traffic data using IoT sources
  • Add emergency vehicle prioritization
  • Upgrade to advanced models like Deep Q-Networks
  • Add map-based real-world visualization
  • Deploy as a scalable smart city service

Built With

Share this project:

Updates