| With the rapid development of the construction industry,the safety problems of construction workers emerge in endlessly.As protective equipment,safety helmet plays an important role in protecting the personal safety of workers.At present,there are two main ways to detect workers wearing safety helmets: one is manual monitoring,but this monitoring method is inefficient,time cost is high,and manpower and material resources are wasted;The second is intelligent video detection system,but there are still problems such as false detection and missing detection in complex environments,low accuracy for small target objects,and poor real-time performance.Therefore,this paper proposes a safety helmet detection algorithm and its lightweight method based on YOLOv5 s.The specific contents are as follows:(1)A safety helmet detection algorithm based on P-CBAM is proposed to solve the problem of false detection and missing detection of safety helmet in complex environment of construction site.P-CBAM(Parallel Mixed Domain Convolution Attention Module)is added behind the feature extraction network of YOLOv5 s.The parallel structure of P-CBAM can focus on the effective feature information of space domain and channel domain at the same time,suppress the useless background information,and strengthen the feature extraction capability for helmet objects.The improved YOLOv5s-P algorithm is 3.39%higher than the original algorithm in terms of the index m AP.(2)In order to solve the problem of low detection accuracy of small helmet objects,a helmet detection algorithm based on multi-scale detection and feature fusion is proposed.Increase the three detection layers in the original YOLOv5 s detection head to four,and set the corresponding prior box;At the same time,referring to the idea of Bi FPN,the structure of FPN and PAN is redesigned,and jump connection is added to the original horizontal connection to strengthen the feature fusion capability of the network.The improved YOLOv5s-4 algorithm can detect more fine-grained feature information,which is 1.69%higher in terms of m AP than the original algorithm.(3)In order to meet the application requirements of embedded devices,it is necessary to reduce the parameters and computation of the model and improve the reasoning speed based on the helmet detection algorithm.A lightweight method of helmet detection algorithm is proposed.Use Ghost Bottleneck to replace the bottleneck layer structure of CSP in the backbone network of YOLOv5 s,and achieve the network lightweight effect by reducing the calculation amount of generating the feature map.Compared with the original algorithm,the improved Ghost Bottleneck-YOLOv5 s reduces the number of parameters by 32% and the number of floating point operations by 38% when it discards a small amount of accuracy,achieving the goal of lightweight.(4)In order to verify the feasibility and effectiveness of the safety helmet detection algorithm,a site safety helmet wearing detection system is designed and implemented,which is preliminarily applied in the construction site,and the system effect is displayed through the visual interface.Finally,the system performance is tested. |