In recent years,the rapid increase in the number of vehicles in our country has resulted in vehicle congestion and frequent traffic accidents.To this end,researchers apply computer technology and artificial intelligence technology to the transportation system to build an intelligent transportation system that can solve current transportation problems.As the basis of building an intelligent transportation system,vehicle detection not only needs to meet a certain detection accuracy,but also the algorithm needs to be lightweight because of the limited computing power of embedded devices.The thesis selects the UA_DETRAC vehicle dataset,constructs a vehicle detection method based on YOLOv5,and mainly improves the existing algorithm from the perspectives of vehicle detection accuracy and algorithm lightweight.The main research contents are as follows:(1)I design anchor boxes that are more suitable for vehicle detection in video surveillance.The anchor box setting of YOLOv5 will affect the accuracy of vehicle detection due to some prior information.Appropriate anchor boxes can not only improve the detection accuracy but also accelerate the convergence speed of the algorithm.In my thesis,K-means method is used to redesign the anchor boxes on the UA_DETRAC dataset.The algorithm using the new anchor box partly reduces the occurrence of missed detections,and also alleviates the situation that the same target is marked multiple times.(2)I introduce a localization loss function that focuses on high IoU targets.Vehicle detection needs to mark the position of vehicle,so the localization loss function is more important.In order to solve the problem that the loss decreases sharply when the prediction box is close to the ground truth box,a α-IoU localization loss function is introduced to improve the attention of algorithm to high IoU targets,thereby improving the vehicle detection accuracy.According to the experimental comparison,when the value of α is 3,the detection accuracy of the vehicle detection algorithm is improved the most by using the α-IoU positioning loss function,which is 1.1 percentage points higher than the accuracy of the original algorithm.(3)I introduce the coordinate attention mechanism to improve the attention of algorithm to the vehicle target.In order to solve to miss vehicle target in dense scenes,a coordinate attention mechanism is introduced into the backbone network,which can better focus on channel correlation and global features,thereby improving the attention to vehicle targets.The algorithm incorporating the coordinate attention mechanism into the feature extraction network improves the accuracy by 0.8 percentage compared with the original algorithm,and hardly introduces additional computational overhead.(4)I research on Lightweight of vehicle detection algorithm for embedded devices.Embedded devices have limited storage space and weak computing power.In order to better deploy vehicle detection algorithm in embedded devices,the backbone network of YOLOv5 is improved through the design of lightweight structures.The thesis uses Ghostbottleneck to improve the CSP structure of YOLOv5.It is found through experiments that the amount of parameters is reduced by 28% and the amount of floatingpoint calculations is reduced by 33% with sacrificing a certain precision. |