Abstract:Aiming at the situation that the target detection accuracy is low due to the factors of lighting, occlusion, small target and complex background in complex traffic scenes, and is prone to missed and false detection, a traffic target detection algorithm based on YOLOv7 is proposed. To better capture the correlation within data and features, the algorithm incorporates a multi-head attention mechanism into the backbone network to enhance the network feature learning ability. The Coordinated attention module (CA) is introduced into the YOLOv7 neck network and the position information is embedded into the attention mechanism, which can ignore the interference of irrelevant information and enhance the feature extraction ability of the network. A multi-scale detection network is added to enhance the detection capability of the model for different scale targets. Changing the CIoU loss function to SIoU function to reduce the problem of model convergence instability and improve the robustness of the model. Moreover, the results show that the detection accuracy and speed of the improved algorithm on the BDD100K public dataset reach 59.8% mAP and 96.2 FPS, respectively, representing an increase of 2.5% compared to that of the original algorithm. It shows that the improved algorithm has good detection accuracy while meeting the real-time requirements, which is suitable for traffic target detection tasks in complex situations.