A unified real-time framework for helmet and red-light violation detection in motorcycle-dominant traffic
Abstract
Traffic surveillance in motorcycle-dominant urban settings presents unique challenges that single-task detection systems have struggled to resolve. This paper describes a framework that jointly addresses helmet non-compliance and red-light violations within a single runtime, without requiring separate model pipelines. Two core mechanisms are introduced: a dual-strategy helmet detection method that combines direct class inference with an occlusion-aware fallback, and a hybrid HSV-YOLO module for traffic light state recognition that adapts between color thresholding and neural-network inference depending on scene conditions. The entire detection stack is embedded in an event-driven streaming architecture built on Apache Kafka and FastAPI. On a combined dataset of 7,500 annotated frames, the YOLOv8s backbone achieves 89.90% mAP@50 for helmet violations and an average end-to-end latency of 380 ms. The results suggest the design is feasible for deployment-grade traffic enforcement in dense urban corridors.