Abstract:
Aiming at the problems of low detection and tracking accuracy, poor robustness and low statistical accuracy of traffic flow of multi-type vehicles in video, a vehicle flow detection method based on improved YOLOv5s object detection algorithm and DeepSort tracking algorithm is proposed. This method reconstructs the feature extraction network of YOLOv5s to strengthen the extraction of important features of the target and improve the detection accuracy of the detector. Firstly, the Swin Transformer module is introduced in the Backbone network to replace some C3 modules in the original algorithm, so as to enhance the global modeling ability of the model, better capture contextual feature information, and expand the receptive field of the model. Then, by comparing different attention mechanisms, GAM attention is selected in Neck network to enhance the cross-dimensional interaction of information between channels and spatial dimensions, reduce information loss and enhance network performance. Finally, the feature extraction network part of the DeepSort tracking algorithm is optimized and re-trained on the vehicle re-recognition dataset to make it more suitable for vehicle tracking. Experimental results show that the improved YOLOv5s improves by 2.04% points compared with the original algorithm. Combined with DeepSort algorithm, the statistical accuracy of vehicle traffic in different lighting conditions such as day, evening and night can reach 97.5%, 95.7% and 85.1%, respectively.