Abstract:In the foggy scene, the captured image is blurred, the detail information is missing, and the target and the background are difficult to distinguish. Aiming at the problems of missed detection, false detection and slow recognition speed of existing deep learning target detection algorithms, a real-time object detection algorithm based on YOLOv7 in foggy weather is proposed. Taking YOLOv7 as the baseline, a cyclic defogging double sub-network including AOD defogging sub-network and foggy image generation sub-network is designed at the front end. The lightweight AOD defogging sub-network takes up little computing resources, effectively overcomes the negative impact of foggy days on the image, and enhances the feature extraction ability of the model. The fog image generation sub-network improves the dehazing performance of the AOD sub-network in the model training stage, and does not participate in the calculation during the test, which significantly reduces the inference time. The improved image reconstruction loss function introduces blurred image information, and the overall network unified training effectively combines defogging and detection tasks. The CityScapes data set is integrated into two foggy image data sets with different fog concentrations. The experimental results on the two data sets show that the average accuracy of the method is 65.2 % and 64.2 %, and the detection speed FPS is 42.4. The model accuracy is the best among all the comparison methods and can achieve real-time detection. Finally, the trained models are verified on the RTTS dataset, and the generalization ability of the designed model is better than other methods.