Problem Dashboard DB Schema Analytics Architecture Corridor Research Results FAQ Contact
PBL PROJECT · TEAM 1 · 22CSE43 v3

Smart Cities: Intelligent
Traffic
Management

An AI-powered Cognitive Traffic Management System combining Deep Q-Network RL, YOLOv8 detection, and Apache Kafka streaming — cutting wait times by 40% and emergency response by 50%.

DQN AI YOLOv8 Kafka CEP Redis <10μs PostgreSQL
0%
Wait Reduction
0%
Faster EMS
<10μs
DB Latency
0
Intersections
CTMS
Cognitive Traffic Management System
LIVE
18.3s
Avg Wait
4,821
Veh/hr
0.872
DQN Q
SubjectDatabase Management System
Code22CSE43
SectionB · IV Semester · CSE
Team1 of 22CSE43
J
Joel Ryan Bangera
4S024CS098
J
Jovin Sequeira
4S024CS100
K
Keshav Aditiya
4S024CS103
L
Loyston Leon D Souza
4S024CS135
🧠 DQN ResNet-18
🚨 Emergency Override
⚡ <10μs Redis
Scroll to explore
The Problem

Why Static Signals Fail Cities

Urban transportation networks are strained by population growth and aging infrastructure. Timer-based systems can't adapt to real-time conditions — creating congestion, emissions, and delayed emergency responses.

01
Inefficient Static Timing
Fixed green-light cycles ignore real-time traffic density, leading to unnecessary wait times and gridlock during peak hours or unexpected surges.
02
🚑
Emergency Vehicle Delay
Ambulances and fire trucks are trapped behind standard red lights for up to 10 minutes — directly impacting life-threatening response times.
03
🏚
Siloed Infrastructure
Traffic, emergency, and public-works departments operate in data silos with no shared platform — preventing coordinated city-wide responses.
04
High Latency Decisions
Manual operator monitoring introduces minutes of delay before any action. Cities need sub-second automated decision-making at scale.
05
🌊
Cascading Gridlock
One blocked intersection triggers a domino effect across corridors — phantom jams spreading system-wide with no predictive mechanism to stop them.
Live Simulation

CTMS Dashboard

Real-time simulation of 9 intersections powered by Deep Q-Network AI, YOLO detection, and Kafka stream processing. Toggle the heatmap view, click any intersection for details, or trigger an emergency.

Tip: click any intersection for details
Avg Wait Time
18.3 sec
↓ 35.2% vs static timers
🚦
Vehicle Throughput
4,821 /hr
↑ 40.1% vs baseline
🚑
Emergency Response
2.4 min
↓ 51.3% improvement
🌱
CO₂ Avoided
28.7 %
↓ Idle emissions saved
Intersection Grid
DQN ACTIVE
Throughput (vehicles/hr)
LIVE
CEP Event Stream
0 events
AI Control Engine
ONLINE
Deep Q-Network
87%
CUMULATIVE REWARD
+0.872
Episode 14,392 · ε=0.05
Status● INFERENCE
ArchitectureDQN ResNet-18
Decision Rate47 dec/s
Horizonγ=0.99 · T+30s
Digital Twin● SYNC
YOLO v8 Detection
Kafka + ksqlDB
Active Topics9
Msg Rate2,840/s
CEP Patterns12 loaded
Redis Latency6.2μs
Floodgates● READY
Emergency Override
Database Design

Relational Schema

Normalized to 3NF. PostgreSQL with B-Tree & BRIN indexing, time-based partitioning on sensor telemetry, and Redis for in-memory edge-cache of live intersection state.

Live Analytics

System Analytics

Real-time performance metrics, DQN convergence tracking, and intersection load distribution — updated every simulation cycle.

System KPIs
LIVE
Avg Queue Length8.3 veh
Phase Switches/min14.2
Green Wave ActiveA1→A2→A3
Floodgate Triggers3 today
DQN Loss0.0142
Replay Buffer48K/50K
Uptime99.97%
DB Queries/s1,240
Throughput Trend
Peak Today5,842 veh/hr
Avg Today4,756 veh/hr
vs Baseline+40.1%
DQN Convergence
87% CONVERGED
Episodes14,392
Epsilonε = 0.05
Learning Rateα = 0.001
Discountγ = 0.99
System Design

Technical Architecture

A layered system combining edge computing, in-memory databases, reinforcement learning, and stream processing — purpose-built for sub-second urban mobility decisions.

🔌
IoT Sensor Layer
Inductive loop sensors, radar units, and cameras capture raw vehicle counts, speeds, and visual feeds as input to the AI pipeline.
Inductive LoopsRADARIP CamerasEdge Nodes
Redis In-Memory Cache
All intersection state is held in a Redis edge cache, guaranteeing <10μs state access latency — critical for real-time AI inference in safety-critical infrastructure.
RedisACIDEdge Computing<10μs
🧠
Deep Q-Network
Trained via RL on a digital twin. Learns optimal green-phase policies maximizing cumulative throughput — extending green waves for arterials during peak hours.
DQNRLDigital Twinγ=0.99
👁
YOLO Object Detection
YOLOv8 processes live camera feeds to classify road users. Ambulance detection triggers an instant priority override, clearing a corridor while ignoring standard rules.
YOLOv8CVGPU EdgeOverride
🌊
Complex Event Processing
Kafka and ksqlDB monitor streams from all intersections. Detects density patterns like "two intersections >90% within 30s" and fires the floodgate protocol before gridlock forms.
Apache KafkaksqlDBCEPFloodgate
Green Wave Planner

Corridor Planning

Visualize and plan green-wave corridors across the 3×3 intersection grid. Click two intersections to plan a path and calculate estimated travel time improvement.

Select Origin → Destination
Corridor Analysis
StatusSelect origin & destination
Path
Hops
Est. Travel Time
Green Wave Gain
Avg Density
Recommended Phase
Green Wave Path   Emergency Path   Selected Node
Secondary Research

Research Summary

Five key research areas explored during the secondary research phase, covering comparative algorithms, benchmarking, stream processing, ethics, and environmental impact.

R1
DQN vs Traditional Adaptive Algorithms
Comparative analysis from Pittsburgh (SCATS) and Los Angeles (ATCS) quantifying throughput improvements when replacing rule-based systems with Deep RL models optimizing long-term horizon rewards over immediate queue clearance.
R2
In-Memory DB Benchmarking at the Edge
Investigating latency trade-offs between Redis and Hazelcast in edge-based traffic controllers — balancing ACID compliance against the microsecond latency required for real-time AI inference in safety-critical systems.
R3
Stream Processing for Predictive Congestion
How CEP engines (ksqlDB, Flink) detect phantom jams using the Lighthill-Whitham-Richards model integrated with Kafka streams, predicting congestion 5 minutes ahead based on density fluctuations.
R4
Ethical Implications of AI Priority Overrides
Social equity study on AI-controlled intersections — focusing on algorithmic bias risks that could deprioritize low-income zones during optimization, referencing U.S. DoT ethical AI guidelines.
R5
Energy vs Throughput Trade-offs
Analysing whether CO₂ reductions from minimized idling justify the higher energy consumption of edge GPUs for YOLO inference and constant Kafka data streaming infrastructure in smart cities.
Key References
🔬
AI for Intersection Congestion — Istanbul & Helsinki
ResearchGate · Tackling intersection congestion using AI
📡
Distributed Traffic Signal Control using DQN
TRID Database · Deep Q-Network Traffic Signal Models
🏥
YOLOv8-Driven Emergency Vehicle Detection
IEEE · Computer Vision for Emergency Response Priority
Design Thinking

Empathy Map

Understanding the lived experience of traffic management authorities, transportation engineers, commuters, and emergency responders who deal with inefficient traffic systems every day.

👮
City Traffic Management Authority
Traffic Control Centre Operator · Transportation Engineer · Emergency Dispatcher
Thinks & Feels
Inner World
  • Fear of gridlock paralysing the city during peak hours
  • Anxiety that an ambulance gets stuck and a life is lost
  • Pressure from city officials after traffic disruptions
  • Dream of a system that "thinks, not just clicks"
Does
Observable Actions
  • Manually monitors video walls to spot congestion
  • Reactively overrides fixed timers during incidents
  • Coordinates with field officers via radio
  • Files incident reports and manually logs anomalies
Hears
Information Sources
  • Colleagues praising Pittsburgh's Surtrac — 25% reduction
  • ITS World Congress talks on RL for signal control
  • Angry citizen complaints after severe disruptions
  • IEEE ITS publications on smart mobility
Says
Expressed Frustrations
  • "Outdated timer-based systems can't handle rush hour"
  • "Gridlock spreads like wildfire — domino effect"
  • "Ambulances stuck 10 minutes at red lights"
  • "Wasted taxpayer money on fuel burned at intersections"
Sees
Environment
  • Video walls with live camera feeds and dashboards
  • Aging static traffic controllers installed decades ago
  • Emerging AI systems like Surtrac in other cities
  • Smart city IoT sensor deployments gaining traction
Pains
Key Frustrations
  • Inflexible legacy systems that cannot adapt in real-time
  • No visibility into emerging congestion before it hits
  • Emergency vehicle delays due to inability to override cycles
  • Data silos between traffic, emergency, and public works
Gains
Desired Outcomes
  • Emergency priority systems cutting response by 40–50%
  • Predictive congestion prevention before gridlock forms
  • Reduced emissions from minimised idling
  • Peace of mind — reliable, intelligent, autonomous control
Needs To Do
Core Tasks
  • Optimise traffic flow dynamically beyond static timers
  • Detect and respond to accidents and emergencies in real-time
  • Prevent cascading congestion across corridors
  • Reduce vehicle idle time and emissions at red lights
◈ Key Insight
Design Opportunity
  • Operators need a system that is predictive, not reactive
  • Emergency override must be automatic — not manual
  • Sub-second latency is a hard safety requirement, not a preference
  • Trust in the AI depends on explainability and reliability
Expected Results

Performance Outcomes

Projected improvements based on secondary research from comparable AI traffic deployments in Pittsburgh, Los Angeles, Istanbul, and Helsinki.

📊 System Improvements
Avg Wait Time Reduction40%
Emergency Response Improvement50%
Vehicle Throughput Gain41%
CO₂ Emission Reduction28%
DQN Policy Accuracy87%
⚡ Technical Benchmarks
<10μs
Redis State Access
Edge cache latency
<1s
End-to-End Decision
Sensor → signal
99.8%
Ambulance Detection
YOLO confidence
5 min
Congestion Prediction
CEP lookahead
14K+
DQN Episodes
Training on digital twin
2.8K
Kafka Msgs/sec
Stream throughput
FAQ

Frequently Asked Questions

Everything judges, faculty, and curious engineers usually ask about how CTMS works under the hood.

A Deep Q-Network (DQN) agent continuously observes the live state of each intersection — lane densities, queue lengths, current phase, and elapsed green time — and picks the action with the highest learned Q-value: extend the current green, switch phases, or trigger a corridor-level green wave. The policy was trained for 14,000+ episodes on a digital-twin simulation before deployment, so every decision happens in under one second with no human in the loop.

CTMS uses a polyglot persistence strategy: PostgreSQL is the ACID-compliant relational core (normalized to 3NF) storing intersections, sensors, readings, signal phases, detections and DQN decisions, with B-Tree and BRIN indexing plus time-based partitioning for high-volume telemetry. Redis serves as a sub-10μs in-memory edge cache for live intersection state, and Apache Kafka + ksqlDB handle real-time stream ingestion and complex event processing.

YOLOv8 processes roadside camera feeds in real-time, classifying eight vehicle types. When an ambulance or fire truck is detected (99.8% confidence), a priority override bypasses the standard DQN cycle, clears a green corridor along the vehicle's route, and activates the floodgate protocol to divert surrounding traffic — cutting emergency response times by up to 50%.

The dashboard is a faithful digital-twin simulation of a 3×3 intersection grid, driven by the same state model, event taxonomy, and decision logic the production architecture defines. Densities, DQN rewards, Kafka throughput, and Redis latencies are simulated within realistic operating ranges so reviewers can experience system behaviour — including a full emergency override — without live road infrastructure.

Every signal change is written transactionally to PostgreSQL (system of record) and synchronized to the Redis edge cache, so all nine intersections always act on the same world state. Kafka provides ordered, replayable event logs per intersection partition, and ksqlDB validates cross-intersection patterns — which is also how cascading-gridlock alerts are raised before a jam spreads.

Yes — the architecture is horizontally scalable by design. Kafka topics are partitioned per intersection, Redis clusters shard live state geographically, and PostgreSQL partitioning keeps sensor telemetry queries fast at city scale. The DQN agents are decentralized (one per intersection) with corridor-level coordination, so adding intersections adds compute linearly rather than exponentially.

CTMS v2.0 adds: DB Schema Viewer with all 6 normalized tables, Density Heatmap view, Intersection Detail Modal with lane-by-lane stats, Corridor Planner for green-wave path planning, Live Analytics Panel with DQN convergence ring, Notifications Drawer, Settings Panel (theme, speed, sound), Data Export (CSV/JSON), Keyboard Shortcuts, Floodgate simulation, and Dark/Light theme toggle.

Contact

Get In Touch

Questions about the architecture, the dataset, or the DQN reward function? Reach out to Team 1.

🏫
Department
Computer Science & Engineering
📘
Subject
Database Management System · 22CSE43
🎓
Class
IV Semester · Section B
👥
Team 1
Joel Ryan Bangera · Jovin Sequeira · Keshav Aditiya · Loyston Leon D Souza
🖥
Live Demo
Interactive dashboard with emergency simulation available in the Live Demo section.
Shortcuts
Press ? anywhere for keyboard shortcuts
Please enter your name.
Please enter a valid email.
Please enter a subject.
Please enter a message.
✓ Message sent — Team 1 will get back to you soon. (Demo: no data leaves this page.)
Interactive SQL

SQL Query Runner

Run pre-built queries against the simulated CTMS schema. Explore how PostgreSQL powers real-time intersection analytics, DQN audit logs, and emergency detection records.

SAVED QUERIES
PostgreSQL · CTMS Database
Results
Intersection Analysis

Compare Intersections

Select any two intersections from the live grid to compare their real-time metrics side-by-side — densities, DQN scores, phase cycles, and congestion risk.

LEFT : vs RIGHT :
Lane Density Comparison
Signal History

Phase Timeline

A Gantt-style view of signal phase switches across all 9 intersections in the current session. Each row is one intersection; blocks show NS (cyan) or EW (indigo) active periods.

NS Green
EW Green
Emergency
Infrastructure

System Health

Live health monitoring of all CTMS infrastructure components — from edge sensors to the central Kafka broker and PostgreSQL cluster.

🚨 AMBULANCE DETECTED — INT-B2 — PRIORITY OVERRIDE ACTIVE — PATH CLEARING
🔔 Notifications
No notifications yet
⚙ Settings
Display
Dark Theme
Toggle dark/light mode
Animations
Card & scroll animations
Simulation
Sim Speed
Tick interval
Auto Emergency
Random emergency events
Event Sound
Notification sound
Dashboard
Heatmap Metric
What the heatmap shows
Max Events
Event feed limit
⌨ Keyboard Shortcuts
ETrigger emergency
FTrigger floodgate
SpacePause / Resume
TToggle theme
NNotifications
SSettings panel
XExport data
HToggle heatmap
EscClose panels
?This help