In recent years,the number of electric bicycles in China rises sustainedly,and the traffic accidents related to electric bicycles also increase steadily.In order to reduce the injury degree of riders in accidents,many cities regulate rider must wear a helmet when riding an electric bicycle.Therefore,the detection of wearing electric bicycle helmet becomes a hot issue in the field of computer vision.Detecting the helmet wearing condition of electric bicycle riders through artificial intelligence algorithm can reduce manual intervention,which is of great significance to promote road safety and a key step towards traffic intelligence.In this paper,the deep learning algorithm is introduced to study the problem of electric bicycle helmet wearing detection.Firstly,the key objects such as electric bicycle and rider’s head are detected through the deep learning model,and then the detected electric bicycle objects and rider’s head objects are matched and correlated,which realizes the aim of detecting the helmet wearing condition of electric bicycle riders accurately and real-timely.Finally,the construction of electric bicycle helmet wearing detection system is completed on the embedded platform.The main work and innovation of this paper are summarized as follows:(1)A helmet wearing detection method based on matching head object and elcectric bicycle object is proposed.Firstly,this method uses YOLOv5 model to detect electric bicycle objects,head objects and helmet objects,and then electric bicycle and rider’s head are matched by setting the distance threshold between electric bicycle and rider’s head,which effectively solves the problem of low detection efficiency and poor generalization in existing methods.At the same time,a threecategory-including helmet wearing detection data set matching the proposed detection method is made.The data set containes 5000 images,and the factors such as weather,angle,distance and shielding degree are fully considered,which greatly enhances the robustness of the model.Finally,experiments based on self-made data set demonstrate the method proposed above is effective.(2)In order to solve the problem of large volume and poor real-time detection of deep learning model,a model improvement method based on YOLOv5 is proposed in this paper.Firstly,the Ghost CSP-Bottleneck model is designed to optimalize feature extraction structure;Secondly,the network structure replaces convolution module in YOLOv5 with Ghost Bottleneck module to reduce the amount of parameter;Thirdly,attention mechanism is added in the backbone network to improve the detection accuracy.Finally,CIOU loss function is introduced to improve the convergence speed during the training process.The parameter and volume of the improved model are respectively compressed by 47.89 percent and 47.22 percent than before,and the detection speed is improved by8.4 FPS under the condition of ensuring the detection accuracy.After improving,the model shows good generalization.(3)Based on Jetson Xavier NX embedded platform,an electric bicycle helmet wearing detection system is designed.The system reads the video stream through camera.After decoding and format conversion,the video stream will be imputed into the improved YOLOv5 model for reasoning.Multithreaded programming is used in this system,which makes the system can read the video stream and reason at the same time.Meanwhile,Tensor RT manages optimizing the detection performance of the system by means of reducing the calculation accuracy and simplifying the model structure,which improves the detection speed of the model on embedded platform and achieves the purpose of realtime detection.According to the test results,the system designed in this paper can detect at the speed of 28.2 FPS on the Jetson Xavier NX embedded platform,and realizes the aim of detecting the helmet wearing condition of electric bicycle riders accurately and real-timely,which has great practical application value. |