The problem of urban road congestion is becoming increasingly serious,and the high flexibility of motorcycles can better overcome the inconvenience caused by road congestion.However,the safety performance of motorcycles is poor,and the standardized wearing of helmets can play a key role in safety protection and effectively reduce the casualty rate of traffic accidents.In order to strengthen the supervision of motorcycle helmet-wearing and solve the difficulty of manual inspection,this thesis studies the motorcycle helmet-wearing detection algorithm based on deep learning,aiming to improve the efficiency of motorcycle helmet-wearing detection in urban roads,which is of great significance for the development of intelligent transportation.Firstly,the deficiencies of the YOLOv5 detection algorithm directly applied to motorcycle helmet detection were analyzed,and corresponding improvement measures were proposed for the input end,trunk network,neck network,and head network of the model,respectively,to improve the detection performance of the algorithm.Secondly,by incorporating the Ghost Net module and model channel pruning,the weight of the model can be reduced,and the reasoning speed can be accelerated.Finally,the lightweight model is deployed to the motorcycle helmet-wearing detection system for real-time detection of images or video frames,which effectively improves the detection efficiency of motorcycle helmet-wearing.The main research contents are as follows:(1)A CY-Dataset set based on image enhancement and category balance was constructed.First,the original images of motorcycle drivers in urban road scenes were collected,and the images were labeled with helmets,without helmets,and motorcycles.Image enhancement methods such as cropping and flipping were used to expand the data set so as to improve the diversity and generalization ability of the CY-Dataset.After statistical analysis of the expanded data set,it was found that there was a serious imbalance in the number of categories in the data set.Therefore,the class-balanced sampling method was used to expand the number of category targets without helmets,which solved the problem of imbalance in the number of categories in the data set.The newly constructed data set CY-Dataset could effectively improve the convergence effect of the algorithm and improve the detection accuracy.(2)The Enhanced-YOLOv5 m algorithm is designed to improve the detection accuracy of motorcycle helmet targets.Firstly,the Enhanced Mosica&Mixup scheme is introduced to enhance the generalization ability of the model,aiming at the problem that the input image target is single.Secondly,aiming at the problem of insufficient feature fusion of the detection network,the MA-ELAN scheme is integrated to enhance the information interaction of each feature layer,which is conducive to identifying and detecting small-scale occluding targets.Then,aiming at the problem of the restricted receptive field of convolutional networks,the Reasoning Layer module is introduced in the tail of the Neck network to enhance the receptive field of feature graphs and improve the classification ability of the algorithm.Finally,to solve the problem that GIo U does not consider the centre distance and aspect ratio between the detection box and the real box,CIo U is used to replace GIo U and enhance the training ability of the algorithm.In the experiment of CY-Dataset,the m AP of Enhanced-YOLOv5 m increased by 23.87%compared with that of YOLOv5 m,indicating that Enhanced-YOLOv5 m was more suitable for motorcycle helmet detection.(3)The lightweight deployment system of the Enhanced-YOLOv5 m was designed to detect motorcycle helmet wear efficiently.Firstly,aiming at the problem of large computation of C3 module in Enhanced-YOLOv5 m,the lightweight module Ghost Net is integrated to reduce the computation amount of backbone network and neck network.Then,given a large number of parameters of the MA-ELAN module,the attention module is used to prune the channel to reduce the number of parameters of the MA-ELAN module.The lightweight Lightweight-YOLOv5 m has an inference time of 11.3ms for a single image in CY-Dataset,which can meet the requirements of real-time detection.Finally,based on the Flask framework,a real-time detection system for motorcycle helmetwearing is designed to improve the supervision and efficiency of urban road motorcycle driving safety violators and reduce the potential safety hazards of road traffic. |