NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Research on Track Defect Visual Detection Method Based on Improved YOLOv7-tiny

Siyi Du, Shaohua JiaoHighlights 2025

Abstract

With the accelerated advancement of rail transit systems, conventional manual inspection methodologies exhibit significant limitations in both efficiency and accuracy. This study proposes a visual inspection framework for rail defects based on an enhanced YOLOv7-tiny model. By integrating the Convolutional Block Attention Module (CBAM) for channel-spatial dual-dimensional attention and Deformable Convolutional Networks (DCN) for irregular feature sampling, the model significantly improves the recognition of small-sized defects under complex environmental conditions. Experimental results demonstrate that the improved model achieves a 95.7% Mean Average Precision (mAP), representing a 7.3% enhancement over the baseline. Furthermore, the optimized network exhibits a 42% reduction in parameters and a 53% reduction in computational complexity, highlighting its suitability for deployment on resource-constrained edge devices.

Introduction: The Challenge of Automated Rail Inspection

Maintaining thousands of miles of railway track is a monumental task. Traditional manual inspection is slow, subjective, and potentially dangerous. While deep learning-based object detection offers an automated alternative, it faces three major roadblocks in the rail industry:

  1. Scale and Diversity: Defects range from millimeter-wide cracks to missing bolts, often hidden against complex, noisy backgrounds like ballast, rust, and shadows.
  2. Environmental Interference: High-speed cameras often produce motion-blurred images, and inspections must frequently occur in low-light or adverse weather conditions.
  3. Hardware Constraints: To be practical, these models must run in real-time on "edge" devices—compact computers mounted on inspection vehicles—which lack the horsepower of server-grade GPUs.
Example of rail surface defects, showing pitting and fine cracks that the model must identify against a complex metallic background.

Methodology: Optimizing YOLOv7-tiny

The authors propose an enhanced YOLOv7-tiny framework that balances a "lean" architecture with "smart" feature extraction through several key innovations:

  • Lightweight Backbone: The backbone was reconstructed using a CSPResNeXt50 architecture and implemented with depth-wise separable convolutions. This significantly reduces the parameter count without sacrificing the depth of feature extraction.
  • CBAM (Convolutional Block Attention Module): This adds a "dual-attention" mechanism, helping the model focus on what is important (channel attention) and where it is located (spatial attention), which is critical for spotting tiny defects in a busy image.
  • DCN (Deformable Convolutional Networks): Standard convolutions use fixed grids. DCN allows the model to "deform" its sampling grid to better fit the irregular shapes of cracks and spalling.
  • Night-time Enhancement: The team integrated a Retinex-based image enhancement module within a UNet framework. This decomposes dark images into illumination and reflection layers, effectively "turning on the lights" for the AI during nocturnal inspections.

Dataset and Training

The study utilized a Heterogeneous Multi-source Dataset to ensure robustness across different environments. This included field data captured at 71 FPS, simulated data created via 3D printing to represent rare damage types, and open-source data aligned using CycleGAN for domain adaptation. To prevent overfitting, the data was subjected to "contextual interference" (adding simulated ballast/rust) and geometric transformations.

Key Results and Performance

The improved model significantly outperformed the baseline YOLOv7-tiny across all critical metrics:

  • Precision: Achieved a 95.7% mAP, a 7.3% increase over the baseline.
  • Efficiency: Parameters dropped from 6.0M to 3.5M (42% reduction), and computational load dropped from 13.2 GFLOPs to 6.2 GFLOPs (53% reduction).
  • Robustness: The model showed a 35% improvement in recognizing motion-blurred targets and a 12.3% boost in low-light environments.
Convergence of the Box loss function over 200 training epochs, demonstrating the stability and learning efficiency of the improved model.

Beyond detection, the study proposes a practical maintenance workflow. Defects are categorized into Level 3 (Incipient), Level 2 (Developing), and Level 1 (Emergency) based on area and pixel ratios, allowing rail operators to prioritize repairs scientifically.

Conclusion

This research presents an innovative solution for intelligent track maintenance, achieving an optimal balance between precision and operational efficiency. By drastically reducing the computational footprint while increasing accuracy, the model is ready for real-time deployment on mobile inspection units. Future research will focus on expanding multi-modal data fusion—incorporating lidar or ultrasonic data—to make the system even more resilient to extreme global rail environments.

Summary updated

BibTeX
@inproceedings{du2025research,
  author = {Siyi Du and Shaohua Jiao},
  title = {{Research on Track Defect Visual Detection Method Based on Improved YOLOv7-tiny}},
  booktitle = {Highlights},
  year = {2025},
  doi = {10.54097/61jfgw45},
}
Figure