원시데이터 수집 시스템
선정목록으로

YOLOv8n-RSDD: A High-Performance Low-Complexity Rail Surface Defect Detection Network

관련 모빌리티 소재 · (4) 카시트 모듈

기본 정보

저자
  1. Z. L. Fang — School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China
  2. Liming Li — School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China
  3. Lele Peng — School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China
  4. Shubin Zheng — School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China
  5. Qianwen Zhong — School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China
  6. Ting Zhu — China Railway Shanghai Group Co., Ltd., Science and Technology Research Institute, Shanghai, China|||Science and Technology Research Institute of China Railway Shanghai Group Co., Ltd, Shanghai, China
DOI
10.1109/access.2024.3466559
저널
IEEE Access
발행년도
2024
발행기관
Institute of Electrical and Electronics Engineers
피인용수
4
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/access.2024.3466559
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W4402742629

평가 내용

관련도
관련
사업분야
모빌리티 소재 · (4) 카시트 모듈
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '모빌리티 소재 > 카시트 모듈' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Detecting surface defects on railway tracks is of significant importance for reducing the risk of safety incidents in high-speed railways. In response to the challenges in the field of railway track surface defect detection, such as insufficient detection performance, high model complexity, and difficulties in terminal device deployment, this study proposes a new type of railway track surface defect detection network named YOLOv8n-RSDD. The network uses a minimalist VanillaNet as the backbone network for feature extraction, effectively simplifying the model structure and accelerating inference speed. Further, the study introduces a slim-neck module based on GSConv convolution to replace the original C2f module, thereby enhancing performance and improving the detection capability for small targets. Additionally, the integration of the CBAM attention mechanism significantly enhances the network’s ability to capture key information on the railway track surface, strengthening perceptual performance. To obtain actual railway track images, this study developed an image acquisition system and constructed the Rail-1600 dataset specifically for the detection of railway track surface defects. Experimental results show that YOLOv8n-RSDD improved by 2.3% in the mAP@0.5 metric compared to YOLOv8n, while maintaining the stability of mAP@0.5:0.95. In terms of computational resource consumption, GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and inference speed was increased by 17.8%. YOLOv8n-RSDD also demonstrated outstanding performance on the RSDDs and NEU RSDDs-113 datasets, indicating its potential for practical application.

본문 75,064자

본문 펼치기
Received 14 August 2024, accepted 20 September 2024, date of publication 23 September 2024, date of current version 31 December 2024. _Digital Object Identifier 10.1109/ACCESS.2024.3466559_ # YOLOv8n-RSDD: A High-Performance Low-Complexity Rail Surface Defect Detection Network ZHANAO FANG 1, LIMING LI1, LELE PENG 1, (Member, IEEE), SHUBIN ZHENG 1,2, QIANWEN ZHONG 1, AND TING ZHU3 1School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai 201620, China 2Higher Vocational and Technical College, Shanghai University of Engineering Science, Shanghai 200437, China 3Science and Technology Research Institute, China Railway Shanghai Group Co., Ltd., Shanghai 200333, China Corresponding authors: Liming Li (liliming@sues.edu.cn) and LeLe Peng (lelepeng@sues.edu.cn) This work was supported in part by the National Natural Science Foundation of China under Grant 51975347, and in part by Shanghai Science and Technology Program under Grant 22010501600. ABSTRACT Detecting surface defects on railway tracks is of significant importance for reducing the risk of safety incidents in high-speed railways. In response to the challenges in the field of railway track surface defect detection, such as insufficient detection performance, high model complexity, and difficulties in terminal device deployment, this study proposes a new type of railway track surface defect detection network named YOLOv8n-RSDD. The network uses a minimalist VanillaNet as the backbone network for feature extraction, effectively simplifying the model structure and accelerating inference speed. Further, the study introduces a slim-neck module based on GSConv convolution to replace the original C2f module, thereby enhancing performance and improving the detection capability for small targets. Additionally, the integration of the CBAM attention mechanism significantly enhances the network’s ability to capture key information on the railway track surface, strengthening perceptual performance. To obtain actual railway track images, this study developed an image acquisition system and constructed the Rail-1600 dataset specifically for the detection of railway track surface defects. Experimental results show that YOLOv8nRSDD improved by 2.3% in the mAP@0.5 metric compared to YOLOv8n, while maintaining the stability of mAP@0.5:0.95. In terms of computational resource consumption, GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and inference speed was increased by 17.8%. YOLOv8n-RSDD also demonstrated outstanding performance on the RSDDs and NEU RSDDs-113 datasets, indicating its potential for practical application. INDEX TERMS Object detection, rail surface defects, deep learning, attention mechanism, YOLOv8, lightweight. I. INTRODUCTION Railway tracks serve as the cornerstone of high-speed rail systems, with surface defects posing a severe risk of damage to the wheel sets and bearings of trains, thereby impacting the operational lifespan and safety of the trains. These defects not only accelerate the wear of wheels but may also, under the periodic impacts, propagate inward, increasing the risk The associate editor coordinating the review of this manuscript and approving it for publication was Ugur Guvenc . of train derailment and severe accidents. Consequently, the timely detection and repair of surface defects on railway tracks are essential for ensuring the safety of railway transportation. Early detection can prevent rail fractures and train derailment, reduce the risk of accidents, and effectively safeguard the lives and property of passengers, ensuring the stable operation of the railway system [1]. Despite the ability of traditional manual inspections to identify defects, their cumbersome, labor-intensive, and error-prone nature, coupled with safety concerns for inspectors, emphasizes the necessity for developing automated and efficient inspection technologies. Non-Destructive Testing (NDT) is widely applied in the industrial field for defect detection due to its non-destructive nature, playing a vital role in early diagnosis and failure prevention [2]. Despite its significant advantages, the widespread application of NDT is limited by the high cost of equipment and stringent requirements for specialized skills. To address these challenges, researchers have begun to explore more advanced detection technologies. In recent years, machine vision-based railway track surface defect detection technologies have gained popularity due to their high efficiency and accuracy. These technologies are primarily divided into two categories: traditional image processing methods and deep learning-based methods. Traditional image processing methods, relying on manual feature extraction, can only capture basic features and struggle to obtain advanced semantic features and complex information, leading to low detection accuracy, long computation times, and a complex process [3]. In contrast, deep learning-based image processing methods can directly extract abundant high-level semantic information from images, demonstrating greater robustness and detection efficiency. By learning automatically from a vast amount of image data, these methods can extract high-level semantic features of the track surface state without human intervention, effectively dealing with interference factors such as uneven lighting, image distortion, or obstruction, thereby significantly enhancing detection accuracy and efficiency [4], [5], [6], [7], [8]. The advancement of this technology has not only enhanced the safety of the railway system but also revolutionized railway maintenance and inspection work, indicating that future railway inspections will increasingly depend on intelligent, automated solutions. As deep learning technology continues to mature, its application in the field of object detection has become more extensive and profound. Object detection in deep learning is primarily divided into two major schools: the two-stage detection algorithms based on region proposal frameworks and the more efficient single-stage detection algorithms. Algorithms such as R-CNN, its derivatives Fast-RCNN and Faster-RCNN, using the synergy of Region Proposal Networks (RPNs) and Convolutional Neural Networks (CNNs) to achieve precise localization and classification of targets [9], [10]. However, the high computational cost associated with candidate region screening in these methods leads to slower inference speed, making it difficult to meet the requirements of real-time detection, especially in resource-constrained environments. To address this challenge, researchers have turned to single-stage detection algorithms, which simplify the detection process and achieve faster detection. Single-stage detection algorithms like YOLO, SSD, and DETR directly extract features from the input image and predict the classification and location of the targets, eliminating candidate region generation, thereby significantly increasing detection speed [11], [12], [13]. They are particularly suitable for real-time application scenarios, capable to completing object detection in a single forward pass, typically with CNNs responsible for feature extraction and additional layers to predict the location and category of the targets. Although single-stage algorithms have the advantage of faster training and are suitable for real-time applications, their detection accuracy in small targets or complex scenes is usually not as good as two-stage algorithms and still requires further improvement. Deep learning models, despite their excellent performance in object detection tasks, often have high computational resource requirements that limit their application in resourceconstrained environments. Especially in scenarios involving the operation of high-speed trains, the detection system needs to process a large amount of data in an extremely short time. Therefore, how to effectively lightweight the object detection model while ensuring detection accuracy, reduce model complexity and reliance on hardware resources, reduce energy consumption, and promote the deployment of the model in practical environments has become a research focus in the field of railway track surface defect detection [14]. In the research and application of railway track surface defect detection, advanced terminal devices play an essential role. For instance, edge computing platforms such as the NVIDIA Jetson series, Huawei Ascend series, and Cambricon series offer computing capabilities ranging from tens to hundreds of TOPS [15], [16]. These devices provide a solid hardware foundation for running efficient AI algorithms. Taking the YOLOv8n model adopted in this study as an example, the model has 3.1M parameters and requiring 8.2 GFLOPs to operate. In the dataset utilized in this research, each 640 × 640 pixel image corresponds to an actual rail length of 0.2 meters. Considering the train operates at a speed of 100 kilometers per hour, approximately 140 images of 640 × 640 pixels will be generated per second. To achieve real-time defect detection, the detection system’s frame rate needs to achieve 140 frames per second. Moreover, when designing the system, sufficient computational redundancy must be reserved to adapt to variable operating conditions and potential performance fluctuations, ensuring the stability and reliability of the detection process and meeting the diverse needs of practical applications. Through the lightweight design and optimization of deep learning models, this study aims to achieve an efficient and energy-saving railway track surface defect detection system, adapting to the detection needs of high-speed train operation and promoting the widespread application of this technology in the field of railway traffic. Facing the challenge of deploying mainstream object detection models on terminal devices with limited computing resources, scholars domestically and internationally have proposed a variety of innovative methods to improve the FIGURE 1. YOLOv8n-RSDD network architecture. lightweight level and operational efficiency of models. For example, Liu et al. [17] proposed a pyramid feature-based and lightweight CNN method for railway surface defect detection, which significantly reduced the model parameters while improving detection efficiency and maintaining high-accuracy defect recognition capabilities through the optimization of network structure and loss function. Du [18] introduced the BiFPN network structure for multi-scale feature fusion and used the Varifocal Loss to optimize the issue of sample imbalance, ensuring the model’s real-time performance and flexibility through feature compression and computational efficiency optimization. Chen et al. [19] designed RailSegVITNet, a real-time railway track surface segmentation network based on the lightweight Vision Transformer (ViT), using lightweight bottleneck blocks, separated self-attention mechanisms, and multi-resolution feature aggregation strategies, achieving an average intersectionover-union (MIoU) of up to 91.43%. Dong et al. [20] improved YOLOv5, adopting C3Ghost and Ghost modules to optimize the network structure and introducing the CBAM attention mechanism, effectively reducing the model’s complexity and improving detection accuracy and efficiency. Yang et al. [21] proposed an improved CBAM-MobilenetV2YOLOv5 model, incorporating MobilenetV2 modules and CBAM attention modules, resulting in an even lighter steel surface defect detection model. Zhang et al. [22] proposed an improved Yolo-Fastest V2 model, significantly enhancing the speed and accuracy of target recognition on edge devices by integrating a position-enhanced feature pyramid network structure, an innovative grouped k-means clustering strategy, an advanced adaptive label assignment algorithm, and an efficient ShuffleNet V2 backbone network. Shen et al. [23] used a channel pruning algorithm to compress the YOLOv5s clustered detection model, significantly enhancing the model’s lightweight level, with the model parameter amount and memory occupation reduced by 79% and 76%, respectively. Despite the significant advancements in the research of lightweight object detection models, several challenges remain. First, existing models are often not fully optimized for specific terminal devices, which limits their deployment capabilities on resource-constrained devices. Second, efforts to reduce the number of parameters and computational burden sometimes sacrifice detection accuracy, or fail to significantly improve computational efficiency without losing accuracy. Moreover, some studies have not been deeply customized for specific tasks; they may still rely on traditional methods in feature extraction and attention mechanisms, failing to fully utilize the latest model structure design and optimization technologies. Upon reviewing the existing research progress of lightweight object detection models, we find several key issues that urgently need to be addressed. First, existing models generally have overly bloated network structures; the addition of too many modules and structures has increased the model’s complexity, which is not conducive to actual deployment on resource-constrained terminal devices. Second, attempts to reduce parameters and computational burden often come at the cost of detection accuracy, failing to achieve a balance between precision and efficiency. Third, without extensive comparative experiments to derive the optimal combination strategy, there is still room for improvement in the overall model performance. Lastly, the lack of actual data resources restricts the effectiveness of model training and verification. In response to these challenges, this study introduces the latest technological advancements in the field of target detection, the YOLOv8 network. As the latest member of the YOLO series, YOLOv8 inherits and develops the advantages of previous algorithms in real-time target detection, while significantly improving accuracy and speed, reaching the current state of the art (SOTA). YOLOv8 utilizes advanced deep learning techniques and network architecture optimization to enhance the model’s detection capability for small targets and demonstrate higher robustness in handling complex scenes. Additionally, YOLOv8 adopts an innovative modular concept in network design, allowing the model to be flexibly adjusted and optimized according to different application scenarios. Based on the core strengths of YOLOv8, this study creatively proposes a high-performance, low-complexity, and highly robust railway track surface defect detection network, YOLOv8n-RSDD (Rail Surface Defect Detection). This model not only inherits the high efficiency of YOLOv8 but also has been customized and improved to meet the unique detection needs of the field of railway traffic. YOLOv8nRSDD, through innovative network structure design, aims to overcome existing challenges, especially achieving breakthrough improvements in the accuracy and real-time nature of railway track surface defect detection, as shown in Figure 1. The main contributions of this study are as follows. (1) The use of a cleverly designed VanillaNet [24] minimalist network as the backbone network for feature extraction, which greatly simplifies the model architecture and significantly improves the model’s inference speed. Furthermore, by employing a modular design approach, the YOLOv8n-RSDD network allows the model to be flexibly adjusted and optimized for various application scenarios, better adapting to the needs of specific terminal devices. (2) The innovative introduction of a slim-neck module [25] based on GSConv convolution, replacing the original network’s C2f module. This improvement refines the model structure and enhances its detection performance for small target objects, compensating for the precision reduction brought by the VanillaNet network at a very low computational cost. (3) The integration of a hybrid attention mechanism module, CBAM [26], enhances the network’s feature perception capability, capturing key feature information on the railway track surface, thus addressing the limitations of traditional methods in feature extraction and attention mechanisms. (4) The construction of a railway track surface image acquisition system and the creation and release of the Rail1600 railway track surface status dataset, providing rich actual data resources for this study, which helps further train and verify the model, ensuring the practicality and effectiveness of the research results. The main structure of this study is as follows: The second part introduces the YOLOv8n model and the improved YOLOv8n-RSDD model; the third part presents the dataset used in this research; the fourth part conducts experiments on the proposed methods; the fifth part discusses the experimental results; and the sixth part draws conclusions. II. PROPOSED METHOD In this study, we propose an improved rail surface condition detection network based on the YOLOv8n backbone network architecture, termed YOLOv8n-RSDD. The YOLOv8nRSDD network primarily consists of three core components: the backbone network, the neck network, and the detection head. The backbone network is responsible for feature extraction from the input images, the neck network handles the fusion of features at different scales, and the detection head is tasked with producing the final detection outcomes. _A._ _YOLOv8n_ The YOLOv8n network structure is primarily composed of the following four core components. 1) INPUT MODULE The input module main function is data preprocessing, including adaptive scaling of input images and mosaic enhancement operations. Mosaic enhancement enriches the image background by randomly cropping and stitching four images together for training data, which not only accelerates network training speed but also helps prevent overfitting and enhances the model’s generalization capability. 2) BACKBONE NETWORK The backbone network consists of Conv, C2f, and SPPF modules, which are used to extract features from the input targets. Conv, as the fundamental convolutional unit of the YOLOv8 network, performs two-dimensional convolution, regularization, and activation operations. The C2f module introduces and implements the concept of cross-stage feature fusion to promote information transfer and integration, reducing the number of network parameters and improving computational efficiency. The SPPF (Spatial Pyramid Pooling - Fast) module processes targets at different scales, achieving a fusion of local and global features, effectively capturing contextual information in the image. 3) NECK NETWORK The neck network, composed of FPN and PAN structures, is responsible for the fusion of features at different scales. The FPN structure transfers semantic information from top to bottom, conveying deep semantic features to shallower layers, thereby enhancing semantic expression across multiple scales. The PAN structure transfers location information from bottom to top, conveying shallow positional information to deeper layers, enhancing positioning capabilities across scales. 4) DETECTION HEAD The detection head translates the extracted feature maps into the final results of object detection, including the location, category, and confidence of the targets. The YOLOv8 detection head processes feature maps at different scales to simultaneously detect small and large targets. Additionally, the detection head includes Non-Maximum Suppression (NMS) operations to filter and merge overlapping detection boxes, thereby enhancing detection accuracy. The YOLOv8 series comprises five versions, namely YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x, with each suffix indicating models of different sizes and complexities. YOLOv8n, being the smallest in width and depth among the series, is selected as the baseline model for this study due to its advantages of small size and fast speed, which meet the practical deployment requirements. _B._ _IMPROVED YOLOv8n-RSDD ALGORITHM_ Although the YOLOv8n model is the smallest in the YOLOv8 series, its computational requirements are still too high for terminal devices, and the model remains overly complex. To achieve the task of terminal deployment for rail surface defect detection, further optimization of the model is necessary. This study innovatively proposes a high-performance, low-complexity, and robust rail surface defect detection network, YOLOv8n-RSDD. Firstly, a minimalist and efficient VanillaNet module is used in the feature extraction network of the backbone to replace traditional convolutional modules, significantly reducing unnecessary branch structures and enhancing model efficiency. Secondly, a lightweight slimneck module is introduced into the neck network, replacing the third C2f module in the original network, to fully integrate features at different scales with minimal computational cost, improving the detection effect on small targets. Lastly, a CBAM attention mechanism module is introduced, replacing the fourth C2f module in the original network, enhancing the network’s representational capacity for image features and further compressing the model. The following sections will sequentially introduce the detailed design and functionality of these three improved modules. _C._ _VanillaNet MODULE_ VanillaNet is a neural network architecture centered on the minimalist concept, which, through a meticulously designed FIGURE 2. Architecture of vanillaNet. layer structure, abandons complex operations such as residual connections and self-attention mechanisms, focusing on fundamental convolutional computations. This simplification not only significantly reduces the computational burden of the model but also ensures efficient operation in resource-constrained environments while maintaining performance comparable to modern deep neural networks and Vision Transformers (ViT) [27]. The design philosophy of VanillaNet is its elegant simplicity, which avoids high depth and complex operations, streamlining the network. This streamlined design allows VanillaNet to operate efficiently on AI chips, which excel at handling parallel computing tasks. Each layer of VanillaNet is designed to be compact and direct, effectively overcoming the inherent complexity issues in traditional deep learning models. The VanillaNet-6 model, as shown in Figure 2, consists of six convolutional layers and a fully connected layer. It does not include residual connections or attention mechanisms, making it easy to deploy on hardware with limited resources. Inspired by classical neural networks such as AlexNet [28] and VGGNet [29], the VanillaNet-6 model achieves effective feature extraction by progressively downsampling the input feature maps and increasing the number of channels layer by layer. The design of the VanillaNet-6 model reflects the beauty of simplicity. Furthermore, it ensures the network captures important image features while maintaining computational efficiency. In the implementation of VanillaNet, the first convolutional layer utilizes a convolutional kernel of size 4 × 4 × 3 × _c_ with a stride of 4, transforming the three-channel input image into a feature map with _c_ channels. Subsequent convolutional layers reduce the size of the feature map and double the number of channels using max-pooling layers with a stride of 2. The fifth convolutional layer employs average pooling without increasing the number of channels. Finally, a fully connected layer outputs the classification results. From the second to the fifth convolutional layer, each layer uses a 1 × 1 convolutional kernel to preserve feature map information at minimal computational cost, and activation functions and batch normalization are applied after each convolutional layer to simplify the training process of the network. Although the VanillaNet architecture is straightforward, its relatively weak nonlinearity may limit the model’s performance. To address this issue, we employed deep training strategies and activation functions inspired by series. The deep training strategy initially trains two convolutional layers simultaneously with a single activation function, rather than training each convolutional layer separately, and then merges these two layers after training to reduce inference time. As training progresses, the activation function gradually evolves into an identity mapping. Furthermore, unlike traditional methods of stacking nonlinear activation layers to improve the nonlinearity of neural networks, the series-inspired activation function is based on the core idea of increasing the nonlinearity of each activation layer. This activation function includes multiple learnable affine transformations, further reducing the latency that may arise when there is an excess of parallel computing power. The application of these innovative technologies not only demonstrates the minimalist power of VanillaNet in design but also proves its efficiency and effectiveness in practical applications. Inspired by VanillaNet, this study designed an innovative module, the VanillaNet Module, and successfully integrated it into the YOLOv8n network, replacing some of the original convolutional modules to enhance the overall performance of the model. A critical deploy parameter was introduced into the VanillaNet Module to identify the current mode of the network: training mode or deployment mode, which has a decisive impact on the network’s behavior during different phases. During the training phase (deploy=False), as shown in Figure 1 the VanillaNet Module employs Batch Normalization (BatchNorm2d) and the LeakyReLU activation function to enhance the model’s learning capabilities. The Batch Normalization layer mitigates internal covariate shift by normalizing layer inputs, thereby accelerating the model’s convergence. Meanwhile, the introduction of the LeakyReLU activation function allows negative input values to produce a slight positive output, effectively preventing the ‘‘dead ReLU’’ problem during training. These designs enable the network to fully leverage the statistical properties of the data, enhancing feature learning and representation capabilities. During the deployment phase (deploy=True), the VanillaNet Module undergoes structural optimization to meet the efficiency requirements of the inference process. At this stage, Batch Normalization parameters are fused into the corresponding convolutional layers. Normalization and convolution operations are merged into a single, more efficient convolutional operation through mathematically equivalent transformations. This fusion reduces the number of model layers and the computational load during inference. Additionally, activation functions are integrated or replaced according to their types to ensure that the model’s inference speed is improved without compromising its performance. With this design, the VanillaNet Module can fully utilize advanced feature learning techniques during the training phase and demonstrate a compact and efficient network structure during the deployment phase, allows it highly suitable for environments with limited resources or strict response time requirements. _D._ _SLIM-NECK MODULE_ For on-vehicle edge computing devices on railway trains, deploying computationally intensive object detection models to achieve real-time detection presents significant challenges. To reduce the model’s complexity and enhance detection efficiency without compromising detection accuracy, this study innovatively replaces the third C2f module in the original YOLOv8n network with a lightweight slim-neck module [33], as shown in Figure 3. The slim-neck module, centered around the lightweight convolutional GSConv module, significantly improves the detection capability for small targets. It effectively extracts both shallow and deep features, reduces the model’s computational complexity, and maintains learning efficacy comparable to standard convolution. The slim-neck module initially employs the lightweight convolutional GSConv module to replace the traditional convolutional Conv module. The GSConv module combines FIGURE 3. Slim-neck module structure. FIGURE 4. CBAM attention mechanism module. group convolution and depthwise separable convolution, significantly reducing the model’s computational cost. It begins by using a standard convolutional Conv module to downsample the feature map. Then, a depthwise separable convolution DWConv generates a new feature map. These feature maps are concatenated using a Concat operation, followed by a shuffle operation to effectively arrange the channel numbers. Experimental results indicate that the GSConv module requires only 60% to 70% of the computational cost of the Conv module but contributes almost equally to enhancing the model’s learning efficacy. Through flexible assembly of Conv and GSConv modules, a comprehensively optimal VoV-GSCSP structure with the highest efficiency, as shown in Figure 3, was derived after extensive experimental validation. _E._ _CBAM ATTENTION MODULE_ To further optimize the model structure, reduce model complexity, and enhance the overall detection efficiency, this study introduces an efficient lightweight Convolutional Block Attention Module (CBAM) attention mechanism, as depicted in Figure 4. Inspired by an understanding of human cognition, this mechanism mimics our ability to focus on important information, enabling more accurate feature capture in images. CBAM significantly enhances the network’s representational capacity for image features by integrating channel and spatial attention modules, deepening the understanding of features across different channels and spatial locations. This dual attention mechanism not only strengthens the model’s identification of salient feature channels and reduces the interference of noise features but also enhances the model’s spatial perception of key regions in the image, thereby improving detection accuracy and robustness. Especially for fine-grained identification tasks such as rail surface defect detection, the introduction of the CBAM module effectively reduces missed detections due to overly small target pixels, which is crucial for enhancing the reliability of the detection system. CBAM, a lightweight universal module, integrates seamlessly into CNN architectures. It achieves significant performance improvements at a low computational cost and supports end-to-end training. The CBAM module processes intermediate feature maps by independently inferring channel and spatial attention maps along two dimensions, and then multiplies these attention maps with the input feature maps for adaptive feature refinement. In the channel attention module, feature maps are processed through max and average pooling to obtain two distinct feature maps, which are then integrated through a shared multilayer perceptron and activated using a Sigmoid function to weight the original input feature maps. In the spatial attention module, feature maps undergo max and average pooling to produce two single-channel feature maps. After concatenation, they are dimensionally reduced through a convolutional layer before being activated by a Sigmoid function. Finally, the outputs from the channel and spatial attention modules are multiplied to obtain the refined feature output of the CBAM module. III. DATASET _A._ _RAILWAY TRACK SURFACE IMAGE ACQUISITION_ _SYSTEM_ In the field of railway track surface defect detection, existing datasets of railway track surface images face numerous challenges, including limited scale, poor image quality, scarcity of surface defect samples, image distortion, and privacy protection issues. Obtaining a large number of real-world railway track surface images that are of high quality and rich in surface defects is a significant task in this domain [30]. To address these challenges, we have designed and implemented a railway track surface image acquisition system. This system, equipped with high-definition cameras on subway trains, collects real-time images of the track surface, effectively achieving online image acquisition. The system schematic is shown in Figure 5. A key component of the system is the DALSA Linea L-FM-08K30H-00-R high-speed CMOS line-scan camera, which boasts a resolution of 3264 × 4 and is distinguished by its high sensitivity and low noise. With a maximum FIGURE 5. Railway track surface image acquisition system. line frequency of 300K Hz and a data transmission rate of up to 4.8GBytes/s, it is capable of meeting the image acquisition needs at train speeds of 300Km/h. The camera is mounted on a dedicated bracket on the subway train, with the lens positioned 440mm above the track surface, maintaining a 90 degrees perpendicular shooting angle. To address issues such as shadows and overexposure, a supplementary laser light source is installed on one side of FIGURE 6. Rail surface waves. the camera. It provides high-intensity illumination in dimly lit environments, ensuring image stability, texture clarity, and improved foreground-background discrimination. Each frame of the image is composed of 3264 lines of pixels, with each pixel having a resolution of 0 _._ 365 × 0 _._ 365 mm. The panoramic grayscale images captured by the line-scan camera, with a resolution of 3264 × 512, are then stored in the reception terminal inside the train carriage and uploaded to a cloud server for backup. _B._ _DATASET_ To validate and evaluate the performance of the YOLOv8nRSDD model, we selected three distinct datasets of rail surface imagery. These encompass our team’s proprietary Rail-1600 dataset, the Railway Surface Discrete Defects (RSDDs) dataset, and the Northeastern University Rail Surface Defects (NEU RSDDs-113) dataset. We divided each dataset into training, validation, and testing sets following an 8:1:1 ratio, a standard approach supported by preliminary experimental outcomes within the deep learning community. This partitioning strategy ensures intensive training data to discern rail defects while maintaining robust subsets for validation and testing, essential for assessing the model’s generalization and stability. Our experiments also included alternative ratios such as 7:2:1 and 7:1.5:1.5, but the 8:1:1 ratio consistently demonstrated enhanced model performance, underscoring its efficacy. (1) Our railway track surface defect dataset, Rail-1600: Utilizing images captured by our rail surface image acquisition system, we have successfully constructed a real-world rail surface dataset. The system conducted a comprehensive image data collection across a 180.909-kilometer track section from location A to location B, with an average inspection speed of 70 kilometers per hour, ensuring the efficiency and coverage of data collection. During the data collection process, we meticulously documented various types of track surface damages, including 70 cases of rail surface waves, 46 cases of railway track switch, 125 cases of rail surface damage, and thousands of instances of rail track joint conditions. Additionally, we recorded 3 instances of rail clip misalignment and 7 cases of rail clip missing; however, anomalies such as rail surface light bands, track slab cracks, foreign objects on the track, and sleepers’ cracks or losses were not observsed. We paid particular attention to the long-tail distribution issue within the dataset, noting an imbalance ratio of up to several dozen times between the majority and minority FIGURE 7. Railway track switch. FIGURE 8. Rail track joint. FIGURE 9. Rail surface damage. FIGURE 10. Normal rail track. categories. Existing research has indicated that this long-tail distribution may adversely affect the performance of learning models [31]. To address this challenge, in constructing our dataset, we carefully selected the four most representative rail conditions: rail surface waves, railway track switch, rail track joint, and rail surface damage, forming our Rail-1600 dataset, as shown in Figure 6 to Figure 10. During the dataset construction process, we adopted a strategy of mixing left and right track images, without distinguishing between left or right rail tracks in the dataset. This approach aims to enhance the generalizability of model training and testing, and to prevent the model from overfitting to specific rail track defect locations. The source images obtained are 3264 × 512 pixels in size, with a significantly different aspect ratio. Given the recommended input size of 640 × 640 pixels for the YOLOv8n-RSDD network, using these images directly for training would inevitably lead to excessive compression of minor features, which is detrimental to the model’s learning. To address this issue, we performed preprocessing on the dataset. Firstly, we scaled the source images to 4080 × 640 pixels, maintaining the aspect ratio, and then centrally cropped them to produce six 640 × 640 pixel images. From these, we carefully selected representative and high-quality images to form our new dataset. To ensure the accuracy and professionalism of the data annotation, we invited experts in the field of railway to conduct the annotation work. After rigorous screening, we selected 40 images for each type of surface defect for further study. To expand our dataset, we applied data augmentation techniques, increasing its size by 900%. These enhancement methods included randomly adjusting image brightness, changing hue, introducing random noise and salt-and-pepper noise, random cropping, converting to a cartoon style, applying Gaussian blur, and performing horizontal and vertical flips. Through this series of processes, we ultimately obtained 1600 highquality railway track surface images, with 400 images for each defect type. These images constitute our Rail-1600 railway track surface dataset, as shown in Figure 11. (2) RSDDs dataset: The RSDDs [32] is composed of two subsets; the Class I subset contains 67 high-speed railway images, while the Class II subset contains 128 conventional railway images. The image resolution for the Class I subset is 160 × 1000 pixels, and for the Class II subset, it is 55×1250 pixels, with both exhibiting a significant difference in aspect ratio. These images are focused exclusively on the condition of the track surface, excluding irrelevant information such as track fastenings and ballast. In preprocessing the RSDDs dataset, we adopted a strategy similar to that used for the Rail-1600 dataset. Specifically, we evenly divided the images in the Class I subset into two parts and those in the Class II subset into eight parts, then resized these images to 204 × 640 pixels and 225 × 640 pixels, respectively. After a selection and data augmentation process, we ultimately obtained a total of 2000 high-quality image samples. (3) NEU RSDDs-113 dataset: This dataset [33] consists of 113 images that depict railway track surface defects at various resolutions, as shown in Figure 12. The size of each image is varying sizes and primarily includes four types of defects: holes, scratches, sunken areas, and corrosion. To construct a more dataset, we selected 100 representative images from the original dataset and standardized their dimensions to 640 × 640 pixels to meet the input requirements of the YOLOv8n-RSDD network. Subsequently, we performed data augmentation on these 100 images, which included operations such as rotation, scaling, cropping, and color transformation, to increase the diversity of the images and enhance the model’s generalization ability. Through these processes, we successfully expanded the dataset to 1000 images. IV. EXPERIMENTAL RESULTS AND ANALYSIS _A._ _EVALUATION METRICS_ In the forthcoming experiments, we employ six pivotal metrics to comprehensively and quantitatively assess the TABLE 1. Experimental environment and hyperparameter Settings. performance of the YOLOv8n-RSDD network and its related methods. These evaluation criteria encompass: mean Average Precision (mAP@0.5), mean Average Precision across varying confidence thresholds (mAP@0.5:0.95), computational complexity of the model (GFLOPs), the count of model parameters (Parameters), the storage size of the model (Model Size), and inference speed in the PyTorch environment (Speed_PyTorch). Utilizing these metrics, we delve into the analysis of the model’s accuracy, efficiency, and practicality. _B._ _EXPERIMENTAL ENVIRONMENT SETUP_ Given that varying experimental environments and parameter configurations might lead to discrepancies in the final outcomes of models, it is essential to maintain consistency across experiments. All experiments in this study were conducted on the same server to ensure the comparability and reproducibility of the results. The specific experimental environment and hyper parameters used are detailed in Table 1. _C._ _ABLATION STUDY_ 1) IMPACT OF DIFFERENT MODULES To validate the significant performance enhancement effects of the VanillaNet module, slim-neck module, and CBAM module introduced in this study on the baseline model, we conducted a series of ablation experiments on the Rail-1600 dataset. These experiments aim to thoroughly analyze the individual contributions and combined effects of each module on the model’s performance, comprehensively assessing their applicability and advantages in the Rail-1600 scenario. Starting with the baseline model, we incrementally introduced one, two, or all three improved modules to systematically evaluate the impact of each on model performance. Through this incremental approach, we were able to clearly observe the specific effects of each module on the model in terms of detection accuracy, parameter volume, and inference speed. The results of the experiments are summarized in Table 2, where B represents the Baseline, V represents VanillaNet, S represents slim-neck, and C represents CBAM. In the ablation study on the Rail-1600 dataset, integrating the VanillaNet module into the YOLOv8n baseline network significantly reduced the model’s parameter count, with a 38.2% decrease in GFLOPs, a 42.5% reduction in FIGURE 11. Rail-1600 dataset overview. TABLE 2. Ablation study results on the rail-1600 dataset. FIGURE 12. NEU RSDDs-113 dataset overview. parameter count, a 41.5% reduction in model size, and a 20.4% increase in inference speed. Despite the minor 1.0% drop in mAP@0.5 and a more significant 0.9% drop in mAP@0.5:0.95 due to architectural simplification, further optimization is needed to restore performance. This performance loss may be attributed to VanillaNet’s simplistic design, which shows insufficiency in feature extraction when dealing with highly complex datasets. To enhance VanillaNet’s performance, customized adjustments to its depth training strategies and activation functions may be required to ensure the model can accurately capture the nonlinear characteristics of the data. Integrating both the VanillaNet and slim-neck modules into the YOLOv8n network resulted in a significant boost in mAP, but also a decrease in inference speed due to the high memory access cost associated with slim-neck’s operations. To improve inference speed, deeper optimization of the model is necessary. The slim-neck module, designed with the innovative lightweight convolutional technology GSConv, combines standard convolution with depthwise separable convolution and introduces a channel shuffle strategy. This design not only optimizes the interaction between feature channels but also enhances the model’s inference speed by reducing redundant computations, while maintaining the ability for feature extraction and fusion at a reduced computational cost. After integrating the VanillaNet, slim-neck, and CBAM modules, CBAM’s attention mechanism enables the model to automatically focus on key channels and locations in the input feature maps, effectively reducing the feature dimension and computational overhead. This integration not only enhances the model’s representational power but also, due to its lightweight nature, achieves seamless integration with existing CNN architectures, achieving significant performance improvements at a small increase in parameters and FIGURE 13. Detection results of different module combinations. computational cost. The model’s GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and the inference speed was increased by 17.8%, making deployment on mobile devices or embedded systems possible. The CBAM module significantly enhances the model’s performance with its finely designed channel and spatial attention mechanisms, which adaptively optimize feature maps, strengthen key features, and suppress irrelevant information, greatly enhancing the model’s representational capabilities. Its end-to-end trainability ensures co-evolution with other network components during training. Combined with VanillaNet and slim-neck, CBAM reduces computational load and improves accuracy, demonstrating excellent performance and application potential in resource-constrained environments. These optimizations lay the foundation for the model’s widespread adoption in a variety of application scenarios, especially in situations requiring high real-time and accuracy demands. Incorporating these optimizations, the model not only demonstrates the sophistication and efficiency of its architecture but also lays a solid foundation for its widespread adoption across diverse application scenarios, particularly in situations with stringent requirements for real-time performance and accuracy. Figure 13 contrasts the target detection results of YOLOv8n and the proposed YOLOv8-RSDD on the Rail-1600 dataset, highlighting the significant improvements and notable enhancement in overall performance of YOLOv8n-RSDD in detecting multiple, small, and challenging targets. In the figure, B represents the results of the Baseline model, B+V indicates the model results after the integration of VanillaNet, B+V+S signifies the model with the further incorporation of the slim-neck module, and B+V+S+C denotes the final YOLOv8-RSDD model integrated with the CBAM attention module. 2) THE IMPACT OF THE BACKBONE NETWORK This study conducted an in-depth exploration of the performance of the YOLOv8n network integrated with various lightweight backbone networks. After a systematic evaluation and comparison of networks such as ShuffleNetV2 [34], EfficientNetV2 [35], GhostConv [36], MobileOne [37], RepConv [38], and Swin Transformer [39], the YOLOv8nVanillaNet demonstrated dual advantages of accuracy and speed in object detection tasks, making it particularly suitable for applications that require high real-time and precision standards. ShuffleNetV2, by introducing pointwise group convolution and channel shuffle technologies, effectively enhances the efficiency of information interaction, enabling it to efficiently perform object detection tasks on resourceconstrained devices. EfficientNetV2 adopts a compound scaling method for networks, optimizing the model through neural architecture search technology, improving efficiency, and surpassing traditional convolutional networks. MobileOne, optimized for mobile devices, designed the MobileOne Block module, employing over-parametrization branches and model scaling strategies to adapt to different computational requirements. GhostConv extends the depth of feature maps through linear transformations, reducing computational load while maintaining efficient feature extraction. RepConv leverages model reparameterization technology to merge computational modules during the inference phase, reducing computational load and memory consumption. Swin Transformer combines the Transformer architecture with convolutional neural networks, adopting hierarchical and windowed local attention mechanisms to effectively handle large-size images and enhance performance. In a series of ablation experiments, as shown in Table 3, YOLOv8n-VanillaNet excelled in inference speed while maintaining the minimization of model parameters and size, achieving a 20.4% increase in inference speed compared to the original YOLOv8n. Although the YOLOv8n-Swin Transformer showed the best performance in detection accuracy, its speed limitations restricted its applicability in practical deployment. YOLOv8n-VanillaNet, with its rapid inference speed and resource optimization, provides an efficient solution for real-time object detection, particularly suitable for edge computing and resource-constrained application environments, offering significant insights for the design of lightweight object detection models. 3) THE IMPACT OF ATTENTION MECHANISMS Attention mechanisms are a key technique in deep learning to enhance model performance, especially prominent in TABLE 3. Impact of backbone network selection on performance. processing visual tasks such as object detection. These mechanisms dynamically adjust the response intensity of features within the network, enabling the model to focus on critical information while ignoring irrelevant background or noise interference. In the design of the YOLOv8n network, the introduction of attention modules aims to strengthen the network’s perceptual capabilities, allowing it to more accurately identify and focus on key features while suppressing irrelevant information. This innovative improvement makes the network more efficient in understanding and utilizing input data, particularly in performing tasks such as object detection. Different attention modules, based on their design strategies, aim to meet the network’s optimization needs in channel and spatial dimensions. For instance, Channel Attention (CA) [40] focuses on learning the weight distribution of each channel, guiding the network to concentrate on channels that convey important information. In contrast, Spatial Attention (SA) [41] emphasizes the weight of key areas in the image by learning and enhancing the network’s ability to recognize spatial features. The Squeeze-and-Excitation (SE) [42] module is dedicated to improving the expressive power of channel features. The Exponential Moving Average (EMA) [43] attention module is an efficient multi-scale attention mechanism that integrates some channels on the batch dimension and processes the channel dimension in groups, ensuring the even distribution of spatial semantic features in each feature group. Its core goal is to enhance the network’s sensitivity to multi-scale features while reducing computational costs by retaining important information. The Convolutional Block Attention Module (CBAM) [26] combines channel and spatial attention mechanisms, further enriching the diversity of feature expression. Overall, the integration of these attention modules aims to increase the network’s flexibility and sensitivity, enhancing its performance in handling complex tasks. In the YOLOv8n baseline network, we introduced SE and EMA attention mechanisms and compared them with the CBAM attention mechanism. The experimental results are shown in Table 4. The data in the table indicates that after the introduction of the CBAM attention mechanism, YOLOv8nCBAM improved the mAP@0.5 by 0.8% compared to the original YOLOv8n network, while reducing the model’s computational load (GFLOPs) by 44.5%, the number of parameters (Parameters) by 54.8%, the model size (Model Size) by 56%, and increasing the inference speed by 7.4%. These results demonstrate that the CBAM attention mechanism not only enhances model performance but also shows superior optimization effects compared to all other tested attention modules. _D._ _COMPARISON WITH RELEVANT FRAMEWORKS_ In this study, we conducted a comprehensive comparison of YOLOv8-RSDD with several state-of-the-art deep learning-based object detection frameworks, including YOLOv3 [11], YOLOv3-SPP [44], YOLOv3-tiny [45], YOLOv5 [46], YOLOv5-P6 [47], YOLOv6 [48], and different versions of the YOLO series such as YOLOv8n and YOLOv8s. Table 5 illustrates the performance comparison of our improved algorithm with the aforementioned algorithms, involving datasets such as our collected Rail-1600 dataset (D1), RSDDs dataset (D2), and NEU RSDDs-113 dataset (D3). YOLOv3-SPP, an enhanced version of YOLOv3, integrates a Spatial Pyramid Pooling (SPP) layer to achieve the fusion of local and global features, enhancing the model’s ability to handle targets of various sizes and its sensitivity to spatial context, potentially offering superior performance and accuracy. YOLOv3-tiny is a lightweight version of YOLOv3, utilizing Darknet-19 as its backbone network, reducing the detection layer scales to two, minimizing network depth and parameter count, and decreasing computational complexity to provide faster inference speeds in resource-constrained environments. YOLOv5-P6 is a further refined version based on YOLOv5, with an optimized detection head structure, expanded to four scales of output, and enriched with additional convolutional and up-sampling layers to better integrate multi-scale features, aiming to improve the model’s capability in detecting complex scenes and small targets. YOLOv6, the latest iteration in the YOLO series, introduces a suite of innovative features, including an optimized efficient backbone network, enhanced multi-scale feature fusion techniques, an improved anchor box mechanism, and a novel loss function. These integrated improvements significantly boost the model’s accuracy and speed in detecting targets of various sizes while maintaining a lightweight model, ensuring efficient operation in diverse resource-constrained environments. In this section, we focus on the Rail-1600 dataset and present the visualized results in Figure 14, gathered from the TABLE 4. Impact of different attention mechanisms on performance. TABLE 5. Comparative experimental results of YOLOv8n-RSDD and related frameworks. FIGURE 14. Detection results on the Rail-1600 dataset. training data obtained during the experiments. It is observable that as the number of iterations increases, the model’s precision, recall rate, mAP@0.5, and mAP@0.5:0.95 all exhibit an upward trend. Notably, our proposed YOLOv8n-RSDD network achieves the best performance in all evaluation metrics except for mAP@0.5:0.95. Additionally, Precision, Recall, mAP@0.5, and mAP@0.5:0.95 demonstrate rapid improvement during the iterative process and gradually approach stable values, as shown in Figure 15. 1) DETECTION RESULTS ON THE RAIL-1600 DATASET As shown in Figure 14, in the detection experiments conducted on the Rail-1600 dataset we established, the YOLOv8n-RSDD network demonstrated superior performance compared to several other advanced detection methods. While most frameworks may generate false positives or false negatives during detection, our YOLOv8nRSDD network achieved comparable detection results to the YOLOv8s network with the fewest parameters and the fastest detection speed, perfectly identifying rail surface waves, railway track switch, railway track joint, and rail surface damage. This outcome not only showcases the broad application potential of the YOLOv8n-RSDD network but also provides a novel solution for the rail surface defect detection field. Additionally, by combining the data from Figure 14 and Table 5, we can observe that while YOLOv3tiny has the fastest detection speed, its accuracy is insufficient FIGURE 15. Performance metrics trend analysis of YOLOv8n-RSDD and other networks on the Rail-1600 dataset. for practical application requirements; the YOLOv3 and YOLOv3-SPP networks may exhibit missed detections; YOLOv5 and YOLOv5-P6, although having higher detection accuracy, are slower and cannot meet the needs of real-time model deployment; YOLOv6 and YOLOv8n, although faster, require improvement in detection accuracy. The quantitative data provided in Table 5 further confirm the superiority of YOLOv8n-RSDD in performance. Ultimately, Figure 15 compares the experimental curves of the seven methods; as training iterations progress, the curve of YOLOv8n-RSDD almost completely envelops the curves of the other methods, indicating that the framework proposed in this study achieved the highest mAP@0.5(%), and the mAP@0.5:0.95(%) is only slightly lower than that of YOLOv8s. 2) DETECTION RESULTS ON THE RSDDs DATASET The detection results depicted in Figure 16 reveal that even on the relatively simple RSDDs dataset, some networks still exhibit missed and false detections. However, the YOLOv8n-RSDD network continued to demonstrate its superior performance by perfectly detecting all targets. Combined with the experimental results shown in Table 5, the YOLOv8n-RSDD not only achieved higher detection accuracy than the YOLOv8s but also showed an advantage in detection speed. Although slightly slower in speed compared to the YOLOv6, the YOLOv8nRSDD’s streamlined parameter count makes the model more lightweight. In the detection experiments on the RSDDs dataset, the YOLOv8n-RSDD network showcased its exceptional detection capabilities, accurately completing the detection tasks even when the target features were relatively straightforward. Compared to other networks that occasionally missed or falsely detected targets, the YOLOv8n-RSDD provided a more reliable and accurate detection solution, significantly reducing the incidence of misses and false alarms. Comparing the experimental results, the YOLOv8nRSDD’s advantage in accuracy is evident, and it is also competitive in speed. Although slightly slower than the YOLOv6 in terms of speed, its smaller parameter count offers greater potential for deployment on devices with limited resources. Additionally, the model size of the YOLOv8n-RSDD has been effectively controlled, which not only helps to speed up the model loading but also reduces the memory burden. These features make the YOLOv8n-RSDD highly suitable for real-time target detection applications on mobile devices and embedded systems, offering an efficient and practical solution. FIGURE 16. Detection results on the RSDDs dataset. 3) DETECTION RESULTS ON THE NEU RSDDs-113 DATASET When confronted with the challenges of the RSDDs-113 dataset, the YOLOv8n-RSDD network has demonstrated its exceptional performance in complex image target detection tasks. Characterized by multiple and diverse targets within the images, as well as multi-scale rusted rail images captured under varying lighting conditions, the dataset poses a severe test to the model’s accuracy and robustness. As shown in Figure 17, in this test, the YOLOv8n-RSDD network excelled, not only surpassing the other six frameworks in visual presentation but, more importantly, showing a significant advantage in detection precision. Even under conditions of complex backgrounds and unstable lighting, the network was able to consistently identify all targets in the images without any false positives or false negatives. This achievement highlights the outstanding capabilities of YOLOv8n-RSDD in feature extraction and spatial perception. Thanks to the synergistic effects of its integrated VanillaNet, slim-neck module, and CBAM attention mechanism, YOLOv8n-RSDD maintains a high level of detection performance when dealing with complex visual scenes. Moreover, the robustness of YOLOv8n-RSDD is equally impressive, as it can adapt to and overcome unpredictable detection environments in the real world. This not only confirms its potential in industrial detection applications but also lays a solid foundation for its deployment in a broader range of scenarios in the future. With further optimization and improvements in model structure, YOLOv8n-RSDD is expected to achieve faster and more accurate detection results in the field of object detection. FIGURE 17. Detection results on the NEU RSDD-113 dataset. V. CONCLUSION This study addresses the challenges in the field of rail surface defect detection, such as low detection efficiency, large model parameter size, and difficulties in terminal device deployment, by proposing an innovative lightweight detection network, YOLOv8n-RSDD. This network integrates the VanillaNet backbone, slim-neck module, and CBAM attention mechanism on the basis of YOLOv8n. The minimalist design philosophy of VanillaNet optimizes the model structure and significantly enhances the inference speed, laying the foundation for rapid detection. The introduction of the slim-neck module, based on GSConv convolution technology, further improves the model’s sensitivity to small target detection. The addition of the CBAM module enhances the network’s ability to capture rail surface features, thereby increasing detection accuracy. In addition, this study has developed a rail surface image acquisition system and constructed the Rail-1600 dataset, providing the YOLOv8n-RSDD network with abundant real-world image resources, ensuring the scientific and effective model training and verification. The experimental results are encouraging; YOLOv8nRSDD outperforms existing deep learning-based detection frameworks on three different defect datasets, including Rail1600. Specifically, YOLOv8n-RSDD improved by 2.3% in the mAP@0.5 metric compared to YOLOv8n, while maintaining stability in mAP@0.5:0.95. In terms of computational resource consumption, GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and inference speed was increased by 17.8%. These improvements demonstrate the potential of YOLOv8n-RSDD in practical applications. Despite the significant performance gains, there is still room for improvement in the efficiency and application range of YOLOv8n-RSDD. Future work will focus on model lightweighting techniques such as quantization, pruning, and distillation to further optimize the model for a broader range of application scenarios. At the same time, with the rapid development of neural network compiler technologies such as TVM [49] and MLIR [50], the deployment of YOLOv8n RSDD on edge computing devices will become more efficient and convenient, providing technical support and possibilities for the online real-time monitoring of rail surface defects. REFERENCES [1] L. Kou, ‘‘A review of research on detection and evaluation of the rail surface defects,’’ _Acta_ _Polytechnica_ _Hungarica_, vol. 19, no. 3, pp. 167–186, 2022. [2] R. Yang, Y. He, B. Gao, G. Y. Tian, and J. Peng, ‘‘Lateral heat conduction based eddy current thermography for detection of parallel cracks and rail tread oblique cracks,’’ _Measurement_, vol. 66, pp. 54–61, Apr. 2015. [3] L. Peng, S. Zheng, P. Li, Y. Wang, and Q. Zhong, ‘‘A comprehensive detection system for track geometry using fused vision and inertia,’’ _IEEE_ _Trans. Instrum. Meas._, vol. 70, pp. 1–15, 2021. [4] X. Ni, Z. Ma, J. Liu, B. Shi, and H. Liu, ‘‘Attention network for rail surface defect detection via consistency of intersection-over-union(IoU)guided center-point estimation,’’ _IEEE Trans. Ind. Informat._, vol. 18, no. 3, pp. 1694–1705, Mar. 2022. [5] S. Yanan, Z. Hui, L. Li, and Z. Hang, ‘‘Rail surface defect detection method based on YOLOv3 deep learning networks,’’ in _Proc. Chin. Autom. Congr._ _(CAC)_, Nov. 2018, pp. 1563–1568. [6] D. Zheng, L. Li, S. Zheng, X. Chai, S. Zhao, Q. Tong, J. Wang, and L. Guo, ‘‘A defect detection method for rail surface and fasteners based on deep convolutional neural network,’’ _Comput. Intell. Neurosci._, vol. 2021, no. 1, Jan. 2021, Art. no. 2565500. [7] C.-C. Hsieh, T.-Y. Hsu, and W.-H. Huang, ‘‘An online rail track fastener classification system based on Yolo models,’’ _Sensors_, vol. 22, no. 24, p. 9970, Dec. 2022. [8] S. Zheng, Y. Wang, L. Li, X. Chen, L. Peng, and Z. Shang, ‘‘A railway fastener inspection method based on abnormal sample generation,’’ _Comput. Model. Eng. Sci._, vol. 139, no. 1, pp. 565–592, 2024. [9] K. He, G. Gkioxari, P. Dollár, and R. Girshick, ‘‘Mask R-CNN,’’ in _Proc._ _IEEE Int. Conf. Comput. Vis. (ICCV)_, Oct. 2017, pp. 2961–2969. [10] R. Girshick, ‘‘Fast R-CNN,’’ in _Proc. IEEE Int. Conf. Comput. Vis. (ICCV)_, Dec. 2015, pp. 1440–1448. [11] J. Redmon and A. Farhadi, ‘‘YOLOv3: An incremental improvement,’’ 2018, _arXiv:1804.02767_ . [12] W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.-Y. Fu, and A. C. Berg, ‘‘SSD: Single shot multibox detector,’’ in _Proc._ _14th_ _Eur._ _Conf. Comput. Vis. (ECCV)_ . Amsterdam, The Netherlands: Springer, 2016, pp. 21–37. [13] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, ‘‘End-to-end object detection with transformers,’’ in _Proc._ _Eur. Conf. Comput. Vis._ Springer, 2020, pp. 213–229. [14] Q. Zhou, H. Shi, W. Xiang, B. Kang, and L. J. Latecki, ‘‘DPNet: Dual-path network for real-time object detection with lightweight attention,’’ _IEEE_ _Trans. Neural Netw. Learn. Syst._, 2024. [15] A. Reuther, P. Michaleas, M. Jones, V. Gadepally, S. Samsi, and J. Kepner, ‘‘AI and ML accelerator survey and trends,’’ in _Proc. IEEE High Perform._ _Extreme Comput. Conf. (HPEC)_, 2022, pp. 1–10. [16] S. Shi, Q. Jiang, X. Jin, W. Wang, K. Liu, H. Chen, P. Liu, W. Zhou, and S. Yao, ‘‘A comparative analysis of near-infrared image colorization methods for low-power NVIDIA Jetson embedded systems,’’ _Frontiers_ _Neurorobot._, vol. 17, Apr. 2023, Art. no. 1143032. [17] Y. Liu, H. Xiao, J. Xu, and J. Zhao, ‘‘A rail surface defect detection method based on pyramid feature and lightweight convolutional neural network,’’ _IEEE Trans. Instrum. Meas._, vol. 71, pp. 1–10, 2022. [18] F.-J. Du and S.-J. Jiao, ‘‘Improvement of lightweight convolutional neural network model based on Yolo algorithm and its research in pavement defect detection,’’ _Sensors_, vol. 22, no. 9, p. 3537, May 2022. [19] Z. Chen, J. Yang, and F. Zhou, ‘‘RailSegVITNet: A lightweight VIT based real-time track surface segmentation network for improving railroad safety,’’ _J._ _King_ _Saud_ _Univ.-Comput._ _Inf._ _Sci._, vol. 36, no. 1, Jan. 2024, Art. no. 101929. [20] X. Dong, S. Yan, and C. Duan, ‘‘A lightweight vehicles detection network model based on YOLOv5,’’ _Eng. Appl. Artif. Intell._, vol. 113, Aug. 2022, Art. no. 104914. [21] L. Yang, X. Huang, Y. Ren, and Y. Huang, ‘‘Steel plate surface defect detection based on dataset enhancement and lightweight convolution neural network,’’ _Machines_, vol. 10, no. 7, p. 523, Jun. 2022. [22] H. Zhang, D. Xu, D. Cheng, X. Meng, G. Xu, W. Liu, and T. Wang, ‘‘An improved lightweight YOLO-fastest V2 for engineering vehicle recognition fusing location enhancement and adaptive label assignment,’’ _IEEE_ _J._ _Sel._ _Topics_ _Appl._ _Earth_ _Observ._ _Remote_ _Sens._, vol. 16, pp. 2450–2461, 2023. [23] L. Shen, J. Su, R. He, L. Song, R. Huang, Y. Fang, Y. Song, and B. Su, ‘‘Real-time tracking and counting of grape clusters in the field based on channel pruning with YOLOv5s,’’ _Comput._ _Electron._ _Agricult._, vol. 206, Mar. 2023, Art. no. 107662. [24] H. Chen, Y. Wang, J. Guo, and D. Tao, ‘‘VanillaNet: The power of minimalism in deep learning,’’ in _Proc._ _Adv._ _Neural_ _Inf._ _Process._ _Syst._, vol. 36, 2024, pp. 1–15. [25] H. Li, J. Li, H. Wei, Z. Liu, Z. Zhan, and Q. Ren, ‘‘Slim-neck by GSConv: A lightweight-design for real-time detector architectures,’’ 2022, _arXiv:2206.02424_ . [26] S. Woo, J. Park, J.-Y. Lee, and I. S. Kweon, ‘‘CBAM: Convolutional block attention module,’’ in _Proc. Eur. Conf. Comput. Vis._, Sep. 2018, pp. 3–19. [27] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, and N. Houlsby, ‘‘An image is worth 16x16 words: Transformers for image recognition at scale,’’ 2020, _arXiv:2010.11929_ . [28] A. Krizhevsky, I. Sutskever, and G. E. Hinton, ‘‘ImageNet classification with deep convolutional neural networks,’’ in _Proc._ _Adv._ _Neural_ _Inf._ _Process. Syst._, vol. 25, 2012, pp. 1–9. [29] K. Simonyan and A. Zisserman, ‘‘Very deep convolutional networks for large-scale image recognition,’’ 2014, _arXiv:1409.1556_ . [30] Z. Zhang, S. Yu, S. Yang, Y. Zhou, and B. Zhao, ‘‘Rail-5k: A real-world dataset for rail surface defects detection,’’ 2021, _arXiv:2106.14366_ . [31] Z. Liu, Z. Miao, X. Zhan, J. Wang, B. Gong, and S. X. Yu, ‘‘Large scale long-tailed recognition in an open world,’’ in _Proc. IEEE/CVF Conf._ _Comput. Vis. Pattern Recognit. (CVPR)_, Jun. 2019, pp. 2537–2546. [32] H. Yu, Q. Li, Y. Tan, J. Gan, J. Wang, Y. Geng, and L. Jia, ‘‘A coarse-to fine model for rail surface defect detection,’’ _IEEE Trans. Instrum. Meas._, vol. 68, no. 3, pp. 656–666, Mar. 2019. [33] M. Niu, K. Song, L. Huang, Q. Wang, Y. Yan, and Q. Meng, ‘‘Unsupervised saliency detection of rail surface defects using stereoscopic images,’’ _IEEE_ _Trans. Ind. Informat._, vol. 17, no. 3, pp. 2271–2281, Mar. 2021. [34] N. Ma, X. Zhang, H.-T. Zheng, and J. Sun, ‘‘ShuffleNet V2: Practical guidelines for efficient CNN architecture design,’’ in _Proc._ _Eur._ _Conf._ _Comput. Vis. (ECCV)_, 2018, pp. 116–131. [35] M. Tan and Q. V. Le, ‘‘EfficientNetv2: Smaller models and faster training,’’ in _Proc. Int. Conf. Mach. Learn._, 2021, pp. 10096–10106. [36] K. Han, Y. Wang, Q. Tian, J. Guo, C. Xu, and C. Xu, ‘‘GhostNet: More features from cheap operations,’’ in _Proc._ _IEEE/CVF_ _Conf._ _Comput._ _Vis._ _Pattern Recognit. (CVPR)_, Jun. 2020, pp. 1580–1589. [37] P. K. A. Vasu, J. Gabriel, J. Zhu, O. Tuzel, and A. Ranjan, ‘‘MobileOne: An improved one millisecond mobile backbone,’’ in _Proc. IEEE/CVF Conf._ _Comput. Vis. Pattern Recognit. (CVPR)_, Jun. 2023, pp. 7907–7917. [38] X. Ding, X. Zhang, N. Ma, J. Han, G. Ding, and J. Sun, ‘‘RepVGG: Making VGG-style ConvNets great again,’’ in _Proc. IEEE/CVF Conf. Comput. Vis._ _Pattern Recognit. (CVPR)_, Jun. 2021, pp. 13733–13742. [39] Z. Liu, Y. Lin, Y. Cao, H. Hu, Y. Wei, Z. Zhang, S. Lin, and B. Guo, ‘‘Swin transformer: Hierarchical vision transformer using shifted windows,’’ in _Proc. IEEE/CVF Int. Conf. Comput. Vis. (ICCV)_, Oct. 2021, pp. 10012–10022. [40] Q. Hou, D. Zhou, and J. Feng, ‘‘Coordinate attention for efficient mobile network design,’’ in _Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit._ _(CVPR)_, Jun. 2021, pp. 13713–13722. [41] Q.-L. Zhang and Y.-B. Yang, ‘‘SA-net: Shuffle attention for deep convolutional neural networks,’’ in _Proc. IEEE Int. Conf. Acoust., Speech_ _Signal Process. (ICASSP)_, Jun. 2021, pp. 2235–2239. [42] J. Hu, L. Shen, and G. Sun, ‘‘Squeeze-and-excitation networks,’’ in _Proc._ _IEEE/CVF_ _Conf._ _Comput._ _Vis._ _Pattern_ _Recognit._, Jun. 2018, pp. 7132–7141. [43] D. Ouyang, S. He, G. Zhang, M. Luo, H. Guo, J. Zhan, and Z. Huang, ‘‘Efficient multi-scale attention module with cross-spatial learning,’’ in _Proc._ _IEEE_ _Int._ _Conf._ _Acoust.,_ _Speech_ _Signal_ _Process._ _(ICASSP)_, Jun. 2023, pp. 1–5. [44] S. Dong, Y. Ma, and C. Li, ‘‘Implementation of detection system of grassland degradation indicator grass species based on YOLOv3SPP algorithm,’’ in _Proc._ _J._ _Phys.,_ _Conf._, 2021, vol. 1738, no. 1, Art. no. 012051. [45] L. Fu, Y. Feng, J. Wu, Z. Liu, F. Gao, Y. Majeed, A. Al-Mallahi, Q. Zhang, R. Li, and Y. Cui, ‘‘Fast and accurate detection of kiwifruit in orchard using improved YOLOv3-tiny model,’’ _Precis._ _Agricult._, vol. 22, no. 3, pp. 754–776, Jun. 2021. [46] X. Zhu, S. Lyu, X. Wang, and Q. Zhao, ‘‘TPH-YOLOv5: Improved YOLOv5 based on transformer prediction head for object detection on drone-captured scenarios,’’ in _Proc._ _IEEE/CVF_ _Int._ _Conf._ _Comput._ _Vis._ _Workshops (ICCVW)_, Oct. 2021, pp. 2778–2788. [47] G. Jocher et al., ‘‘ultralytics/yolov5: v5.0—YOLOv5-P6 1280 models, AWS, Supervise.ly and YouTube integrations,’’ Zenodo, 2021. [48] C. Li, L. Li, H. Jiang, K. Weng, Y. Geng, L. Li, Z. Ke, Q. Li, M. Cheng, W. Nie, Y. Li, B. Zhang, Y. Liang, L. Zhou, X. Xu, X. Chu, X. Wei, and X. Wei, ‘‘YOLOv6: A single-stage object detection framework for industrial applications,’’ 2022, _arXiv:2209.02976_ . [49] T. Chen et al., ‘‘TVM: An automated end-to-end optimizing compiler for deep learning,’’ in _Proc._ _13th_ _USENIX_ _Symp._ _Operating_ _Syst._ _Design_ _Implement. (OSDI)_, 2018, pp. 578–594. [50] N. Katel, V. Khandelwal, and U. Bondhugula, ‘‘High performance GPU code generation for matrix-matrix multiplication using MLIR: Some early results,’’ 2021, _arXiv:2108.13191_ . ZHANAO FANG received the B.E. degree in transportation from Shanghai University of Engineering Science, in 2022, where he is currently pursuing the master’s degree. His current research interests include computer vision, object detection, and deep learning compilers. LIMING LI received the Ph.D. degree in computer engineering from Donghua University, Shanghai, China, in 2023. He is currently a Senior Laboratory Leader with the Department of Urban Rail Transit Control Engineering, Shanghai University of Engineering Science, Shanghai. His current research interests include computer vision, artificial intelligence, and image segmentation. LELE PENG (Member, IEEE) received the Ph.D. degree in mechanical engineering from Donghua University, Shanghai, China, in 2015. He is currently an Associate Professor with the Department of Urban Rail Transit Vehicle Engineering, Shanghai University of Engineering Science, Shanghai. His current research interests include artificial intelligence technology, digital perception of rail transit, and application of artificial intelligence technology. SHUBIN ZHENG received the B.S. and Ph.D. degrees from Southwest Jiaotong University, Chengdu, Sichuan, China, in 2002 and 2007, respectively. Since 2008, he has been with the School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China, where he is currently a Professor and the Director. His main research interests include rail transit vehicles and rail equipment condition detection technology and theory. QIANWEN ZHONG received the Ph.D. degree in mechanical engineering from Donghua University, Shanghai, China, in 2018. She is currently a Lecturer with the Department of Urban Rail Transit Vehicle Engineering, Shanghai University of Engineering Science, Shanghai. Her current research interests include intelligent detection on urban rail transit vehicles and data mining of rail transit. TING ZHU received the M.Eng. degree in electronic and communication engineering from Nanjing University, Nanjing, China, in 1999. He is a Senior Engineer and the Deputy Director of the Scientific Research Institute, China Railway Shanghai Bureau Group Company Ltd. He has been instrumental in leading projects, notably the national 863, among over 30 key research initiatives. His main research interests include intelligent monitoring of high-speed railway equipment and computer vision.

섹션 본문 98문단 · 61,557자

(제목 없음)

1Detecting surface defects on railway tracks is of significant importance for reducing the risk of safety incidents in high-speed railways.In response to the challenges in the field of railway track surface defect detection, such as insufficient detection performance, high model complexity, and difficulties in terminal device deployment, this study proposes a new type of railway track surface defect detection network named YOLOv8n-RSDD.The network uses a minimalist VanillaNet as the backbone network for feature extraction, effectively simplifying the model structure and accelerating inference speed.Further, the study introduces a slim-neck module based on GSConv convolution to replace the original C2f module, thereby enhancing performance and improving the detection capability for small targets.Additionally, the integration of the CBAM attention mechanism significantly enhances the network's ability to capture key information on the railway track surface, strengthening perceptual performance.To obtain actual railway track images, this study developed an image acquisition system and constructed the Rail-1600 dataset specifically for the detection of railway track surface defects.Experimental results show that YOLOv8n-RSDD improved by 2.3%

I. INTRODUCTION

2Railway tracks serve as the cornerstone of high-speed rail systems, with surface defects posing a severe risk of damage to the wheel sets and bearings of trains, thereby impacting the operational lifespan and safety of the trains.These defects not only accelerate the wear of wheels but may also, under the periodic impacts, propagate inward, increasing the risk The associate editor coordinating the review of this manuscript and approving it for publication was Ugur Guvenc .

3of train derailment and severe accidents.Consequently, the timely detection and repair of surface defects on railway tracks are essential for ensuring the safety of railway transportation.Early detection can prevent rail fractures and train derailment, reduce the risk of accidents, and effectively safeguard the lives and property of passengers, ensuring the stable operation of the railway system [1].Despite the ability of traditional manual inspections to identify defects, their cumbersome, labor-intensive, and error-prone nature, coupled with safety concerns for inspectors, emphasizes the necessity for developing automated and efficient inspection technologies.Non-Destructive Testing (NDT) is widely applied in the industrial field for defect detection due to its non-destructive nature, playing a vital role in early diagnosis and failure prevention [2].Despite its significant advantages, the widespread application of NDT is limited by the high cost of equipment and stringent requirements for specialized skills.

4To address these challenges, researchers have begun to explore more advanced detection technologies.In recent years, machine vision-based railway track surface defect detection technologies have gained popularity due to their high efficiency and accuracy.These technologies are primarily divided into two categories: traditional image processing methods and deep learning-based methods.Traditional image processing methods, relying on manual feature extraction, can only capture basic features and struggle to obtain advanced semantic features and complex information, leading to low detection accuracy, long computation times, and a complex process [3].In contrast, deep learning-based image processing methods can directly extract abundant high-level semantic information from images, demonstrating greater robustness and detection efficiency.By learning automatically from a vast amount of image data, these methods can extract high-level semantic features of the track surface state without human intervention, effectively dealing with interference factors such as uneven lighting, image distortion, or obstruction, thereby significantly enhancing detection accuracy and efficiency [4], [5], [6], [7], [8].The advancement of this technology has not only enhanced the safety of the railway system but also revolutionized railway maintenance and inspection work, indicating that future railway inspections will increasingly depend on intelligent, automated solutions.

5As deep learning technology continues to mature, its application in the field of object detection has become more extensive and profound.Object detection in deep learning is primarily divided into two major schools: the two-stage detection algorithms based on region proposal frameworks and the more efficient single-stage detection algorithms.Algorithms such as R-CNN, its derivatives Fast-RCNN and Faster-RCNN, using the synergy of Region Proposal Networks (RPNs) and Convolutional Neural Networks (CNNs) to achieve precise localization and classification of targets [9], [10].However, the high computational cost associated with candidate region screening in these methods leads to slower inference speed, making it difficult to meet the requirements of real-time detection, especially in resource-constrained environments.

6To address this challenge, researchers have turned to single-stage detection algorithms, which simplify the detection process and achieve faster detection.Single-stage detection algorithms like YOLO, SSD, and DETR directly extract features from the input image and predict the classification and location of the targets, eliminating candidate region generation, thereby significantly increasing detection speed [11], [12], [13].They are particularly suitable for real-time application scenarios, capable to completing object detection in a single forward pass, typically with CNNs responsible for feature extraction and additional layers to predict the location and category of the targets.Although single-stage algorithms have the advantage of faster training and are suitable for real-time applications, their detection accuracy in small targets or complex scenes is usually not as good as two-stage algorithms and still requires further improvement.

7Deep learning models, despite their excellent performance in object detection tasks, often have high computational resource requirements that limit their application in resourceconstrained environments.Especially in scenarios involving the operation of high-speed trains, the detection system needs to process a large amount of data in an extremely short time.Therefore, how to effectively lightweight the object detection model while ensuring detection accuracy, reduce model complexity and reliance on hardware resources, reduce energy consumption, and promote the deployment of the model in practical environments has become a research focus in the field of railway track surface defect detection [14].

8In the research and application of railway track surface defect detection, advanced terminal devices play an essential role.For instance, edge computing platforms such as the NVIDIA Jetson series, Huawei Ascend series, and Cambricon series offer computing capabilities ranging from tens to hundreds of TOPS [15], [16].These devices provide a solid hardware foundation for running efficient AI algorithms.Taking the YOLOv8n model adopted in this study as an example, the model has 3.1M parameters and requiring 8.2 GFLOPs to operate.In the dataset utilized in this research, each 640 × 640 pixel image corresponds to an actual rail length of 0.2 meters.Considering the train operates at a speed of 100 kilometers per hour, approximately 140 images of 640 × 640 pixels will be generated per second.To achieve real-time defect detection, the detection system's frame rate needs to achieve 140 frames per second.Moreover, when designing the system, sufficient computational redundancy must be reserved to adapt to variable operating conditions and potential performance fluctuations, ensuring the stability and reliability of the detection process and meeting the diverse needs of practical applications.Through the lightweight design and optimization of deep learning models, this study aims to achieve an efficient and energy-saving railway track surface defect detection system, adapting to the detection needs of high-speed train operation and promoting the widespread application of this technology in the field of railway traffic.

9Facing the challenge of deploying mainstream object detection models on terminal devices with limited computing resources, scholars domestically and internationally have proposed a variety of innovative methods to improve the lightweight level and operational efficiency of models.For example, Liu et al. [17] proposed a pyramid feature-based and lightweight CNN method for railway surface defect detection, which significantly reduced the model parameters while improving detection efficiency and maintaining high-accuracy defect recognition capabilities through the optimization of network structure and loss function.Du [18] introduced the BiFPN network structure for multi-scale feature fusion and used the Varifocal Loss to optimize the issue of sample imbalance, ensuring the model's real-time performance and flexibility through feature compression and computational efficiency optimization.Chen et al. [19] designed RailSegVITNet, a real-time railway track surface segmentation network based on the lightweight Vision Transformer (ViT), using lightweight bottleneck blocks, separated self-attention mechanisms, and multi-resolution feature aggregation strategies, achieving an average intersectionover-union (MIoU) of up to 91.43%.Dong et al. [20] improved YOLOv5, adopting C3Ghost and Ghost modules to optimize the network structure and introducing the CBAM attention mechanism, effectively reducing the model's complexity and improving detection accuracy and efficiency.Yang et al. [21] proposed an improved CBAM-MobilenetV2-YOLOv5 model, incorporating MobilenetV2 modules and CBAM attention modules, resulting in an even lighter steel surface defect detection model.Zhang et al. [22] proposed an improved Yolo-Fastest V2 model, significantly enhancing the speed and accuracy of target recognition on edge devices by integrating a position-enhanced feature pyramid network structure, an innovative grouped k-means clustering strategy, an advanced adaptive label assignment algorithm, and an efficient ShuffleNet V2 backbone network.Shen et al. [23] used a channel pruning algorithm to compress the YOLOv5s clustered detection model, significantly enhancing the model's lightweight level, with the model parameter amount and memory occupation reduced by 79% and 76%, respectively.

10Despite the significant advancements in the research of lightweight object detection models, several challenges remain.First, existing models are often not fully optimized for specific terminal devices, which limits their deployment capabilities on resource-constrained devices.Second, efforts to reduce the number of parameters and computational burden sometimes sacrifice detection accuracy, or fail to significantly improve computational efficiency without losing accuracy.Moreover, some studies have not been deeply customized for specific tasks; they may still rely on traditional methods in feature extraction and attention mechanisms, failing to fully utilize the latest model structure design and optimization technologies.

11Upon reviewing the existing research progress of lightweight object detection models, we find several key issues that urgently need to be addressed.First, existing models generally have overly bloated network structures; the addition of too many modules and structures has increased the model's complexity, which is not conducive to actual deployment on resource-constrained terminal devices.Second, attempts to reduce parameters and computational burden often come at the cost of detection accuracy, failing to achieve a balance between precision and efficiency.Third, without extensive comparative experiments to derive the optimal combination strategy, there is still room for improvement in the overall model performance.Lastly, the lack of actual data resources restricts the effectiveness of model training and verification.

12In response to these challenges, this study introduces the latest technological advancements in the field of target detection, the YOLOv8 network.As the latest member of the YOLO series, YOLOv8 inherits and develops the advantages of previous algorithms in real-time target detection, while significantly improving accuracy and speed, reaching the current state of the art (SOTA).YOLOv8 utilizes advanced deep learning techniques and network architecture optimization to enhance the model's detection capability for small targets and demonstrate higher robustness in handling complex scenes.Additionally, YOLOv8 adopts an innovative modular concept in network design, allowing the model to be flexibly adjusted and optimized according to different application scenarios.

13Based on the core strengths of YOLOv8, this study creatively proposes a high-performance, low-complexity, and highly robust railway track surface defect detection network, YOLOv8n-RSDD (Rail Surface Defect Detection).This model not only inherits the high efficiency of YOLOv8 but also has been customized and improved to meet the unique detection needs of the field of railway traffic.YOLOv8n-RSDD, through innovative network structure design, aims to overcome existing challenges, especially achieving breakthrough improvements in the accuracy and real-time nature of railway track surface defect detection, as shown in Figure 1.

14The main contributions of this study are as follows.

15(1) The use of a cleverly designed VanillaNet [24] minimalist network as the backbone network for feature extraction, which greatly simplifies the model architecture and significantly improves the model's inference speed.Furthermore, by employing a modular design approach, the YOLOv8n-RSDD network allows the model to be flexibly adjusted and optimized for various application scenarios, better adapting to the needs of specific terminal devices.

16(2) The innovative introduction of a slim-neck module [25] based on GSConv convolution, replacing the original network's C2f module.This improvement refines the model structure and enhances its detection performance for small target objects, compensating for the precision reduction brought by the VanillaNet network at a very low computational cost.

17(3) The integration of a hybrid attention mechanism module, CBAM [26], enhances the network's feature perception capability, capturing key feature information on the railway track surface, thus addressing the limitations of traditional methods in feature extraction and attention mechanisms.

18(4) The construction of a railway track surface image acquisition system and the creation and release of the Rail-1600 railway track surface status dataset, providing rich actual data resources for this study, which helps further train and verify the model, ensuring the practicality and effectiveness of the research results.

19The main structure of this study is as follows: The second part introduces the YOLOv8n model and the improved YOLOv8n-RSDD model; the third part presents the dataset used in this research; the fourth part conducts experiments on the proposed methods; the fifth part discusses the experimental results; and the sixth part draws conclusions.

II. PROPOSED METHOD

20In this study, we propose an improved rail surface condition detection network based on the YOLOv8n backbone network architecture, termed YOLOv8n-RSDD.The YOLOv8n-RSDD network primarily consists of three core components: the backbone network, the neck network, and the detection head.The backbone network is responsible for feature extraction from the input images, the neck network handles the fusion of features at different scales, and the detection head is tasked with producing the final detection outcomes.

A. YOLOv8n

21The YOLOv8n network structure is primarily composed of the following four core components.

1) INPUT MODULE

22The input module main function is data preprocessing, including adaptive scaling of input images and mosaic enhancement operations.Mosaic enhancement enriches the image background by randomly cropping and stitching four images together for training data, which not only accelerates network training speed but also helps prevent overfitting and enhances the model's generalization capability.

2) BACKBONE NETWORK

23The backbone network consists of Conv, C2f, and SPPF modules, which are used to extract features from the input targets.Conv, as the fundamental convolutional unit of the YOLOv8 network, performs two-dimensional convolution, regularization, and activation operations.The C2f module introduces and implements the concept of cross-stage feature fusion to promote information transfer and integration, reducing the number of network parameters and improving computational efficiency.The SPPF (Spatial Pyramid Pooling -Fast) module processes targets at different scales, achieving a fusion of local and global features, effectively capturing contextual information in the image.

24196252 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

3) NECK NETWORK

25The neck network, composed of FPN and PAN structures, is responsible for the fusion of features at different scales.

26The FPN structure transfers semantic information from top to bottom, conveying deep semantic features to shallower layers, thereby enhancing semantic expression across multiple scales.The PAN structure transfers location information from bottom to top, conveying shallow positional information to deeper layers, enhancing positioning capabilities across scales.

4) DETECTION HEAD

27The detection head translates the extracted feature maps into the final results of object detection, including the location, category, and confidence of the targets.The YOLOv8 detection head processes feature maps at different scales to simultaneously detect small and large targets.Additionally, the detection head includes Non-Maximum Suppression (NMS) operations to filter and merge overlapping detection boxes, thereby enhancing detection accuracy.

28The YOLOv8 series comprises five versions, namely YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x, with each suffix indicating models of different sizes and complexities.YOLOv8n, being the smallest in width and depth among the series, is selected as the baseline model for this study due to its advantages of small size and fast speed, which meet the practical deployment requirements.

B. IMPROVED YOLOv8n-RSDD ALGORITHM

29Although the YOLOv8n model is the smallest in the YOLOv8 series, its computational requirements are still too high for terminal devices, and the model remains overly complex.To achieve the task of terminal deployment for rail surface defect detection, further optimization of the model is necessary.This study innovatively proposes a high-performance, low-complexity, and robust rail surface defect detection network, YOLOv8n-RSDD.Firstly, a minimalist and efficient VanillaNet module is used in the feature extraction network of the backbone to replace traditional convolutional modules, significantly reducing unnecessary branch structures and enhancing model efficiency.Secondly, a lightweight slimneck module is introduced into the neck network, replacing the third C2f module in the original network, to fully integrate features at different scales with minimal computational cost, improving the detection effect on small targets.Lastly, a CBAM attention mechanism module is introduced, replacing the fourth C2f module in the original network, enhancing the network's representational capacity for image features and further compressing the model.The following sections will sequentially introduce the detailed design and functionality of these three improved modules.

C. VanillaNet MODULE

30VanillaNet is a neural network architecture centered on the minimalist concept, which, through a meticulously designed layer structure, abandons complex operations such as residual connections and self-attention mechanisms, focusing on fundamental convolutional computations.This simplification not only significantly reduces the computational burden of the model but also ensures efficient operation in resource-constrained environments while maintaining performance comparable to modern deep neural networks and Vision Transformers (ViT) [27].The design philosophy of VanillaNet is its elegant simplicity, which avoids high depth and complex operations, streamlining the network.This streamlined design allows VanillaNet to operate efficiently on AI chips, which excel at handling parallel computing tasks.Each layer of VanillaNet is designed to be compact and direct, effectively overcoming the inherent complexity issues in traditional deep learning models.

31The VanillaNet-6 model, as shown in Figure 2, consists of six convolutional layers and a fully connected layer.It does not include residual connections or attention mechanisms, making it easy to deploy on hardware with limited resources.Inspired by classical neural networks such as AlexNet [28] and VGGNet [29], the VanillaNet-6 model achieves effective feature extraction by progressively downsampling the input feature maps and increasing the number of channels layer by layer.The design of the VanillaNet-6 model reflects the beauty of simplicity.Furthermore, it ensures the network captures important image features while maintaining computational efficiency.

32In the implementation of VanillaNet, the first convolutional layer utilizes a convolutional kernel of size 4 × 4 × 3 × c with a stride of 4, transforming the three-channel input image into a feature map with c channels.Subsequent convolutional layers reduce the size of the feature map and double the number of channels using max-pooling layers with a stride of 2. The fifth convolutional layer employs average pooling without increasing the number of channels.Finally, a fully connected layer outputs the classification results.From the second to the fifth convolutional layer, each layer uses a 1 × 1 convolutional kernel to preserve feature map information at minimal computational cost, and activation functions and batch normalization are applied after each convolutional layer to simplify the training process of the network.

33Although the VanillaNet architecture is straightforward, its relatively weak nonlinearity may limit the model's performance.To address this issue, we employed deep training strategies and activation functions inspired by series.The deep training strategy initially trains two convolutional layers simultaneously with a single activation function, rather than training each convolutional layer separately, and then merges these two layers after training to reduce inference time.As training progresses, the activation function gradually evolves into an identity mapping.Furthermore, unlike traditional methods of stacking nonlinear activation layers to improve the nonlinearity of neural networks, the series-inspired activation function is based on the core idea of increasing the nonlinearity of each activation layer.This activation function includes multiple learnable affine transformations, further reducing the latency that may arise when there is an excess of parallel computing power.The application of these innovative technologies not only demonstrates the minimalist power of VanillaNet in design but also proves its efficiency and effectiveness in practical applications.

34Inspired by VanillaNet, this study designed an innovative module, the VanillaNet Module, and successfully integrated it into the YOLOv8n network, replacing some of the original convolutional modules to enhance the overall performance of the model.A critical deploy parameter was introduced into the VanillaNet Module to identify the current mode of the network: training mode or deployment mode, which has a decisive impact on the network's behavior during different phases.

35During the training phase (deploy=False), as shown in Figure 1 During the deployment phase (deploy=True), the Vanil-laNet Module undergoes structural optimization to meet the efficiency requirements of the inference process.At this stage, Batch Normalization parameters are fused into the corresponding convolutional layers.Normalization and convolution operations are merged into a single, more efficient convolutional operation through mathematically equivalent transformations.This fusion reduces the number of model layers and the computational load during inference.Additionally, activation functions are integrated or replaced according to their types to ensure that the model's inference speed is improved without compromising its performance.

36With this design, the VanillaNet Module can fully utilize advanced feature learning techniques during the training phase and demonstrate a compact and efficient network structure during the deployment phase, allows it highly suitable for environments with limited resources or strict response time requirements.

D. SLIM-NECK MODULE

37For on-vehicle edge computing devices on railway trains, deploying computationally intensive object detection models to achieve real-time detection presents significant challenges.To reduce the model's complexity and enhance detection efficiency without compromising detection accuracy, this study innovatively replaces the third C2f module in the original YOLOv8n network with a lightweight slim-neck module [33], as shown in Figure 3.The slim-neck module, centered around the lightweight convolutional GSConv module, significantly improves the detection capability for small targets.It effectively extracts both shallow and deep features, reduces the model's computational complexity, and maintains learning efficacy comparable to standard convolution.

38The slim-neck module initially employs the lightweight convolutional GSConv module to replace the traditional convolutional Conv module.The GSConv module combines group convolution and depthwise separable convolution, significantly reducing the model's computational cost.It begins by using a standard convolutional Conv module to downsample the feature map.Then, a depthwise separable convolution DWConv generates a new feature map.These feature maps are concatenated using a Concat operation, followed by a shuffle operation to effectively arrange the channel numbers.Experimental results indicate that the GSConv module requires only 60% to 70% of the computational cost of the Conv module but contributes almost equally to enhancing the model's learning efficacy.Through flexible assembly of Conv and GSConv modules, a comprehensively optimal VoV-GSCSP structure with the highest efficiency, as shown in Figure 3, was derived after extensive experimental validation.

E. CBAM ATTENTION MODULE

39To further optimize the model structure, reduce model complexity, and enhance the overall detection efficiency, this study introduces an efficient lightweight Convolutional Block Attention Module (CBAM) attention mechanism, as depicted in Figure 4. Inspired by an understanding of human cognition, this mechanism mimics our ability to focus on important information, enabling more accurate feature capture in images.CBAM significantly enhances the network's representational capacity for image features by integrating channel and spatial attention modules, deepening the understanding of features across different channels and spatial locations.This dual attention mechanism not only strengthens the model's identification of salient feature channels and reduces the interference of noise features but also enhances the model's spatial perception of key regions in the image, thereby improving detection accuracy and robustness.Especially for fine-grained identification tasks such as rail surface defect detection, the introduction of the CBAM module effectively reduces missed detections due to overly small target pixels, which is crucial for enhancing the reliability of the detection system.CBAM, a lightweight universal module, integrates seamlessly into CNN architectures.It achieves significant performance improvements at a low computational cost and supports end-to-end training.

40The CBAM module processes intermediate feature maps by independently inferring channel and spatial attention maps along two dimensions, and then multiplies these attention maps with the input feature maps for adaptive feature refinement.In the channel attention module, feature maps are processed through max and average pooling to obtain two distinct feature maps, which are then integrated through a shared multilayer perceptron and activated using a Sigmoid function to weight the original input feature maps.In the spatial attention module, feature maps undergo max and average pooling to produce two single-channel feature maps.After concatenation, they are dimensionally reduced through a convolutional layer before being activated by a Sigmoid function.Finally, the outputs from the channel and spatial attention modules are multiplied to obtain the refined feature output of the CBAM module.

III. DATASET A. RAILWAY TRACK SURFACE IMAGE ACQUISITION SYSTEM

41In the field of railway track surface defect detection, existing datasets of railway track surface images face numerous challenges, including limited scale, poor image quality, scarcity of surface defect samples, image distortion, and privacy protection issues.Obtaining a large number of real-world railway track surface images that are of high quality and rich in surface defects is a significant task in this domain [30].To address these challenges, we have designed and implemented a railway track surface image acquisition system.This system, equipped with high-definition cameras on subway trains, collects real-time images of the track surface, effectively achieving online image acquisition.The system schematic is shown in Figure 5.

42A key component of the system is the DALSA Linea L-FM-08K30H-00-R high-speed CMOS line-scan camera, which boasts a resolution of 3264 × 4 and is distinguished by its high sensitivity and low noise.With a maximum line frequency of 300K Hz and a data transmission rate of up to 4.8GBytes/s, it is capable of meeting the image acquisition needs at train speeds of 300Km/h.The camera is mounted on a dedicated bracket on the subway train, with the lens positioned 440mm above the track surface, maintaining a 90 degrees perpendicular shooting angle.

43To address issues such as shadows and overexposure, a supplementary laser light source is installed on one side of

B. DATASET

44To validate and evaluate the performance of the YOLOv8n-RSDD model, we selected three distinct datasets of rail surface imagery.These encompass our team's proprietary Rail-1600 dataset, the Railway Surface Discrete Defects (RSDDs) dataset, and the Northeastern University Rail Surface Defects (NEU RSDDs-113) dataset.We divided each dataset into training, validation, and testing sets following an 8:1:1 ratio, a standard approach supported by preliminary experimental outcomes within the deep learning community.This partitioning strategy ensures intensive training data to discern rail defects while maintaining robust subsets for validation and testing, essential for assessing the model's generalization and stability.Our experiments also included alternative ratios such as 7:2:1 and 7:1.5:1.5, but the 8:1:1 ratio consistently demonstrated enhanced model performance, underscoring its efficacy.

45(1) Our railway track surface defect dataset, Rail-1600: Utilizing images captured by our rail surface image acquisition system, we have successfully constructed a real-world rail surface dataset.The system conducted a comprehensive image data collection across a 180.909-kilometer track section from location A to location B, with an average inspection speed of 70 kilometers per hour, ensuring the efficiency and coverage of data collection.During the data collection process, we meticulously documented various types of track surface damages, including 70 cases of rail surface waves, 46 cases of railway track switch, 125 cases of rail surface damage, and thousands of instances of rail track joint conditions.Additionally, we recorded 3 instances of rail clip misalignment and 7 cases of rail clip missing; however, anomalies such as rail surface light bands, track slab cracks, foreign objects on the track, and sleepers' cracks or losses were not observsed.

46We paid particular attention to the long-tail distribution issue within the dataset, noting an imbalance ratio of up to several dozen times between the majority and minority categories.Existing research has indicated that this long-tail distribution may adversely affect the performance of learning models [31].To address this challenge, in constructing our dataset, we carefully selected the four most representative rail conditions: rail surface waves, railway track switch, rail track joint, and rail surface damage, forming our Rail-1600 dataset, as shown in Figure 6 to Figure 10.During the dataset construction process, we adopted a strategy of mixing left and right track images, without distinguishing between left or right rail tracks in the dataset.This approach aims to enhance the generalizability of model training and testing, and to prevent the model from overfitting to specific rail track defect locations.

47The source images obtained are 3264 × 512 pixels in size, with a significantly different aspect ratio.Given the recommended input size of 640 × 640 pixels for the YOLOv8n-RSDD network, using these images directly for training would inevitably lead to excessive compression of minor features, which is detrimental to the model's learning.

48To address this issue, we performed preprocessing on the dataset.Firstly, we scaled the source images to 4080 × 640 pixels, maintaining the aspect ratio, and then centrally cropped them to produce six 640 × 640 pixel images.From these, we carefully selected representative and high-quality images to form our new dataset.To ensure the accuracy and professionalism of the data annotation, we invited experts in the field of railway to conduct the annotation work.After rigorous screening, we selected 40 images for each type of surface defect for further study.To expand our dataset, we applied data augmentation techniques, increasing its size by 900%.These enhancement methods included randomly adjusting image brightness, changing hue, introducing random noise and salt-and-pepper noise, random cropping, converting to a cartoon style, applying Gaussian blur, and performing horizontal and vertical flips.Through this series of processes, we ultimately obtained 1600 highquality railway track surface images, with 400 images for each defect type.These images constitute our Rail-1600 railway track surface dataset, as shown in Figure 11.

49(2) RSDDs dataset: The RSDDs [32] is composed of two subsets; the Class I subset contains 67 high-speed railway images, while the Class II subset contains 128 conventional railway images.The image resolution for the Class I subset is 160 × 1000 pixels, and for the Class II subset, it is 55×1250 pixels, with both exhibiting a significant difference in aspect ratio.These images are focused exclusively on the condition of the track surface, excluding irrelevant information such as track fastenings and ballast.In preprocessing the RSDDs dataset, we adopted a strategy similar to that used for the Rail-1600 dataset.Specifically, we evenly divided the images in the Class I subset into two parts and those in the Class II subset into eight parts, then resized these images to 204 × 640 pixels and 225 × 640 pixels, respectively.After a selection and data augmentation process, we ultimately obtained a total of 2000 high-quality image samples.

50(3) NEU RSDDs-113 dataset: This dataset [33] consists of 113 images that depict railway track surface defects at various resolutions, as shown in Figure 12.The size of each image is varying sizes and primarily includes four types of defects: holes, scratches, sunken areas, and corrosion.To construct a more dataset, we selected 100 representative images from the original dataset and standardized their dimensions to 640 × 640 pixels to meet the input requirements of the YOLOv8n-RSDD network.Subsequently, we performed data augmentation on these 100 images, which included operations such as rotation, scaling, cropping, and color transformation, to increase the diversity of the images and enhance the model's generalization ability.Through these processes, we successfully expanded the dataset to 1000 images.

IV. EXPERIMENTAL RESULTS AND ANALYSIS A. EVALUATION METRICS

51In the forthcoming experiments, we employ six pivotal metrics to comprehensively and quantitatively assess the performance of the YOLOv8n-RSDD network and its related methods.These evaluation criteria encompass: mean Average Precision (mAP@0.5),mean Average Precision across varying confidence thresholds (mAP@0.5:0.95), computational complexity of the model (GFLOPs), the count of model parameters (Parameters), the storage size of the model (Model Size), and inference speed in the PyTorch environment (Speed_PyTorch).Utilizing these metrics, we delve into the analysis of the model's accuracy, efficiency, and practicality.

B. EXPERIMENTAL ENVIRONMENT SETUP

52Given that varying experimental environments and parameter configurations might lead to discrepancies in the final outcomes of models, it is essential to maintain consistency across experiments.All experiments in this study were conducted on the same server to ensure the comparability and reproducibility of the results.The specific experimental environment and hyper parameters used are detailed in Table 1.

C. ABLATION STUDY 1) IMPACT OF DIFFERENT MODULES

53To validate the significant performance enhancement effects of the VanillaNet module, slim-neck module, and CBAM module introduced in this study on the baseline model, we conducted a series of ablation experiments on the Rail-1600 dataset.These experiments aim to thoroughly analyze the individual contributions and combined effects of each module on the model's performance, comprehensively assessing their applicability and advantages in the Rail-1600 scenario.Starting with the baseline model, we incrementally introduced one, two, or all three improved modules to systematically evaluate the impact of each on model performance.Through this incremental approach, we were able to clearly observe the specific effects of each module on the model in terms of detection accuracy, parameter volume, and inference speed.The results of the experiments are summarized in Table 2, where B represents the Baseline, V represents VanillaNet, S represents slim-neck, and C represents CBAM.

54In the ablation study on the Rail-1600 dataset, integrating the VanillaNet module into the YOLOv8n baseline network significantly reduced the model's parameter count, with a 38.2% decrease in GFLOPs, a 42.5% reduction in parameter count, a 41.5% reduction in model size, and a 20.4% increase in inference speed.Despite the minor 1.0% drop in mAP@0.5 and a more significant 0.9% drop in mAP@0.5:0.95due to architectural simplification, further optimization is needed to restore performance.This performance loss may be attributed to VanillaNet's simplistic design, which shows insufficiency in feature extraction when dealing with highly complex datasets.To enhance VanillaNet's performance, customized adjustments to its depth training strategies and activation functions may be required to ensure the model can accurately capture the nonlinear characteristics of the data.

55Integrating both the VanillaNet and slim-neck modules into the YOLOv8n network resulted in a significant boost in mAP, but also a decrease in inference speed due to the high memory access cost associated with slim-neck's operations.To improve inference speed, deeper optimization of the model is necessary.

56The slim-neck module, designed with the innovative lightweight convolutional technology GSConv, combines standard convolution with depthwise separable convolution and introduces a channel shuffle strategy.This design not only optimizes the interaction between feature channels but also enhances the model's inference speed by reducing redundant computations, while maintaining the ability for feature extraction and fusion at a reduced computational cost.

57After integrating the VanillaNet, slim-neck, and CBAM modules, CBAM's attention mechanism enables the model to automatically focus on key channels and locations in the input feature maps, effectively reducing the feature dimension and computational overhead.This integration not only enhances the model's representational power but also, due to its lightweight nature, achieves seamless integration with existing CNN architectures, achieving significant performance improvements at a small increase in parameters and 196258 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.computational cost.The model's GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and the inference speed was increased by 17.8%, making deployment on mobile devices or embedded systems possible.

58The CBAM module significantly enhances the model's performance with its finely designed channel and spatial attention mechanisms, which adaptively optimize feature maps, strengthen key features, and suppress irrelevant information, greatly enhancing the model's representational capabilities.Its end-to-end trainability ensures co-evolution with other network components during training.Combined with VanillaNet and slim-neck, CBAM reduces computational load and improves accuracy, demonstrating excellent performance and application potential in resource-constrained environments.These optimizations lay the foundation for the model's widespread adoption in a variety of application scenarios, especially in situations requiring high real-time and accuracy demands.

59Incorporating these optimizations, the model not only demonstrates the sophistication and efficiency of its architecture but also lays a solid foundation for its widespread adoption across diverse application scenarios, particularly in situations with stringent requirements for real-time performance and accuracy.Figure 13 contrasts the target detection results of YOLOv8n and the proposed YOLOv8-RSDD on the Rail-1600 dataset, highlighting the significant improvements and notable enhancement in overall performance of YOLOv8n-RSDD in detecting multiple, small, and challenging targets.In the figure, B represents the results of the Baseline model, B+V indicates the model results after the integration of VanillaNet, B+V+S signifies the model with the further incorporation of the slim-neck module, and B+V+S+C denotes the final YOLOv8-RSDD model integrated with the CBAM attention module.

2) THE IMPACT OF THE BACKBONE NETWORK

60This study conducted an in-depth exploration of the performance of the YOLOv8n network integrated with various lightweight backbone networks.After a systematic evaluation and comparison of networks such as ShuffleNetV2 [34], EfficientNetV2 [35], GhostConv [36], MobileOne [37], RepConv [38], and Swin Transformer [39], the YOLOv8n-VanillaNet demonstrated dual advantages of accuracy and speed in object detection tasks, making it particularly suitable for applications that require high real-time and precision standards.

61ShuffleNetV2, by introducing pointwise group convolution and channel shuffle technologies, effectively enhances the efficiency of information interaction, enabling it to efficiently perform object detection tasks on resourceconstrained devices.EfficientNetV2 adopts a compound scaling method for networks, optimizing the model through neural architecture search technology, improving efficiency, and surpassing traditional convolutional networks.MobileOne, optimized for mobile devices, designed the MobileOne Block module, employing over-parametrization branches and model scaling strategies to adapt to different computational requirements.GhostConv extends the depth of feature maps through linear transformations, reducing computational load while maintaining efficient feature extraction.RepConv leverages model reparameterization technology to merge computational modules during the inference phase, reducing computational load and memory consumption.Swin Transformer combines the Transformer architecture with convolutional neural networks, adopting hierarchical and windowed local attention mechanisms to effectively handle large-size images and enhance performance.

62In a series of ablation experiments, as shown in Table 3, YOLOv8n-VanillaNet excelled in inference speed while maintaining the minimization of model parameters and size, achieving a 20.4% increase in inference speed compared to the original YOLOv8n.Although the YOLOv8n-Swin Transformer showed the best performance in detection accuracy, its speed limitations restricted its applicability in practical deployment.YOLOv8n-VanillaNet, with its rapid inference speed and resource optimization, provides an efficient solution for real-time object detection, particularly suitable for edge computing and resource-constrained application environments, offering significant insights for the design of lightweight object detection models.

3) THE IMPACT OF ATTENTION MECHANISMS

63Attention mechanisms are a key technique in deep learning to enhance model performance, especially prominent in processing visual tasks such as object detection.These mechanisms dynamically adjust the response intensity of features within the network, enabling the model to focus on critical information while ignoring irrelevant background or noise interference.

64In the design of the YOLOv8n network, the introduction of attention modules aims to strengthen the network's perceptual capabilities, allowing it to more accurately identify and focus on key features while suppressing irrelevant information.This innovative improvement makes the network more efficient in understanding and utilizing input data, particularly in performing tasks such as object detection.Different attention modules, based on their design strategies, aim to meet the network's optimization needs in channel and spatial dimensions.For instance, Channel Attention (CA) [40] focuses on learning the weight distribution of each channel, guiding the network to concentrate on channels that convey important information.In contrast, Spatial Attention (SA) [41] emphasizes the weight of key areas in the image by learning and enhancing the network's ability to recognize spatial features.The Squeeze-and-Excitation (SE) [42] module is dedicated to improving the expressive power of channel features.The Exponential Moving Average (EMA) [43] attention module is an efficient multi-scale attention mechanism that integrates some channels on the batch dimension and processes the channel dimension in groups, ensuring the even distribution of spatial semantic features in each feature group.Its core goal is to enhance the network's sensitivity to multi-scale features while reducing computational costs by retaining important information.The Convolutional Block Attention Module (CBAM) [26] combines channel and spatial attention mechanisms, further enriching the diversity of feature expression.Overall, the integration of these attention modules aims to increase the network's flexibility and sensitivity, enhancing its performance in handling complex tasks.

65In the YOLOv8n baseline network, we introduced SE and EMA attention mechanisms and compared them with the CBAM attention mechanism.The experimental results are shown in Table 4.The data in the table indicates that after the introduction of the CBAM attention mechanism, YOLOv8n-CBAM improved the mAP@0.5 by 0.8% compared to the original YOLOv8n network, while reducing the model's computational load (GFLOPs) by 44.5%, the number of parameters (Parameters) by 54.8%, the model size (Model Size) by 56%, and increasing the inference speed by 7.4%.These results demonstrate that the CBAM attention mechanism not only enhances model performance but also shows superior optimization effects compared to all other tested attention modules.

D. COMPARISON WITH RELEVANT FRAMEWORKS

66In this study, we conducted a comprehensive comparison of YOLOv8-RSDD with several state-of-the-art deep learning-based object detection frameworks, including YOLOv3 [11], YOLOv3-SPP [44], YOLOv3-tiny [45], YOLOv5 [46], YOLOv5-P6 [47], YOLOv6 [48], and different versions of the YOLO series such as YOLOv8n and YOLOv8s.Table 5 illustrates the performance comparison of our improved algorithm with the aforementioned algorithms, involving datasets such as our collected Rail-1600 dataset (D1), RSDDs dataset (D2), and NEU RSDDs-113 dataset (D3).

67YOLOv3-SPP, an enhanced version of YOLOv3, integrates a Spatial Pyramid Pooling (SPP) layer to achieve the fusion of local and global features, enhancing the model's ability to handle targets of various sizes and its sensitivity to spatial context, potentially offering superior performance and accuracy.YOLOv3-tiny is a lightweight version of YOLOv3, utilizing Darknet-19 as its backbone network, reducing the detection layer scales to two, minimizing network depth and parameter count, and decreasing computational complexity to provide faster inference speeds in resource-constrained environments.YOLOv5-P6 is a further refined version based on YOLOv5, with an optimized detection head structure, expanded to four scales of output, and enriched with additional convolutional and up-sampling layers to better integrate multi-scale features, aiming to improve the model's capability in detecting complex scenes and small targets.YOLOv6, the latest iteration in the YOLO series, introduces a suite of innovative features, including an optimized efficient backbone network, enhanced multi-scale feature fusion techniques, an improved anchor box mechanism, and a novel loss function.These integrated improvements significantly boost the model's accuracy and speed in detecting targets of various sizes while maintaining a lightweight model, ensuring efficient operation in diverse resource-constrained environments.

68In this section, we focus on the Rail-1600 dataset and present the visualized results in Figure 14, gathered from the 196260 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.training data obtained during the experiments.It is observable that as the number of iterations increases, the model's precision, recall rate, mAP@0.5, and mAP@0.5:0.95all exhibit an upward trend.Notably, our proposed YOLOv8n-RSDD network achieves the best performance in all evaluation metrics except for mAP@0.5:0.95.Additionally, Precision, Recall, mAP@0.5, and mAP@0.5:0.95demonstrate rapid improvement during the iterative process and gradually approach stable values, as shown in Figure 15.

1) DETECTION RESULTS ON THE RAIL-1600 DATASET

69As shown in Figure 14, in the detection experiments conducted on the Rail-1600 dataset we established, the YOLOv8n-RSDD network demonstrated superior performance compared to several other advanced detection methods.While most frameworks may generate false positives or false negatives during detection, our YOLOv8n-RSDD network achieved comparable detection results to the YOLOv8s network with the fewest parameters and the fastest detection speed, perfectly identifying rail surface waves, railway track switch, railway track joint, and rail surface damage.This outcome not only showcases the broad application potential of the YOLOv8n-RSDD network but also provides a novel solution for the rail surface defect detection field.Additionally, by combining the data from Figure 14 and Table 5, we can observe that while YOLOv3tiny has the fastest detection speed, its accuracy is insufficient for practical application requirements; the YOLOv3 and YOLOv3-SPP networks may exhibit missed detections; YOLOv5 and YOLOv5-P6, although having higher detection accuracy, are slower and cannot meet the needs of real-time model deployment; YOLOv6 and YOLOv8n, although faster, require improvement in detection accuracy.The quantitative data provided in Table 5 further confirm the superiority of YOLOv8n-RSDD in performance.Ultimately, Figure 15 compares the experimental curves of the seven methods; as training iterations progress, the curve of YOLOv8n-RSDD almost completely envelops the curves of the other methods, indicating that the framework proposed in this study achieved the highest mAP@0.5(%),and the mAP@0.5:0.95(%) is only slightly lower than that of YOLOv8s.

2) DETECTION RESULTS ON THE RSDDs DATASET

70The detection results depicted in Figure 16 reveal that even on the relatively simple RSDDs dataset, some networks still exhibit missed and false detections.However, the YOLOv8n-RSDD network continued to demonstrate its superior performance by perfectly detecting all targets.Combined with the experimental results shown in Table 5, the YOLOv8n-RSDD not only achieved higher detection accuracy than the YOLOv8s but also showed an advantage in detection speed.Although slightly slower in speed compared to the YOLOv6, the YOLOv8n-RSDD's streamlined parameter count makes the model more lightweight.

71In the detection experiments on the RSDDs dataset, the YOLOv8n-RSDD network showcased its exceptional detection capabilities, accurately completing the detection tasks even when the target features were relatively straightforward.Compared to other networks that occasionally missed or falsely detected targets, the YOLOv8n-RSDD provided a more reliable and accurate detection solution, significantly reducing the incidence of misses and false alarms.

72Comparing the experimental results, the YOLOv8n-RSDD's advantage in accuracy is evident, and it is also competitive in speed.Although slightly slower than the YOLOv6 in terms of speed, its smaller parameter count offers greater potential for deployment on devices with limited resources.Additionally, the model size of the YOLOv8n-RSDD has been effectively controlled, which not only helps to speed up the model loading but also reduces the memory burden.These features make the YOLOv8n-RSDD highly suitable for real-time target detection applications on mobile devices and embedded systems, offering an efficient and practical solution.

3) DETECTION RESULTS ON THE NEU RSDDs-113 DATASET

73When confronted with the challenges of the RSDDs-113 dataset, the YOLOv8n-RSDD network has demonstrated its exceptional performance in complex image target detection tasks.Characterized by multiple and diverse targets within the images, as well as multi-scale rusted rail images captured under varying lighting conditions, the dataset poses a severe test to the model's accuracy and robustness.As shown in Figure 17, in this test, the YOLOv8n-RSDD network excelled, not only surpassing the other six frameworks in visual presentation but, more importantly, showing a significant advantage in detection precision.Even under conditions of complex backgrounds and unstable lighting, the network was able to consistently identify all targets in the images without any false positives or false negatives.This achievement highlights the outstanding capabilities of YOLOv8n-RSDD in feature extraction and spatial perception.Thanks to the synergistic effects of its integrated VanillaNet, slim-neck module, and CBAM attention mechanism, YOLOv8n-RSDD maintains a high level of detection performance when dealing with complex visual scenes.Moreover, the robustness of YOLOv8n-RSDD is equally impressive, as it can adapt to and overcome unpredictable detection environments in the real world.This not only confirms its potential in industrial detection applications but also lays a solid foundation for its deployment in a broader range of scenarios in the future.With further optimization and improvements in model structure, YOLOv8n-RSDD is expected to achieve faster and more accurate detection results in the field of object detection.In addition, this study has developed a rail surface image acquisition system and constructed the Rail-1600 dataset, providing the YOLOv8n-RSDD network with abundant real-world image resources, ensuring the scientific and effective model training and verification.

74The experimental results are encouraging; YOLOv8n-RSDD outperforms existing deep learning-based detection frameworks on three different defect datasets, including Rail-1600.Specifically, YOLOv8n-RSDD improved by 2.3% in the mAP@0.5 metric compared to YOLOv8n, while maintaining stability in mAP@0.5:0.95.In terms of computational resource consumption, GFLOPs were reduced by 44.6%, the number of parameters decreased by 58.1%, the model size was reduced by 56.5%, and inference speed was increased by 17.8%.These improvements demonstrate the potential of YOLOv8n-RSDD in practical applications.

75Despite the significant performance gains, there is still room for improvement in the efficiency and application range of YOLOv8n-RSDD.Future work will focus on model lightweighting techniques such as quantization, pruning, and distillation to further optimize the model for a broader range of application scenarios.At the same time, with the rapid development of neural network compiler technologies such as TVM [49] and MLIR [50], the deployment of YOLOv8n-RSDD on edge computing devices will become more efficient and convenient, providing technical support and possibilities for the online real-time monitoring of rail surface defects.

FIGURE 1 .

76FIGURE 1. YOLOv8n-RSDD network architecture.

FIGURE 2 .

77FIGURE 2. Architecture of vanillaNet.

78the VanillaNet Module employs Batch Normalization (BatchNorm2d) and the LeakyReLU activation function to enhance the model's learning capabilities.The Batch Normalization layer mitigates internal covariate shift by normalizing layer inputs, thereby accelerating the model's convergence.Meanwhile, the introduction of the LeakyReLU activation function allows negative input values to produce a slight positive output, effectively preventing the ''dead ReLU'' problem during training.These designs enable the network to fully leverage the statistical properties of the data, enhancing feature learning and representation capabilities.

FIGURE 3 .

79FIGURE 3. Slim-neck module structure.

FIGURE 4 .

80FIGURE 4. CBAM attention mechanism module.

FIGURE 5 .

81FIGURE 5. Railway track surface image acquisition system.

FIGURE 6 .

82FIGURE 6. Rail surface waves.the camera.It provides high-intensity illumination in dimly lit environments, ensuring image stability, texture clarity, and improved foreground-background discrimination.Each frame of the image is composed of 3264 lines of pixels, with each pixel having a resolution of 0.365 × 0.365 mm.The panoramic grayscale images captured by the line-scan camera, with a resolution of 3264 × 512, are then stored in the reception terminal inside the train carriage and uploaded to a cloud server for backup.

FIGURE 7 .

83FIGURE 7. Railway track switch.

FIGURE 8 .

84FIGURE 8. Rail track joint.

FIGURE 9 .

85FIGURE 9. Rail surface damage.

FIGURE 10 .

86FIGURE 10.Normal rail track.

FIGURE 11 .TABLE 2 .

87FIGURE 11.Rail-1600 dataset overview.TABLE 2. Ablation study results on the rail-1600 dataset.

FIGURE 12 .

88FIGURE 12. NEU RSDDs-113 dataset overview.

FIGURE 13 .

89FIGURE 13.Detection results of different module combinations.

FIGURE 14 .

90FIGURE 14.Detection results on the Rail-1600 dataset.

FIGURE 15 .

91FIGURE 15.Performance metrics trend analysis of YOLOv8n-RSDD and other networks on the Rail-1600 dataset.

FIGURE 16 .

92FIGURE 16.Detection results on the RSDDs dataset.

FIGURE 17 .

93FIGURE 17.Detection results on the NEU RSDD-113 dataset.

94ZHANAO FANG received the B.E. degree in transportation from Shanghai University of Engineering Science, in 2022, where he is currently pursuing the master's degree.His current research interests include computer vision, object detection, and deep learning compilers.LIMING LI received the Ph.D. degree in computer engineering from Donghua University, Shanghai, China, in 2023.He is currently a Senior Laboratory Leader with the Department of Urban Rail Transit Control Engineering, Shanghai University of Engineering Science, Shanghai.His current research interests include computer vision, artificial intelligence, and image segmentation.LELE PENG (Member, IEEE) received the Ph.D. degree in mechanical engineering from Donghua University, Shanghai, China, in 2015.He is currently an Associate Professor with the Department of Urban Rail Transit Vehicle Engineering, Shanghai University of Engineering Science, Shanghai.His current research interests include artificial intelligence technology, digital perception of rail transit, and application of artificial intelligence technology.SHUBIN ZHENG received the B.S. and Ph.D. degrees from Southwest Jiaotong University, Chengdu, Sichuan, China, in 2002 and 2007, respectively.Since 2008, he has been with the School of Urban Railway Transportation, Shanghai University of Engineering Science, Shanghai, China, where he is currently a Professor and the Director.His main research interests include rail transit vehicles and rail equipment condition detection technology and theory.QIANWEN ZHONG received the Ph.D. degree in mechanical engineering from Donghua University, Shanghai, China, in 2018.She is currently a Lecturer with the Department of Urban Rail Transit Vehicle Engineering, Shanghai University of Engineering Science, Shanghai.Her current research interests include intelligent detection on urban rail transit vehicles and data mining of rail transit.TING ZHU received the M.Eng.degree in electronic and communication engineering from Nanjing University, Nanjing, China, in 1999.He is a Senior Engineer and the Deputy Director of the Scientific Research Institute, China Railway Shanghai Bureau Group Company Ltd.He has been instrumental in leading projects, notably the national 863, among over 30 key research initiatives.His main research interests include intelligent monitoring of high-speed railway equipment and computer vision.

TABLE 1 .

95Experimental environment and hyperparameter Settings.

TABLE 3 .

96Impact of backbone network selection on performance.

TABLE 4 .

97Impact of different attention mechanisms on performance.

TABLE 5 .

98Comparative experimental results of YOLOv8n-RSDD and related frameworks.

참고문헌 41건

  1. Fast R-CNN 2015 10.1109/iccv.2015.169
  2. Lateral heat conduction based eddy current thermography for detection of parallel cracks and rail tread oblique cracks Measurement · Elsevier BV · 2015 10.1016/j.measurement.2015.01.024
  3. SSD: Single Shot MultiBox Detector Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46448-0_2
  4. Squeeze-and-Excitation Networks 2018 10.1109/cvpr.2018.00745
  5. ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design Lecture notes in computer science · Springer Science+Business Media · 2018 10.1007/978-3-030-01264-9_8
  6. A Coarse-to-Fine Model for Rail Surface Defect Detection IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2018 10.1109/tim.2018.2853958
  7. Rail Surface Defect Detection Method Based on YOLOv3 Deep Learning Networks 2018 10.1109/cac.2018.8623082
  8. Large-Scale Long-Tailed Recognition in an Open World 2019 10.1109/cvpr.2019.00264
  9. Mask R-CNN 2017 10.1109/iccv.2017.322
  10. GhostNet: More Features From Cheap Operations 2020 10.1109/cvpr42600.2020.00165
  11. Unsupervised Saliency Detection of Rail Surface Defects using Stereoscopic Images IEEE Transactions on Industrial Informatics · Institute of Electrical and Electronics Engineers · 2020 10.1109/tii.2020.3004397
  12. Fast and accurate detection of kiwifruit in orchard using improved YOLOv3-tiny model Precision Agriculture · Springer Science+Business Media · 2020 10.1007/s11119-020-09754-y
  13. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2010.11929
  14. End-to-End Object Detection with Transformers Lecture notes in computer science · Springer Science+Business Media · 2020 10.1007/978-3-030-58452-8_13
  15. A Comprehensive Detection System for Track Geometry Using Fused Vision and Inertia IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2020 10.1109/tim.2020.3039301
  16. Implementation of Detection System of Grassland Degradation Indicator Grass Species Based on YOLOv3-SPP Algorithm Journal of Physics Conference Series · IOP Publishing · 2021 10.1088/1742-6596/1738/1/012051
  17. Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · 2021 10.1109/iccv48922.2021.00986
  18. SA-Net: Shuffle Attention for Deep Convolutional Neural Networks 2021 10.1109/icassp39728.2021.9414568
  19. RepVGG: Making VGG-style ConvNets Great Again 2021 10.1109/cvpr46437.2021.01352
  20. Attention Network for Rail Surface Defect Detection via Consistency of Intersection-over-Union(IoU)-Guided Center-Point Estimation IEEE Transactions on Industrial Informatics · Institute of Electrical and Electronics Engineers · 2021 10.1109/tii.2021.3085848
  21. Coordinate Attention for Efficient Mobile Network Design 2021 10.1109/cvpr46437.2021.01350
  22. A Defect Detection Method for Rail Surface and Fasteners Based on Deep Convolutional Neural Network Computational Intelligence and Neuroscience · Hindawi Publishing Corporation · 2021 10.1155/2021/2565500
  23. TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-captured Scenarios 2021 10.1109/iccvw54120.2021.00312
  24. A Review of Research on Detection and Evaluation of the Rail Surface Defects Acta Polytechnica Hungarica · Óbuda University · 2022 10.12700/aph.19.3.2022.3.14
  25. A Rail Surface Defect Detection Method Based on Pyramid Feature and Lightweight Convolutional Neural Network IEEE Transactions on Instrumentation and Measurement · Institute of Electrical and Electronics Engineers · 2022 10.1109/tim.2022.3165287
  26. Improvement of Lightweight Convolutional Neural Network Model Based on YOLO Algorithm and Its Research in Pavement Defect Detection Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22093537
  27. A lightweight vehicles detection network model based on YOLOv5 Engineering Applications of Artificial Intelligence · Elsevier BV · 2022 10.1016/j.engappai.2022.104914
  28. Steel Plate Surface Defect Detection Based on Dataset Enhancement and Lightweight Convolution Neural Network Machines · Multidisciplinary Digital Publishing Institute · 2022 10.3390/machines10070523
  29. CBAM: Convolutional Block Attention Module arXiv (Cornell University) · Cornell University · 2018 10.48550/arxiv.1807.06521
  30. YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications arXiv (Cornell University) · Cornell University · 2022 10.48550/arxiv.2209.02976
  31. AI and ML Accelerator Survey and Trends 2022 10.1109/hpec55821.2022.9926331
  32. An Online Rail Track Fastener Classification System Based on YOLO Models Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22249970
  33. Real-time tracking and counting of grape clusters in the field based on channel pruning with YOLOv5s Computers and Electronics in Agriculture · Elsevier BV · 2023 10.1016/j.compag.2023.107662
  34. An Improved Lightweight Yolo-Fastest V2 for Engineering Vehicle Recognition Fusing Location Enhancement and Adaptive Label Assignment IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing · Institute of Electrical and Electronics Engineers · 2023 10.1109/jstars.2023.3249216
  35. A comparative analysis of near-infrared image colorization methods for low-power NVIDIA Jetson embedded systems Frontiers in Neurorobotics · Frontiers Media · 2023 10.3389/fnbot.2023.1143032
  36. Efficient Multi-Scale Attention Module with Cross-Spatial Learning 2023 10.1109/icassp49357.2023.10096516
  37. MobileOne: An Improved One millisecond Mobile Backbone 2023 10.1109/cvpr52729.2023.00764
  38. A Railway Fastener Inspection Method Based on Abnormal Sample Generation Computer Modeling in Engineering & Sciences · Tech Science Press · 2023 10.32604/cmes.2023.043832
  39. RailSegVITNet: A lightweight VIT-based real-time track surface segmentation network for improving railroad safety Journal of King Saud University - Computer and Information Sciences · Elsevier BV · 2024 10.1016/j.jksuci.2024.101929
  40. DPNet: Dual-Path Network for Real-Time Object Detection With Lightweight Attention IEEE Transactions on Neural Networks and Learning Systems · Institute of Electrical and Electronics Engineers · 2024 10.1109/tnnls.2024.3376563
  41. Slim-neck by GSConv: a lightweight-design for real-time detector architectures Journal of Real-Time Image Processing · Springer Science+Business Media · 2024 10.1007/s11554-024-01436-6