| Vehicle detection,as a key technology in the field of assisted driving,has been widely concerned by scholars at home and abroad for a long time.Compared with traditional manual design algorithm,the vehicle detection algorithm using deep neural network has greatly improved the detection accuracy,but the calculation amount of detection algorithm is very large,and GPU is usually needed to improve the parallelism of the operation.Therefore,it is still facing a great challenge in many applications with high demand for power consumption and cost of products.This thesis studies the method of vehicle detection in front of lightweight model,designs and implements the vehicle detection system running in embedded equipment,and the main work is as follows:(1)An improved vehicle detection algorithm based on yolov4-tiny is proposed.Firstly,the feature extraction network is optimized to improve the detection accuracy of the model,and the yolov4 tiny model is combined with the improved s-mobilenet model to improve the feature extraction ability of the model.Secondly,aiming at the problem of weak small target detection ability of the model,combined with the idea of multi-scale fusion,a layer of small-scale prediction output is added on the basis of the two-scale prediction output of the original model.Thirdly,in order to get a better anchor frame,Kmeans++ algorithm with better initialization effect is selected,and the expression of distance measurement is modified combined with IOU.Finally,a feature pyramid structure based on attention mechanism is designed to enhance the output of key location information and suppress the unimportant information,so that the model can obtain better semantic information in feature fusion.The experimental results show that the detection accuracy of the improved model is improved by 9.8% compared with that before improvement.(2)Combined with model compression technology,a channel pruning strategy for the improved yolov4-tiny algorithm is designed.Firstly,the scaling factor in the batch normalization layer is selected as the criterion to judge the importance of the channel.Then,for the convenience of channel evaluation and pruning,the L1 norm restriction of scaling factor is added to the loss function to achieve the purpose of sparsifying the scaling factor.Finally,an iterative pruning method is used to remove redundant channels according to a certain pruning ratio to achieve model compression.In the process of channel pruning,the corresponding pruning strategies are designed for the depthwise convolution structure and the shortcut connection structure to ensure the effectiveness of each structure after pruning.The experimental results show that the channel pruning strategy designed in this thesis can make the compression ratio of the model reach 46.6% when the detection accuracy is lost by 1.4%,and the running speed of the model on ARM-CPU architecture is nearly doubled.(3)A front vehicle detection system based on embedded platform is designed and implemented.The hardware of the system is mainly composed of Raspberry PI 4B platform and Intel’s second generation Neural Computing Stick.The detection method adopts the improved yolov4-tiny model and the pruning compression strategy proposed in this thesis.The system can collect the front image of the current vehicle,detect the vehicle target in the image and output the detection results.The simulation and road test results show that the system can maintain a high detection accuracy and achieve a fast detection speed of 14.8 frames per second.The effectiveness of the system is preliminarily verified in the actual road experiment. |