The escalating global rates of traffic accidents in urban areas and the growing demands of smart cities underscore the urgent need for advanced real-time monitoring solutions. This paper presents an EdgeML-based system for vehicle tracking that performs real-time speed and distance analysis and traffic violation detection. This is achieved by deploying a YOLOv8 object detection model on a Raspberry Pi 5 with a Coral USB Edge TPU accelerator. The system integrates computer vision and IoT technologies to enable real-time processing. It utilizes the Message Queuing Telemetry Transport (MQTT) protocol to allow scalable communication between distributed edge devices and a central MongoDB database, facilitating real-time storage and analysis of traffic data. A synthetic dataset generated via the Blender 3D modeling tool validates the system’s accuracy, demonstrating average speed and distance measurement errors of ±2.11 km/h and ±0.58 m, respectively. These findings are further supported by preliminary practical experiments in a real-world environment, where speed estimation errors remained within 0–2 km/h and distance errors stayed below 0.11 m. Key innovations of this work include license plate recognition, speeding and collision detection, and context analysis using Google’s Gemini-2.5-Flash API. A Streamlit dashboard provides real-time visualization of traffic metrics, violations, and aggregated data. A comparative evaluation of YOLOv5n, YOLOv8n, YOLOv11n, and YOLOv12n identifies YOLOv8n as the most suitable model for embedded deployment, achieving 91.07 ± 0.61% mAP@0.5 without quantization, 88.77 ± 3.31% mAP@0.5 with quantization, while maintaining real-time performance of 30–43 frames per second (FPS) on the Edge TPU. The system’s modular architecture, low latency, and robust performance highlight its suitability for smart city applications, enhancing traffic safety and enabling data-driven urban mobility management.
Silva et al. (Wed,) studied this question.