🚦 SmartTraffic AI: Intelligent Intersection Management Python Streamlit Reinforcement Learning

SmartTraffic AI is a data-driven simulation project that uses Reinforcement Learning (Q-Learning) to optimize traffic signal timing. By dynamically adapting to real-time vehicle density, the AI system significantly reduces commuter waiting time compared to traditional fixed-timer signals.

🚀 The Core Problem Traditional traffic lights operate on fixed intervals, regardless of actual traffic flow. This leads to:

Unnecessary idling at empty intersections. Gridlock during sudden traffic spikes. Increased carbon emissions due to constant stopping and starting. The Solution: An AI agent that "sees" the intersection and prioritizes lanes with the highest congestion, clearing traffic pulses before they turn into jams.

✨ Key Features 🤖 Q-Learning Agent: An RL model that learns optimal switching policies through thousands of simulated episodes. 📈 Live Visualizer: A high-performance Streamlit dashboard showing side-by-side comparisons of "Old System" vs "AI System." 🌪️ Realistic Scenarios: Test the AI against Rush Hour (N-S/E-W), Random Spikes, and Normal balanced flow. 📊 Performance Metrics: Real-time tracking of Total Waiting Time, Average Delay, and Max Queue Length. 🚦 Dynamic Congestion Bars: Visual "pressure gauges" that color-code lane status (Green → Orange → Red).

Built With

Share this project:

Updates