| Electric vehicle drivers cause a significant proportion of safety accidents in the annual road traffic accident statistics.Wearing a safety helmet can effectively protect the lives of riders and passengers and reduce head injuries.Many cities have introduced laws and regulations for electric vehicle riders,requiring them to wear safety helmets before travelling.At present the cameras on the road mainly take pictures of motor vehicle violations,and do not detect violations of non-motorised vehicles such as electric bikes.Therefore,in response to the lack of safety helmet related detection on the roads today,an innovative helmet wearing detection system for electric vehicle riders based on the TRB-YOLOv5 network has been proposed.The system can effectively identify 3 types of targets for distinguishing whether an electric vehicle rider is wearing a safety helmet or not.It works as follows:(1)The first step was to obtain some of the electric bike rider image data through a web crawler and use the lablelmg tool to produce the corresponding dataset.However,the web images cannot meet the application requirements of the detection system,so we adopt the manual shooting method and innovatively use the trinity data set of electric bike riders’ helmets to distinguish three types of detection targets electric bike riders without safety helmets(E-bike-head),electric bike riders with safety helmets(E-bike-helmet),and safety helmet(helmet).(2)Configure the training environment,and select the yolov5 target recognition network as the basic network model based on the algorithm requirements of universality,high precision and fast detection.The TRB-YOLOv5 algorithm is innovatively proposed to replace part of CSPDarknet53 feature extraction network in YOLOv5 network with transformer network,followed by the use of a weighted bi-directional feature pyramid network(BiFPN)module to replace the feature pyramid network originally used by YOLOv5,and finally adding the anchor-K-Means clustering algorithm.In order to verify the advantages of the improved algorithm,TRB-YOLOv5 was compared with the pre-improved algorithm,and finally it was found that the TRB-YOLOv5m algorithm had a detection accuracy of 96.70%for the electric bike rider helmet wearing detection dataset,which was significantly better than the other algorithms,and about double the speed of the original YOLOv5 network.(3)PyQt5-based GUI interface was built and divided into three parts:a target detection function module,a manual review module,and a visualisation module with a target character playback function.The reliability of the model was verified through experiments.Eventually an online detection system for electric bike riders’ helmet wearing was established based on the TRB-YOLOv5 network,which can effectively detect the type and location of electric bike riders and other information.It is able to save police manpower,avoid traffic safety hazards,improve urban traffic order and increase the efficiency of passage. |