Vehicle flow statistics are an important task in the study of traffic management and planning,as it can provide accurate traffic condition data and support traffic management decision-making.The new generation of vehicle flow statistics methods use vehicle detection and tracking technology to obtain data.However,urban roads face problems such as complex backgrounds and high traffic density,which can reduce the efficiency of detection and tracking,leading to missed and false detections in vehicle counting.This paper addresses these challenges by conducting research on real-time vehicle flow statistics algorithms based on traffic videos,with the following specific tasks:(1)To address the problems of complex detection models and low detection accuracy,first,a new feature extraction network called ECAShuffle-Net is created by introducing the lightweight network Shuffle Net V2 based on YOLOv5 s and combining it with the ECA-Net attention mechanism to achieve model lightweighting while ensuring detection accuracy.Secondly,to reduce feature duplication and further extract semantic information-rich feature maps,an improved Bidirectional Feature Pyramid Network(Bi FPN)is used instead of Feature Pyramid Network and Path Aggregation Network to enhance the network’s ability to extract vehicle features.Finally,during model training,the CIo U loss is used as a new bounding box loss function to improve bounding box regression accuracy and obtain higher-quality anchor boxes.Experimental results show that the improved vehicle detection algorithm can increase the m AP value to 95.61% with an FPS of 73.(2)To address the problem of ineffective extraction of vehicle features during tracking in complex scenes,the small residual network originally used to extract appearance information features in the algorithm is replaced with Res Net18 to improve the tracker’s feature extraction ability and alleviate the problem of frequent identity switching during tracking.Secondly,a vehicle tracking re-matching optimization strategy is proposed to alleviate missed detections caused by severe occlusion during tracking and improve the counting accuracy of subsequent vehicle flow statistics.Experimental results show that the improved tracking algorithm has strong robustness in different environments and successfully alleviates the problems of vehicle identity switching and missed detections caused by occlusion.(3)To address the problem of interference from irrelevant factors such as buildings and green belts in vehicle flow statistics,a vehicle tracking method based on virtual detection areas is proposed.This method integrates the improved YOLOv5s+Deep Sort with virtual detection areas and designs a new vehicle counting method.Firstly,a virtual detection area is set up in a suitable area,and then tracking begins when a vehicle enters the virtual detection area and ends when it exits.At this point,the vehicle counter increases by 1.Finally,a vehicle flow statistics system is designed to display information such as vehicle tracking,the number of different types of vehicles,and the total number of vehicles on a UI interface.Experimental results show that this method can be applied in various complex scenes and has improved counting accuracy and speed compared to the original algorithm. |