With the continuous development and progress of various production fields,the issue of safe production has received more and more attention.As an important safety protective equipment,safety helmets can be used in industrial production,construction sites and other industries.In modern workplaces,it is necessary to check the wearing of hard hats to ensure the safety of employees.Most of the traditional safety helmet wearing inspection methods are carried out through manual supervision,which has problems such as high cost and low efficiency.Therefore,it is of great significance to use object detection technology to study effective safety helmet wearing detection algorithms to ensure the personal safety of employees.In this paper,a helmet wearing detection algorithm based on improved YOLOv5 is proposed.YOLOv5 has the advantages of high efficiency and real-time performance,and can be effectively used in hard hat wearing inspection.However,in practical applications,safety helmet wearing detection technology will face problems such as complex personnel,poor detection environment,blocked targets,and small detection targets,resulting in insufficient detection accuracy,missed or misdetected targets.Therefore,in view of the above problems and the YOLOv5 model,this paper proposes an improvement method,and carries out the following research:(1)In view of the insufficient detection accuracy of hard hat wearing detection in small target detection,complex environment detection and blurred background detection,and prone to false detection and missed detection,this paper proposes an improved YOLOv5 network based on the attention mechanism.The network incorporates the improved SENetbased multi-scale attention mechanism MSENet module proposed in this paper.This module can make up the information between channels,then integrate the information of each channel,and assign weights to the features between each channel,so that the model can focus on the target detection task.The MSENet network uses a multi-scale feature input module that combines image segmentation,residual connection,and pointwise convolution,and then passes through two parallel pooling layers and a fully connected layer,multiplying the obtained channel weights with the original features to form a new multi-scale attention mechanism is proposed.Experiments were carried out on the self-made data set and SHWD data set in this paper.Compared with the baseline network,the detection accuracy m AP of the improved network was increased by 1.1% and 0.7%,respectively,and the detection of small targets,complex environments and blurred backgrounds was improved.(2)Aiming at the problem that the fusion of the MSENet module in front of the detection head of YOLOv5 has little effect on feature extraction,its detection accuracy still has room for improvement,and the problem of information loss of the original YOLOv5 SPPF module,this paper proposes a method based on multi-scale Improved YOLOv5 network for NDC fusion of dilated convolution modules.It can increase the receptive field while keeping the resolution of the feature map unchanged,which helps to capture targets of different scales,and further enhances the detection effect of each scene.Experiments were carried out in the self-made data set in this paper.Compared with the baseline network,the improved network detection accuracy m Ap@0.5 has increased by 1.2%,and its m Ap@.5:.95 value has increased by 1.1% on the SHWD data set.(3)Aiming at the problem that it is difficult to detect occluded targets in helmet wearing detection,and the accuracy can still be improved,this paper proposes an improved module GPANet based on recursive gated convolution.It can obtain high-order spatial interactions between adjacent pixels in the image to capture complex spatial dependencies.Experiments were carried out on the self-made data set in this paper.Compared with the baseline network,the detection accuracy of the improved network m Ap@0.5 has increased by 2.2%,and its m Ap@.5:.95 value has increased by 2.1% on the SHWD data set,and improved Detection effect of scenes such as occluded target detection.Experiments show that the detection accuracy of YOLOv5 network in the self-made data set is m Ap@0.5% higher than that of the benchmark network,and the detection accuracy in the SHWD dataset is m Ap@.5:.95 compared with the benchmark network by2.4%,and the multi-scenario detection problem in the helmet wearing detection is also improved,and the detection effect is good. |