Abstract:Not wearing helmets or wearing helmets incorrectly will pose significant threats to the safety of riders. Manual inspection not only requires large and inefficient work, but also makes it difficult to achieve full coverage of the entire area and time. This paper proposes a helmet wearing detection method for riders based on improved YOLOv5, which intelligently detects and automatically recognizes the helmet wearing status of riders through surveillance cameras. Firstly, a dataset of riders’ helmet wearing in different locations, perspectives, weather conditions, and time periods is created to lay the foundation for the research. Subsequently, a helmet wearing detection model based on improved YOLOv5 is proposed, which improves the multi-scale feature fusion module of YOLOv5 to enhance the detection effect of small targets. ECA attention mechanism is introduced to enhance feature map fusion effect, which significantly improves model detection accuracy; a lightweighted neck is designed based on GSConv to effectively reduce the detection time of the model. Our experiments show that the proposed algorithm has good detection performance for helmet wearing of riders, with mAP reaching 93.2%, which is 1.9% higher than the original algorithm. The detection time of a single image is 15.23ms, which ensures high detection rate and higher detection accuracy, and has certain application value.