Abstract:To solve the problem of small target detection and target occlusion, this study constructs corresponding traffic scenes based on the VisDrone2019 data set and proposes a small target detection algorithm. First, the shallow features of the backbone network are fully used to improve the problem of missing small targets. The small target detection layer P2 is added to the original network structure of the YOLOv7 algorithm, and a multi-level shallow information fusion module is added to the feature fusion network of the model of the small target detection layer P2, so as to improve the small target detection effect of the algorithm. Secondly, the global context module is used to build the connection between the target and the global context, enhance the ability of the model to distinguish between the target and the background, and improve the detection effect when the target is missing features due to occlusion. Finally, the CIoU loss function in the baseline model is replaced by NWD, a loss function specially designed for small targets in this study, so as to solve the problem that IoU itself and its extension are highly sensitive to the position deviation of small targets. Experiments show that the improved YOLOv7 model has improved by 2.3% and 2.8% respectively in the small target aerial photography data set VisDrone2019 (test set and validation set) with mAP.5:.95, achieving excellent detection results.