In recent years, infrared target detection has played a crucial role in intelligent transportation and assisted driving. Addressing the current issues of low detection accuracy, poor robustness, and missed detections in infrared image detection, we propose an improved infrared road traffic detection algorithm, YOLOv8-EGP, based on YOLOv8s. Firstly, we replace the original C2f module with the SCConv convolution module to extract feature information of different sizes, thereby enhancing the perception of local features in infrared images and connecting spatial relationships between them. Then, in the head part, we use the dyhead detection head and combine three different dimensions with multi-attention, improving the expression ability of the detection head for infrared targets without increasing computational complexity. Finally, we add a small target detection layer (min) to reduce missed detections of small targets in infrared images and improve the final detection accuracy. The conducted ablation experiments show that on the FILIR public dataset, compared to YOLOv8s, the YOLOv8-EGP algorithm increases mAP50 by 6.1%, and precision and recall also increase by 5.8% and 1.6%, respectively, indicating that the improved model can better adapt to infrared target detection, validating the effectiveness of this method. © (2024), (International Association of Engineers). All Rights Reserved.