| Relevant studies have shown that most factory safety accidents are directly related to unsafe behaviors of workers,and timely detection of unsafe behaviors is a key step to ensure the safety of workers’lives.At present,most scholars are researching whether workers wear safety helmets,but there are relatively few studies on workers’smoking behavior,and the traditional smoking behavior detection algorithm has low recognition accuracy,high missed detection rate,and slow speed.question.Therefore,this paper proposes an improved workers’unsafe behavior detection algorithm YOLOv5s_MAX,and designs a worker’s unsafe behavior detection system to help safety officers supervise workers’behavior.The main research contents are as follows:(1)First of all,the on-site construction environment was investigated and analyzed,and workers’unsafe behaviors were defined as smoking and not wearing safety helmets.Then,build a data set of workers’unsafe behavior,and use horizontal flip,random contrast,image noise,image scaling,etc.to enhance the data image,so as to improve the generalization ability of the model.(2)Aiming at the problems of low recognition accuracy and high missed detection rate of workers’smoking behavior,this paper proposes the YOLOv5s_1X model.First,the improved K-means++algorithm is used to cluster the constructed data set,and the clustered anchors are replaced with the original anchors;then,the detection layer of the ultra-small target is added.The experimental results show that compared with the original model,the average accuracy of smoking behavior is increased from 70.4%to 72.4%,and the improvement effect on small targets is more obvious.(3)In order to further improve the detection accuracy of workers’smoking behavior and the feature extraction ability of workers’behavior,this paper proposes a YOLOv5s_2X model that integrates attention modules.First,add the attention module CBAM to the backbone network of the YOLOv5s_1X model to improve the feature extraction ability of the model for worker behavior;then,add the SE module to the head layer to improve the model’s attention to feature information.The experimental results show that the average accuracy of smoking behavior is further increased by 2.8 percentage points,which greatly improves the detection accuracy of small target objects.(4)In order to solve the problem of slow recognition of worker behavior and large amount of calculation.This paper proposes an improved C2f_SE module.First,optimize the Conv module in the backbone network,replace the Bottleneck of the Conv layer with a lightweight Ghost Bottleneck,and simplify the calculation of the model.Secondly,the three Conv convolution modules in the C3 module are simplified and replaced by two optimized Conv convolution modules;at the same time,the attention module SE is added to improve the model’s attention to worker behavior.Finally,the improved module C2f_SE is obtained.Combining the above three improvements,a worker unsafe behavior detection algorithm YOLOv5s_MAX is proposed.The results show that the m AP value of the improved model is 86.0%,which is 3 percentage points higher than the original algorithm;the average precision of smoking behavior is increased by 6.6 percentage points.Compared with the video detection frame rate,the FPS frame rate of the improved model is about 30.55f.s-1,which is 2.93 f.s-1 higher than the 27.62f.s-1of the original model.Finally,this paper develops a worker’s unsafe behavior detection system,deploys and applies the proposed algorithm,and verifies the effectiveness of the algorithm. |