Intelligent Traffic Light Control System using Deep Q-Learning (DQN)
An AI-powered traffic management system that optimizes multi-intersection signal timing using Deep Q-Network (DQN) and real-time vehicle detection.
0
Project description
<ENG>
Intelligent Traffic Light Control System
AI-Based Multi-Intersection Signal Optimization Using Deep Reinforcement Learning
Project Overview
The Intelligent Traffic Light Control System is an AI-powered traffic management solution that optimizes signal timing across multiple intersections using Deep Reinforcement Learning (DQN) and real-time vehicle detection.
Problem Statement
Traditional fixed-time traffic signals cannot adapt to dynamic traffic conditions, resulting in:
- Long waiting times during peak hours
- Poor coordination between adjacent intersections
- Inefficient green wave progression
Unlike traditional fixed-time traffic lights, this system dynamically adapts to changing traffic conditions and coordinates adjacent intersections to form an efficient Green Wave, reducing congestion and waiting time.
Key Highlights
- Simulation-based training with real-world deployment
- Centralized GUI for multi-intersection control
- Stable Ethernet-based IoT communication using WIZnet W5500
Hardware Components
| Component | Role |
|---|---|
| Raspberry Pi Pico | Local traffic signal controller |
| WIZnet W5500 Lite | Wired Ethernet communication |
| 74HC595 | LED signal expansion |
| Traffic Light LEDs | Physical signal output |
A DQN-based adaptive traffic control system that:
- Learns optimal signal timing policies through simulation
- Adapts to real-time traffic conditions using camera-based vehicle detection
- Coordinates multiple intersections for smooth green wave progression
- Deploys on a real-world GUI with hardware integration
We developed and compared two DQN-based approaches to identify the optimal strategy for traffic signal control:
- Simpler state representation (no travel time focus)
- Single-output action space (combined discrete actions)
- Reward focuses on individual intersection optimization
- No explicit green wave coordination
- Serves as experimental baseline for performance comparison
- Suitable for isolated intersections without coordination needs
| Metric | DQN-GreenWave | DQN-Baseline | Improvement |
|---|---|---|---|
| Average Waiting Time (s) | 21.28 | 14.07 | โ -33.9% |
| Average Speed (m/s) | 2.87 | 2.36 | โ +17.6% |
| Green Wave Efficiency | 82.5% | 64.3% | โ +18.2% |
- โ Low Traffic: Both perform well, GreenWave slightly better
- โ Medium Traffic: GreenWave shows clear advantage
- โ High Traffic: GreenWave significantly outperforms baseline

Deployment (GUI Application)
Real-Time Monitoring
Auto Mode (AI-Controlled)
- DQN model makes decisions every cycle
- Updates based on real-time vehicle counts
- Adapts to traffic density changes
Manual Mode
- Override AI decisions
- Set custom cycle length and green times
- Emergency control for special events
<KOR>
Intelligent Traffic Light Control System
Deep Q-Network(DQN) ๊ธฐ๋ฐ ๋ค์ค ๊ต์ฐจ๋ก ์ ํธ ์ต์ ํ ์์คํ
Project Overview
Intelligent Traffic Light Control System์ Deep Q-Network(DQN) ๊ณผ ์ค์๊ฐ ์ฐจ๋ ์ธ์(YOLO) ์ ๊ฒฐํฉํ์ฌ ๋ค์ค ๊ต์ฐจ๋ก ์ ํธ๋ฅผ ์๋์ผ๋ก ์ต์ ํํ๋ AI ๊ธฐ๋ฐ ๊ตํต ์ ์ด ์์คํ ์ ๋๋ค.
DQN์ ๊ตํต ์๋ฎฌ๋ ์ด์ ์์ ์ ํธ ์ ์ด๋ฅผ ๋ฐ๋ณต์ ์ผ๋ก ์ฐ์ตํ๋ฉฐ, ๊ฐ์ฅ ํจ์จ์ ์ธ ์ ํธ ํ์ด๋ฐ์ ์ค์ค๋ก ํ์ตํ๋ AI ์๊ณ ๋ฆฌ์ฆ์ ๋๋ค.
๋ฌธ์ ์ ๊ธฐ
๊ธฐ์กด์ ๊ณ ์ ์๊ฐ ์ ํธ๋ฑ์ ์ญ๋์ ์ธ ๊ตํต ์ํฉ์ ์ ์ํ ์ ์์ด ๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค.
- ํผํฌ ์๊ฐ๋์๋ ๋๊ธฐ ์๊ฐ์ด ๊ธธ์ด์ง๋๋ค.
- ์ธ์ ๊ต์ฐจ๋ก ๊ฐ์ ์กฐ์ ๋ถ์กฑ
- ๋นํจ์จ์ ์ธ ๋ น์ ๋ฌผ๊ฒฐ ์งํ
๊ธฐ์กด ๊ณ ์ ์ ํธ ๋ฐฉ์์ ํ๊ณ๋ฅผ ๊ทน๋ณตํ๊ณ ,
์ค์๊ฐ ๊ตํต ์ํฉ์ ์ ์ํ๋ฉฐ Green Wave(์ฐ์ ๋
น์ ์ ํธ) ๋ฅผ ํ์ฑํ๋ ๊ฒ์ด ํต์ฌ ๋ชฉํ์
๋๋ค.
๋ฌด๊ฑฐ์ด AI ์ฐ์ฐ (DQN + YOLO) -> PC / Jetson Nano / Edge Device ์์ ์ฒ๋ฆฌ ํ
Pico + Ethernet(W5500)์ผ๋ก ๊ฒฐ๊ณผ ๋ช ๋ น ์์ ํ ์ ์ดํ์ฌ, AI ์ฐ์ฐ๊ณผ ํ๋์จ์ด ์ ์ด ๋ถ๋ฆฌํ์ฌ ์์ ์ ํต์ ์ ๊ตฌํํ์ต๋๋ค.
Hardware Components
| Component | Role |
|---|---|
| Raspberry Pi Pico | ๊ฐ ๊ต์ฐจ๋ก ์ ํธ ์ ์ด MCU |
| WIZnet W5500 Lite | ์ ์ Ethernet ํต์ |
| 74HC595 | ๋ค์ค LED ์ ํธ ์ ์ด |
| Traffic Light LEDs | ์ค์ ์ ํธ ์ถ๋ ฅ |
DQN ๊ธฐ๋ฐ ์ ์ํ ๊ตํต ์ ์ด ์์คํ ์ ๋ค์๊ณผ ๊ฐ์ ํน์ง์ ๊ฐ์ต๋๋ค.
- ์๋ฎฌ๋ ์ด์ ์ ํตํด ์ต์ ์ ์ ํธ ํ์ด๋ฐ ์ ์ฑ ์ ํ์ตํฉ๋๋ค.
- ์นด๋ฉ๋ผ ๊ธฐ๋ฐ ์ฐจ๋ ๊ฐ์ง๋ฅผ ์ฌ์ฉํ์ฌ ์ค์๊ฐ ๊ตํต ์ํฉ์ ๋ง์ถฐ ์๋ํฉ๋๋ค .
- ์ํํ ๋ น์ ์ ํธ ์งํ์ ์ํด ์ฌ๋ฌ ๊ต์ฐจ๋ก์ ์ขํ ๋ฅผ ์กฐ์ ํฉ๋๋ค .
- ํ๋์จ์ด ํตํฉ์ ํตํด ์ค์ GUI์ ๋ฐฐํฌ๋ฉ๋๋ค .
Intelligent Traffic Light Control System์ AI ํ์ต ๋จ๊ณ์ ์ค์ ๋ฐฐํฌ ๋จ๊ณ๋ฅผ
๋ ๊ฐ์ Phase๋ก ๋๋์ด ๋ณด์ฌ์ค๋๋ค.
Phase 1 : AI ํ์ต ๋จ๊ณ
- SUMO(Simulation of Urban Mobility) ๋ ์ค์ ๋๋ก์ ์ ์ฌํ ํ๊ฒฝ์ ๋ง๋ค์ด์ฃผ๋ ๊ตํต ์๋ฎฌ๋ ์ดํฐ
- DQN์ SUMO ํ๊ฒฝ์์ ์ ํธ๋ฅผ ๋ฐ๊ฟ๋ณด๋ฉฐ ๊ฒฐ๊ณผ๋ฅผ ๊ด์ฐฐํ๋ ๋ฐฉ์์ผ๋ก ํ์ต
- ๋๊ธฐ ์๊ฐ์ด ์ค์ด๋ค๋ฉด ๋ณด์์ ๋ฐ๊ณ ํผ์ก์ด ๋ฐ์ํ๋ฉด ํจ๋ํฐ๋ฅผ ๋ฐ์ผ๋ฉด์ ์ ์ ๋ ๋์ ์ ํธ ์ ์ด ์ ๋ต์ ํ์ต
- ์ด ๋จ๊ณ์ ๊ฒฐ๊ณผ๋ก ๊ฐ์ฅ ์ฑ๋ฅ์ด ์ข์ DQN ๋ชจ๋ธ(Best DQN Model) ์ด ์์ฑ
PHASE 2: Deployment ํ์ต์ด ๋๋ AI๋ฅผ ์ค์ ์์คํ ์ ์ ์ฉํ๋ ๋จ๊ณ
- ์นด๋ฉ๋ผ ์ ๋ ฅ์ ํตํด YOLO ๋ชจ๋ธ์ด ์ฐจ๋์ ์ค์๊ฐ์ผ๋ก ํ์ง -> ๊ฐ ๋ฐฉํฅ๋ณ ์ฐจ๋ ๋์(vehicle counts) ๊ฐ ๊ณ์ฐ
- TomTom API๋ฅผ ํตํด ๋๋ก ์๋, ํผ์ก ์ ๋ณด, ์ฌ๊ณ ๋ฐ์ดํฐ๋ฅผ ์์ง
- Green Wave Engine + DQN Model
- YOLO์์ ๋ฐ์ ์ฐจ๋ ์
- TomTom API์ ์๋ ์ ๋ณด
- ํ์ต๋ DQN ๋ชจ๋ธ
- ์ธ ๊ฐ์ง๋ฅผ ๊ฒฐํฉํ์ฌ ์ ํธ ์ฃผ๊ธฐ, ๋ น์ ์๊ฐ, ์งํ ๋ฐฉํฅ์ ๊ฒฐ์
- ๊ฒฐ์ ๋ ๊ฒฐ๊ณผ๊ฐ์ W5500์ ํตํด Pico๋ก ์ ๋ฌ
- ์ฃผ๋ณ ๊ต์ฐจ๋ก(A, B, C, D)๊ฐ ํจ๊ป ์ ์ด
DQN ์ ๊ทผ ๋ฐฉ์ ๋น๊ต (์ฐธ๊ณ )
๋ณธ ์ฐ๊ตฌ์์๋ ๊ตํต ์ ํธ ์ ์ด๋ฅผ ์ํ ์ต์ ์ ์ ๋ต์ ํ์ ํ๊ธฐ ์ํด ๋ ๊ฐ์ง DQN ๊ธฐ๋ฐ ์ ๊ทผ ๋ฐฉ์์ ๊ฐ๋ฐํ๊ณ ๋น๊ตํ์ต๋๋ค.
- ๋ณด๋ค ๊ฐ์ํ๋ ์ํ ํํ (์ด๋ ์๊ฐ์ ์ด์ ์ ๋ง์ถ์ง ์์)
- ๋จ์ผ ์ถ๋ ฅ ํ๋ ๊ณต๊ฐ(์ด์ฐ ํ๋๋ค์ ๊ฒฐํฉ)
- ๋ณด์์ ๊ฐ๋ณ ๊ต์ฐจ์ ์ต์ ํ ์ ์ค์ ์ ๋ก๋๋ค.
- ๋ น์ ๋ฌผ๊ฒฐ์ ๋ํ ๋ช ์์ ์ธ ํ๋ ฅ์ ์์๋ค.
- ์ฑ๋ฅ ๋น๊ต๋ฅผ ์ํ ์คํ ๊ธฐ์ค์ ์ญํ ์ ํฉ๋๋ค.
- ์กฐ์ ์ด ํ์ ์๋ ๋ ๋ฆฝ๋ ๊ต์ฐจ๋ก์ ์ ํฉํฉ๋๋ค.
| ๋ฏธํฐ๋ฒ | DQN-๊ทธ๋ฆฐ์จ์ด๋ธ | DQN-๊ธฐ์ค์ | ๊ฐ์ |
|---|---|---|---|
| ํ๊ท ๋๊ธฐ ์๊ฐ(์ด) | 21.28 | 14.07 | โ -33.9% |
| ํ๊ท ์๋ (m/s) | 2.87 | 2.36 | โ +17.6% |
| ๊ทธ๋ฆฐ ์จ์ด๋ธ ํจ์จ์ฑ | 82.5% | 64.3% | โ +18.2% |
- โ ๊ตํต๋์ด ์ ์ ๋ : ๋ ์ ํ ๋ชจ๋ ์ฑ๋ฅ์ด ์ฐ์ํ๋ฉฐ, GreenWave๊ฐ ์ฝ๊ฐ ๋ ์ข์ต๋๋ค.
- โ ์ค๊ฐ ๊ท๋ชจ ๊ตํต๋ : GreenWave๊ฐ ํ์คํ ์ฐ์๋ฅผ ๋ณด์ ๋๋ค
- โ ๋์ ํธ๋ํฝ : GreenWave๋ ๊ธฐ์ค์ ๋๋น ํจ์ฌ ๋ฐ์ด๋ ์ฑ๋ฅ์ ๋ณด์ฌ์ค๋๋ค.

๋ฐฐํฌ (GUI ์ ํ๋ฆฌ์ผ์ด์ )
์ค์๊ฐ ๋ชจ๋ํฐ๋ง
๊ตํต ์ ์ด ๋ชจ๋
์๋ ๋ชจ๋(AI ์ ์ด)
- DQN ๋ชจ๋ธ์ ๋งค ์ฃผ๊ธฐ๋ง๋ค ๊ฒฐ์ ์ ๋ด๋ฆฝ๋๋ค.
- ์ค์๊ฐ ์ฐจ๋ ๋์์ ๋ฐ๋ฅธ ์ ๋ฐ์ดํธ
- ๊ตํต ๋ฐ๋ ๋ณํ์ ์ ์ํฉ๋๋ค
์๋ ๋ชจ๋
- AI์ ๊ฒฐ์ ์ ์ฌ์ ์ํฉ๋๋ค.
- ์ฌ์ฉ์ ์ง์ ์ฌ์ดํด ๊ธธ์ด ๋ฐ ๋ น์ ์๊ฐ ์ค์
- ํน๋ณ ํ์ฌ ๋น์ ํต์



