A method and system for detecting obstacles on a train track

By using LiteRailSegNet, self-supervised pre-trained ConvNeXt and TFFP-Net networks, combined with a Transformer detection head, the contradiction between computational complexity and recognition accuracy in existing train track obstacle detection methods is resolved. This enables multi-scale perception of small targets at long distances and large targets at close distances, improving the reliability and real-time performance of detection.

CN122493035APending Publication Date: 2026-07-31GUANGZHOU NANCHE CITY RAILS EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU NANCHE CITY RAILS EQUIP CO LTD
Filing Date
2026-07-01
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing train track obstacle detection methods present a trade-off between computational complexity and recognition accuracy, making it difficult to simultaneously guarantee multi-scale perception capabilities for both small targets at long distances and large targets at close range. Furthermore, existing methods have high installation and maintenance costs, limited real-time performance, and limited coverage.

Method used

LiteRailSegNet is used for track region segmentation. It is combined with a self-supervised pre-trained ConvNeXt feature encoding backbone network and a TFFP-Net two-level feature focusing propagation network. The Transformer detection head is used for obstacle detection to improve multi-scale perception capability and detection reliability.

Benefits of technology

It improves the reliability and real-time performance of obstacle detection on train tracks, reduces the false detection rate caused by non-track backgrounds, and enhances the ability to identify complex texture targets and multi-scale targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493035A_ABST
    Figure CN122493035A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for obstacle detection on train tracks, relating to the field of machine vision technology. The method includes: preprocessing a target image of the train track; segmenting the target image into track regions based on LiteRailSegNet to obtain a track mask; extracting features using the track mask and the target image based on a self-supervised pre-trained ConvNeXt feature encoding backbone network; performing secondary focus propagation processing using first multi-scale visual features based on a TFFP-Net two-level feature focusing propagation network to obtain second multi-scale visual features that are semantically consistent and have a concentrated target response; and performing obstacle detection using the second multi-scale visual features based on a Transformer detection head to determine warning information. This invention improves the multi-scale perception capability of small targets at long distances, targets with complex textures, and large targets at close range, thereby improving the reliability of obstacle detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method and system for detecting obstacles on train tracks. Background Technology

[0002] Current methods for monitoring the train operating environment mainly include manual inspection, video surveillance, and contact sensor detection. Manual inspection and video surveillance rely on human observation, which has limited coverage and real-time performance. Contact sensor detection usually requires the deployment of sensors beside or along the track, which can only monitor fixed locations or local areas. It has high installation and maintenance costs and is difficult to adapt to the continuously changing environment ahead of the train during operation.

[0003] Track region identification and obstacle detection are crucial aspects of train operation monitoring. Existing track region identification methods typically employ encoder-decoder networks to achieve pixel-level track segmentation. While these methods can output track masks or track boundaries, most models either have high computational complexity, making them unsuitable for deployment of onboard edge devices, or their lightweight design results in insufficient stability in identifying track boundaries, slender structures, and complex curved scenes.

[0004] Meanwhile, obstacles on train tracks are characterized by large differences in scale, diverse categories, irregular shapes, and strong background embedding. Pedestrians and vehicles at close range are relatively large in scale, while animals, rocks, and small foreign objects at distant range are relatively small in scale. Some targets are similar in color and texture to the track background. The single-scale or simple pyramid fusion methods currently used cannot simultaneously guarantee the detection capability of small targets at distant range and the positioning accuracy of large targets at close range. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a method and system for obstacle detection on train tracks, which improves the multi-scale perception capability of small targets at a distance, targets with complex textures, and large targets at close range, thereby improving the reliability of obstacle detection on train tracks.

[0006] To address the aforementioned technical problems, the present invention provides a method for detecting obstacles on train tracks, the method comprising: Acquire a target image of the train track and preprocess the target image to obtain a preprocessed target image; The preprocessed target image is segmented into track regions based on the lightweight track segmentation network LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight coding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses orbital masks and pre-processed target images to extract features and obtain the first multi-scale visual features. Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are used to perform second-level focusing propagation processing to obtain second multi-scale visual features that are semantically consistent and have a target response set. Obstacle detection results are obtained by using the second multi-scale visual features based on the Transformer detection head; Obstacle warning information for the train track is determined based on the obstacle detection results.

[0007] Optionally, the step of preprocessing the target image to obtain a preprocessed target image includes: The target image is subjected to image enhancement processing to obtain the enhanced target image; The target image after image enhancement is resized to obtain a preprocessed target image.

[0008] Optionally, the step of segmenting the preprocessed target image into orbital regions based on the lightweight orbital segmentation network LiteRailSegNet to obtain an orbital mask includes: The PConv lightweight coding network based on LiteRailSegNet extracts visual features from the preprocessed target image to obtain multi-level visual features. The multi-level visual features are enhanced and fused based on the MEUM multi-scale edge upsampling feature enhancement module to obtain enhanced and fused visual features. The enhanced fusion visual features are decoded using the MADN multichannel attention decoding network to obtain segmentation features, and the orbital mask is determined based on the segmentation head using the segmentation features.

[0009] Optionally, the self-supervised pre-trained ConvNeXt feature encoding backbone network uses the orbital mask and the preprocessed target image to extract features and obtain the first multi-scale visual features, including: The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses orbital masks and pre-processed target images to perform feature downsampling to obtain initial feature representations. The initial feature representation is processed by depthwise separable convolution based on the self-supervised pre-trained ConvNeXt feature encoding backbone network to obtain the initial feature representation after depthwise separable convolution processing. The initial feature representation after depthwise separable convolution is normalized using the Layer Normalization layer to obtain normalized features; The normalized features are processed by a nonlinear activation function based on pointwise convolution to obtain transformed features. The initial feature representation and the transformed features are then fused based on residual connections to obtain the first multi-scale visual features.

[0010] Optionally, the ConvNeXt feature encoding backbone network is self-supervised pre-trained based on the DINOv3 framework using a softmax operation with temperature parameters, and the DINOv3 framework includes a teacher-student self-distillation framework.

[0011] Optionally, the expression for the first multi-scale visual feature is: , , Where Y is the first multi-scale visual feature, X is the initial feature representation, and F(X) is the transformed feature. For pointwise convolution, GELU is the non-linear activation function, and LN is the normalization function. It is a depthwise separable convolution.

[0012] Optionally, the TFFP-Net-based two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features within the target response set, including: Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are processed by unified channel mapping to obtain the first multi-scale visual features after unified channel mapping. The feature focusing module based on the TFFP-Net two-level feature focusing propagation network performs scale alignment processing on the first multi-scale visual features after unified channel mapping processing to obtain several levels of visual features. Several levels of visual features are stitched together to obtain stitched features, and the stitched features are then subjected to depthwise separable convolutional aggregation to obtain aggregated features. Multi-branch convolution modeling is performed on the aggregated features to obtain the aggregated features after multi-branch convolution modeling, and the first-level focusing features are determined based on the aggregated features after multi-branch convolution modeling. The first-level focused features are propagated to higher and lower layers to obtain higher-level propagated features and lower-level propagated features. Based on the higher-level propagated features and lower-level propagated features, the focused propagation is updated to obtain the higher-level propagated features and lower-level propagated features after the focused propagation is updated. Based on the updated high-level and low-level propagation features of focused propagation, a second-level focused propagation is performed to obtain the second-level focused features. The encoder utilizes the second-level focusing features to generate a second multi-scale visual feature that is semantically consistent and within the target response set.

[0013] Optionally, the expression for the updated high-level propagation features after focused propagation is: , in, To focus on the updated high-level propagation characteristics, C2f() is the feature fusion module. Characteristics of high-level communication Characterized by high-level features; The expression for the updated low-level propagation features after focused propagation is: , in, To focus on the updated low-level propagation features, C2f() is the feature fusion module. Characteristics of low-level propagation. These are low-level features.

[0014] Optionally, the obstacle detection based on the Transformer detection head using the second multi-scale visual features to obtain obstacle detection results includes: The query vector, key vector, and value vector are determined, and multi-head attention interaction is performed based on the Transformer detection head using the second multi-scale visual features, query vector, key vector, and value vector to obtain multi-head attention interaction information; Obstacle detection is performed based on the multi-head attention interaction information to obtain obstacle detection results.

[0015] In addition, the present invention also provides an obstacle detection system for train tracks, the system comprising: Image preprocessing module: used to acquire the target image of the train track and preprocess the target image to obtain the preprocessed target image; Track Region Segmentation Module: Used to segment the preprocessed target image into track regions based on LiteRailSegNet to obtain a track mask. LiteRailSegNet includes PConv lightweight coding network, MEUM multi-scale edge upsampling feature enhancement module and MADN multi-channel attention decoding network. Feature extraction module: Used by the self-supervised pre-trained ConvNeXt feature encoding backbone network to extract features using the orbital mask and the pre-processed target image to obtain the first multi-scale visual features; Feature processing module: used to perform secondary focus propagation processing on the first multi-scale visual features based on the TFFP-Net two-level feature focusing propagation network to obtain second multi-scale visual features that are semantically consistent and have a target response set; Obstacle detection module: used to detect obstacles based on the Transformer detection head using the second multi-scale visual features, and obtain obstacle detection results; Early warning module: used to determine obstacle early warning information for the train track based on the obstacle detection results.

[0016] In this embodiment of the invention, a target image of the train track is acquired and preprocessed. Track region segmentation is performed on the preprocessed target image using LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight encoding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The PConv lightweight encoding network reduces computational load, the MEUM multi-scale edge upsampling feature enhancement module strengthens boundary details, and the MADN multi-channel attention decoding network achieves channel and spatial attention decoding, thereby maintaining high segmentation accuracy and real-time performance with a low parameter count and reducing false detections caused by non-track backgrounds. The self-supervised pre-trained ConvNeXt feature encoding backbone network extracts features using the track mask and the preprocessed target image, achieving a more stable visual representation even with limited samples of track anomalies and obstacles. The TFFP-Net two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features with a concentrated target response. This TFFP-Net two-level feature focusing propagation network enhances the multi-scale perception capability for distant small targets, complex textured targets, and close-range large targets. The Transformer detection head utilizes the second multi-scale visual features for obstacle detection. Based on the obstacle detection results, obstacle warning information for train tracks is determined. The Transformer detection head can perform global relationship modeling, reducing reliance on complex candidate box selection and post-processing, and improving the reliability of train track obstacle detection. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the obstacle detection method for train tracks in an embodiment of the present invention. Figure 2 This is a flowchart illustrating an obstacle detection method for train tracks according to another embodiment of the present invention; Figure 3 This is a schematic diagram of the structural composition of the obstacle detection system for train tracks in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating an obstacle detection method for train tracks according to an embodiment of the present invention. The method includes: S11: Acquire a target image of the train track and preprocess the target image to obtain a preprocessed target image; In the specific implementation of this invention, the target image is subjected to image enhancement processing to obtain an enhanced target image; the enhanced target image is then subjected to size transformation processing to obtain a preprocessed target image, providing reliable image data support for subsequent orbital region segmentation and feature extraction.

[0021] S12: Perform track region segmentation on the preprocessed target image based on LiteRailSegNet to obtain a track mask. LiteRailSegNet includes PConv lightweight coding network, MEUM multi-scale edge upsampling feature enhancement module and MADN multi-channel attention decoding network. In the specific implementation of this invention, the preprocessed target image is visually extracted using a partially convolutional (PConv) lightweight coding network based on the Lightweight RailSegmentation Network (LiteRailSegNet) to obtain multi-level visual features. These multi-level visual features are then enhanced and fused using a Multi-scale Edge Upsampling Module (MEUM) to obtain enhanced and fused visual features. Finally, the enhanced and fused visual features are decoded using a Multichannel Attention Decoding Network (MADN) to obtain segmentation features. The segmentation features are then used to determine the track mask based on the segmentation head. Boundary details are enhanced using the MEUM multi-scale edge upsampling feature enhancement module, and channel and spatial attention decoding is achieved using the MADN multichannel attention decoding network. This approach maintains high segmentation accuracy and real-time performance with a low parameter count, reduces false detections caused by non-track backgrounds, and enhances the ability to identify potential intruding targets within the track and around the boundary.

[0022] S13: The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses the orbital mask and the pre-processed target image to extract features and obtain the first multi-scale visual features. In the specific implementation of this invention, the self-supervised pre-trained ConvNeXt feature encoding backbone network performs feature downsampling processing using the track mask and the pre-processed target image to obtain an initial feature representation; the self-supervised pre-trained ConvNeXt feature encoding backbone network performs depthwise separable convolution processing on the initial feature representation to obtain a depthwise separable convolution processing initial feature representation; the depthwise separable convolution processing initial feature representation is normalized based on the Layer Normalization layer to obtain normalized features; the normalized features are processed using a nonlinear activation function based on pointwise convolution to obtain transformed features; the initial feature representation and transformed features are fused based on residual connections to obtain a first multi-scale visual feature. The self-supervised pre-trained ConvNeXt feature encoding backbone network can obtain a more stable visual representation when the number of track anomaly obstacle samples is limited.

[0023] S14: Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are used to perform second-level focusing propagation processing to obtain second multi-scale visual features that are semantically consistent and have a target response set. In the specific implementation of this invention, the first multi-scale visual features are processed by a unified channel mapping based on a Two-level Feature Focus Propagation Network (TFFP-Net) to obtain the first multi-scale visual features after unified channel mapping. The feature focusing module of the TFFP-Net performs scale alignment processing on the first multi-scale visual features after unified channel mapping to obtain several levels of visual features. These several levels of visual features are then concatenated to obtain concatenated features, and the concatenated features are subjected to depthwise separable convolutional aggregation processing to obtain aggregated features. Finally, multi-branch convolutional modeling is performed on the aggregated features. The TFFP-Net two-level feature focus propagation network obtains aggregated features after multi-branch convolution modeling and determines first-level focus features based on these aggregated features. The first-level focus features are then propagated to higher and lower layers to obtain higher-level and lower-level propagation features. Focus propagation is then updated based on these higher-level and lower-level features to obtain updated higher-level and lower-level propagation features. Second-level focus propagation is then performed based on these updated higher-level and lower-level features to obtain second-level focus features. Finally, the encoder uses these second-level focus features to generate second-level multi-scale visual features that are semantically consistent and have a set target response. Through two-level focus propagation and a mid-level semantic anchor mechanism, the TFFP-Net two-level feature focus propagation network enhances the multi-scale perception capability of distant small targets, complex texture targets, and near large targets.

[0024] S15: Based on the Transformer detection head, obstacle detection is performed using the second multi-scale visual features to obtain obstacle detection results; In the specific implementation of this invention, the query vector, key vector, and value vector are determined, and multi-head attention interaction is performed based on the Transformer detection head using the second multi-scale visual features, query vector, key vector, and value vector to obtain multi-head attention interaction information; obstacle detection is performed based on the multi-head attention interaction information to obtain obstacle detection results. The Transformer detection head can perform global relationship modeling, reducing the dependence on complex candidate box screening and post-processing.

[0025] S16: Determine obstacle warning information for the train track based on the obstacle detection results.

[0026] In the specific implementation of this invention, determining the obstacle warning information of the train track based on the obstacle detection results is more in line with the engineering requirements of the train active obstacle avoidance system.

[0027] In this embodiment of the invention, a target image of the train track is acquired and preprocessed. Track region segmentation is performed on the preprocessed target image using LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight encoding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The PConv lightweight encoding network reduces computational load, the MEUM multi-scale edge upsampling feature enhancement module strengthens boundary details, and the MADN multi-channel attention decoding network achieves channel and spatial attention decoding, thereby maintaining high segmentation accuracy and real-time performance with a low parameter count and reducing false detections caused by non-track backgrounds. The self-supervised pre-trained ConvNeXt feature encoding backbone network extracts features using the track mask and the preprocessed target image, achieving a more stable visual representation even with limited samples of track anomalies and obstacles. The TFFP-Net two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features with a concentrated target response. This TFFP-Net two-level feature focusing propagation network enhances the multi-scale perception capability for distant small targets, complex textured targets, and close-range large targets. The Transformer detection head utilizes the second multi-scale visual features for obstacle detection. Based on the obstacle detection results, obstacle warning information for train tracks is determined. The Transformer detection head can perform global relationship modeling, reducing reliance on complex candidate box selection and post-processing, and improving the reliability of train track obstacle detection.

[0028] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating an obstacle detection method for train tracks according to another embodiment of the present invention, the method comprising: S201: Acquire a target image of the train track and preprocess the target image to obtain a preprocessed target image; In a specific implementation of the present invention, the step of preprocessing the target image to obtain a preprocessed target image includes: performing image enhancement processing on the target image to obtain an image-enhanced target image; and performing size transformation processing on the image-enhanced target image to obtain a preprocessed target image.

[0029] Specifically, the process involves acquiring a target image of the train track, which is obtained by using a corresponding image sensor to capture an image of the track scene ahead of the train. Image enhancement processing is then applied to the target image, including noise reduction and sharpness enhancement, to obtain an enhanced target image. Finally, the enhanced target image undergoes a resizing process, where the input size of the target image is set according to network input requirements to obtain a preprocessed target image.

[0030] Meanwhile, for the image dataset used in network training, the track segmentation data can be filtered to retain valid images containing track labels. Self-built track images can be manually labeled pixel by pixel. During the training phase, image enhancement strategies such as random cropping and flipping can be used to improve the robustness and generalization ability of the model. At the same time, the image input size can be set according to the network input requirements of different tasks. The input size for the track segmentation experiment is 512, and the image size for the obstacle detection experiment is 640.

[0031] S202: Perform track region segmentation on the preprocessed target image based on LiteRailSegNet to obtain a track mask. LiteRailSegNet includes PConv lightweight coding network, MEUM multi-scale edge upsampling feature enhancement module and MADN multi-channel attention decoding network. In the specific implementation of this invention, the step of segmenting the preprocessed target image into a track region based on LiteRailSegNet to obtain a track mask includes: extracting visual features from the preprocessed target image using the PConv lightweight coding network based on LiteRailSegNet to obtain multi-level visual features; enhancing and fusing the multi-level visual features using the MEUM multi-scale edge upsampling feature enhancement module to obtain enhanced and fused visual features; decoding the enhanced and fused visual features using the MADN multi-channel attention decoding network to obtain segmentation features; and determining the track mask using the segmentation features based on the segmentation head.

[0032] Specifically, LiteRailSegNet transforms the track recognition problem into a pixel-level semantic segmentation task, following an encoder-decoder architecture. The PConv lightweight encoding network based on LiteRailSegNet extracts visual features from the preprocessed target image. The PConv lightweight encoding network is used to extract multi-level visual features from the input image. To reduce the number of parameters and computational overhead, the encoder employs a partially convolutional and progressive downsampling structure, reducing redundant computation while preserving key track structure information. The multi-scale features output by the encoder include both shallow edge texture and deep semantic context, providing a foundation for subsequent edge enhancement and decoding.

[0033] The MEUM multi-scale edge upsampling feature enhancement module enhances and fuses the multi-level visual features, mitigating the weakening of track boundary information during downsampling. This module fuses features from different scales output by the encoder and restores spatial resolution through upsampling, compensating for track boundaries, slender structures, and curve orientation during feature propagation, thus obtaining enhanced and fused visual features.

[0034] The enhanced fused visual features are decoded using a MADN multi-channel attention decoding network. This network decodes features from different levels and receptive fields, introducing features from multiple encoding stages into different channels. Some channels capture mesoscale and large-scale context through dilated convolutions, while others incorporate MEUM-enhanced edge features. Channel attention is then used to learn the importance of different channels, and spatial attention enhances the relevant responses in the track region, ultimately obtaining segmentation features. A segmentation head uses these features to determine a track mask. The segmentation head converts the segmentation features output by the decoder into the final segmentation result corresponding to the target category, completing end-to-end recognition of the track region. The resulting track mask provides a foundation for subsequent obstacle detection. Based on the track segmentation results, obstacle intrusion detection research is conducted. Track region segmentation is used to define the detection range, and further, the potential intrusion targets in and around the track region are perceived, identified, and warned.

[0035] S203: The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses the orbital mask and the pre-processed target image to perform feature downsampling to obtain the initial feature representation; In the specific implementation of this invention, the ConvNeXt feature encoding backbone network is self-supervised pre-trained based on the DINOv3 framework using a softmax operation with temperature parameters. The DINOv3 framework includes a teacher-student self-distillation framework.

[0036] Specifically, in the task of detecting obstacles ahead of a train, the quality of visual feature representation directly affects the subsequent detection network's understanding of the scene. However, in current methods, due to high annotation costs, frequent scene variations, and the difficulty in obtaining large-scale and evenly distributed labeled data, traditional supervised learning-based feature pre-training methods have limitations in generalization and stability. To address this, this invention introduces a self-supervised visual feature learning mechanism and constructs a feature encoding network based on self-distillation with no labels Version 3 (DINOv3) self-supervised pre-training as the backbone structure of the obstacle detection model. This backbone network is based on the ConvNeXt structure and undergoes self-supervised pre-training with large-scale unlabeled data to obtain more adaptive visual feature representations. Structurally, the original classification head is removed, retaining only the feature extraction part. In the output stage, class labels and patch-level features are organized to maintain consistency with the Vision Transformer in feature form.

[0037] Self-supervised learning (SSL) is a method that learns feature representations from unlabeled datasets. By leveraging the structural information inherent in the dataset itself, it can achieve preliminary feature recognition capabilities without relying on manual annotation. Compared to traditional supervised learning, this type of method exhibits several practical advantages in tasks such as obstacle detection ahead of trains. Firstly, there are many types of abnormal obstacles in rail transit scenarios, and the data distribution is often uneven. Although the dataset used in this invention compensates for this disadvantage, relying solely on manually labeled data has certain limitations. Self-supervised learning can utilize a large amount of unlabeled data to uncover potential structural information, thereby alleviating the dependence on large-scale labeled data to some extent and significantly reducing annotation costs. Secondly, self-supervised methods pay more attention to the stable features of images at the structural and semantic levels, thus generally maintaining better adaptability under different lighting conditions, complex weather, and multi-viewpoint changes.

[0038] DINOv3 was selected as the self-supervised pre-training method for initializing the ConvNeXt backbone network. DINOv3 is based on a teacher-student self-distillation framework. Unlike traditional distillation methods that rely on manual annotation or external teacher models, self-distillation achieves knowledge transfer under unsupervised conditions by constructing a teacher-student model within the same network structure. The teacher network is updated by the exponential moving average of the student network parameters to provide a stable target distribution; the student network continuously approximates the teacher network output through backpropagation, thereby gradually learning semantically consistent feature representations. The entire process does not rely on category labels but achieves high-level semantic information modeling by constraining the features of the same image to remain consistent across different viewpoints.

[0039] As a general-purpose vision foundation model, DINOv3 achieves good overall performance without additional fine-tuning, and in some cases even outperforms previous self-supervised, weakly supervised methods, and some specialized models. Furthermore, it generates more detailed feature representations, which can be directly used for downstream tasks such as object detection, and improve performance. In addition, DINOv3 provides pre-trained weights of various sizes as an open-source model, making it applicable under different computing resource conditions. It can be deployed in resource-constrained environments or performance-critical scenarios, making it suitable for direct migration to automotive embedded devices.

[0040] Suppose the input image is x, and multiple different types of data are generated through enhancement strategies such as random data cropping, color perturbation, and mosaic blurring. , The teacher network and the student network encode these perspectives respectively, obtaining the corresponding feature vectors. , , in, and These represent the coding characteristics of the teacher network and the student network, respectively. and These are the feature mapping functions of the student network.

[0041] To enhance the discriminative power of the feature distribution, a softmax operation with a temperature parameter is introduced. , , Among them, temperature parameter This is used to control the sharpness of the teacher's output distribution and to provide clearer learning objectives. and These represent the output characteristics of the teacher network and the student network, respectively.

[0042] Compared to earlier self-supervised methods, DINOv3 focuses more on the consistency of overall structure and semantics during feature learning, rather than just local textures or simple contrast relationships. This difference is more intuitive in visual scenes with obvious structural features. In rail transit scenarios, the tracks themselves have strong geometric continuity, and obstacles are often embedded in the background. These characteristics make DINOv3 more likely to capture long-distance spatial dependencies and form an understanding of the overall scene. Therefore, it can provide more stable prior feature support when detecting obstacles in dynamic environments like rail tracks.

[0043] The ConvNeXt feature encoding backbone network based on self-supervised pre-training utilizes an orbital mask and a preprocessed target image for feature downsampling. The network consists of an initial downsampling layer and four feature stages. The preprocessed target image and orbital mask are first downsampled by a convolution operation with a stride of 4. Subsequently, feature extraction and resolution compression are performed alternately in each stage to form a multi-scale feature representation, i.e., the initial feature representation is obtained.

[0044] In each feature stage, the network stacks several ConvNeXt Blocks to progressively enhance the semantic expressiveness of the features. As the network depth increases, the spatial resolution of the feature maps decreases progressively, while the channel dimension increases progressively, allowing higher-level features to focus more on global structure and semantic information. This hierarchical design enables the network to simultaneously preserve local details and global contextual information, making it suitable for rail transit scenarios where the target scale varies significantly. The progressive changes in spatial resolution and number of channels for each stage are shown in Table 1.

[0045] Table 1: Characteristics of each stage of ConvNeXt

[0046] S204: The ConvNeXt feature encoding backbone network based on self-supervised pre-training performs depthwise separable convolution processing on the initial feature representation to obtain the initial feature representation after depthwise separable convolution processing; In the specific implementation of this invention, the initial feature representation is subjected to depthwise separable convolution processing based on the self-supervised pre-trained ConvNeXt feature encoding backbone network to obtain the initial feature representation after depthwise separable convolution processing. The initial feature representation is spatially modeled through a large kernel depthwise separable convolution to significantly expand the receptive field and enhance the ability to capture long-range structural information.

[0047] S205: Based on the Layer Normalization layer, the initial feature representation after depthwise separable convolution is normalized to obtain normalized features; In the specific implementation of this invention, the initial feature representation after depthwise separable convolution is normalized based on the Layer Normalization layer to obtain normalized features. Layer Normalization is used to normalize the features to replace the Batch Normalization commonly used in traditional convolutional networks, thereby improving stability under small-batch training and complex lighting conditions.

[0048] S206: Based on pointwise convolution, the normalized features are processed using a nonlinear activation function to obtain transformed features. Based on residual connection, the initial feature representation and the transformed features are fused to obtain the first multi-scale visual features. In a specific implementation of this invention, the expression for the first multi-scale visual feature is: , , Where Y is the first multi-scale visual feature, X is the initial feature representation, and F(X) is the transformed feature. For pointwise convolution, GELU is the non-linear activation function, and LN is the normalization function. It is a depthwise separable convolution.

[0049] Specifically, the normalized features are processed using a non-linear activation function based on pointwise convolution. Two pointwise convolutions are used to non-linearly map and recombine the channel dimensions, with the introduction of a non-linear activation function to enhance the model's expressive power. This channel mixing process is functionally similar to the feedforward network in the Transformer, but it is entirely based on convolution, avoiding the high computational complexity of the self-attention mechanism and obtaining transformed features. The initial feature representation and transformed features are fused using residual connections to obtain the first multi-scale visual feature. Residual connections are used to fuse the input features with the transformed features, effectively alleviating the gradient vanishing problem in deep networks and promoting feature reuse. Through the stacking of multiple blocks, the network can gradually construct a hierarchical feature representation from low-level geometric structure to high-level semantic information. The expression for the first multi-scale visual feature is: , , Where Y is the first multi-scale visual feature, X is the initial feature representation, and F(X) is the transformed feature. For pointwise convolution, GELU is the non-linear activation function, and LN is the normalization function. It is a depthwise separable convolution.

[0050] Through a phased, hierarchical feature encoding structure, self-supervised features are progressively passed through ConvNeXt and continuously aggregate semantic information. Shallow features primarily focus on local structures such as edges and textures, while as the network depth increases, mid-to-high-level features gradually integrate the global layout and contextual information of the scene. This feature extraction process from local to global ensures that the encoding results maintain spatial resolution information while possessing strong semantic discriminative ability. It ensures that spatial details are not completely lost while giving the features stronger semantic distinguishability, providing foundational information for subsequent modeling.

[0051] Rail transit scenarios exhibit significant structural characteristics, such as the linear extension of track regions, embedded relationships, and a wide range of obstacle scale variations. ConvNeXt employs large-kernel depthwise separable convolutions, which expand the receptive field while maintaining the spatial inductive bias of the convolutional structure, thus facilitating the capture of long-range structural information and overall geometric layout of the track. Furthermore, its hierarchical feature modeling approach allows the model to simultaneously handle distant small targets and nearby large targets at different scales, making it more flexible and better suited to real-world rail transit scenarios.

[0052] S207: Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are used to perform second-level focusing propagation processing to obtain second multi-scale visual features that are semantically consistent and have a target response set. In a specific implementation of this invention, the TFFP-Net-based two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent and target-response-focused second multi-scale visual features. This includes: performing unified channel mapping processing on the first multi-scale visual features based on the TFFP-Net two-level feature focusing propagation network to obtain the first multi-scale visual features after unified channel mapping processing; performing scale alignment processing on the first multi-scale visual features after unified channel mapping processing using the feature focusing module of the TFFP-Net two-level feature focusing propagation network to obtain several hierarchical visual features; and concatenating the several hierarchical visual features to obtain concatenated features, and then processing the concatenated features... Features are subjected to depthwise separable convolutional aggregation to obtain aggregated features; multi-branch convolutional modeling is performed on the aggregated features to obtain multi-branch convolutional modeled aggregated features, and first-level focusing features are determined based on the multi-branch convolutional modeled aggregated features; the first-level focusing features are propagated to higher and lower layers to obtain higher-level propagated features and lower-level propagated features, and focusing propagation is updated based on the higher-level propagated features and lower-level propagated features to obtain updated higher-level propagated features and lower-level propagated features; second-level focusing propagation is performed based on the updated higher-level and lower-level focusing features to obtain second-level focusing features; and the encoder uses the second-level focusing features to generate second multi-scale visual features that are semantically consistent and have a set of target responses.

[0053] Furthermore, the expression for the updated high-level propagation features of the focused propagation is: , in, To focus on the updated high-level propagation characteristics, C2f() is the feature fusion module. Characteristics of high-level communication Characterized by high-level features; The expression for the updated low-level propagation features after focused propagation is: , in, To focus on the updated low-level propagation features, C2f() is the feature fusion module. Characteristics of low-level propagation. These are low-level features.

[0054] Specifically, the first multi-scale visual features are processed by unified channel mapping based on the TFFP-Net two-level feature focusing propagation network. That is, by inputting the projection layer through a 1×1 convolution, the features of different levels of the backbone network are mapped to the corresponding feature dimensions, thereby constructing a unified feature space for subsequent information interaction and obtaining the first multi-scale visual features after unified channel mapping.

[0055] The feature focusing module of the TFFP-Net two-level feature focusing propagation network performs scale alignment processing on the first multi-scale visual features after unified channel mapping, obtaining several levels of visual features. The network then enters the first-level feature focusing propagation stage, which is implemented by the feature focusing module. First, scale alignment processing is performed on the mapped three-layer features. High-resolution features are upsampled to supplement speech rate features while maintaining their original scale as a structural reference, while low-resolution features are compressed through the adaptive downsampling module D to retain key discriminative information while reducing resolution. This asymmetric scale adjustment method avoids the semantic dilution problem caused by multiple interpolations in traditional pyramid structures.

[0056] Several levels of visual features are concatenated to obtain concatenated features, and these concatenated features are then subjected to depthwise separable convolutional aggregation to obtain aggregated features. The expression for the concatenated features is as follows: , in, For splicing features, For different levels of visual features, The expression for the aggregation feature is: , in, As an aggregation feature, For a depthwise separable convolution with a kernel size of k, This is a splicing feature.

[0057] Multi-branch convolutional modeling is applied to the aggregated features to obtain the aggregated features after multi-branch convolutional modeling. Based on the aggregated features after multi-branch convolutional modeling, the first-level focusing features are determined. The original spliced ​​features and the aggregated features after multi-branch convolutional modeling are fused through residual connections to obtain the first-level focusing features. Local and neighborhood response modeling is performed on the features using multi-branch depthwise separable convolution, enabling the network to perceive features of the track region and potential obstacles within different receptive fields. The expression for the aggregated features after multi-branch convolutional modeling is: , in, Aggregated features after modeling multi-branch convolution. For non-linear activation operations, BN is the batch normalization operation. This is an aggregation feature.

[0058] The first-level focused features are propagated to higher and lower layers to obtain higher-level and lower-level propagated features. Based on these features, the focus propagation is updated to obtain updated higher-level and lower-level propagated features. During propagation to higher layers, the focused features are downsampled and fused with higher-level features. This aims to maintain the semantic abstraction capabilities of higher layers while incorporating local structural and target detail information from lower layers, thereby improving the stability of obstacle recognition at medium to long distances. During propagation to lower layers, the focused features are upsampled and fused with lower-level features to recalibrate fine-grained feature responses under strong semantic guidance, reducing background noise interference with small target detection. The expression for the updated higher-level propagated features is: , , in, To focus on the updated high-level propagation characteristics, C2f() is the feature fusion module. Characteristics of high-level communication Characterized by high-level features 3 3 convolutions, This is an average pooling downsampling operation. This is the first-level focusing feature; The expression for the updated low-level propagation features after focused propagation is: , , in, To focus on the updated low-level propagation features, C2f() is the feature fusion module. Characteristics of low-level propagation. For low-level features, U represents the average pooling upsampling operation. This is the first-level focusing feature.

[0059] Based on the updated high-level and low-level propagation features from the initial focused propagation, a second-level focused propagation is performed. After completing one full focusing and propagation cycle, the network enters the second-level feature focusing phase. This phase uses the high-level, mid-level, and low-level features from the first-level propagation as input and performs feature focusing again. Unlike the first level, the second-level focusing emphasizes semantic consistency and fine-tuning of cross-layer information. Its role is to eliminate semantic biases that may arise during the initial propagation and further strengthen the stable responses of key regions. Through this two-level progressive focusing, the network gradually forms a feature representation that is hierarchically clear, semantically consistent, and has a concentrated target response, thus obtaining the second-level focused features.

[0060] The encoder generates semantically consistent, target-response-focused second-scale visual features based on the second-level focusing features. These multi-layer features, after propagation through the second-level focusing, are output to the decoder. These features maintain hierarchical differences in spatial resolution, possess high semantic consistency, preserve low-level detail perception, balance mid-level semantic information and spatial details, and integrate high-level global contextual information. This provides more robust and discriminative encoded features for train obstacle detection tasks; these features are the semantically consistent, target-response-focused second-scale visual features. The calculation process for each layer's output features is as follows:

[0061] in, This is a second-level focusing feature. The high-level propagation features are obtained by downsampling the second-level focusing features. The low-level propagation features are obtained by upsampling the second-level focusing features. 3 3 convolutions, This is an average pooling downsampling operation. To focus on the updated high-level propagation characteristics, C2f() is the feature fusion module. Characteristics of high-level communication , and These represent the high-level, low-level, and mid-level features output by the two-level feature focusing and propagation network, respectively, where u is the average pooling upsampling operation. To focus on the updated low-level propagation features, C2f() is the feature fusion module. This is a characteristic of low-level propagation.

[0062] S208: Obstacle detection is performed using the second multi-scale visual features based on the Transformer detection head to obtain obstacle detection results; In a specific implementation of this invention, the obstacle detection based on the Transformer detection head using the second multi-scale visual features to obtain obstacle detection results includes: determining a query vector, a key vector, and a value vector; performing multi-head attention interaction based on the Transformer detection head using the second multi-scale visual features, the query vector, the key vector, and the value vector to obtain multi-head attention interaction information; and performing obstacle detection based on the multi-head attention interaction information to obtain obstacle detection results.

[0063] Specifically, the query vector, key vector, and value vector are determined. Based on the Transformer detection head, multi-head attention interaction is performed using the second multi-scale visual features, query vector, key vector, and value vector to obtain multi-head attention interaction information. Obstacle detection is then performed based on this information to obtain the obstacle detection result. The Transformer, centered on the query vector, decodes the encoded features through a cross-scale attention mechanism, thereby transforming the obstacle detection problem into a global modeling problem of set prediction. The Transformer detection head uses multi-scale features as input and employs an encoder-decoder Transformer architecture to complete the obstacle detection task. Its core idea is to use a set of learnable query vectors to interact with the input features through multi-head attention, thereby gradually aggregating global information related to the target. The Transformer first flattens the features at each scale and adds positional encoding, then uses them as keys (K) and values ​​(V) as input to the decoder. In each decoder layer, the query vector Q interacts with the multi-scale features through a cross-attention mechanism. Through multi-layer decoding iterations, the query vector gradually focuses on potential obstacle regions and forms a joint representation of the target's semantics and spatial location in the feature space.

[0064] In the entire detection framework, the Transformer serves as a central transformation hub, organizing the previously obtained feature representations into concrete predicted target results. It further transforms information that originally remained at the feature layer into outputs that can be directly used for localization and classification. The cross-scale attention mechanism plays a crucial role, preventing features at different resolutions from being output separately. Instead, they are aggregated into the same decoding space for unified processing. In this way, both small targets at a distance and large targets at close range can be analyzed and decoded together under the same modeling architecture. This is particularly suitable for improving decoding efficiency in scenarios with significant scale variations, such as orbital environments. In addition, this query-based decoding method simplifies the entire detection process. It no longer relies on densely generating candidate boxes and eliminates tedious screening steps such as non-maximum suppression. The overall process is more direct, and the overhead during inference is easier to control.

[0065] S209: Determine obstacle warning information for the train track based on the obstacle detection results.

[0066] In the specific implementation of this invention, obstacle warning information of the train track is determined based on the obstacle detection results, and the warning output unit outputs the identification and warning information of potential obstacles in the track area according to the obstacle detection results.

[0067] In this embodiment of the invention, a target image of the train track is acquired and preprocessed. Track region segmentation is performed on the preprocessed target image using LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight encoding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The PConv lightweight encoding network reduces computational load, the MEUM multi-scale edge upsampling feature enhancement module strengthens boundary details, and the MADN multi-channel attention decoding network achieves channel and spatial attention decoding, thereby maintaining high segmentation accuracy and real-time performance with a low parameter count and reducing false detections caused by non-track backgrounds. The self-supervised pre-trained ConvNeXt feature encoding backbone network extracts features using the track mask and the preprocessed target image, achieving a more stable visual representation even with limited samples of track anomalies and obstacles. The TFFP-Net two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features with a concentrated target response. This TFFP-Net two-level feature focusing propagation network enhances the multi-scale perception capability for distant small targets, complex textured targets, and close-range large targets. The Transformer detection head utilizes the second multi-scale visual features for obstacle detection. Based on the obstacle detection results, obstacle warning information for train tracks is determined. The Transformer detection head can perform global relationship modeling, reducing reliance on complex candidate box selection and post-processing, and improving the reliability of train track obstacle detection.

[0068] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of the structural composition of a train track obstacle detection system according to an embodiment of the present invention. The system includes: Image preprocessing module 31: used to acquire a target image of the train track and preprocess the target image to obtain a preprocessed target image; Track region segmentation module 32: used to perform track region segmentation on the preprocessed target image based on LiteRailSegNet to obtain a track mask. LiteRailSegNet includes PConv lightweight coding network, MEUM multi-scale edge upsampling feature enhancement module and MADN multi-channel attention decoding network. Feature extraction module 33: Used to extract features from the self-supervised pre-trained ConvNeXt feature encoding backbone network using the orbital mask and the pre-processed target image to obtain the first multi-scale visual features; Feature processing module 34: is used to perform secondary focus propagation processing on the first multi-scale visual features based on the TFFP-Net two-level feature focusing propagation network to obtain second multi-scale visual features that are semantically consistent and have a target response set. Obstacle detection module 35: used to perform obstacle detection based on the Transformer detection head using the second multi-scale visual features, and obtain obstacle detection results; Early warning module 36: used to determine obstacle early warning information for the train track based on the obstacle detection results.

[0069] In the specific implementation of this invention, the specific implementation methods of the system items can be referred to the implementation methods of the above-mentioned method items, and will not be repeated here.

[0070] In this embodiment of the invention, a target image of the train track is acquired and preprocessed. Track region segmentation is performed on the preprocessed target image using LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight encoding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The PConv lightweight encoding network reduces computational load, the MEUM multi-scale edge upsampling feature enhancement module strengthens boundary details, and the MADN multi-channel attention decoding network achieves channel and spatial attention decoding, thereby maintaining high segmentation accuracy and real-time performance with a low parameter count and reducing false detections caused by non-track backgrounds. The self-supervised pre-trained ConvNeXt feature encoding backbone network extracts features using the track mask and the preprocessed target image, achieving a more stable visual representation even with limited samples of track anomalies and obstacles. The TFFP-Net two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features with a concentrated target response. This TFFP-Net two-level feature focusing propagation network enhances the multi-scale perception capability for distant small targets, complex textured targets, and close-range large targets. The Transformer detection head utilizes the second multi-scale visual features for obstacle detection. Based on the obstacle detection results, obstacle warning information for train tracks is determined. The Transformer detection head can perform global relationship modeling, reducing reliance on complex candidate box selection and post-processing, and improving the reliability of train track obstacle detection.

[0071] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0072] Furthermore, the above description provides a detailed explanation of the obstacle detection method and system for train tracks provided by the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting obstacles on train tracks, characterized in that, The method includes: Acquire a target image of the train track and preprocess the target image to obtain a preprocessed target image; The preprocessed target image is segmented into track regions based on the lightweight track segmentation network LiteRailSegNet to obtain a track mask. LiteRailSegNet includes a PConv lightweight coding network, a MEUM multi-scale edge upsampling feature enhancement module, and a MADN multi-channel attention decoding network. The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses orbital masks and pre-processed target images to extract features and obtain the first multi-scale visual features. Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are used to perform second-level focusing propagation processing to obtain second multi-scale visual features that are semantically consistent and have a target response set. Obstacle detection results are obtained by using the second multi-scale visual features based on the Transformer detection head; Obstacle warning information for the train track is determined based on the obstacle detection results.

2. The obstacle detection method for train tracks according to claim 1, characterized in that, The step of preprocessing the target image to obtain a preprocessed target image includes: The target image is subjected to image enhancement processing to obtain the enhanced target image; The target image after image enhancement is resized to obtain a preprocessed target image.

3. The obstacle detection method for train tracks according to claim 1, characterized in that, The method of segmenting the preprocessed target image into orbit regions based on the lightweight orbit segmentation network LiteRailSegNet to obtain an orbit mask includes: The PConv lightweight coding network based on LiteRailSegNet extracts visual features from the preprocessed target image to obtain multi-level visual features. The multi-level visual features are enhanced and fused based on the MEUM multi-scale edge upsampling feature enhancement module to obtain enhanced and fused visual features. The enhanced fusion visual features are decoded using the MADN multichannel attention decoding network to obtain segmentation features, and the orbital mask is determined based on the segmentation head using the segmentation features.

4. The obstacle detection method for train tracks according to claim 1, characterized in that, The self-supervised pre-trained ConvNeXt feature encoding backbone network extracts features using an orbital mask and a preprocessed target image to obtain the first multi-scale visual features, including: The ConvNeXt feature encoding backbone network based on self-supervised pre-training uses orbital masks and pre-processed target images to perform feature downsampling to obtain initial feature representations. The initial feature representation is processed by depthwise separable convolution based on the self-supervised pre-trained ConvNeXt feature encoding backbone network to obtain the initial feature representation after depthwise separable convolution processing. The initial feature representation after depthwise separable convolution is normalized using the Layer Normalization layer to obtain normalized features; The normalized features are processed by a nonlinear activation function based on pointwise convolution to obtain transformed features. The initial feature representation and the transformed features are then fused based on residual connections to obtain the first multi-scale visual features.

5. The obstacle detection method for train tracks according to claim 4, characterized in that, The ConvNeXt feature encoding backbone network is self-supervised pre-trained based on the DINOv3 framework using a softmax operation with temperature parameters. The DINOv3 framework includes a teacher-student self-distillation framework.

6. The obstacle detection method for train tracks according to claim 4, characterized in that, The expression for the first multi-scale visual feature is: , , Where Y is the first multi-scale visual feature, X is the initial feature representation, and F(X) is the transformed feature. For pointwise convolution, GELU is the non-linear activation function, and LN is the normalization function. It is a depthwise separable convolution.

7. The obstacle detection method for train tracks according to claim 1, characterized in that, The TFFP-Net-based two-level feature focusing propagation network utilizes the first multi-scale visual features for second-level focusing propagation processing to obtain semantically consistent second multi-scale visual features within the target response set, including: Based on the TFFP-Net two-level feature focusing propagation network, the first multi-scale visual features are processed by unified channel mapping to obtain the first multi-scale visual features after unified channel mapping. The feature focusing module based on the TFFP-Net two-level feature focusing propagation network performs scale alignment processing on the first multi-scale visual features after unified channel mapping processing to obtain several levels of visual features. Several levels of visual features are stitched together to obtain stitched features, and the stitched features are then subjected to depthwise separable convolutional aggregation to obtain aggregated features. Multi-branch convolution modeling is performed on the aggregated features to obtain the aggregated features after multi-branch convolution modeling, and the first-level focusing features are determined based on the aggregated features after multi-branch convolution modeling. The first-level focused features are propagated to higher and lower layers to obtain higher-level propagated features and lower-level propagated features. Based on the higher-level propagated features and lower-level propagated features, the focused propagation is updated to obtain the higher-level propagated features and lower-level propagated features after the focused propagation is updated. Based on the updated high-level and low-level propagation features of focused propagation, a second-level focused propagation is performed to obtain the second-level focused features. The encoder utilizes the second-level focusing features to generate a second multi-scale visual feature that is semantically consistent and within the target response set.

8. The obstacle detection method for train tracks according to claim 7, characterized in that, The expression for the updated high-level propagation feature after focused propagation is: , in, To focus on the updated high-level propagation characteristics, C2f() is the feature fusion module. Characteristics of high-level communication Characterized by high-level features; The expression for the updated low-level propagation features after focused propagation is: , in, To focus on the updated low-level propagation features, C2f() is the feature fusion module. Characteristics of low-level propagation. These are low-level features.

9. The obstacle detection method for train tracks according to claim 1, characterized in that, The obstacle detection based on the Transformer detection head utilizes the second multi-scale visual features to perform obstacle detection and obtain obstacle detection results, including: The query vector, key vector, and value vector are determined, and multi-head attention interaction is performed based on the Transformer detection head using the second multi-scale visual features, query vector, key vector, and value vector to obtain multi-head attention interaction information; Obstacle detection is performed based on the multi-head attention interaction information to obtain obstacle detection results.

10. An obstacle detection system for train tracks, characterized in that, The system includes: Image preprocessing module: used to acquire the target image of the train track and preprocess the target image to obtain the preprocessed target image; Track Region Segmentation Module: Used to segment the preprocessed target image into track regions based on LiteRailSegNet to obtain a track mask. LiteRailSegNet includes PConv lightweight coding network, MEUM multi-scale edge upsampling feature enhancement module and MADN multi-channel attention decoding network. Feature extraction module: Used to extract features from the self-supervised pre-trained ConvNeXt feature encoding backbone network using orbital masks and pre-processed target images to obtain the first multi-scale visual features; Feature processing module: used to perform secondary focus propagation processing on the first multi-scale visual features based on the TFFP-Net two-level feature focusing propagation network to obtain second multi-scale visual features that are semantically consistent and have a target response set; Obstacle detection module: used to detect obstacles based on the Transformer detection head using the second multi-scale visual features, and obtain obstacle detection results; Early warning module: used to determine obstacle warning information for the train track based on the obstacle detection results.