Building an AI-Powered Smart Traffic Management System with YOLO
Every morning on my way to work, I often notice the same problem on the road: traffic lights usually operate on fixed signal timings.
Building an AI-Powered Smart Traffic Management System with YOLO

Generated by GPT
Every morning on my way to work, I often notice the same problem on the road: traffic lights usually operate on fixed signal timings.
Sometimes, even when there are no cars moving in the green-light direction, the signal still stays green. Meanwhile, vehicles in the other direction have to wait unnecessarily. This kind of wasted time becomes even more obvious at intersections, where traffic conditions can change quickly.
That made me wonder:
What if traffic lights could understand the real-time situation on the road?
To explore this idea, I built an AI-powered smart traffic management system using computer vision. By detecting vehicles from traffic camera footage, the system can count cars in different directions and suggest better timing for changing traffic signals.
The goal of this project is simple: to reduce unnecessary waiting time and make traffic flow smarter using AI.
From Idea to Prototype
For this project, I decided to use YOLO v26 because it is both powerful and easy to work with. Since the goal was to detect vehicles from traffic footage in real time, YOLO was a natural choice for building the computer vision part of the system.
To speed up the development process, I also used **Codex to quickly turn my idea into working code. While building this project, I strongly felt that we are living in an era where ideas matter more than ever**. Once you have a clear idea, AI tools can help you test and implement it much faster than before.
However, building a smart traffic light system is not just about counting cars. There are several important design decisions to consider.
First, the system needs to decide the minimum green-light duration. If the traffic light changes too quickly, it can actually make traffic worse. For example, if the east-west direction has more cars now, but two seconds later the north-south direction becomes busier, the signal should not keep switching back and forth. That would create confusion and increase congestion.
Second, the system needs to decide which directions should be grouped together. At most intersections, traffic usually moves in two main groups:
North-South
East-West
So instead of treating every direction separately, I grouped the vehicle counts into these two traffic flows.
Another important issue is fairness. If the system only focuses on efficiency, one direction might keep getting the green light while the other direction waits too long. To prevent this, the system also needs a maximum green-light duration.
Finally, the system needs a rule for deciding when to switch signals. It should not change the light just because the red-light direction has one more car. That could actually reduce efficiency. Instead, the system should only recommend a signal change when the number of waiting vehicles is clearly higher than the current green-light direction.
In short, a smart traffic light system needs to balance:
real-time vehicle count minimum green-light time maximum green-light time direction grouping signal switching threshold
These rules make the system more stable, practical, and closer to how real traffic control should work.
Github Link
My Github : https://github.com/TCK2001
Code and Implementation
If you want to see the full implementation, you can click the GitHub link below or visit my GitHub repository directly.
I wrote the setup guide and execution steps in the project’s **README**, so you can follow the instructions there to run the system on your own machine.
Now, let’s move on to the most important part:
Let’s See the Results!

0 ~ 7 sec NS Green light, EW Red light
Change to EW Green Light, NS Red Light (20 sec — 7 sec = Gain 13 sec)

If you have any questions, feel free to leave a comment or send me an email.
Thank you for reading !
YOLOOOOOOOOOOOOOOOOOOOOOOOOOOO
Other YOLO Projects
[embed]Custom DataSet in YOLO V8 ! Let’s use a custom Dataset to Training own YOLO model !medium.com
메타데이터
- post_id
- b1365683045a
- slug
- building-an-ai-powered-smart-traffic-management-system-with-yolo-b1365683045a
- url
- https://medium.com/@hichengkang/building-an-ai-powered-smart-traffic-management-system-with-yolo-b1365683045a
- canonical_url
- https://medium.com/@hichengkang/building-an-ai-powered-smart-traffic-management-system-with-yolo-b1365683045a
- author_url
- https://medium.com/@hichengkang
- status
- ok
- fetched_at
- 2026-06-09 15:37:30