| Object detection is a research hotspot in computer vision domain.At present,object detection technology based on deep learning is an important means to monitor the wearing situation of safety helmet in construction site.However,the illumination of the construction site changes greatly,and there are many small targets and the problem of occlusion.In order to solve these question,an improved single stage detection algorithm YOLOv4-tiny is proposed in this thesis.Along with the development of the embedded platform,the helmet wearing detection model has deployment requirements,due to the problems such as the limited computing resources of embedded platform,the detection model is directly deployed on the platform,the real-time detection of model will be affected,this thesis optimize the model and deploy it on embedded platform,main work is as follows:1.Regarding the selection of prior frames,the K-means algorithm in YOLOv4-tiny selects the clustering center of prior frame randomly,which is not conducive to the convergence and training of the model.In this thesis,K-means++ algorithm is used to generate the prior box through clustering experiment,it is more conducive to the training of helmet data set.In the aspect of feature extraction,the model structure of YOLOv4-tiny is relatively simple,the feature information extracted is not sufficient,When there are many small targets in the picture and the light is dim,the detection effect of the model is not good,this thesis establishes the CBAM_CSP attention residual block structure,adding CBAM attention mechanism to the residual structure,it improves the channel characteristic of target weight,and reduces weight of irrelevant information channels,the problem is solved effectively.In the aspect of selecting the candidate frames,the NMS algorithm in YOLOv4-tiny has a relatively simple way of removing redundant boxes,and it is easy to miss detection when the target is blocked.In this thesis,the Softer-NMS algorithm is used to deal with the redundant frame and select the appropriate candidate frame,which can effectively reduce the probability of missing detection caused by occlusion of the target.The experimental results show that the m AP value of the improved YOLOv4-tiny model reaches78.5%,and it can complete the detection task better.2.The model is deployed on the embedded platform Jetson Nano.Considering the computing characteristics of the platform,the model is optimized: In order to simplify the structure of the model,and reduce some computation and parameter number,deeply separable convolution and linear bottleneck structure are raised,Since the model is directly deployed on the platform,its real-time detection will be affected.In this thesis,the model is accelerated by TensorRT,which greatly improves the real-time detection.The experimental results show that after lightweight treatment,combined with TensorRT,the detection accuracy of the model will be reduced,but the detection speed is greatly improved.3.Test the optimized helmet wearing detection model on Jetson Nano.To further test the optimized model,it is deployed on the platform.USB camera and V4L2 are used to complete the data acquisition,the data is encoded and decoded by Gstreamer to realize the helmet wearing detection system based on embedded platform.Experimental results show that the system can accurately and quickly detect the wearing condition of helmet with an average accuracy of 76%and a frame rate of 25 fps,which can meet the practical application requirements of helmet wearing detection in most work scenes. |