# An improved YOLOv8n with multi-scale feature fusion for real time and high precision railway track defect detection

**Authors:** Zhihong Zhang, Liling Zhang, Xin Lu, Tingting Ma, Feng Huang, Sheng Zhong

PMC · DOI: 10.3389/frai.2025.1711309 · 2026-01-09

## TL;DR

This paper introduces an improved YOLOv8 model for detecting railway track defects with high precision and efficiency, suitable for real-time applications.

## Contribution

The paper proposes a lightweight YOLOv8-based framework with novel modules for multi-scale feature fusion and small target detection in complex backgrounds.

## Key findings

- The model achieved 90.2% detection precision and 90.2% mAP@0.5 on a real-world track defect dataset.
- The model size was reduced to 5.2MB with 2.45M parameters while maintaining high performance.
- Ablation studies confirmed the effectiveness of each module in improving detection accuracy.

## Abstract

Railway transportation is increasingly critical for modern urban and intercity mobility. However, the expanding scale and intensifying operational intensity of rail networks have elevated track defect detection to a key concern. Traditional inspection methods (manual, ultrasonic, eddy current, magnetic flux leakage testing) are limited by insufficient accuracy, low efficiency, or poor adaptability to complex environmental conditions.

An enhanced defect detection framework based on an improved YOLOv8 algorithm was proposed, tailored for small targets and complex backgrounds. Three core improvements were integrated: 1) AVCStem module with variable convolution kernels to dynamically adapt to defects of different shapes and scales; 2) ADSPPF module using multi-scale pooling and multi-branch attention mechanisms to preserve fine-grained features across scales; 3) MSF module for enhanced multi-scale feature fusion via partial convolution and hierarchical feature alignment.

Experiments on a real-world track defect dataset showed the proposed model achieved 90.2% detection precision, 90.2% mAP@0.5, and 73.2% mAP@0.5:0.95. Meanwhile, the model size was reduced to 5.2MB with 2.45M parameters. Comparative and ablation studies confirmed the complementary advantages of each module and the model’s superior performance over existing lightweight detectors. The proposed model provides a robust, accurate, and efficient solution for real-time railway defect detection. It exhibits strong potential for deployment in edge AI devices and mobile inspection robots, addressing the limitations of traditional inspection methods.

## Full-text entities

- **Diseases:** railway defect (MESH:D000013)

## Figures

10 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12827737/full.md

---
Source: https://tomesphere.com/paper/PMC12827737