Abstract:【Objective】This study aims to address the issues of insufficient feature extraction and low multi-target detection accuracy in rail fastener defect detection. 【Methods】Based on the YOLOv13 algorithm, ContextGuidedBlock_Down (CGBlock_Down) was introduced to enhance multi-scale feature capture capability, a Diverse Branch Block (DBB) was adopted to improve convolutional representation diversity, and an iEMA was embedded to optimize feature fusion and inference efficiency.【Results】Experimental results indicate that the improved YOLO-CTGI model achieves an mAP50 of 95.9% on the fastener-defect-detection dataset, representing a 1.4% improvement compared with the original YOLOv13, and the parameter count is 5.7M. while the inference speed remains basically unchanged, the detection effect on missing and foreign object defects has been improved.【Conclusion】The proposed method effectively improves the recognition accuracy of fastener defects in complex scenarios while maintaining high detection speed, providing a reliable technical solution for intelligent railway maintenance.