Skip to content

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.

Hannah

Published December 24, 2025

Original author: Hoang LongOriginal source (new tab)

Intelligent Traffic Light Control System using Deep Q-Learning (DQN)

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

System Diagram

Hardware Diagram

Hardware Components

ComponentRole
Raspberry Pi PicoLocal traffic signal controller
WIZnet W5500 LiteWired Ethernet communication
74HC595LED signal expansion
Traffic Light LEDsPhysical signal output

Solution

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

System Overview

DQN Approaches Comparison

We developed and compared two DQN-based approaches to identify the optimal strategy for traffic signal control:

1. DQN-GreenWave (Green Wave Approach) โญ Recommended

DQN-GreenWave Architecture

2. DQN-Baseline (Baseline Approach)

Differences from DQN-GreenWave

  • 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

Use Case

  • Serves as experimental baseline for performance comparison
  • Suitable for isolated intersections without coordination needs

๐Ÿ“Š Performance Comparison

Performance Comparison Chart

MetricDQN-GreenWaveDQN-BaselineImprovement
Average Waiting Time (s)21.2814.07โœ… -33.9%
Average Speed (m/s)2.872.36โœ… +17.6%
Green Wave Efficiency82.5%64.3%โœ… +18.2%

Testing Scenarios

  • โœ… Low Traffic: Both perform well, GreenWave slightly better
  • โœ… Medium Traffic: GreenWave shows clear advantage
  • โœ… High Traffic: GreenWave significantly outperforms baseline

 

DQN Approaches Comparison

Deployment (GUI Application)

Real-Time Monitoring
Camera Monitoring

Traffic Control Modes

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

ComponentRole
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 ๊ธฐ๋ฐ˜ ์ ‘๊ทผ ๋ฐฉ์‹์„ ๊ฐœ๋ฐœํ•˜๊ณ  ๋น„๊ตํ–ˆ์Šต๋‹ˆ๋‹ค.

1. DQN-GreenWave (๊ทธ๋ฆฐ์›จ์ด๋ธŒ ์ ‘๊ทผ๋ฒ•) โญ ์ถ”์ฒœ

DQN-๊ทธ๋ฆฐ์›จ์ด๋ธŒ ์•„ํ‚คํ…์ฒ˜

2. DQN-๊ธฐ์ค€์„  (๊ธฐ์ค€์„  ์ ‘๊ทผ๋ฒ•)

DQN-GreenWave์™€์˜ ์ฐจ์ด์ 

  • ๋ณด๋‹ค ๊ฐ„์†Œํ™”๋œ ์ƒํƒœ ํ‘œํ˜„ (์ด๋™ ์‹œ๊ฐ„์— ์ดˆ์ ์„ ๋งž์ถ”์ง€ ์•Š์Œ)
  • ๋‹จ์ผ ์ถœ๋ ฅ ํ–‰๋™ ๊ณต๊ฐ„(์ด์‚ฐ ํ–‰๋™๋“ค์˜ ๊ฒฐํ•ฉ)
  • ๋ณด์ƒ์€ ๊ฐœ๋ณ„ ๊ต์ฐจ์  ์ตœ์ ํ™” ์— ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค.
  • ๋…น์ƒ‰ ๋ฌผ๊ฒฐ์— ๋Œ€ํ•œ ๋ช…์‹œ์ ์ธ ํ˜‘๋ ฅ์€ ์—†์—ˆ๋‹ค.

์‚ฌ์šฉ ์‚ฌ๋ก€

  • ์„ฑ๋Šฅ ๋น„๊ต๋ฅผ ์œ„ํ•œ ์‹คํ—˜ ๊ธฐ์ค€์„  ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
  • ์กฐ์ •์ด ํ•„์š” ์—†๋Š” ๋…๋ฆฝ๋œ ๊ต์ฐจ๋กœ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Š ์„ฑ๋Šฅ ๋น„๊ต

์„ฑ๋Šฅ ๋น„๊ต ์ฐจํŠธ

๋ฏธํ„ฐ๋ฒ•DQN-๊ทธ๋ฆฐ์›จ์ด๋ธŒDQN-๊ธฐ์ค€์„ ๊ฐœ์„ 
ํ‰๊ท  ๋Œ€๊ธฐ ์‹œ๊ฐ„(์ดˆ)21.2814.07โœ… -33.9%
ํ‰๊ท  ์†๋„ (m/s)2.872.36โœ… +17.6%
๊ทธ๋ฆฐ ์›จ์ด๋ธŒ ํšจ์œจ์„ฑ82.5%64.3%โœ… +18.2%

ํ…Œ์ŠคํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค

  • โœ… ๊ตํ†ต๋Ÿ‰์ด ์ ์„ ๋•Œ : ๋‘ ์ œํ’ˆ ๋ชจ๋‘ ์„ฑ๋Šฅ์ด ์šฐ์ˆ˜ํ•˜๋ฉฐ, GreenWave๊ฐ€ ์•ฝ๊ฐ„ ๋” ์ข‹์Šต๋‹ˆ๋‹ค.
  • โœ… ์ค‘๊ฐ„ ๊ทœ๋ชจ ๊ตํ†ต๋Ÿ‰ : GreenWave๊ฐ€ ํ™•์‹คํ•œ ์šฐ์œ„๋ฅผ ๋ณด์ž…๋‹ˆ๋‹ค
  • โœ… ๋†’์€ ํŠธ๋ž˜ํ”ฝ : GreenWave๋Š” ๊ธฐ์ค€์„  ๋Œ€๋น„ ํ›จ์”ฌ ๋›ฐ์–ด๋‚œ ์„ฑ๋Šฅ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

 

DQN ์ ‘๊ทผ ๋ฐฉ์‹ ๋น„๊ต (์ฐธ๊ณ )

๋ฐฐํฌ (GUI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜)

์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง
์นด๋ฉ”๋ผ ๋ชจ๋‹ˆํ„ฐ๋ง

๊ตํ†ต ์ œ์–ด ๋ชจ๋“œ

์ž๋™ ๋ชจ๋“œ(AI ์ œ์–ด)

  • DQN ๋ชจ๋ธ์€ ๋งค ์ฃผ๊ธฐ๋งˆ๋‹ค ๊ฒฐ์ •์„ ๋‚ด๋ฆฝ๋‹ˆ๋‹ค.
  • ์‹ค์‹œ๊ฐ„ ์ฐจ๋Ÿ‰ ๋Œ€์ˆ˜์— ๋”ฐ๋ฅธ ์—…๋ฐ์ดํŠธ
  • ๊ตํ†ต ๋ฐ€๋„ ๋ณ€ํ™”์— ์ ์‘ํ•ฉ๋‹ˆ๋‹ค

์ˆ˜๋™ ๋ชจ๋“œ

  • AI์˜ ๊ฒฐ์ •์„ ์žฌ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ์ž ์ง€์ • ์‚ฌ์ดํด ๊ธธ์ด ๋ฐ ๋…น์ƒ‰ ์‹œ๊ฐ„ ์„ค์ •
  • ํŠน๋ณ„ ํ–‰์‚ฌ ๋น„์ƒ ํ†ต์ œ

Comments

Comments