Improvement and Application of YOLOv7 Algorithm for Intelligent Detection of Traffic Flow
Aiming at the accuracy issue of vehicle flow detection in current machine vision recognition,a modified vehicle flow intelligent detection method based on YOLOv7 artificial intelligence algorithm and Deep SORT is proposed by adding visual tracking and attention mechanism.The attention module GAM is fused with the YOLOv7 network to enhance the feature extraction capability of the detection network.Meanwhile,Deep SORT tracking algorithm is introduced into the improved YOLOv7 network to improve the problem of re-checking and missed detection caused by vehicle occlusion.In the experiment,the dual-directional 3-lanes Jingwei Avenue in Yuzhong District of Chongqing is selected as the research object,and data collection and algorithm verification are conducted by connecting a fixed camera to a mobile notebook computer on the Xinpushe Overpass.To ensure the repeatability of the algorithm,5-minute traffic flow videos are recorded during the morning rush hour,noon off-peak period,and evening rush hour.By setting virtual detection lines inthe traffic video,the new algorithm tracks the trajectory of vehicles while detecting them,and records the identity number of the vehicles when they passe the detection line to achieve traffic video flow monitoring and tracking counting.The experimental results show that compared with the original YOLOv7 algorithm,the modified algorithm has increased the average precision of vehicle detection by 2.3%and the accuracy of video vehicle flow statistics by 8.2%.