| Object detection is to find the object in the image,classify the object and label the object’s location.With the maturity of deep neural network technology,more and more object detection applications appear in people’s production and life,such as vehicle flow detection,wearing a mask detection,break-in detection of personnel dangerous areas,etc.The application of object detection technology is of great practical significance.However,the existing object detection algorithms often have high precision or fast detection speed,and the balance between speed and precision is often not very well.Object detection algorithms based on deep learning can be divided into two-stage object detection algorithms and one-stage object detection algorithms.The two-stage object detection algorithm performs object detection in two steps:some regions that may have a target is proposed,and then the candidate regions are further detected to obtain the final result;while the one-stage object detection algorithm directly detects the object and omits the step of proposing candidate regions,so it is faster,but the detection accuracy is reduced.As a typical one-stage object detection algorithm,YOLO has been widely used because of its fast detection speed and excellent comprehensive performance.YOLO uses backbone network to extract the features of different levels of image,fuses these features on multi-scale,and then detects the object and locates the position of the fused image features.However,because the proposed candidate regions are omitted and the fusion of image features is not sufficient,the detection accuracy of YOLO is less than that of some two-stage obj ect detection algorithms.Based on the bidirectional feature fusion structure,this thesis proposes a pyramid structure of bidirectional adaptive multi-scale feature fusion:BAFPN,and introduces the C2 level image feature into the feature fusion process.The innovations of this thesis are as follows:(1)On the basis of FPN(Feature Pyramid Network),a top-down feature fusion channel is added,a two-way fusion channel is used to fuse the features of different levels of the image,and an adaptive multi-scale feature fusion scheme is introduced.A new feature pyramid structure,BAFPN,is proposed,which can better fuse the features of different scales of the image and then improve the accuracy of object detection.(2)The exponential moving average(EMA)is introduced in the training,and the exponential average parameters are generated by using the weight parameters within a certain period of time.In the testing,the exponential average parameters are used as the weights of the neural network.The use of EMA can avoid the instability of the model caused by the jumping of model weights,and make the model more robust.(3)Pruning optimization for neural network models.The smaller y value in the batch normalization layer indicates that the role of the channel or layer in the neural network is smaller,and the role of the layer or channel whose γ value is lower than a certain threshold value can be neglected,so pruning can be carried out.Pruning optimization can reduce the model volume and improve the object detection speed.BAFPN-YOLO can improve the performance of MS COCO dataset by 3.4%compared with YOLOv5m,while maintaining a higher detection speed and achieving a better performance balance.At the same time,this thesis designs and develops a smoking detection system,which further verifies that BAFPN-YOLO can achieve good results in practical applications. |