A railway track defect detection method based on an MFGA-YOLO model
By improving the backbone and neck structure of the YOLO11N model and combining adaptive fine-grained channel attention and the Wise-ShapeIoU loss function, the problem of low accuracy of the YOLO algorithm in railway track defect detection is solved, and more efficient and accurate defect detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2026-03-31
AI Technical Summary
Existing YOLO algorithms fail to fully utilize track defect-related feature information in railway track defect detection, resulting in low detection accuracy and problems of missed detections and false detections.
We adopted an MFGA-YOLO model, replaced the backbone structure of the YOLO11N model with the hybrid aggregation network MANet, added the adaptive fine-grained channel attention mechanism AFGCA, and used the fast convolutional gating unit Faster-CGLU in the neck structure. We also combined the Wise-ShapeIoU loss function to optimize the model weights to improve detection accuracy and efficiency.
It significantly improves the accuracy and efficiency of railway track defect detection, reduces the cost of manual inspection, enhances the integrity of track defect detection, and reduces missed and false detections.
Smart Images

Figure CN120298307B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method for detecting railway track defects based on the MFGA-YOLO model. Background Technology
[0002] With the continuous progress of society and the economy, the development of rail transit systems not only signifies the acceleration of urbanization but also reflects the increasing public demand for efficient and environmentally friendly travel. However, rail transit faces numerous challenges during operation; for example, subway trains operate for extended periods in underground tunnels with poor lighting conditions, while high-speed trains operate under various adverse weather conditions, with natural factors such as rain, snow, and fog having a significant impact on train maintenance; simultaneously, high-intensity and high-frequency operation increases the risk of equipment wear and tear. Therefore, ensuring the safety and reliability of subway trains has become particularly crucial, and one important aspect is the effective detection of track defects and faults.
[0003] Traditional track defect detection methods often rely on manual inspection and sensors. Manual inspection is not only inefficient and costly, but also struggles to guarantee accuracy in complex and changing environments. While sensor detection can replace manual inspection, it also has significant limitations; natural factors such as temperature and humidity greatly influence sensor results. Therefore, to reduce railway maintenance costs and improve fault repair efficiency, adopting advanced technologies to achieve automated and intelligent railway track defect detection has become an inevitable trend in the industry. With the rapid development of deep learning, intelligent detection technologies have become increasingly mature, with deep learning technology performing exceptionally well in image classification and object detection. This has led to the development of many classic object detection algorithms. For example, the early R-CNN and Fast R-CNN algorithms proposed by Girshick et al. pioneered two-stage object detection. R-CNN's idea is to first generate region proposals, then classify samples using convolutional neural networks, and finally use deep convolutional neural networks for image detection. Subsequently, He et al. proposed the Faster R-CNN algorithm based on R-CNN, which greatly improved the speed and accuracy of object detection while simplifying the model training and deployment process. Two-stage object detection is widely used due to its high accuracy and superior performance. However, while these two-stage object detection methods offer high detection accuracy, their real-time performance is very low, severely limiting their industrial application. To address this significant drawback, Redmon proposed the You Only Look Once (YOLO) object detection algorithm, pioneering single-stage object detection. YOLO treats object detection as a regression problem rather than a classification problem, eliminating the need to generate candidate regions and directly predicting bounding boxes and class probabilities from the image. This characteristic greatly improves the real-time performance of object detection. However, early versions of YOLO sacrificed accuracy for real-time performance. Therefore, Redmon et al. proposed YOLOv3, which significantly improved the accuracy of the original YOLO algorithm by incorporating residual network structures and adaptive anchor boxes. Furthermore, the residual network concept greatly accelerates the model's inference speed while improving accuracy.
[0004] Simultaneously, with the introduction of Transformer, Transformer-based object detection algorithms have emerged, such as the DETR series of object detection algorithms from Free-NMS, which pioneered a new approach to object detection. Later, the RT-DETR end-to-end real-time object detection algorithm appeared. However, due to the current immaturity of the DETR series algorithms and their high parameter count and computational complexity, their deployment in industry is relatively limited. Therefore, the YOLO series of object detection algorithms are very mature and popular in industrial applications. Many researchers have introduced YOLO object detection into industrial fault and defect detection. For example, Wei Ruoyu et al. used YOLOv3 to detect defects in track fasteners. Ma Zhipeng et al. used the YOLOv4 algorithm for intelligent detection of the suspension status of rigid contact wires in urban rail transit. Zou Yiming et al. used the YOLOv5 algorithm for detecting missing bolts on subway vehicle bogies. Chen Ting et al. used the YOLOv7 algorithm for detecting apparent defects in subway tunnel linings. Li Xianwang et al. used the YOLOv8 algorithm for detecting weld defects in subway trains.
[0005] Although the YOLO algorithms mentioned above have shown some competitiveness in track-related defect detection, these target detection algorithms have not made full use of track defect-related feature information, such as the lack of consideration for edge information of track defects and some uncommon defects. This has resulted in low detection accuracy of track defects and incomplete detection of track defects, leading to missed detections and false detections.
[0006] Therefore, fault detection algorithms for railway track defects still need improvement, and there is still great potential for improvement of YOLO-related algorithms. Summary of the Invention
[0007] The purpose of this invention is to provide a railway track defect detection method based on the MFGA-YOLO model, which improves the detection efficiency and accuracy in complex environments such as railways where trains are running.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] On the one hand, this invention provides a railway track defect detection method based on the MFGA-YOLO model, comprising the following steps:
[0010] The dataset containing images of railway track defects is input into the MFGA-YOLO model for training. After training is complete, the collected images of railway track defects are input into the MFGA-YOLO model to detect railway track defects and output the defect detection results.
[0011] The MFGA-YOLO model is based on the YOLO11N model architecture. First, it uses the hybrid aggregation network MANet to replace the third and fourth layers of the C3k2 structure in the backbone of the YOLO11N model, and then adds the adaptive fine-grained channel attention mechanism AFGCA at the end of the backbone.
[0012] Secondly, in the neck structure of the YOLO11N model, the C3k2 structure is replaced by the Faster-CGLU convolutional gating unit, and an adaptive fine-grained channel attention mechanism AFGCA is added after the output layer of the neck structure.
[0013] Finally, the Wise-ShapeIoU loss function is used to adjust the adaptive weights of the MFGA-YOLO model.
[0014] In some embodiments, the dataset includes the RSDDs (Rail Surface Defects) dataset, a railway track defect detection dataset from GitHub, and a dataset on railway track fastener and bolt anomalies. The RSDDs dataset contains 195 images, divided into Class I and Class II, and its high background noise makes defect detection challenging. The GitHub dataset contains approximately 4200 images with common railway track defects, while the dataset for railway track fastener and bolt anomaly detection contains approximately 7000 images. These images were manually labeled to ensure accurate classification of each defect class.
[0015] In some embodiments, the hybrid aggregation network MANet includes Bypass convolution, depthwise separable convolution, and C2f module;
[0016] The Bypass convolution is used to calibrate channels and adapt them to the various feature maps after convolution.
[0017] The depthwise separable convolution includes depthwise convolution and pointwise convolution, which are used to reduce the number of parameters and reduce computational complexity.
[0018] The C2f module is used to extract features of different levels and abstractions from the input data, and then branches the input data to increase the network's nonlinearity and improve its ability to model complex data. The C2f module enhances the integration of feature levels from different branches by concatenating features along the channel dimension.
[0019] In some embodiments, the Faster-CGLU fast convolutional gating unit includes the Faster-Block module in FasterNet and the Convolutional GLU module in TransNeXt;
[0020] The Faster-Block module includes a partial convolution module and a hierarchical scaling module. The partial convolution module divides the input channels into two parts, performs convolution operations on one part of the channels, and keeps the other part unchanged, thereby reducing the amount of computation. The hierarchical scaling module scales the features through trainable scaling parameters to enhance the model's learning ability.
[0021] The Convolutional GLU module is an improved channel mixer that combines channel attention and convolution operations, while using a [missing information - likely a specific function or feature] before the activation function GELU in the GLU gated branch. Depthwise separable convolutions are used to enhance the model's local modeling capabilities.
[0022] In some embodiments, the Wise-ShapeIoU loss function is:
[0023] ;
[0024] in,
[0025] ;
[0026] ;
[0027] In the formula, The distance between the center points of the predicted bounding box and the target bounding box; The intersection of the target bounding box and the predicted bounding box; The union of the target bounding box and the predicted bounding box; This is the intersection-union ratio (IUU) between the predicted bounding box and the target bounding box. For the nonlinear transformation of shape similarity cost, an exponential function and a fourth power are used to enhance the penalty for large differences and ensure that the cost is positive. , This is used to measure the relative difference in width and height between the predicted bounding box and the target bounding box.
[0028] On the other hand, the present invention provides a railway track defect detection system based on the MFGA-YOLO model, which applies the above method and includes:
[0029] Dataset module: This module stores the railway track defect image dataset and inputs it into the MFGA-YOLO module.
[0030] Training module: The PyTorch deep learning framework is used to train the MFGA-YOLO model;
[0031] The MFGA-YOLO module is used to detect whether there are defects in the input railway track defect image. Its architecture is based on the YOLO11N model architecture. First, the third and fourth layers of the C3k2 structure in the backbone of the YOLO11N model are replaced by the hybrid aggregation network MANet. Then, an adaptive fine-grained channel attention mechanism AFGCA is added at the end of the backbone.
[0032] Secondly, in the neck structure of the YOLO11N model, the C3k2 structure is replaced by the Faster-CGLU convolutional gating unit, and an adaptive fine-grained channel attention mechanism AFGCA is added after the output layer of the neck structure.
[0033] Finally, the Wise-ShapeIoU loss function is used to adjust the adaptive weights of the MFGA-YOLO model;
[0034] Image acquisition module: used to acquire images of railway track defects and input them into the MFGA-YOLO module;
[0035] Output module: Used to output the detection results of the MFGA-YOLO module.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] This invention, based on the YOLO11N architecture, significantly improves detection performance by employing a hybrid aggregation network to integrate multi-scale features, fast convolutional gating units to accelerate computation while maintaining accuracy, adaptive fine-grained channel attention to focus on key regions, and the Wise-ShapeIoU loss function to accurately evaluate target matching. By inputting the image to be detected into the model for railway track detection, detection efficiency is improved while significantly reducing the cost of manual detection. Attached Figure Description
[0038] Figure 1 This is a schematic diagram of the overall structure of the YOLO11N model;
[0039] Figure 2 This is a schematic diagram of the overall structure of the MFGA-YOLO model in Embodiment 1 of the present invention;
[0040] Figure 3 This is a schematic diagram of the structure of the hybrid aggregation network MANet in Embodiment 1 of the present invention;
[0041] Figure 4This is a schematic diagram of the adaptive fine-grained channel attention (AFGCA) structure in Embodiment 1 of the present invention;
[0042] Figure 5 This is a schematic diagram of the Faster-CGLU fast convolution gate unit in Embodiment 1 of the present invention;
[0043] Figure 6 This is a visualization diagram of the railway track defect detection dataset in Embodiment 1 of the present invention;
[0044] Figure 7 This is a comparative experimental diagram of abnormal datasets of railway track fasteners and bolts in Embodiment 1 of the present invention. Detailed Implementation
[0045] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0046] Example 1:
[0047] Please see Figures 1-5 A railway track defect detection method based on the MFGA-YOLO model is proposed. The dataset containing railway track defect images is input into the MFGA-YOLO model for training. After the training is completed, the collected railway track defect images are input into the trained MFGA-YOLO model to detect railway track defects and output the defect detection results.
[0048] The MFGA-YOLO model is based on the YOLO11N model architecture, such as Figure 1 As shown, the YOLO11N model includes the following modules:
[0049] Input end:
[0050] The input side of the YOLO11N model mainly preprocesses, normalizes, and scales the input data to adapt it to the network's input. It also employs numerous data augmentation methods to increase the model's robustness.
[0051] Backbone structure:
[0052] The Backbone module is mainly used for feature extraction, and includes Conv, C3k2, SPPF, and C2PSA structures. The Conv structure first employs... The convolution kernels are standard 2D convolutions with a stride of 2, followed by batch normalization, and finally SiLU is used as the activation function. The C3k2 structure is an extension of the C2f structure in YOLOv8. The C3k2 structure can be set as the initial C2f block. The C3k2 structure is a faster and more efficient variant of the CSP bottleneck. It uses two convolutions instead of one large convolution, thus speeding up feature extraction. The SPPF (Spatial Pyramid Pooling Fast Module) structure first performs multiple convolutions to reduce channels, then performs max pooling at different scales, and concatenates the results to capture features at multiple spatial scales. The C2PSA (Cross-Stage Local Spatial Attention) structure added in YOLO11N enhances spatial attention in feature maps, improving the model's focus on important parts of the image. By spatially pooling features, the model can more effectively focus on specific regions of interest. This structure can add attention to the feature map, helping the model focus on important regions of the image.
[0053] Neck structure:
[0054] The neck structure is primarily responsible for receiving feature information from the backbone structure, aggregating features at different resolutions, and passing them to the head network for prediction. It also utilizes the faster and more efficient C3k2 structure, further enhancing the model's attention mechanism and robustness. Through multi-level feature fusion and processing, effective detection of multi-scale targets is achieved. Through convolutional layers, upsampling and downsampling operations, and feature map concatenation, the neck network captures target information at different scales and passes it to the head network for final prediction.
[0055] Head structure
[0056] The Head structure serves as the detection head, outputting predictions from three feature maps (P3, P4, and P5), corresponding to different granularity levels in the image. Specifically, P3 is an 8x downsampled feature pyramid for smaller objects, P4 is a 16x downsampled feature pyramid for medium-sized objects, and P5 is a 32x downsampled feature pyramid for large objects. This method ensures that small objects are detected more finely (P3), while larger objects are captured by higher-level features (P5). Depthwise separable convolution (DWConv) is used on the classification branch. Compared to standard convolution, this DWConv performs depthwise convolution on each channel dimension followed by pointwise convolution to restore the feature map size, significantly reducing computational complexity and model parameters. Classification loss, regression loss, and a DFL (Distributed Focus Loss Module) for bounding box refinement are defined for classification and prediction, respectively.
[0057] To address the challenges of extracting feature information from subtle defects in railway tracks and insufficient attention to key feature information, this embodiment of the MFGA-YOLO model improves upon the YOLO11N model to achieve efficient and high-precision detection of railway track defects.
[0058] like Figure 2 As shown, the MFGA-YOLO model utilizes the Mixed Aggregation Network (MANet) from Hyper-YOLO to improve part of the C3k2 structure in the backbone of the original YOLO11N model. Furthermore, it incorporates an Adaptive Fine-Grained Channel Attention (AFGCA) mechanism into the backbone to enhance the YOLO11N backbone structure. The aim is to efficiently select key features highly relevant to the target task from multi-scale information, thereby enhancing the feature extraction capability of the backbone network. Simultaneously, it introduces the Faster-Block module from FasterNet and the Convolutional GLU module from TransNeXt convolutions to form Faster-CGLU, improving the neck structure of YOLO11N. Partial convolutional structures within the Faster-Block module extract spatial features more effectively by reducing redundant computation and memory access. It selects the characteristics of a subset of channels for regular convolutions while keeping the characteristics of the remaining channels unchanged, reducing computational complexity and thus achieving a fast and efficient neural network.
[0059] The Convolutional GLU module adds a gated branch to the GLU. Deep convolution enables each token to obtain a unique gating signal based on its neighboring fine-grained features, mitigating potential model depth degradation and achieving information perception close to human foveal vision. The Wise-ShapeIoU loss function allows the model to adaptively adjust weights, automatically adjusting the loss weights for positive and negative samples, thus accelerating model training and convergence. The MFGA-YOLO model of this invention demonstrates better detection performance on its railway track defect-related dataset.
[0060] like Figure 3 As shown, the Hybrid Convergence Network (MANet) is a network architecture used to enhance feature extraction capabilities. It improves the diversity and information flow of visual features by fusing multiple convolutional operations, thereby enhancing the model's feature representation and semantic depth at different levels. The Hybrid Convergence Network (MANet) combines... By combining three typical convolutional variants—side-channel convolution, depthwise separable convolution, and C2f modules—we can enhance the diversity of visual features and the flow of information.
[0061] Side-channel convolution is used to calibrate channels and adapt them to the various feature maps after convolution. Depthwise separable convolution is divided into depthwise convolution and pointwise convolution. Compared with traditional standard convolution, depthwise separable convolution can significantly reduce the number of parameters and computational complexity. Since traditional convolution requires applying a large convolution kernel to every position on all input channels, it increases the computational complexity of the model. Depthwise separable convolution decomposes this process into two steps, and each step uses a smaller convolution kernel.
[0062] The C2f module uses convolutional operations to extract features at different levels and abstractions from the input data, and then branches the input data to increase the network's non-linearity and improve its ability to model complex data. The C2f module also enhances the integration of feature levels from different branches by concatenating features along the channel dimension.
[0063] like Figure 4 As shown, the Adaptive Fine-Grained Channel Attention (AFGCA) mechanism aims to improve the performance of visual tasks by enhancing the model's understanding and processing of image features. In traditional convolutional neural networks, all channels are typically treated equally, regardless of their importance to a specific task. However, the Adaptive Fine-Grained Channel Attention (AFGCA) mechanism breaks this limitation by introducing a dynamic weight allocation strategy that adjusts the importance of each channel based on its contribution to the current task. This method not only emphasizes features crucial for completing the task but also suppresses or ignores irrelevant or potentially noisy features. It can more accurately focus on key information in the image, thereby improving the model's performance in various visual tasks, making the model more flexible and robust in handling different scenes and tasks. Furthermore, through fine-grained attention allocation, it can better capture detailed features in the image, further improving the model's recognition accuracy and generalization ability, and enhancing the model's ability to understand and interpret data.
[0064] like Figure 5The diagram shows the structure of the Faster Convolutional Gated Unit (Faster-CGLU). The Faster-Block module is a key module in FasterNet, comprising two crucial components: Partial Convolution and Layer Scaling. These components work together to reduce redundant computation and memory access, thereby improving computational speed without sacrificing accuracy. The Partial Convolution module reduces computation by dividing the input channels into two parts, performing convolution on one part while leaving the other part unchanged. The Layer Scaling module scales features using trainable scaling parameters, enhancing the model's learning ability.
[0065] A Convolutional Gated Unit (CGLU) is an improved channel mixer that combines channel attention mechanisms with convolution operations. A gated function is used before the activation function of the GLU gated branch. Depth-separable convolutions enhance the model's local modeling capabilities.
[0066] Channel attention mechanisms enhance the focus on important features of the model while suppressing unimportant channels, thereby improving the model's ability to perceive key information. By learning the importance weights of each channel in the input feature map, the model can better adapt to different input data, thus improving its generalization ability. This type of attention mechanism has relatively low computational complexity and does not significantly increase the model's computational burden, thus improving the model's efficiency.
[0067] Combining the advantages of the Faster-Block module and the Convolutional Gated Unit (CGLU) enables efficient model computation, with some convolutional techniques significantly reducing redundant computations and memory accesses. This combination not only reduces forward and backward propagation time and improves computational efficiency but also lowers model complexity without sacrificing performance, thereby reducing memory consumption and computational resource requirements, and enhancing the model's hardware-awareness. Furthermore, the built-in gating mechanism of the CGLU helps alleviate the vanishing gradient problem in deep networks, improving the model's ability to learn complex nonlinear relationships while ensuring good training dynamics during rapid computation.
[0068] The Wise-Power-IOU loss function dynamically adjusts the weights of different loss components, giving different parts a focus, and automatically adjusts the loss weights of positive and negative samples based on the sample difficulty. Combining multi-scale information fusion can better handle multi-scale features, improve small object detection capabilities, emphasize bounding box edge information, and help to more accurately locate targets. A weighted mechanism is introduced to better estimate the overlap between the predicted and ground truth boxes, thus reducing the limitations of traditional single IoU (Intersection over Union) when the overlap area is small or the location is inaccurate. The Wise-Power-IOU loss function is robust to predicted boxes with different distributions, reducing the impact of small errors commonly found at boundaries on the model training process, enabling the model to learn target features more accurately. It can help improve the detection accuracy of the model in various scenarios, especially in complex backgrounds where the detection effect is very significant.
[0069] The Wise-ShapeIoU loss function is defined as follows:
[0070] The x and y coordinates of the prediction box are: ( , (), , The x and y coordinates of the target bounding box are: ( , (), , ).
[0071] Calculate the width and height of the predicted bounding box and the target bounding box separately:
[0072] Width and height of the prediction box:
[0073] (1);
[0074] Width and height of the target bounding box:
[0075] (2);
[0076] In the formula, This is an adjustment factor to prevent division by zero.
[0077] Calculate shape distance weights:
[0078] Width weight:
[0079] (3);
[0080] Height weight:
[0081] (4);
[0082] In the formula, and The weights are used to adapt to target boxes of different shapes, because different targets may have different aspect ratios. The loss function can more intelligently measure the positional difference between the predicted box and the target box, especially when dealing with non-square or large aspect ratio objects, which can improve the accuracy of the model in locating these objects.
[0083] (5);
[0084] In the formula, and These are the width and height of the rectangle that minimum-covers both bounding boxes, respectively.
[0085] (6);
[0086] In the formula, It is the diagonal length of the minimum covering rectangle, and is an adjustment factor to prevent division by zero.
[0087] (7);
[0088] (8);
[0089] (9);
[0090] In the formula, Distance between the center points of the predicted bounding box and the target bounding box and Used to measure the center points of two bounding boxes. shaft and Differences along the axial direction. Here, the position of the center point is calculated by taking the average, and the square of the difference between them is calculated.
[0091] (10);
[0092] (11);
[0093] In the formula, and Used to measure the relative difference in width and height between the predicted bounding box and the target bounding box. After... and After adjusting the weights, divide by the maximum of the two values to emphasize the difference in shape.
[0094] (12);
[0095] It is a non-linear transformation of shape similarity cost, using an exponential function and a fourth power to enhance the penalty for large differences and ensure that the cost is positive.
[0096] The final regression loss function for the bounding box is:
[0097] (13);
[0098] The intersection-union ratio (IUU) of the predicted bounding box and the target bounding box is defined as:
[0099] ;
[0100] In the formula, represents the intersection of the target box and the predicted box, and represents the union of the target box and the predicted box.
[0101] The datasets used in this embodiment include the RSDDs rail surface defect dataset, a railway track defect detection dataset from GitHub, and a dataset on anomalies in railway track fasteners and bolts. Each of the three datasets is divided into training, validation, and test sets in a 7:2:1 ratio to systematically evaluate the performance of the MFGA-YOLO model.
[0102] All experiments used Python version 3.10.16, PyTorch version 2.3.0, and CUDA 12.6 for training. During training, the batch size was 32, with 400 epochs. The SGD optimizer was used, and cosine annealing was employed as the learning rate. The input image was 640x640 pixels. The specific hardware configuration for the experiments is shown in Table 1.
[0103] Table 1 Experimental Hardware Environment Configuration Table
[0104]
[0105] To verify the effectiveness of the MFGA-YOLO model, a series of mainstream object detection algorithms were selected and compared on the RSDDS dataset. Precision (P), recall (R), mean precision (mAP@0.5), F1 score, and number of parameters were compared as evaluation metrics. The specific results are shown in Table 2.
[0106] Table 2 Comparison of various metrics for different algorithm models on the RSDDs dataset
[0107]
[0108] As can be seen from Table 2, although the MFGA-YOLO model is an improvement on the YOLO11N model, its various indicators are basically consistent with those of the YOLO11s model. Therefore, it can be verified that the various indicators of the MFGA-YOLO model are basically superior to the basic YOLO11N model.
[0109] To illustrate the performance of the MFGA-YOLO model on other datasets, this embodiment trains and tests the model on a railway track defect detection dataset to compare various metrics of the YOLO11N model and the MFGA-YOLO model. The results on the test set are shown in Table 3.
[0110] Table 3 Comparison of Railway Track Defect Detection Datasets
[0111]
[0112] As shown in Table 3, the MFGA-YOLO model demonstrates a significant performance advantage on the railway track defect detection dataset. It achieves an accuracy of 0.975, surpassing YOLO11N's 0.959, and also boasts a higher recall of 0.936, greatly reducing the possibility of missed detections. Furthermore, the MFGA-YOLO model performs exceptionally well in mean precision (mAP@0.5), reaching 0.979. In a broader IoU range (mAP@[0.5:0.95]), its mAP value is 0.707, exceeding the corresponding values of YOLO11N. This proves its superior performance across target detection tasks of varying sizes and complexities. Although the MFGA-YOLO model has a slightly higher number of parameters and computational complexity, this additional resource consumption is worthwhile for scenarios requiring extremely high defect detection accuracy. The detection results are also visualized, such as... Figure 6 As shown.
[0113] Meanwhile, experiments were conducted on another dataset for detecting abnormalities in railway track fasteners and bolts to demonstrate that the MFGA-YOLO model exhibits excellent performance in detecting various defects in railway tracks. The experimental results were compared on the test set, and the results are shown in Table 4.
[0114] Table 4 Comparison of Abnormal Datasets for Railway Track Fasteners and Bolts
[0115]
[0116] For the railway track fastener and bolt anomaly dataset, the categories are relatively simple and easy to detect. Therefore, both the YOLO11N model and the MFGA-YOLO model showed good experimental results. This also demonstrates that the MFGA-YOLO model can perform very well in defect detection under both complex and relatively simple conditions. The detection results are visualized as follows: Figure 7 As shown.
[0117] This invention, based on the YOLO11N architecture, significantly improves detection performance by introducing a hybrid aggregation network to integrate multi-scale features, fast convolutional gating units to accelerate computation while maintaining accuracy, adaptive fine-grained channel attention to focus on key regions, and the Wise-ShapeIoU loss function to accurately evaluate target matching. By inputting the image to be detected into the model to detect railway tracks, detection efficiency is improved while significantly reducing the cost of manual detection.
[0118] Example 2
[0119] A railway track defect detection system based on the MFGA-YOLO model includes:
[0120] Dataset Module: This module stores the railway track defect image dataset and inputs it into the MFGA-YOLO module.
[0121] Training module: The PyTorch deep learning framework is used to train the MFGA-YOLO model.
[0122] The MFGA-YOLO module is used to detect whether there are defects in the input railway track defect images. Its architecture is based on the YOLO11N model architecture. First, the third and fourth layers of the C3k2 structure in the backbone of the YOLO11N model are replaced by the hybrid aggregation network MANet. Finally, an adaptive fine-grained channel attention mechanism AFGCA is added to the end of the backbone.
[0123] Secondly, in the neck structure of the YOLO11N model, the C3k2 structure is replaced by the Faster-CGLU convolutional gating unit, and an adaptive fine-grained channel attention mechanism AFGCA is added after the output layer of the neck structure.
[0124] Finally, the Wise-ShapeIoU loss function is used to adjust the adaptive weights of the MFGA-YOLO model;
[0125] Image acquisition module: Uses cameras, high-definition video cameras, etc. to acquire images of railway track defects and inputs these images of railway track defects to be detected into the MFGA-YOLO module.
[0126] Output module: Used to output the detection results of the MFGA-YOLO module.
[0127] This invention discloses a railway track defect detection system based on the MFGA-YOLO model, which can be installed in a computer device. The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a railway track defect detection program based on the MFGA-YOLO model. The memory includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic storage, disk, optical disk, etc. The processor is the control core of the electronic device, connecting various components of the computer device via various interfaces and lines. It executes programs or modules stored in the memory and calls data stored in the memory to perform various functions of the computer device and process data.
[0128] The module described in this invention refers to a series of computer program segments that can be executed by the processor of a computer device and can perform a fixed function, and which are stored in the memory of the computer device.
[0129] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A railway track defect detection method based on a MFGA-YOLO model, characterized in that, The method comprises the following steps: The data set containing the image of the railway track defect is input into the MFGA-YOLO model for training, and after the training is completed, the collected image of the railway track defect is input into the MFGA-YOLO model to detect the railway track defect and output the defect detection result; The MFGA-YOLO model is based on the YOLO11N model architecture, first uses a mixed aggregation network MANet to replace the third and fourth layers C3k2 structure in the backbone structure Backbone of the YOLO11N model, and adds an adaptive fine-grained channel attention mechanism AFGCA at the end of the backbone structure Backbone; Secondly, in the neck structure Neck of the YOLO11N model, a faster convolution gate unit Faster-CGLU is used to replace the C3k2 structure, and an adaptive fine-grained channel attention mechanism AFGCA is added after the output layer of the neck structure Neck; Finally, the Wise-ShapeIoU loss function is used to adjust the adaptive weight of the MFGA-YOLO model.
2. The railway track defect detection method based on the MFGA-YOLO model according to claim 1, characterized in that, The data set includes the RSDDs rail surface defect data set, the railway track defect detection data set from GitHub and the data set about the abnormality of the railway track fastening and bolt.
3. The railway track defect detection method based on the MFGA-YOLO model according to claim 1, characterized in that, A mixed aggregation network MANet comprises Bypass convolution, depthwise separable convolution and C2f module The Bypass convolution is used to correct for channels; The depth separable convolution includes a depth convolution and a pointwise convolution, which are used to reduce the number of parameters and reduce the computational complexity; The C2f module is used to extract features of different levels and degrees of abstraction in the input data, and branch the input data again.
4. The railway track defect detection method based on the MFGA-YOLO model according to claim 1, characterized in that, The Faster-CGLU includes a Faster-Block module in FasterNet and a Convolutional GLU module in TransNeXt; The Faster-Block module includes a partial convolution module and a hierarchical scaling module, the partial convolution module divides the input channels into two parts, one part of the channels is convolved, and the other part of the channels remains unchanged, thereby reducing the amount of calculation; The hierarchical scaling module scales the features through trainable scaling parameters to enhance the learning ability of the model; The Convolutional GLU module is an improved channel mixer that combines channel attention mechanism and convolution operation, while using a depthwise separable convolution before the activation function GELU of the GLU gating branch to enhance the local modeling capability of the model. The Convolutional GLU module is an improved channel mixer that combines channel attention mechanism and convolution operation, while using a depthwise separable convolution before the activation function GELU of the GLU gating branch to enhance the local modeling capability of the model.
5. The railway track defect detection method based on the MFGA-YOLO model according to claim 1, characterized in that, The Wise-ShapeIoU loss function is: ; Wherein, ; ; wherein, is the distance between the center points of the prediction and target boxes; is the intersection of the target and prediction boxes; is the union of the target and prediction boxes; is the intersection over union of the prediction and target boxes; is a non-linear transformation of the shape similarity cost, using an exponential function and a fourth power to enhance the penalty for large differences and to ensure the cost is positive; , is a measure of the relative difference in width and height of the prediction and target boxes.
6. A railway track defect detection system based on a MFGA-YOLO model, applying the method of any one of claims 1-5, characterized in that, It comprises: The data set module: a storage module of the railway track defect image data set, and the railway track defect image data set is input into the MFGA-YOLO module; The training module: using the Pytorch deep learning framework, which is used to train the MFGA-YOLO model; The MFGA-YOLO module: used to detect whether there is a defect in the input railway track defect image, and its architecture is based on the YOLO11N model architecture, first uses a mixed aggregation network MANet to replace part of the C3k2 structure in the backbone structure Backbone of the YOLO11N model, and adds an adaptive fine-grained channel attention mechanism AFGCA at the end of the backbone structure Backbone; Secondly, in the neck structure Neck of YOLO11N model, the C3k2 structure is replaced by the Faster-CGLU, and the AFGCA is added after part of the Faster-CGLU; Finally, the Wise-ShapeIoU loss function is used to adjust the adaptive weight of the MFGA-YOLO model; The image acquisition module is used to acquire the railway track defect image and input the railway track defect image into the MFGA-YOLO module; The output module is used to output the detection result of the MFGA-YOLO module.
Citation Information
Patent Citations
Improved YOLO v8-based mushroom stick cultivation mushroom grading method and system
CN119206711A
High-precision fabric defect detection method based on lightweight hybrid aggregation network and enhanced generalized feature fusion
CN119444714A