A lightweight YOLOv8n-based method for detecting dangerous riding behaviors of electric two-wheelers
Abstract
Electric two-wheelers are widely used in urban and campus traffic, but unsafe behaviors such as missing helmets and abnormal handlebar grasping remain difficult to detect continuously from road-scene images. This paper proposes a lightweight YOLOv8n-based detector for five-class dangerous-riding behavior detection of electric two-wheelers. The detector adapts an EHNeck/LFF feature-fusion structure and combines it with task-specific Small-object Context Attention (SCA). SCA uses 3 × 3 and k × k depthwise convolution branches to form spatial responses with different receptive fields, together with spatial reweighting, channel attention, and a residual path, thereby enhancing small behavior-related regions without changing the feature resolution. Experiments show that the final model achieves 0.7514 mAP50 and 0.4856 mAP50-95 on the test set. Compared with YOLOv8n, test mAP50-95 improves by 0.0252 (5.47%), while parameters and GFLOPs decrease by 9.56% and 7.16%, respectively.