Abstract:This paper proposes a lightweight object detection model based on YOLOv10n to improve the accuracy of rail surface defect detection and enhance the recognition of small targets. The model incorporates C2f_CGBlock into the P3 and P4 layers of the backbone network to strengthen local context perception and feature representation. The feature fusion part uses RepGFPN and integrates SimAM into some feedback paths to emphasize critical features. The training process adopts Inner-SIoU loss function to optimize localization accuracy. Experimental results on a rail surface defect dataset showed that the improved model outperformed the original one, with improvements of 3.38%, 3.72%, 3.55% and 4.01% in Precision, Recall, F1 and mAP@0.5. The model demonstrates clear advantages over the baseline in detecting small-size defects and challenging backgrounds. It effectively enhances the performance of rail defect detection while maintaining a balance between accuracy and real-time efficiency, and has good potential for engineering applications.