| With the rise of intelligent transportation and the development of artificial intelligence,how to apply deep learning technology to complex transportation planning has brought great challenges to researcher.Vehicle detection is an important step for intelligent transportation and is widely used in vehicle supervision,smart parking and unmanned driving.However,problems such as complex backgrounds and occlusion caused by overlapping positions between vehicles under real road conditions have seriously affected the accuracy of vehicle detection and vehicle classification.Faster R-CNN is a mainstream model in the field of vehicle detection.Research and improvement on Faster R-CNN can further improve the accuracy and robustness of vehicle detection in complex environments.This paper studies the anchor box size and regression loss function in Faster R-CNN model.The main research contents include:(1)Vehicle image collection,labeling and data preprocessing.Firstly,1750 images of vehicles at traffic intersections and 950 images of vehicles around schools,communities,and shopping malls were collected.Each image contained multiple vehicle targets.Then perform data preprocessing on the collected vehicle images.Image sharpening highlights image edge information and vehicle contours,adding noise to image,image flipping,and image rotation expand the number of samples,and image graying reduces calculations.Finally,the vehicle images after data preprocessing were manually labeled on a vehicle-by-vehicle basis to obtain a vehicle detection data set.(2)A Faster R-CNN anchor box size clustering algorithm is proposed.Aiming at the problem that the nine anchor box sizes fixed in the original Faster R-CNN do not fully match the vehicle shape characteristics,a K-means-based vehicle anchor box size clustering algorithm is proposed.First,the width and height values of the true label frames of all vehicles are extracted for clustering,and three clustering results of K = 3,4,and 5 are obtained.Then set the anchor box size and anchor box proportion according to the coordinates of the three cluster center points.The same vehicle detection data set is used to train and detect the original Faster R-CNN model and modified Faster R-CNN model.(3)An improved method of Faster R-CNN regression loss function is proposed.The Huber Loss regression loss function when the original Faster R-CNN returns for the first time is computationally intensive and it is easy to ignore the problem of blocking vehicle candidate frames.So modify the loss function at the first regression to the L2 loss function.Using the sensitivity of the L2 loss function to outliers,it is possible to retain the occluded vehicle candidate frame which is usually regarded as an outlier in the regression stage,and increase the possibility of detecting occluded vehicles.Compared with the original model,the modified Faster R-CNN model of the loss function has a detection accuracy rate of 96.05% and a detection recall rate of 1.36%,which effectively improves the problem of vehicle missed detection.At the same time,the different values of Huber Loss function segmentation points during the second regression are experimentally studied.Experimental results show that after optimizing the value of segmentation points,the model detection accuracy rate reaches 96.43%,and the detection recall rate reaches 85.04%,which further improves the vehicle detection performance.(4)Parameter optimization of Faster R-CNN.Adjusting the hyperparameters of the network model can achieve the purpose of improving the training effect of the model.Design a vehicle detection experiment to optimize the two main hyperparameters of Faster R-CNN:learning rate and batch size.After the two hyperparameters are adjusted,training time of the model can be shortened,and the vehicle detection accuracy is further improved. |