Track fastener state detection method based on improved YOLO11 model
By improving the track fastener status detection method of the YOLO11 model, adopting the progressive feature pyramid AFPN structure and the lightweight detection head LADH, and combining the SIoU loss function, the problems of poor detection effect and high model complexity in the existing technology are solved, realizing lightweight and efficient fastener status detection, which is suitable for edge devices.
Patent Information
- Application Number
- CN202511491909.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing track fastener status detection methods are ineffective in complex scenarios, have high model complexity, are not easy to deploy at the edge, and suffer from problems such as missed detection of small targets and insufficient positioning accuracy.
An improved YOLO11 model is adopted, combined with the progressive feature pyramid AFPN structure and the lightweight asymmetric detection head LADH. Multi-scale feature fusion combining bottom-up and top-down paths is used, and ASFF and BasicBlock modules are introduced. The SIoU loss function is used to optimize the orientation, position and shape consistency between the predicted box and the ground truth box. The weak augmentation, strong augmentation and virtual data training strategies are combined to achieve lightweight and efficient detection.
While maintaining detection accuracy, the model is lightweight, making it suitable for deployment on edge devices. This improves the efficiency of fastener defect identification and maintenance response speed, while reducing computational complexity and resource requirements.
Smart Images

Figure CN120976840A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing and detection technology, specifically a method for detecting the status of track fasteners based on an improved YOLO11 model. Background Technology
[0002] Track fasteners are critical components in railway lines used to secure rails to sleepers, and their condition directly affects the safety and stability of train operation. During long-term service, fasteners not only withstand dynamic impacts and vibrations from the wheels and rails but also the continuous effects of natural environmental factors such as rain, wind, sand, and temperature changes, making them highly susceptible to loosening, missing fasteners, and breakage. If these defects are not detected and addressed promptly, they can lead to lateral or longitudinal displacement of the rails, potentially causing serious accidents such as train derailments. Therefore, regular and comprehensive condition inspections of track fasteners are a crucial aspect of ensuring safe train operation for railway maintenance departments.
[0003] Traditional inspection methods primarily rely on manual patrols, requiring workers to walk along the route during nighttime "maintenance windows" and check fasteners one by one through visual inspection, hammering, or simple tools. This method is not only labor-intensive and inefficient, but also significantly affected by lighting, weather, and personnel experience, resulting in a high rate of missed and false inspections. It can no longer meet the increasing demands for inspection frequency and accuracy from the growing operating mileage and traffic density.
[0004] In recent years, with the popularization of machine vision and deep learning technologies, image-based automatic detection solutions have begun to be piloted in the railway field. Existing technologies generally employ general-purpose object detection networks such as YOLO, SSD, or Faster R-CNN, acquiring images of fasteners through track inspection vehicles or portable cameras, and then using models to infer and determine the defect category. However, these general-purpose networks reveal three shortcomings in fastener scenarios: First, fasteners occupy a small proportion of pixels in the image, and there are scale differences due to different models and shooting distances. Conventional feature pyramids have limited ability to fuse multi-scale information, resulting in missed detections of small targets. Second, fastener defects are subtle in shape and have blurred boundaries, making it difficult for existing detection heads to balance positioning accuracy and parameter quantity, resulting in high model complexity and difficulty in deployment on edge devices. Third, existing loss functions mainly consider overlapping area, ignoring angle, shape, and orientation errors, leading to inconsistencies between the orientation of the predicted bounding box and the actual bounding box, and misalignment of edges, affecting subsequent defect size measurement and maintenance decisions. The aforementioned problems mean that existing image detection methods still face bottlenecks such as insufficient accuracy, low real-time performance, and bloated models when applied in the field. There is an urgent need for a lightweight detection technology that is specifically optimized for the characteristics of fastener scenarios. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a track fastener status detection method based on an improved YOLO11 model, in order to solve the problems of poor detection effect in some complex scenarios and high model complexity in existing track fastener status detection algorithms, which are not easy to deploy at the edge.
[0006] To achieve the above objectives, a track fastener state detection method based on an improved YOLO11 model is designed, comprising the following steps: Step S1: Collect track fastener image data, augment the data using an image augmentation algorithm, performing weak augmentation on one part and strong augmentation on another, and finally adding virtual data; Step S2: Label the track fastener dataset, dividing the dataset into training set, validation set, and test set; Step S3: Construct a track fastener state detection network model based on the improved YOLO11 model. The network model specifically includes an input, a backbone network, a neck network, a detection head, and an output. The neck network adopts an progressive feature pyramid (AFPN) structure, combining bottom-up and top-down paths with lateral connections, introducing an ASFF module to achieve dynamic multi-scale feature fusion, and using BasicBlock... The module performs deep feature extraction and transformation to improve the expressive power and positioning accuracy of track fastener features at different scales. The detection head adopts a lightweight asymmetric detection head LADH, including regression and classification branches. The regression branch enhances the bounding box localization capability through depthwise separable convolution, while the classification branch maintains a lightweight structure to achieve efficient classification. The model uses the SIoU loss function, combined with angle loss, distance loss, shape loss, and IoU loss, to optimize the consistency between the predicted box and the ground truth box in terms of orientation, position, shape, and overlap. The overall model achieves lightweight design while maintaining detection accuracy, making it suitable for edge deployment. Step S4: The track fastener status detection network model is trained using the training and validation sets to obtain the various parameters of the network model, resulting in the trained safety equipment detection network model. Step S5: The trained track fastener status detection network model is tested using the test dataset, and the test results are evaluated.
[0007] Preferably, the present invention further includes: step S3 further includes: adaptive weighted fusion of multi-scale feature maps between the bottom-up and top-down paths through ASFF_2 and ASFF_3 modules. The feature maps are derived from the initial multi-scale features extracted from the track fastener dataset by the backbone network and passed to the neck network. During the fusion process, the spatial size is unified by upsampling, and fusion weights are generated using 1×1 convolution and Softmax. Finally, the fused feature map is output through 3×3 convolution. The ASFF_2 module is used to fuse feature maps of two scales: feature map x0 and feature map x1. First, feature map x1 is upsampled to match the size of feature map x0. Then, fusion weights are calculated through 1×1 convolution and Softmax. The feature map x0 and the upsampled feature map x1 are weighted and summed, and finally a fused feature map is output through a 3×3 convolution. The ASFF_3 module is used to fuse feature maps of three scales: feature map x0, feature map x1 and feature map x2. First, feature maps x1 and x2 are upsampled to match the size of x0. Then, the fusion weights of each feature map are calculated through a 1×1 convolution and Softmax. Then, feature map x0, the upsampled feature map x1 and feature map x2 are weighted and summed. Finally, a fused feature map is output through a 3×3 convolution. The BasicBlock module is set after the ASFF module and is used to perform deep feature extraction on the fused feature map. Its structure includes two convolutions, batch normalization, SiLU activation operation, and residual connections to enhance feature representation and training stability.
[0008] Preferably, the present invention further includes: the regression branch of the lightweight asymmetric detection head LADH includes a standard convolution, two depthwise separable convolutions and a regular convolution, used to extract spatial features and output bounding box regression parameters; the classification branch includes a standard convolution, a depthwise separable convolution and a regular convolution, used to output category prediction results.
[0009] Preferably, the present invention further includes: the angle loss in the SIoU loss function is used to guide the predicted box to preferentially approach the real box along the X or Y axis direction, reducing directional deviation; the distance loss combines angle information to adjust the spatial distance between the predicted box and the real box; the shape loss optimizes the shape of the predicted box by comparing the differences in width and height; and the IoU loss measures the degree of overlap between the predicted box and the real box, synergistically improving positioning accuracy and shape adaptability.
[0010] Preferably, the present invention further includes: the specific method of step S1 is as follows: Step S1.1: Obtain a dataset of track fastener images in different states; Step S1.2: Expand the dataset using image augmentation algorithms, performing weak augmentation methods such as rotation, cropping, and translation on one part, and strong augmentation methods such as random noise, grayscale, and color transformation on the other part; Step S1.3: Add virtual data to the dataset, which is a 3D model rendering of the track fastener; the specific method of step S2 is as follows: Step S2.1: Manually annotate the detection targets in the track fastener dataset using an annotation website, where the states of the track fasteners include: loose, missing, and normal; Step S2.2: Divide the annotated track fastener dataset into a training set, a validation set, and a test set according to a certain ratio; Step S2.3: Divide the virtual data into the validation set and the test set to improve the robustness and generalization of model training.
[0011] Preferably, the present invention further includes: the Neck Progressive Feature Pyramid (AFPN) structure in step S3 is as follows: Step S3.1.1: The neck network adopts a bottom-up and top-down path, combined with lateral connections, to achieve efficient multi-scale feature fusion. The specific structure includes three parallel feature processing paths, which typically correspond to small, medium, and large target scale features of the input. From top to bottom, they are high-resolution shallow features, medium-resolution mid-level features, and low-resolution deep features, respectively, to achieve comprehensive detection of track fasteners of different sizes; Step S3.1.2: Each path first undergoes preliminary feature transformation and dimensionality adjustment through continuous Conv modules. The Conv module consists of three parts: firstly, the input feature map is convolved through a two-dimensional convolutional layer. The convolution operation is used to extract local spatial features; then batch normalization is applied to normalize the convolution output, stabilizing the training process and accelerating convergence; finally, nonlinearity is introduced through the SiLU activation function, enabling the model to better capture the complex edges, morphological details, and texture variations of the track fastener; Step S3.1.3: Then, through the ASFF_2 module: First, weights are calculated for feature map x0 and feature map x1 respectively; feature map x1 is upsampled to the same size as feature map x0 to make the spatial dimensions of the two feature maps of the track fastener consistent; then, the weights of the two feature maps are further processed through 1x1 convolution and normalized through the Softmax function to generate weighted fusion weight coefficients; subsequently, the features are weighted according to these weights. The feature map x0 and the upsampled feature map x1 are weighted and summed to obtain a preliminary fused feature map. Finally, a 3x3 convolutional layer is used to further process the fused features and output the fused feature map. Step S3.1.4: The feature map enters the BasicBlock module: First, it passes through a two-dimensional convolutional layer, then normalizes it through two-dimensional batch normalization to stabilize the training, and then applies the SiLU activation function to introduce nonlinearity. Then, a second two-dimensional convolution and two-dimensional batch normalization operation is performed. The output is added to the original input through the residual connection, and finally, the SiLU activation function is applied again to generate a further output. Step S3.1.5: The feature map enters the ASFF_3 module: The ASFF_3 module is used to fuse three different scales of the track fastener. The feature maps, denoted as feature map x0, feature map x1, and feature map x2, follow a similar but more complex process to ASFF_2: First, weights are calculated for feature maps x0, x1, and x2 respectively. To align spatial dimensions, feature maps x1 and x2 are upsampled to the same size as feature map x0. Then, the three weights are processed through a 1x1 convolution and normalized using the Softmax function to generate fusion weights for each feature map. Next, feature map x0, the upsampled feature map x1, and feature map x2 are weighted and summed according to these weights to obtain a preliminary fused feature map. Finally, a 3x3 convolutional layer is used to further process the fused features, outputting the final feature map; Step S3.1.6: The feature map re-enters the BasicBlock module for deeper feature extraction, ensuring training stability. Alternating between the ASFF and BasicBlock modules guarantees adaptive fusion of multi-scale features while continuously strengthening deep feature extraction, enabling the model to maintain high expressive power across multiple scales, especially for the varied shapes and complex textures of track fasteners. Step S3.1.7: Finally, each path outputs processed features via Conv, providing rich and stable multi-scale features for subsequent detection heads. Step S3.1.8: The ASFF module dynamically fuses features from multiple scales to achieve more comprehensive multi-scale perception, helping the model adapt to the features exhibited by track fasteners at different distances and angles. Step S3.1.9: The BasicBlock module performs deep feature extraction and transformation on the fused feature map, enhancing expressive power and thus improving the recognition rate and positioning accuracy of track fasteners.
[0012] Preferably, the present invention further includes: the lightweight asymmetric detection head LADH structure in step S3 is as follows: Step S3.2.1: The overall design of the LADH detection head is divided into two parallel branches: a regression branch and a classification branch. The overall design adopts an asymmetric structure, which enables the regression branch to have a deeper feature extraction capability to cope with the complex requirements of bounding box localization, while the classification branch remains relatively simple, balancing the computational efficiency and detection performance of the model, and effectively improving the detection speed and accuracy in resource-constrained environments; Step S3.2.2: The regression branch consists of a regular convolution, two depthwise separable convolutions and a normal convolution, which is mainly used for the accurate localization of bounding boxes: firstly, preliminary features are extracted through a standard convolutional layer, then... Then, two depthwise separable convolutional layers are applied consecutively. The depthwise convolution decomposes the spatial and channel convolutions, which greatly reduces the computational complexity and the number of parameters, while maintaining the effective expression of spatial features. Finally, a regular convolutional layer is used to output the bounding box regression result, which helps the model to accurately adjust the position and size of the bounding box of the track fastener under limited computing resources, and adapt to the shape changes of the fastener and complex scenarios under different states. Step S3.2.3: The classification branch consists of a regular convolution, a depthwise separable convolution and a regular convolution, which focuses on the discrimination of the target category: first, a standard convolutional layer is used for feature extraction, then a depthwise separable convolution is used for lightweight feature processing, and finally a regular convolutional layer is used to output the category prediction.
[0013] Preferably, the present invention further includes: the SIoU loss function in step S3 functions as follows: Step S3.3.1: The SIoU loss function consists of four parts: angle loss, distance loss, shape loss, and IoU loss, which significantly improves the detection accuracy of track fasteners; Step S3.3.2: First, the angle loss is designed to reduce the number of variables in the distance-related adjustment of the predicted box. The model will prioritize moving the predicted box closer to the nearest X or Y axis, and then further approximate the real box along that axis to align with the actual position of the track fastener, reducing the error caused by directional deviation and ensuring that the predicted box is more in line with the main directional features of the fastener; Step S3.3.3: Second, the distance loss takes into account the influence of the angle loss when calculating. The distance loss combines angle information to adjust the spatial distance between the predicted box and the real box. Only when the angle is close... The distance loss only takes effect at this time, thus avoiding misleading results when the predicted box deviates significantly from the direction, and strengthening the spatial consistency between the box and the target; Step S3.3.4: Shape loss is used to measure the difference in shape between the predicted box and the real box. By comparing the width and height of the predicted box with the real box, the shape loss is calculated to guide the model to optimize the shape of the predicted box, making it more in line with the standard size and shape of the track fastener, and avoiding unreasonable boxes that are too long or too wide; Step S3.3.5: IoU loss is a commonly used metric in object detection, used to represent the degree of overlap between the predicted box and the real box; Combining these four parts, the SIoU loss function not only improves the positioning accuracy in track fastener detection, but also enhances the adaptability to shape and direction, helping the model to more stably identify fasteners and improve the detection efficiency and reliability in practical applications.
[0014] Compared with the prior art, the advantages of this invention are: This invention improves the detection accuracy and lightweight model of the YOLO11 network in track fastener condition detection, meeting the needs of edge deployment in railway sites. First, the neck network adopts an Asymmetric Feature Pyramid (AFPN) structure. The ASFF module adaptively weights and fuses the multi-scale feature maps output by the backbone network, fully integrating the feature information of small, medium, and large-sized fasteners, effectively mitigating the problem of missed detection of small targets. After fusion, BasicBlock residual units are used to further extract deep semantic features, enhancing the ability to express fastener edges, textures, and subtle defects. Second, the detection head uses a lightweight asymmetric detection head, LADH. The regression branch uses dual-depth separable convolutions, reducing the number of parameters while maintaining positioning accuracy; the classification branch uses single-depth separable convolutions, significantly reducing computation. The overall structure is lighter than conventional detection heads, making it suitable for resource-constrained equipment. Furthermore, the SIoU loss function is introduced, combining angular loss, distance loss, shape loss, and IoU loss to simultaneously optimize the orientation, position, size, and overlap of the predicted bounding box. This makes the bounding box regression results closer to the true bounding box, improving positioning accuracy and shape consistency. Finally, through a training strategy combining weak augmentation, strong augmentation, and virtual data, the model exhibits strong generalization ability under different lighting conditions, contamination, and shooting angles. It can be directly deployed on edge devices such as track inspection trolleys or portable terminals without additional compression processing, significantly improving the efficiency of fastener defect identification and maintenance response speed. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method in an embodiment of the present invention; Figure 2 This is a rendering of the three-dimensional model in an embodiment of the present invention; Figure 3 This is a network structure diagram of the improved YOLO11 model in an embodiment of the present invention; Figure 4 This is a diagram of the improved neck network structure in an embodiment of the present invention; Figure 5 This is a structural diagram of the Conv module in an embodiment of the present invention; Figure 6 This is a structural diagram of the ASFF and BasicBlock modules in an embodiment of the present invention; Figure 7 This is a flowchart illustrating the module operation process of the improved neck network in an embodiment of the present invention; Figure 8 This is a structural diagram of the LADH detection head in an embodiment of the present invention; Figure 9 This is a comparison chart of experimental results for the improved algorithm model in the embodiments of the present invention; Figure 10This is a comparison chart of the complexity of the improved algorithm model in the embodiments of the present invention; Figure 11 The image shows the test results of the improved algorithm in this embodiment of the invention. Detailed Implementation
[0016] To make the purpose, principle and structure of the present invention clearer, the following description is provided in conjunction with the accompanying drawings and specific embodiments.
[0017] This invention provides a method for detecting the status of track fasteners based on an improved YOLO11 model.
[0018] The overall process is as follows Figure 1 As shown, images of track fasteners on the operating line were first acquired using high-definition industrial cameras along the track during nighttime "maintenance windows." The image resolution was uniformly scaled to 640×640 pixels to form the initial sample set. To improve sample diversity and alleviate class imbalance, a hybrid augmentation strategy was adopted: weak augmentation such as rotation, translation, and cropping was applied to some samples; strong augmentation such as random noise, grayscale conversion, and color perturbation was applied to the remaining samples. Furthermore, fastener renderings generated by 3D modeling software were used as virtual data and only mixed into the validation and test sets to avoid information leakage during the training phase. All images were then manually annotated using the MakeSense online annotation platform. The labels were divided into three categories: "normal," "loose," and "missing." The annotation format adopted the normalized center coordinates and width / height representation required by YOLO, and the sets were divided into training, validation, and test sets in a 7:2:1 ratio.
[0019] In the network construction phase, YOLO11 is used as the foundation, retaining its input layer and backbone network, while replacing the neck network and head detection head. The backbone network extracts multi-scale features from the input image, outputting feature maps x0, x1, and x2 at three spatial resolutions, which are directly fed into the improved neck network. The neck network adopts a progressive feature pyramid (AFPN) structure: three parallel paths correspond to small, medium, and large target scales, respectively. Within each path, a Conv module (in the order of 2D convolution → 2D batch normalization → SiLU activation) is used to complete the initial feature transformation; then, ASFF_2 and ASFF_3 modules are inserted between the paths to achieve adaptive fusion. When ASFF_2 processes x0 and x1, x1 is first upsampled to x0 resolution, and then normalized weights are generated using 1×1 convolution + Softmax. The two feature paths are weighted and summed, and then the fused result is output after 3×3 convolution. When ASFF_3 processes x0, x1, and x2, x1 and x2 are upsampled to x0 size, and then the three weights are obtained in the same way and fusion is completed. After each fusion, the input is fed into the BasicBlock module, which consists of two concatenated layers of "convolution → 2D batch normalization → SiLU" with residual connections introduced at the end to enhance deep semantic representation and stabilize training. Finally, the three paths output enhanced multi-scale features for use by subsequent detection heads.
[0020] The detection head employs a lightweight asymmetric LADH head, divided into two parallel branches: regression and classification. The regression branch sequentially uses one standard convolution, two depthwise separable convolutions, and one 1×1 convolution to output the center point coordinates, width, and height—four regression parameters. The classification branch sequentially uses one standard convolution, one depthwise separable convolution, and one 1×1 convolution to output the class confidence score. The depthwise separable convolutions decouple spatial and channel convolutions, significantly reducing the number of parameters and computational cost while preserving feature representation, making the overall detection head more suitable for edge devices.
[0021] During training, the model uses the SIoU loss function for supervision. This loss is a linear combination of four parts: angle loss, distance loss, shape loss, and IoU loss. The angle loss guides the predicted bounding box to first approach the nearest principal axis and then approximate along the axis, reducing orientation error. The distance loss only takes effect when the angle is close, avoiding misleading results when the orientation deviates. The shape loss calculates the difference between width and height separately to suppress overly long or wide boxes. The IoU loss measures the overlapping area to ensure the final fit. The four parts are optimized collaboratively to ensure that the bounding box is consistent with the ground truth box in orientation, position, and size.
[0022] The training environment consisted of Windows 11, Python 3.10, PyTorch 2.6, CUDA 12.4, and an RTX 4050 Laptop with 6GB of VRAM. The input image size was 640×640, the batch size was 16, and the iterations were 100 rounds. The optimizer used was the automatically selected AdamW. During training, online enhancements such as hue, saturation, brightness, random flipping, Mosaic, MixUp, and Copy-Paste were enabled to prevent overfitting. During inference, the input image underwent one forward propagation to obtain candidate boxes, which were then subjected to non-maximum suppression before the final class and confidence score were output. The entire process could be completed in real-time on the RTX 4050 mobile GPU without additional quantization or pruning.
[0023] Through the above steps, the present invention achieves lightweight model while maintaining detection accuracy, and can be directly deployed on resource-constrained equipment such as track inspection trolleys and portable terminals, significantly improving the efficiency of fastener defect identification and maintenance response speed.
[0024] Example 1: The present invention discloses a method for detecting the condition of track fasteners based on an improved YOLO11 model, comprising the following steps: S1: Collect image data of track fasteners, use image augmentation algorithms to augment the data, perform weak augmentation on one part and strong augmentation on another part, and finally add virtual data.
[0025] S2: Label the track fastener dataset and divide the dataset into training set, validation set, and test set.
[0026] S3: Construct a track fastener status detection network model based on an improved YOLO11 model. The network model specifically includes an input, a backbone network, a neck network, a head detection head, and an output. The main improvements include: the neck network adopts an asymmetric feature pyramid (AFPN) structure, containing modules such as ASFF and BasicBlock; the head detection head adopts a lightweight asymmetric head (LADH), containing regression and classification branches; the SIoU loss function is applied, which includes four parts of loss: angle loss, distance loss, shape loss, and IoU loss; while ensuring detection accuracy, the model can effectively reduce model complexity, ultimately achieving lightweight design.
[0027] S4: The track fastener status detection network model is trained using the training set and validation set to obtain the various parameters of the network model and obtain the trained safety equipment detection network model.
[0028] S5: Test the trained track fastener status detection network model using the test dataset and evaluate the test results.
[0029] Furthermore, the specific method of step S1 is as follows: S1.1: Obtain a dataset of track fastener images in different states.
[0030] S1.2: Expand the dataset using image augmentation algorithms. One part is augmented using weak augmentation methods such as rotation, cropping, and translation, while the other part is augmented using strong augmentation methods such as random noise, grayscale, and color transformation.
[0031] S1.3: Add virtual data to the dataset, which is a 3D model rendering of the track fastener.
[0032] Furthermore, the specific method of step S2 is as follows: S2.1: Use the MakeSense annotation website to manually annotate the detected targets in the track fastener dataset. The track fastener status includes: loose, missing, and normal.
[0033] S2.2: Divide the labeled track fastener dataset into training set, validation set, and test set according to a certain ratio.
[0034] S2.3: Divide the virtual data into validation and test sets to improve the robustness and generalization of model training.
[0035] Furthermore, the Neck Progressive Feature Pyramid (AFPN) structure in step S3 is as follows: S3.1.1: The neck network adopts a bottom-up and top-down approach, combined with lateral connections, to achieve efficient multi-scale feature fusion. The specific structure includes three parallel feature processing paths, which typically correspond to small, medium, and large target scale features of the input. From top to bottom, they are high-resolution shallow features, medium-resolution mid-level features, and low-resolution deep features, enabling comprehensive detection of track fasteners of different sizes.
[0036] S3.1.2: Each path first undergoes preliminary feature transformation and dimension adjustment through continuous Conv modules. The Conv module consists of three parts: First, a two-dimensional convolutional layer is used to perform convolution operations on the input feature map to extract local spatial features; then, batch normalization is applied to normalize the convolution output, stabilizing the training process and accelerating the convergence speed; finally, the SiLU activation function is used to introduce nonlinearity, enabling the model to better capture the complex edges, morphological details and texture changes of the track fasteners.
[0037] S3.1.3: Then, using the ASFF_2 module: First, weights are calculated for x0 and x1 respectively. To ensure the spatial dimensions of the two feature maps of the track fastener are consistent, x1 is upsampled to the same size as x0. Next, the weights of the two feature maps are further processed through a 1x1 convolution and normalized using the Softmax function to generate weighted fusion coefficients. Subsequently, x0 and the upsampled x1 are weighted and summed according to these weights to obtain a preliminary fused feature map. Finally, a 3x3 convolutional layer further processes the fused features, outputting the fused feature map.
[0038] S3.1.4: Feature maps enter the BasicBlock module: First, they pass through a 2D convolutional layer, then are normalized using BatchNorm2d to stabilize training, and then the SiLU activation function is applied to introduce non-linearity. Next, a second 2D convolution and BatchNorm2d operation are performed, the output is added to the original input through a residual connection, and finally, the SiLU activation function is applied again to generate further output.
[0039] S3.1.5: Feature Maps Enter the ASFF_3 Module: The ASFF_3 module is used to fuse feature maps of three different scales of the track fastener, denoted as x0, x1, and x2. Its process is similar to ASFF_2 but more complex: First, weights are calculated for x0, x1, and x2 respectively. To align spatial dimensions, x1 and x2 are upsampled to the same size as x0. Then, the three sets of weights are processed through a 1x1 convolution and normalized using the Softmax function to generate fusion weights for each feature map. Next, x0, the upsampled x1, and x2 are weighted and summed according to these weights to obtain a preliminary fused feature map. Finally, a 3x3 convolutional layer further processes the fused features to output the final feature map.
[0040] S3.1.6: The feature map re-enters the BasicBlock module for deeper feature extraction, while ensuring the stability of training. The alternating use of ASFF and BasicBlock modules ensures both adaptive fusion of multi-scale features and continuous enhancement of deep feature extraction, enabling the model to maintain high expressive power in multi-scale space, especially for the varied shapes and complex textures of track fasteners.
[0041] S3.1.7: Finally, each path outputs processed features through Conv, providing rich and stable multi-scale features for subsequent detection heads.
[0042] S3.1.8: ASFF is responsible for dynamically fusing features from multiple scales to achieve more comprehensive multi-scale perception and help the model adapt to the features exhibited by the track fasteners at different distances and angles.
[0043] S3.1.9: BasicBlock is responsible for performing deep feature extraction and transformation on the fused feature map to improve expressive power, thereby improving the recognition rate and positioning accuracy of track fasteners.
[0044] Furthermore, the lightweight asymmetric detection head LADH structure in step S3 is as follows: S3.2.1: The overall design of the LADH detection head is divided into two parallel branches: a regression branch and a classification branch. The overall design adopts an asymmetric structure, which enables the regression branch to have a deeper feature extraction capability to cope with the complex requirements of bounding box localization, while the classification branch remains relatively simple, balancing the computational efficiency and detection performance of the model, and effectively improving the detection speed and accuracy in resource-constrained environments.
[0045] S3.2.2: The regression branch consists of a regular convolution, two depthwise separable convolutions, and a standard convolution, which is mainly used for the accurate localization of the bounding box. First, a standard convolutional layer is used to extract preliminary features. Then, two depthwise separable convolutional layers are applied consecutively. The depthwise convolution is used to decompose the spatial and channel convolutions, which greatly reduces the computational complexity and the number of parameters, while maintaining the effective expression of spatial features. Finally, a standard convolutional layer is used to output the bounding box regression result, which helps the model to accurately adjust the position and size of the track fastener bounding box under limited computing resources, and adapt to different state categories and complex scenarios of the fastener.
[0046] S3.2.3: The classification branch consists of a regular convolution, a depthwise separable convolution, and a normal convolution, focusing on the discrimination of the target class: first, a standard convolutional layer is used for feature extraction, then a depthwise separable convolution is used for lightweight feature processing, and finally a normal convolutional layer is used to output the class prediction.
[0047] Furthermore, the SIoU loss function in step S3 functions as follows: S3.3.1: The SIoU loss function consists of four parts: angle loss, distance loss, shape loss, and IoU loss, which significantly improves the detection accuracy of track fasteners.
[0048] S3.3.2: First, the purpose of the angle loss design is to reduce the number of variables in the distance-related adjustment of the predicted box. The model will prioritize moving the predicted box closer to the nearest X or Y axis, and then further approximate the true box along the axis to align with the actual position of the track fastener, reduce the error caused by directional deviation, and ensure that the predicted box fits the main directional features of the fastener better.
[0049] S3.3.3: Secondly, the distance loss takes into account the influence of angle loss when calculating. The distance loss is combined with angle information to adjust the spatial distance between the predicted box and the real box. The distance loss only takes effect when the angles are close. This avoids the misleading effect of the predicted box when the direction is significantly deviated, and strengthens the spatial consistency between the box and the target.
[0050] S3.3.4: Shape loss is used to measure the difference in shape between the predicted box and the true box. By comparing the width and height of the predicted box with the true box, the shape loss is calculated to guide the model to optimize the shape of the predicted box, so that it is more in line with the standard size and shape of the track fastener, and avoids unreasonable boxes that are too long or too wide.
[0051] S3.3.5: IoU loss is a commonly used metric in object detection, used to represent the degree of overlap between the predicted bounding box and the ground truth bounding box. Combining these four parts, the SIoU loss function not only improves the positioning accuracy in track fastener detection, but also enhances its adaptability to shape and orientation, helping the model to identify fasteners more stably and improving the monitoring efficiency and reliability in practical applications.
[0052] Furthermore, the model training process in step S4 is as follows: S4.1: Configure the environment before training. The environment for this training is a GPU training environment. The specific device model and hyperparameters are shown in Table 1. Table 1. Equipment model and parameters.
[0053]
[0054] S4.2: Perform data augmentation during training to prevent model overfitting, including the following methods: hue enhancement, saturation enhancement, brightness enhancement, random vertical flipping, random horizontal flipping, Mosaic, MixUp, and Copy-Paste.
[0055] Furthermore, the specific method of step S5 is as follows: S5.1: Input the image of the track fastener to be detected into the trained track fastener state detection model.
[0056] S5.2: The track fastener image undergoes candidate box generation, classification, and location regression to output the final detection results, including category and score.
[0057] S5.3: The following evaluation indicators shall be used to evaluate the results: Precision (P): Precision is defined as the proportion of samples that the model predicts as positive, but which are actually positive. It reflects the accuracy of the model's predictions, and its calculation formula is as follows: ; Wherein, TP represents true positives, which are positive examples correctly predicted by the model; FP represents false positives, which are negative examples incorrectly predicted as positive by the model. High accuracy indicates that the model has a low false alarm rate when predicting positive examples.
[0058] Recall (R): Recall is defined as the proportion of all true positives correctly predicted by the model, reflecting the model's coverage of positive examples. Its calculation formula is: ; Here, FN represents false negatives, which are real positives that the model failed to detect. High recall indicates that the model can effectively identify most positives and reduce the false negative rate.
[0059] The F1 score is the harmonic mean of precision and recall, used to comprehensively measure the model's precision and recall. The calculation formula is: .
[0060] It is worth noting that: In object detection tasks, the ground truth box (GTR) is a rectangular box manually labeled during annotation that corresponds to the actual location of the object in the image; its coordinates and dimensions are considered the "correct answer." The prediction box (PCR) is a rectangular box output for each possible object after forward inference by the model; its coordinates and dimensions are obtained by network regression, representing the model's "guess" of the object's location. During training, the difference between the PCR and GTR (such as center point offset, width and height errors, and IoU) is compared to calculate the loss and guide network parameter updates; during inference, the PCR is directly used as the final detection result.
[0061] The Softmax function is a normalized exponential function used to map a real number vector (logits) into a probability distribution vector. As the last layer of a multi-classification network, it works in conjunction with cross-entropy loss to calculate errors and generates normalized weights in attention mechanisms and weighted fusion (such as ASFF). Softmax transforms any real number vector into a probability vector that sums to 1, acting as a "normalization switch" in classification and weighted scenarios.
[0062] BasicBlock is a residual building block in ResNet, used to implement "skip connections" in deep networks to alleviate gradient vanishing and improve training stability and accuracy. Structurally, the input x passes through the main path and the short path, then is added together, followed by a ReLU / SiLU activation to obtain the final output y. This allows the network to learn only the residual mapping, rather than the complete mapping, thus reducing the optimization difficulty. In this invention, the neck network AFPN inserts BasicBlock after each multi-scale fusion (ASFF) to perform deep feature re-extraction and residual enhancement, enhancing the ability to express details such as the edges and textures of track fasteners, while maintaining multi-scale information without dilution.
[0063] This embodiment discloses a method for detecting the status of track fasteners based on an improved YOLO11 model, which mainly includes the following steps: (1) Dataset Creation. The dataset in this embodiment is derived from manually collected images of track fasteners using a camera on the track test line. The collected track fastener images are classified into three categories: missing, loose, and normal. Due to the limited length of the track test line, the dataset sample size is limited. Image augmentation algorithms are used to expand the dataset. One part undergoes weak augmentation methods such as rotation, cropping, and translation, while the other part undergoes strong augmentation methods such as random noise, grayscale, and color transformation. Simultaneously, some virtual data, namely, 3D model renderings of the track fasteners, are added, such as... Figure 2 As shown, this part of the data is ultimately only used in the validation and test sets.
[0064] (2) After the image samples were collected, the targets in the track fastener dataset were manually labeled using the MakeSense website. Finally, a YOLO format labeled txt file was generated, including target category, coordinates and other information. All data were divided into training set, validation set and test set according to the proportion.
[0065] (3) Construct a track fastener status detection network model based on the improved YOLO11 model. The improved YOLO11 track fastener status detection model is as follows: Figure 3 As shown, the model includes a backbone network, a neck network, and a detection head. The main improvements are in the neck network and the detection head.
[0066] The neck network is improved by replacing the original structure with an Asymptotic Feature Pyramid (AFPN) structure. The improved neck network structure is shown in the figure below. Figure 4 As shown, the Conv module structure in the neck network is as follows: Figure 5 As shown, the ASFF and BasicBlock module structures are as follows: Figure 6 As shown, the main module's operation process is as follows: Figure 7As shown, ASFF is responsible for dynamically fusing features at multiple scales to achieve more comprehensive multi-scale perception, helping the model adapt to the features exhibited by the track fastener at different distances and angles. BasicBlock is responsible for deep feature extraction and transformation on the fused feature map to improve expressive power, thereby improving the recognition rate and positioning accuracy of the track fastener.
[0067] The specific function of the neck network is as follows: The structure includes three parallel feature processing paths, corresponding to the multi-scale features of the input track fasteners. In track fastener state detection, the neck network preprocesses the multi-scale features from the backbone network through multi-layer convolution. Combined with ASFF_2 and ASFF_3 modules, it adaptively and dynamically fuses features of different scales, effectively integrating shallow, medium and deep information. With the help of BasicBlock deep feature extraction and residual connections, it enhances feature expression capabilities, improves the detection of fastener details and state changes, and provides accurate multi-scale fusion features for subsequent detection heads, significantly improving the accuracy and stability of fastener state recognition.
[0068] (4) A lightweight asymmetric detection head, LADH, is adopted. The structure of this detection head is as follows: Figure 8 As shown.
[0069] The regression branch consists of a regular convolution, two depthwise separable convolutions, and a normal convolution, focusing on the precise localization of the bounding box. The classification branch consists of a regular convolution, a depthwise separable convolution, and a normal convolution, focusing on the discrimination of the target category.
[0070] The specific functions of each branch are as follows: Regression branch (used to predict the target's location box information): Conv: Input features are first passed through a standard convolution to enhance their expressive power.
[0071] DWConv: Performs a depthwise separable convolution to fully extract spatial features.
[0072] DWConv: Perform another depthwise separable convolution to further improve feature extraction capabilities while reducing the number of parameters.
[0073] nn.Conv2d: Finally, the regression parameters of the target box, such as center point, width and height, are obtained through 1×1 convolution.
[0074] Classification branch (used to predict the category of the target): Conv: The input features are also first passed through a standard convolution.
[0075] DWConv: Extracts spatial features using a single depthwise separable convolution.
[0076] nn.Conv2d: Directly outputs the class prediction score.
[0077] (5) The prepared track fastener dataset was input into the improved YOLO11 model for training. In this invention, the dataset was divided into training, validation, and test sets in a ratio of 7:2:1. The experimental hardware configuration was a 12th Gen Intel(R) Core(TM) i7-12650H@2.30GHz processor, an NVIDIA GeForce RTX4050 Laptop GPU with 6GB of video memory and 24GB of RAM. The operating system was Windows 11, the development platform was VScode, the programming language was Python, the deep learning framework was PyTorch, the torch version was 2.6.0, and the CUDA version was 12.4. The model training image size was 640*640, the Workers were set to 6, the Batch was set to 16, data augmentation was enabled during training, optimization was set to automatic, the optimizer and related parameters were automatically selected, and the training rounds were set to 100 rounds.
[0078] (6) In order to evaluate the track fastener status detection model, commonly used evaluation indicators in the field of target detection were used, mainly precision and recall.
[0079] Precision (P): Precision is defined as the proportion of samples that the model predicts as positive, but which are actually positive. It reflects the accuracy of the model's predictions, and its calculation formula is as follows: ; Wherein, TP represents true positives, which are positive examples correctly predicted by the model; FP represents false positives, which are negative examples incorrectly predicted as positive by the model. High accuracy indicates that the model has a low false alarm rate when predicting positive examples.
[0080] Recall (R): Recall is defined as the proportion of all true positives correctly predicted by the model, reflecting the model's coverage of positive examples. Its calculation formula is: ; Here, FN represents false negatives, which are real positives that the model failed to detect. High recall indicates that the model can effectively identify most positives and reduce the false negative rate.
[0081] The F1 score is the harmonic mean of precision and recall, used to comprehensively measure the model's precision and recall. The calculation formula is: .
[0082] (7) This embodiment is compared with the base model, the YOLOv5 model, and the YOLOv8 model. To better reflect the generalization performance of the model, a test set is used for experimentation. The comparison results of the model detection performance are as follows: Figure 7 As shown, the main evaluation metrics referenced are precision and recall. The model complexity comparison results are as follows: Figure 8 As shown in Table 2, the main comparison parameters are Weights and GFLOPs.
[0083] Table 2, Experimental Data Table.
[0084]
[0085] Depend on Figure 9 , 10 As shown in Table 2, the proposed track fastener status detection method based on the improved YOLO11 model exhibits significant advantages in both target detection performance and model complexity. In terms of detection performance, the algorithm achieves 289 true positives (TPs), the highest among all compared models; the number of false negatives (FNs) is only 13, significantly lower than YOLO11, YOLOv5, and YOLOv8, indicating stronger ability to capture real targets and a lower false negative rate. Among the corresponding derived metrics, the algorithm achieves a recall rate of 0.9570 and an F1 score of 0.8934, both ranking first, and a precision of 0.8377, close to YOLOv8's 0.8387, comprehensively demonstrating superior detection accuracy and target coverage. In terms of model complexity, the algorithm has a weight file size of 4.7MB, a computational cost of 6.0 GFLOPs, and a number of parameters of 2,176,598. The number of parameters is the smallest among all models. The weight size and computational cost are both at a low level, only slightly higher than YOLOv5, which has the lowest complexity, and far lower than YOLO11 and YOLOv8.
[0086] Depend on Figure 11 It can be seen that the track fastener status detection method based on the improved YOLO11 model proposed in this invention has a high accuracy rate and good detection effect in actual test results.
[0087] The above results show that the track fastener status detection method based on the improved YOLO11 model proposed in this invention effectively improves the overall performance of target detection while reducing model complexity to ensure lightweight deployment characteristics. It solves the technical problem of existing models being difficult to balance between detection accuracy and complexity, and has better practical application value.
[0088] The above description is merely a specific embodiment of the invention, but the scope of protection of the invention is not limited thereto. Any equivalent substitutions or changes made by those skilled in the art within the technical scope disclosed in the invention, based on the technical solution and concept of the invention, should be covered within the scope of protection of the invention.
Claims
1. A method for detecting the condition of track fasteners based on an improved YOLO11 model, characterized in that, Includes the following steps: Step S1: Collect track fastener image data, use image augmentation algorithm to augment the data, perform weak augmentation on one part and strong augmentation on another part, and finally add virtual data; Step S2: Label the track fastener dataset and divide the dataset into training set, validation set, and test set; Step S3: Construct a track fastener status detection network model based on the improved YOLO11 model. The network model specifically includes Input, Backbone, Neck, Head, and Output. in, The Neck network adopts the progressive feature pyramid (AFPN) structure, which combines bottom-up and top-down paths with lateral connections. It introduces the ASFF module to achieve dynamic fusion of multi-scale features and uses the BasicBlock module for deep feature extraction and transformation, thereby improving the ability to express the features of track fasteners at different scales and the positioning accuracy. The head of the detector uses a lightweight asymmetric detector head LADH, which includes a regression branch and a classification branch. The regression branch enhances the bounding box localization capability through depthwise separable convolution, while the classification branch maintains a lightweight structure to achieve efficient classification. The model employs the SIoU loss function, combining angle loss, distance loss, shape loss, and IoU loss to optimize the consistency between the predicted bounding box and the ground truth bounding box in terms of orientation, position, shape, and overlap. The overall model maintains detection accuracy while being lightweight, making it suitable for edge deployment; Step S4: Train the track fastener status detection network model using the training set and validation set, obtain the various parameters of the network model, and obtain the trained safety equipment detection network model. Step S5: Test the trained track fastener status detection network model using the test dataset and evaluate the test results.
2. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 1, characterized in that, Step S3 further includes: The bottom-up and top-down paths are connected by ASFF_2 and ASFF_3 modules to achieve adaptive weighted fusion of multi-scale feature maps. The feature maps are derived from the initial multi-scale features extracted from the track fastener dataset by the backbone network and passed to the neck network. During the fusion process, the spatial size is unified by upsampling, and fusion weights are generated by 1×1 convolution and Softmax. Finally, the fused feature map is output by 3×3 convolution. The ASFF_2 module is used to fuse feature maps of two scales: feature map x0 and feature map x1. First, feature map x1 is upsampled to match the size of feature map x0. Then, the fusion weights are calculated through 1×1 convolution and Softmax. Next, feature map x0 and the upsampled feature map x1 are weighted and summed. Finally, the fused feature map is output through 3×3 convolution. The ASFF_3 module is used to fuse feature maps of three scales: feature map x0, feature map x1, and feature map x2. First, feature map x1 and feature map x2 are upsampled to match the size of x0. Then, the fusion weights of each feature map are calculated through 1×1 convolution and Softmax. Next, feature map x0, the upsampled feature map x1, and feature map x2 are weighted and summed. Finally, the fused feature map is output through 3×3 convolution. The BasicBlock module is placed after the ASFF module and is used to perform deep feature extraction on the fused feature map. Its structure includes two convolutions, batch normalization, SiLU activation operations, and residual connections to enhance feature representation and training stability.
3. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 1, characterized in that, The lightweight asymmetric detection head LADH has a regression branch consisting of a standard convolution, two depthwise separable convolutions, and a regular convolution, used to extract spatial features and output bounding box regression parameters; and a classification branch consisting of a standard convolution, a depthwise separable convolution, and a regular convolution, used to output class prediction results.
4. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 1, characterized in that, The SIoU loss function uses angle loss to guide the predicted box to approach the real box preferentially along the X or Y axis, reducing directional deviation; distance loss combines angle information to adjust the spatial distance between the predicted box and the real box; shape loss optimizes the shape of the predicted box by comparing width and height differences; and IoU loss measures the degree of overlap between the predicted box and the real box, synergistically improving positioning accuracy and shape adaptability.
5. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 1, characterized in that, The specific method for step S1 is as follows: Step S1.1: Obtain a dataset of track fastener images in different states; Step S1.2: Expand the dataset using image augmentation algorithms. One part is augmented using weak augmentation methods such as rotation, cropping, and translation, while the other part is augmented using strong augmentation methods such as random noise, grayscale, and color transformation. Step S1.3: Add virtual data to the dataset, which is a 3D model rendering of the track fastener; The specific method for step S2 is as follows: Step S2.1: Manually annotate the detected targets in the track fastener dataset using an annotation website. The status of the track fasteners includes: loose, missing, and normal. Step S2.2: Divide the labeled track fastener dataset into training set, validation set, and test set according to a certain ratio; Step S2.3: Divide the virtual data into the validation set and the test set to improve the robustness and generalization of model training.
6. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 2, characterized in that, The Neck Progressive Feature Pyramid (AFPN) structure in step S3 is as follows: Step S3.1.1: The neck network adopts a bottom-up and top-down path, combined with lateral connections, to achieve efficient multi-scale feature fusion. The specific structure includes three parallel feature processing paths, which usually correspond to small, medium and large target scale features of the input. From top to bottom, they are high-resolution shallow features, medium-resolution medium features and low-resolution deep features, to achieve comprehensive detection of track fasteners of different sizes. Step S3.1.2: Each path first undergoes preliminary feature transformation and dimension adjustment through continuous Conv modules. The Conv module consists of three parts: First, a two-dimensional convolutional layer is used to perform convolution operations on the input feature map to extract local spatial features; then, batch normalization is applied to normalize the convolution output, stabilizing the training process and accelerating the convergence speed; finally, the SiLU activation function is used to introduce nonlinearity, enabling the model to better capture the complex edges, morphological details and texture changes of the track fasteners. Step S3.1.3: Then, using the ASFF_2 module: First, weights are calculated for feature map x0 and feature map x1 respectively; feature map x1 is upsampled to the same size as feature map x0 to ensure that the spatial dimensions of the two feature maps of the track fastener are consistent; next, the weights of the two feature maps are further processed through a 1x1 convolution and normalized using the Softmax function to generate weight coefficients for weighted fusion; subsequently, feature map x0 and the upsampled feature map x1 are weighted and summed according to these weights to obtain a preliminary fused feature map; finally, the fused features are further processed through a 3x3 convolutional layer to output the fused feature map. Step S3.1.4: Feature map enters BasicBlock module: First, it goes through a two-dimensional convolutional layer, then normalizes through two-dimensional batch normalization to stabilize training, and then applies SiLU activation function to introduce non-linearity; then a second two-dimensional convolution and two-dimensional batch normalization operation is performed, the output is added to the original input through residual connection, and finally passes through SiLU activation function again to generate further output; Step S3.1.5: Feature maps enter the ASFF_3 module: The ASFF_3 module is used to fuse three feature maps of different scales of the track fastener, denoted as feature map x0, feature map x1, and feature map x2. Its process is similar to ASFF_2 but more complex: First, weights are calculated for feature maps x0, x1, and x2 respectively; to align spatial dimensions, feature maps x1 and x2 are upsampled to the same size as feature map x0; then, the three sets of weights are processed by 1x1 convolution and normalized by the Softmax function to generate the fusion weights for each feature map; next, feature map x0, the upsampled feature map x1, and feature map x2 are weighted and summed according to these weights to obtain the preliminary fused feature map; finally, the fused features are further processed by a 3x3 convolutional layer to output the final feature map. Step S3.1.6: The feature map re-enters the BasicBlock module for deeper feature extraction, while ensuring the stability of training. The alternating use of the ASFF module and the BasicBlock module ensures both adaptive fusion of multi-scale features and continuous enhancement of deep feature extraction, enabling the model to maintain high expressive power in multi-scale space, especially for the varied shapes and complex textures of track fasteners. Step S3.1.7: Finally, each path outputs processed features through Conv to provide rich and stable multi-scale features for subsequent detection heads; Step S3.1.8: The ASFF module is responsible for dynamically fusing features from multiple scales to achieve more comprehensive multi-scale perception and help the model adapt to the features exhibited by the track fasteners at different distances and angles; Step S3.1.9: The BasicBlock module is responsible for performing deep feature extraction and transformation on the fused feature map to improve expressive power, thereby improving the recognition rate and positioning accuracy of track fasteners.
7. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 3, characterized in that, The lightweight asymmetric detection head LADH structure in step S3 is as follows: Step S3.2.1: The overall design of the LADH detection head is divided into two parallel branches: a regression branch and a classification branch. The overall design adopts an asymmetric structure, which enables the regression branch to have a deeper feature extraction capability to cope with the complex requirements of bounding box localization, while the classification branch remains relatively simple, balancing the computational efficiency and detection performance of the model, and effectively improving the detection speed and accuracy in resource-constrained environments. Step S3.2.2: The regression branch consists of a regular convolution, two depthwise separable convolutions, and a normal convolution, which is mainly used for the accurate localization of the bounding box. First, a standard convolutional layer is used to extract preliminary features. Then, two depthwise separable convolutional layers are applied consecutively. The depthwise convolution is used to decompose the spatial and channel convolutions, which greatly reduces the computational complexity and the number of parameters, while maintaining the effective expression of spatial features. Finally, a normal convolutional layer is used to output the bounding box regression results, which helps the model to accurately adjust the position and size of the track fastener bounding box under limited computing resources, and adapt to the shape changes of the fastener and complex scenarios under different states. Step S3.2.3: The classification branch consists of a regular convolution, a depthwise separable convolution, and a normal convolution, focusing on the discrimination of the target category: first, a standard convolutional layer is used for feature extraction, then a depthwise separable convolution is used for lightweight feature processing, and finally a normal convolutional layer is used to output the category prediction.
8. The method for detecting the condition of track fasteners based on the improved YOLO11 model as described in claim 4, characterized in that, The SIoU loss function in step S3 has the following effect: Step S3.3.1: The SIoU loss function consists of four parts: angle loss, distance loss, shape loss, and IoU loss, which significantly improves the detection accuracy of track fasteners; Step S3.3.2: First, the purpose of the angle loss design is to reduce the number of variables in the distance-related adjustment of the predicted box. The model will prioritize moving the predicted box to the nearest X or Y axis, and then further approximate the true box along the axis to align with the actual position of the track fastener, reduce the error caused by the orientation deviation, and ensure that the predicted box fits the main orientation features of the fastener better. Step S3.3.3: Secondly, the distance loss takes into account the influence of angle loss when calculating. The distance loss is combined with angle information to adjust the spatial distance between the predicted box and the real box. The distance loss only takes effect when the angles are close. This avoids the misleading effect of the predicted box when the direction is significantly deviated, and strengthens the spatial consistency between the box and the target. Step S3.3.4: Shape loss is used to measure the difference in shape between the predicted box and the true box. By comparing the width and height of the predicted box with the true box, the shape loss is calculated to guide the model to optimize the shape of the predicted box, so that it is more in line with the standard size and shape of the track fastener, and avoids unreasonable boxes that are too long or too wide. Step S3.3.5: IoU loss is a commonly used metric in object detection, used to represent the degree of overlap between the predicted bounding box and the ground truth bounding box. Combining these four parts, the SIoU loss function not only improves the positioning accuracy in track fastener detection, but also enhances the adaptability to shape and orientation, helping the model to more stably identify fasteners and improve detection efficiency and reliability in practical applications.
Citation Information
Patent Citations
Rail transit obstacle detection method based on improved convolutional neural network
CN113486726A
Track curve obstacle detection method
CN114155416A
Track fastener state identification method based on real-time instance segmentation
CN116721263A
Method for enhancing object detection
EP4614454A1