| With the rapid development of economy,the number of motor vehicles is increasing rapidly,urban road congestion and traffic accidents are becoming more and more frequent.To solve these problems,the Intelligent Transportation System(ITS)came into being.Traffic flow detection is a vital part of the Intelligent Transportation System.It provides basic data support for the system,and is also the basis for traffic control and management.In recent years,vehicle detection technology based on smart videos has received wide attention from all walks of life at home and abroad.How to get accurate traffic flow from road traffic videos in time has become one of the research hotspots in the field of intelligent transportation.Deep learning algorithms are usually more accurate and can adapt to increasingly complex traffic scenes than traditional algorithms.However,deep learning algorithms have strict requirements on computing power and memory space of hardware,making it difficult to deploy and apply them to mobile or embedded devices with limited computing power.Therefore,from the aspects of lightweight,model compression,model deployment and optimization of in-depth learning algorithm,this paper designs and implements a traffic flow detection system based on edge computation.The main research work is as follows:(1)Vehicle detection method based on lightweight network.YOLOv4 is lightweight designed to solve the problem that the real-time requirement of vehicle detection is high,but the complexity of the model is too high to detect in real-time on edge computing devices.Replace YOLOv4 backbone network and feature extraction network with Mobile Net v2 lightweight network,and introduce Kmeans++ clustering algorithm and Focal Loss function to improve the model’s focus on vehicle targets,thereby upgrading the overall detection accuracy.The experimental results show that the lightweight modified Mobile Netv2-YOLOv4 reduces the complexity and occupancy of the model significantly compared with the original YOLOv4.The loading and detection speed on PC and RK3399 Pro edge computing devices are also greatly improved,and it can accurately detect vehicle targets on the road.(2)Vehicle detection methods based on model compression.In order to improve the loading and inference speed of the model on edge computing devices,YOLOv4-tiny was compressed using structured pruning method.The experimental results reveal that the compressed YOLOv4-tiny can achieve high detection speed on PC and RK3399 Pro devices with little loss of detection accuracy.(3)Design and implementation of a traffic flow detection system based on edge computation.This paper establishes a traffic flow detection system based on edge computing using Rockchip micro RK3399 Pro and other hardware devices.After completing the design of software scheme and environment deployment,the improved Mobile Netv2-YOLOv4 and compressed YOLOv4-tiny models presented in this paper are transplanted to edge computing devices.The test results on actual road sites show that the system is able to analyze video in real time,obtain and transmit traffic flow information,and achieve the expected design goals. |