Smart Traffic Management System: Real-Time AI-Based Adaptive Traffic Light Control Using Vehicle Density Analysis

Authors

  • Anthony Olayinka Adekoya
  • Jumah Abdul Ganiyu
  • Femi Owoeye
  • Amaechi Tobenna Kelvin

Keywords:

Adaptive traffic control, Deep learning, Edge computing, Nigeria, Object detection, smart city, Vehicle density, YOLOv5

Abstract

Urban traffic gridlock in Nigerian cities, particularly Lagos and Port Harcourt, exacts a severe toll on both the economy and public health a toll that conventional fixed-cycle signal systems are structurally ill-equipped to address. This study presents the design, construction, and experimental validation of a software-driven adaptive traffic control system that modifies signal timing in real time by measuring vehicle density from live camera feeds. At its core, the system employs a YOLOv5 object detection model trained on a purpose-built Nigerian traffic dataset that spans cars, buses, okadas, danfos, and trucks, enabling per-lane vehicle counting; a bounded proportional algorithm then translates those counts into green-signal durations while a fairness mechanism prevents any lane from being indefinitely starved. The full processing chain operates on a Raspberry Pi 4 edge device and is supervised through a Flask-based web dashboard. On the Raspberry Pi, detection accuracy reached mAP@0.5 = 92.4% at 15–20 FPS. When benchmarked against a conventional 60 s fixed-cycle signal across ten SUMO simulation trials per scenario, the adaptive system delivered average reductions in vehicle waiting time of 27%–42%, queue length cuts of 38%–43%, and throughput gains of 17%–28%. Full documentation of the experimental protocol is provided to support independent replication.

Published

2026-10-12