Steel rail surface state detection method and system
By combining feature encoding, fusion, and decoding with path aggregation and feature pyramids, a W-shaped encoding-decoding structure is constructed. By introducing Transformer and an efficient channel attention mechanism, the problems of insufficient accuracy and poor adaptability in rail surface condition detection are solved, and efficient identification and robust detection of multiple types of defects are achieved.
Patent Information
- Application Number
- CN202511508597.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies for rail surface condition inspection suffer from insufficient detection accuracy, poor adaptability, difficulty in identifying various types of defects in complex surface morphology, and low efficiency and high cost, making it difficult to meet the refined inspection requirements of high-speed railways.
A rail surface condition detection method is adopted. Through feature encoding, fusion and decoding, combined with path aggregation and feature pyramid, a W-shaped encoding-decoding structure is constructed. A cross-embedding module of Transformer and efficient channel attention mechanism is introduced to enhance the global information modeling capability and improve the cross-scale attention allocation accuracy.
It achieves comprehensive perception and intelligent recognition of rail surface condition, improves the accuracy and robustness of identifying various types of defects, effectively captures local details and global features, and is adaptable to multi-scale target detection.
Smart Images

Figure CN120997205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit technology, and more specifically, to a method and system for detecting the surface condition of rails. Background Technology
[0002] Rails are critical components of railway lines, bearing train loads and guiding train movement. Their surface condition directly affects train operation safety and track structure lifespan. Under the coupled effects of multiple fields such as train loads and temperature changes, rail surfaces commonly exhibit defects such as spalling, cracks, and abnormal light bands. These anomalies are not only the result of rail fatigue damage evolution but also manifestations of imbalance in wheel-rail contact, possessing significant safety early warning value. Traditional manual inspection methods are inefficient and costly, failing to meet the increasingly sophisticated inspection needs of high-speed railways.
[0003] In recent years, non-contact non-destructive testing (NDT) technologies have become a research hotspot, including methods such as ultrasonic, eddy current, magnetic flux leakage, and machine vision. Although these methods are superior to manual methods in terms of efficiency and objectivity, they still suffer from problems such as insufficient detection accuracy and poor adaptability, especially in the identification of complex surface morphologies. While visual inspection can directly acquire surface image information, existing methods are limited by imaging equipment and algorithm capabilities, making it difficult to accurately identify typical damage features such as microcracks and gradient light bands.
[0004] While some Transformer-based research has been applied to rail surface defect detection, it largely focuses on single defect types, employing customized network structures to optimize the recognition accuracy of specific targets, while neglecting the complexity of multiple defect types coexisting in real-world detection scenarios. This single-objective optimization paradigm makes the model prone to missed detections or misjudgments when faced with simultaneous detection of heterogeneous defects due to competition among multiple defect features.
[0005] Therefore, there is an urgent need for a deep model that takes into account both local details and global structure to achieve comprehensive perception and intelligent recognition of rail surface conditions, enabling refined recognition of surface conditions such as chipping and abnormal light bands, and improving the accuracy and robustness of recognizing complex morphological defects. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for detecting the surface condition of rails, thereby improving the aforementioned problems. To achieve this objective, the technical solution adopted by this invention is as follows: Firstly, this application provides a method for detecting the surface condition of rails, including: Acquire railway image data, which includes images of different surface conditions of the rails; Based on the railway image data, feature encoding processing is performed to obtain encoded features at different levels; Based on the encoded features, feature fusion processing is performed, and combined with path aggregation and feature pyramid, fused features at different levels are obtained; Based on the encoded features and the fused features, feature decoding processing is performed to obtain the decoded features; Based on the decoding features, a rail surface condition detection model is constructed, and the target rail surface is detected using the rail surface condition detection model to obtain the defect type and defect location of the target rail surface.
[0007] Secondly, this application also provides a rail surface condition inspection system, comprising: The acquisition unit is used to acquire railway image data, which includes images of different surface conditions of the rails; The encoding unit is used to perform feature encoding processing on the railway image data to obtain encoded features at different levels; The fusion unit is used to perform feature fusion processing based on the encoded features, and combine path aggregation and feature pyramid to obtain fused features at different levels. A decoding unit is used to perform feature decoding processing based on the encoded features and the fused features to obtain decoded features; The detection unit is used to construct a rail surface condition detection model based on the decoded features, and to detect the target rail surface using the rail surface condition detection model to obtain the defect type and defect location of the target rail surface.
[0008] The beneficial effects of this invention are as follows: By constructing a rail surface condition detection model, this invention combines deep and shallow features, fully leveraging their complementary advantages to achieve a better balance between target semantic representation and geometric localization. Furthermore, path aggregation and feature pyramids are introduced into the rail surface condition detection model, constructing a W-shaped encoder-decoder structure through a bidirectional fusion strategy. This enables the model to more effectively handle target scale variations and improves the detection capability for multi-scale targets. Simultaneously, a cross-embedding module combining Transformer and an efficient channel attention mechanism is introduced to enhance global information modeling capabilities and improve the accuracy of cross-scale attention allocation. Through this invention, the rail surface condition detection model can effectively capture the local details and global features of the target, thereby making accurate decisions regarding targets of different shapes.
[0009] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of the rail surface condition detection method described in this embodiment of the invention; Figure 2 This is a schematic diagram of the strip feature extraction module described in an embodiment of the present invention; Figure 3 This is a schematic diagram of the cross-embedding module described in an embodiment of the present invention; Figure 4 This is a schematic diagram of the encoder-decoder structure described in an embodiment of the present invention; Figure 5 This is a schematic diagram of the rail surface condition detection model described in an embodiment of the present invention. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0013] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0014] Example 1: This embodiment provides a method for detecting the surface condition of rails.
[0015] See Figure 1 The figure shows that the method includes steps S1, S2, S3, S4 and S5.
[0016] Step S1: Acquire railway image data, which includes images of different surface conditions of the rails; Step S2: Perform feature encoding processing on the railway image data to obtain encoded features at different levels; Step S3: Perform feature fusion processing based on the encoded features, and combine path aggregation and feature pyramid to obtain fused features at different levels; In step S3, obtaining the fusion features at different levels includes: Step S31: Construct a strip feature extraction module and a cross-embedding module based on the coding features, wherein the coding features include a first coding feature, a second coding feature, a third coding feature, a fourth coding feature, and a fifth coding feature with gradually decreasing resolution; In step S31, the feature extraction steps of the strip feature extraction module are as follows: Step A1: Perform average pooling and max pooling operations on the input features of the strip feature extraction module to obtain average pooling features and max pooling features respectively; Step A2: Perform convolution and upsampling operations on the average pooling features sequentially to obtain the first strip pooling feature; Step A3: Perform convolution and upsampling operations on the max pooling features sequentially to obtain the second strip pooling feature; Step A4: Concatenate the first and second band pooling features to obtain the third concatenated feature; Step A5: Perform convolution, batch normalization, and ReLU activation on the third concatenated feature in sequence to obtain the strip feature; Step A6: Perform matrix multiplication on the input features and strip features of the strip feature extraction module to obtain the output features of the strip feature extraction module.
[0017] In this embodiment, the structural diagram of the strip feature extraction module is as follows: Figure 2 As shown, Input represents the input features, Output represents the output features, 1D Conv represents one-dimensional convolution, and FM represents the feature fusion module. The feature fusion module includes a concatenation operation, a convolution operation, a batch normalization operation, and a ReLU activation function connected in sequence.
[0018] Specifically, the strip feature extraction module includes two strip pooling branches. The two strip pooling branches perform average pooling and max pooling on the input features of the strip feature extraction module, respectively. Average pooling takes the average value of the local region of the input features, which can preserve the overall trend and background information within the region. Max pooling takes the maximum value of the local region, which can highlight the salient features within the region (such as edges, textures and other strong response signals) and is more sensitive to local details.
[0019] By employing two pooling methods, both global trends and local salient features can be captured simultaneously, avoiding information loss caused by single pooling.
[0020] Then, the average pooling features and max pooling features are convolved and upsampled separately to further extract local correlation patterns, reduce redundant information, enhance the discriminative power of the features, and restore the scaled-down feature maps after pooling to the same spatial size as the input features, ensuring dimensionality matching in subsequent concatenation operations. Processing the two pooling features separately (average pooling features and max pooling features) allows for targeted enhancement of their respective advantages, while upsampling ensures spatial consistency of the features, preparing for fusion.
[0021] The first and second strip pooling features are processed by the feature fusion module FM. Through a combination of convolutional dimensionality reduction, normalization for stable training, and nonlinear enhancement of expression, the third concatenated feature is optimized into a more refined and discriminative strip feature.
[0022] Finally, the strip features are multiplied with the input features of the strip feature extraction module, so that the output features of the strip feature extraction module focus on the key information related to the strip (filtering out noise and irrelevant features), while retaining the basic features of the original input. The final output features contain the original information and are guided and strengthened by the strip features, thus improving the accuracy of subsequent tasks.
[0023] In step S31, the feature embedding step of the cross-embedding module is as follows: Step B1: The input features of the cross-embedding module are weighted using an efficient channel attention mechanism to obtain the first enhanced feature; Step B2: The input features of the cross-embedding module are weighted through the attention module to obtain the second enhanced features. The attention module includes a depthwise separable convolution, layer normalization, multi-head self-attention mechanism, random depth module and addition module connected in sequence. Step B3: Extract the second enhanced feature through a feedforward network to obtain the third enhanced feature. The feedforward network includes a layer normalization layer, a fully connected layer, a depthwise separable convolution, a GeLU activation function, a random depth module, and an addition module connected in sequence. Step B4: Concatenate the first and third enhanced features to obtain the output features of the cross-embedding module.
[0024] In this embodiment, the structure of the cross-embedding module is as follows: Figure 3As shown, Input represents the input features, Output represents the output features, kernel size represents the kernel size, and kConv1D represents a one-dimensional convolutional layer with a kernel size of 1×k. Furthermore, the random depth module employs Dropout, a regularization technique that randomly discards some neurons, breaking the dependence on specific neuron combinations and forcing the model to learn more general and robust features.
[0025] Understandably, the cross-embedding module combines the efficient channel attention mechanism ECA with the Transformer (feedforward network) to enhance global information modeling capabilities and improve the accuracy of cross-scale attention allocation.
[0026] Specifically, the input features of the cross-embedding module are adaptively captured through an efficient channel attention mechanism to capture the dependencies between channels and assign dynamic weights to different channel features. This directly strengthens the channel information that is important to the task and suppresses the interference of noise or redundant channels without the need for complex dimensionality reduction operations.
[0027] Then, the attention module sequentially performs depthwise separable convolution, layer normalization, multi-head self-attention mechanism, and Dropout on the first enhanced feature, and then adds it to the input feature (first enhanced feature) of the attention module. This achieves local detail extraction, global dependency modeling, stable training, and overfitting prevention. It retains the precision of local features and establishes global contextual relationships, providing both local and global information for subsequent feature processing.
[0028] The feedforward network further normalizes the feature distribution of the second enhanced feature through layer normalization, and then expands the feature dimension through fully connected layers to enhance expressive power. Depthwise separable convolutions further extract local patterns. The combination of these two approaches achieves dimensionality transformation and local feature enhancement. The GeLU activation function used, compared to ReLU, has smoother non-linear characteristics (more sensitive to input), making it suitable for the non-linear mapping of complex features in deep networks and improving the flexibility of feature representation. Finally, similar to the attention module, it performs random depth addition and is added to the input features of the feedforward network to achieve regularization and residual preservation, ensuring that key information is not lost during feature processing. Therefore, the feedforward network performs refined processing on the features modeled by the attention module, including dimensionality enhancement, local re-extraction, and non-linear enhancement, strengthening the discriminative power of the features (highlighting the difference between the target and the background), while ensuring the stability of feature flow through the residual structure.
[0029] Finally, the first enhanced feature, which focuses on key channel-level information, and the third enhanced feature, processed by the Transformer, are concatenated. This process preserves the core features at the channel level while integrating global and local contextual relationships. The final output feature combines channel discriminative and global modeling capabilities, effectively improving the accuracy of attention allocation across scales (such as targets of different sizes and locations).
[0030] Step S32: The encoded features are aggregated by the strip feature extraction module and the deconvolution operation, and the features are embedded by the cross embedding module to obtain intermediate features. The intermediate features include aggregated features, first embedded features and second embedded features. The deconvolution operation includes deconvolution, batch normalization and ReLU activation function connected in sequence. In this embodiment, as Figure 4 As shown, when the feature map resolution is reduced to 1 / 16 of the original resolution in the encoding layer, a path aggregation network (PAN) is introduced to progressively fuse multi-scale features from the bottom to the top, resulting in aggregated features. When the resolution increases to 1 / 4 of the original resolution, a feature pyramid network (FPN) is used to integrate feature information at different scales from top to bottom, resulting in fused features at different levels. This bidirectional fusion strategy constructs a W-shaped encoder-decoder structure, enabling the model to more effectively cope with changes in target scale and improve the detection capability of multi-scale targets. Furthermore, the cross-embedding module is deployed between the encoding and decoding layers via skip connections.
[0031] Figure 4 In this context, Conv(3×3) represents 3×3 convolution, BN represents batch normalization, ReLU represents ReLU activation function, Max-Pooling(2×2) represents 2×2 max pooling, Up-Sampling(2×2, bilinear) represents 2×2 upsampling using bilinear interpolation, Deconv(3×3) represents 3×3 deconvolution, w represents feature width, and h represents feature height.
[0032] In step S32, obtaining the intermediate features includes: Step S321: Deconvolve the fifth encoded feature to obtain the first deconvolution feature; Step S322: Extract the third and fourth coding features from the strip feature extraction module to obtain the first extracted feature and the second extracted feature; Step S323: After concatenating the first deconvolution feature and the second extracted feature, the first concatenated feature is obtained; Step S324: Deconvolve the first concatenated feature to obtain the second deconvolution feature; Step S325: After concatenating the second deconvolution feature and the first extracted feature, the aggregated feature is obtained; Step S326: The fifth encoding feature and the second deconvolution feature are respectively embedded through the cross-embedding module to obtain the first embedded feature and the second embedded feature.
[0033] Understandably, step S32 obtains intermediate features through the strip feature extraction module and the PAN structure. Starting from the features of the encoding stage, the encoded features obtained at different resolutions in different encoding stages correspond to high-level semantic features (low resolution, containing global information) and low-level detail features (high resolution, containing position and texture information), respectively. Through deconvolution (upgrading resolution), strip feature extraction (enhancing key features), and feature concatenation (fusion of information from different levels), aggregated features that guide low-level details with high-level semantics are formed. This actually compensates for the loss of details caused by the reduction in resolution of encoded features in the encoding stage through the bottom-up fusion logic of PAN. The deconvolution operation includes sequentially connected 3×3 deconvolution, batch normalization, and ReLU activation function.
[0034] The strip feature extraction module participates in the processing at each level, using pooling, convolution, and attention weighting to enhance key patterns related to the target (such as strip structure and edge information) in features at each scale. At the same time, features at different levels maintain semantic consistency by sharing embedded features (first embedded feature and second embedded feature), avoiding semantic gaps across scale features.
[0035] Step S33: The intermediate features are scaled through the strip feature extraction module and max pooling operation, and the fused features at different levels are obtained by combining the feature pyramid. The fused features include the third fused feature, the fourth fused feature and the fifth fused feature.
[0036] In this embodiment, as Figure 4 As shown, in addition to using PAN from bottom to top, it is also using FPN from top to bottom to achieve the W-shaped encoding-decoding structure, which allows high and low layer features to fully interact and solves the problem that single-scale features cannot take into account both the details of small targets and the semantics of large targets.
[0037] Understandably, the PAN path aggregation connects high- and low-level features, and the cross-embedding module enhances the global modeling capability of features, generating intermediate features that combine detail and semantics. Based on these intermediate features, the FPN feature pyramid logic generates fused features at different resolutions to adapt to the detection needs of targets at different scales. The multiple interventions of the strip feature extraction module and the cross-embedding module continuously filter and enhance core features related to the target (such as strip structure and cross-regional correlation), improving the discriminative power of the features. Furthermore, throughout the entire process from aggregation to output, operations such as splicing and embedding maintain the semantic correlation between features at different scales, preventing multi-scale features from operating independently.
[0038] In step S33, the combined feature pyramid yields fused features at different levels, including: Step S331: Extract the aggregated features using the strip feature extraction module to obtain the third fused feature; Step S332: Obtain the first pooled feature by performing max pooling on the aggregated feature; Step S333: After concatenating the first pooling feature and the second embedding feature, the second concatenated feature is obtained; Step S334: Extract the second splicing feature using the strip feature extraction module to obtain the fourth fused feature; Step S335: After performing max pooling, the second concatenated feature is concatenated with the first embedded feature to obtain the fifth fused feature.
[0039] Step S4: Perform feature decoding processing based on the encoded features and the fused features to obtain the decoded features; Step S5: Based on the decoded features, construct a rail surface condition detection model, and use the rail surface condition detection model to detect the target rail surface to obtain the defect type and defect location of the target rail surface.
[0040] In step S5, the process of constructing a rail surface condition detection model based on the decoded features includes: Step S51: Construct multiple sequentially connected codecs, each codec including multiple levels of encoding and decoding layers, wherein the multiple levels of each encoding layer are connected by downsampling operations, the multiple levels of each decoding layer are connected by upsampling operations, the output features of the encoding layer are the encoding features of different levels, and the output features of the decoding layer are the decoding features; Step S52: Construct a collaborative perception module, which includes a strip feature extraction module and a cross-embedding module; Step S53: Embed the collaborative sensing module into each encoder and decoder to obtain the rail surface condition detection model. The input features of the collaborative sensing module are the output features of the last three levels of the encoding layer. The output features of the collaborative sensing module are the fused features of different levels. The input features of the last three levels of the decoding layer include the output features of the collaborative sensing module.
[0041] In this embodiment, the rail surface condition detection model is as follows: Figure 5 As shown, different codecs use memory connections, and each codec has 5 resolution levels, that is, 5 encoding and decoding layers. Figure 5 In this context, w represents the feature width, h represents the feature height, Conv(3×3) represents 3×3 convolution, BN represents batch normalization, ReLU represents the ReLU activation function, Max-Pooling(2×2) represents 2×2 max pooling, and Up-Sampling(2×2, bilinear) represents 2×2 upsampling implemented using bilinear interpolation.
[0042] Specifically, the rail surface condition detection model references the head-to-tail connection method of UNet and adopts the ShuttleNet architecture of repeated encoding and decoding, allowing the global context and finer details to be learned multiple times. Based on this, a W-shaped encoding and decoding topology for the collaborative perception module is designed to extract latent representations from finer to coarser resolutions, amplify the data, and retrieve details from coarser to finer resolutions.
[0043] In each codec, multiple coding layers output first, second, third, fourth, and fifth coded features, respectively. These features are then processed by a collaborative sensing module to output aggregated features, first embedded features, and second embedded features. The first embedded feature is then used as input to the fifth-level decoding layer for feature decoding. The second embedded feature and aggregated feature are input to the fourth and third-level decoding layers, respectively, and combined with the output features of the corresponding previous-level decoding layers for further feature decoding. Finally, the output features of the first-level decoding layer are used as the output features of this codec, i.e., the decoded features. These decoded features are then used as input features for the next codec. Furthermore, decoding layers at the same level in different codecs utilize memory connections.
[0044] Therefore, the rail surface condition detection model integrates local and global feature co-sensing, uses dense jump connections to retain high-frequency details of the edge of the block, and uses a self-attention mechanism to model the gradient law of the light band region. It can effectively capture the local details and global features of the target, thereby making accurate decisions for targets of different shapes.
[0045] It should be noted that before detecting the target rail surface using the rail surface condition detection model, the model also needs to be trained. Specifically, railway image data is collected, and a ground truth image dataset is constructed, consisting of multiple rail corrugation contour images drawn based on the railway image data. Then, the ground truth image dataset is binarized, setting background pixels to 0 and rail corrugation pixels to 1, representing the rail corrugation contour image data numerically. The binarized ground truth image dataset is then normalized and divided into training and testing sets. The rail surface condition detection model is trained using the training and testing sets, and the model with the optimal network parameters is saved. Finally, the trained rail surface condition detection model is used to detect the target rail surface, obtaining the defect category and location.
[0046] Example 2: This embodiment provides a rail surface condition inspection system, the system comprising: The acquisition unit is used to acquire railway image data, which includes images of different surface conditions of the rails; The encoding unit is used to perform feature encoding processing on the railway image data to obtain encoded features at different levels; The fusion unit is used to perform feature fusion processing based on the encoded features, and combine path aggregation and feature pyramid to obtain fused features at different levels. A decoding unit is used to perform feature decoding processing based on the encoded features and the fused features to obtain decoded features; The detection unit is used to construct a rail surface condition detection model based on the decoded features, and to detect the target rail surface using the rail surface condition detection model to obtain the defect type and defect location of the target rail surface.
[0047] The fusion unit includes: The first construction unit is used to construct a strip feature extraction module and a cross-embedding module based on the coding features, wherein the coding features include a first coding feature, a second coding feature, a third coding feature, a fourth coding feature and a fifth coding feature with gradually decreasing resolution; The aggregation unit is used to aggregate the encoded features through the strip feature extraction module and the deconvolution operation, and to embed the features in combination with the cross embedding module to obtain intermediate features. The intermediate features include aggregated features, first embedded features and second embedded features. The deconvolution operation includes deconvolution, batch normalization and ReLU activation function connected in sequence. The integration unit is used to scale-integrate intermediate features through the strip feature extraction module and max pooling operation, and combine them with the feature pyramid to obtain fused features at different levels, including a third fused feature, a fourth fused feature and a fifth fused feature.
[0048] The detection unit includes: The second construction unit is used to construct multiple sequentially connected codecs. Each codec includes multiple levels of encoding and decoding layers. The multiple levels of each encoding layer are connected by downsampling operations, and the multiple levels of each decoding layer are connected by upsampling operations. The output features of the encoding layer are encoding features of different levels, and the output features of the decoding layer are decoding features. The third building unit is used to build a collaborative perception module, which includes a strip feature extraction module and a cross-embedding module. The fourth construction unit is used to embed the collaborative sensing module into each encoder and decoder to obtain the rail surface condition detection model. The input features of the collaborative sensing module are the output features of the last three levels of the encoding layer, the output features of the collaborative sensing module are the fused features of different levels, and the input features of the last three levels of the decoding layer include the output features of the collaborative sensing module.
[0049] It should be noted that the specific methods by which each module performs operations in the system described in the above embodiments have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0050] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0051] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting the surface condition of rails, characterized in that, include: Acquire railway image data, which includes images of different surface conditions of the rails; Based on the railway image data, feature encoding processing is performed to obtain encoded features at different levels; Based on the encoded features, feature fusion processing is performed, and combined with path aggregation and feature pyramid, fused features at different levels are obtained; Based on the encoded features and the fused features, feature decoding processing is performed to obtain the decoded features; Based on the decoding features, a rail surface condition detection model is constructed, and the target rail surface is detected using the rail surface condition detection model to obtain the defect type and defect location of the target rail surface.
2. The method for detecting the surface condition of rails according to claim 1, characterized in that, The obtained fusion features at different levels include: A strip feature extraction module and a cross-embedding module are constructed based on coding features, wherein the coding features include a first coding feature, a second coding feature, a third coding feature, a fourth coding feature, and a fifth coding feature with gradually decreasing resolution; The encoded features are aggregated by a strip feature extraction module and a deconvolution operation, and then embedded by a cross-embedding module to obtain intermediate features. The intermediate features include aggregated features, first embedded features and second embedded features. The deconvolution operation includes sequentially connected deconvolution, batch normalization and ReLU activation function. The intermediate features are scaled by a strip feature extraction module and a max pooling operation, and combined with a feature pyramid to obtain fused features at different levels, including a third fused feature, a fourth fused feature, and a fifth fused feature.
3. The method for detecting the surface condition of rails according to claim 2, characterized in that, The intermediate features obtained include: The fifth encoded feature is deconvolved using a deconvolution operation to obtain the first deconvolution feature. The third and fourth coding features are extracted using the strip feature extraction module to obtain the first and second extracted features. The first deconvolution feature and the second extracted feature are concatenated to obtain the first concatenated feature. The first concatenated feature is deconvolved using a deconvolution operation to obtain the second deconvolution feature; The aggregated feature is obtained by concatenating the second deconvolution feature and the first extracted feature. The fifth encoding feature and the second deconvolution feature are respectively embedded through the cross-embedding module to obtain the first embedded feature and the second embedded feature.
4. The method for detecting the surface condition of rails according to claim 2, characterized in that, The combined feature pyramid yields fused features at different levels, including: The aggregated features are extracted using the strip feature extraction module to obtain the third fused feature; The aggregated features are processed by max pooling to obtain the first pooled features; The second concatenated feature is obtained by concatenating the first pooling feature and the second embedding feature. The second splicing feature is extracted using the strip feature extraction module to obtain the fourth fused feature; The second concatenated feature is concatenated with the first embedded feature after undergoing max pooling to obtain the fifth fused feature.
5. The method for detecting the surface condition of rails according to claim 2, characterized in that, The feature extraction steps of the strip feature extraction module are as follows: The input features of the strip feature extraction module are subjected to average pooling and max pooling operations respectively to obtain average pooling features and max pooling features. The average pooling features are sequentially subjected to convolution and upsampling operations to obtain the first strip pooling feature. The max pooling features are sequentially subjected to convolution and upsampling operations to obtain the second strip pooling features. The first and second band pooling features are concatenated to obtain the third concatenated feature; The third concatenated feature is sequentially subjected to convolution, batch normalization, and ReLU activation to obtain the strip feature. The input features and the strip features of the strip feature extraction module are multiplied by a matrix to obtain the output features of the strip feature extraction module.
6. The method for detecting the surface condition of rails according to claim 2, characterized in that, The feature embedding steps of the cross-embedding module are as follows: The input features of the cross-embedding module are weighted using an efficient channel attention mechanism to obtain the first enhanced feature; The input features of the cross-embedding module are weighted through the attention module to obtain the second enhanced features. The attention module includes a depthwise separable convolution, layer normalization, multi-head self-attention mechanism, random depth module and addition module connected in sequence. The second enhanced feature is extracted through a feedforward network to obtain the third enhanced feature. The feedforward network includes a layer normalization layer, a fully connected layer, a depthwise separable convolution, a GeLU activation function, a random depth module, and an addition module connected in sequence. The first and third enhanced features are concatenated to obtain the output features of the cross-embedding module.
7. The method for detecting the surface condition of rails according to claim 1, characterized in that, The rail surface condition detection model constructed based on the decoded features includes: Construct multiple sequentially connected codecs, each codec including multiple levels of encoding and decoding layers, wherein the multiple levels of each encoding layer are connected by downsampling operations, the multiple levels of each decoding layer are connected by upsampling operations, the output features of the encoding layer are the encoding features of different levels, and the output features of the decoding layer are the decoding features; A collaborative perception module is constructed, which includes a strip feature extraction module and a cross-embedding module; The collaborative sensing module is embedded in each encoder and decoder to obtain the rail surface condition detection model. The input features of the collaborative sensing module are the output features of the last three levels of the encoding layer, and the output features of the collaborative sensing module are the fused features of different levels. The input features of the last three levels of the decoding layer include the output features of the collaborative sensing module.
8. A rail surface condition inspection system, characterized in that, include: The acquisition unit is used to acquire railway image data, which includes images of different surface conditions of the rails; The encoding unit is used to perform feature encoding processing on the railway image data to obtain encoded features at different levels; The fusion unit is used to perform feature fusion processing based on the encoded features, and combine path aggregation and feature pyramid to obtain fused features at different levels. A decoding unit is used to perform feature decoding processing based on the encoded features and the fused features to obtain decoded features; The detection unit is used to construct a rail surface condition detection model based on the decoded features, and to detect the target rail surface using the rail surface condition detection model to obtain the defect type and defect location of the target rail surface.
9. The rail surface condition inspection system according to claim 8, characterized in that, The fusion unit includes: The first construction unit is used to construct a strip feature extraction module and a cross-embedding module based on the coding features, wherein the coding features include a first coding feature, a second coding feature, a third coding feature, a fourth coding feature and a fifth coding feature with gradually decreasing resolution; The aggregation unit is used to aggregate the encoded features through the strip feature extraction module and the deconvolution operation, and to embed the features in combination with the cross embedding module to obtain intermediate features. The intermediate features include aggregated features, first embedded features and second embedded features. The deconvolution operation includes deconvolution, batch normalization and ReLU activation function connected in sequence. The integration unit is used to scale-integrate intermediate features through the strip feature extraction module and max pooling operation, and combine them with the feature pyramid to obtain fused features at different levels, including a third fused feature, a fourth fused feature and a fifth fused feature.
10. The rail surface condition detection system according to claim 8, characterized in that, The detection unit includes: The second construction unit is used to construct multiple sequentially connected codecs. Each codec includes multiple levels of encoding and decoding layers. The multiple levels of each encoding layer are connected by downsampling operations, and the multiple levels of each decoding layer are connected by upsampling operations. The output features of the encoding layer are encoding features of different levels, and the output features of the decoding layer are decoding features. The third building unit is used to build a collaborative perception module, which includes a strip feature extraction module and a cross-embedding module. The fourth construction unit is used to embed the collaborative sensing module into each encoder and decoder to obtain the rail surface condition detection model. The input features of the collaborative sensing module are the output features of the last three levels of the encoding layer, the output features of the collaborative sensing module are the fused features of different levels, and the input features of the last three levels of the decoding layer include the output features of the collaborative sensing module.
Citation Information
Patent Citations
Railway steel rail surface state detection method and system based on image semantic segmentation
CN119360127A
Track surface defect detection system made of YOLOv8-based steel
CN120672724A