Smart City Traffic Flow Optimization using Reinforcement Learning
Smart City Traffic Flow Optimization using Reinforcement Learning
Dr Sanjiv Shukla¹, Mr.Darshan Rajendra Ahire², Bandi Ramteja³, Banala Nikhil Kumar Reddy⁴,Choppari Shoba Raju⁵, Gujjula Shiva Kumar Reddy⁶
¹Professor (HOD), Computer Science & Engineering, Sandip University, Nashik, Maharashtra, India
²Professor (Guide), Computer Science & Engineering, Sandip University, Nashik, Maharashtra, India
³⁴⁵⁶Scholar, Sandip University, Nashik, Maharashtra, India
Abstract:Urban traffic congestion is one of the most pressing challenges in modern smart city development. Conventional fixed-timer traffic signals fail to adapt to real-world traffic dynamics, causing unnecessary delays, increased fuel consumption, and elevated carbon emissions. This research paper presents a Smart Traffic Signal Control System that leverages computer vision, deep learning (YOLOv8 object detection), and reinforcement learning (Q-Learning) to dynamically allocate green-signal durations and optimize lane scheduling based on real-time vehicle density and type across four independent lanes. The system integrates a FastAPI backend with OpenCV-based video processing, a React.js real-time dashboard, a region-of-interest (ROI) based lane management module, and a Q-Learning agent for intelligent lane priority scheduling.Vehicle classes including cars, motorcycles, buses, trucks, and bicycles are weighted differently to compute proportional green-light timers, while the Q-Learning agent learns optimal lane activation sequences to minimize overall intersection waiting time. Experimental evaluations demonstrate average vehicle detection accuracy above 92% and green-time allocation efficiency improvements of up to 38% compared to fixed-cycle systems. The RL agent converges within 200 episodes and reduces average waiting time by an additional 15-22% over the baseline weighted model. The platform supports both live camera feeds and user-uploaded images, making it versatile for deployment in diverse real-world intersections.Keywords: YOLOv8, Computer Vision, OpenCV, Smart Traffic Signal, Vehicle Detection, FastAPI, React.js, Adaptive Traffic Control, Deep Learning, ROI Detection, Reinforcement Learning, Q-Learning, Smart City.