A high-speed railway high and steep slope state monitoring and identification method based on YOLOv5
By integrating YOLOv5 and the improved STANet, the problem of geometric consistency modeling between multiple inspection results in the existing technology is solved, realizing the technical problem of cross-time relativity, improving the technical problem of high-speed railway steep slope condition monitoring. By introducing confidence embedding, correlation volume construction and offset sampling attention, combined with changing phase coding and historical baseline hierarchical early warning, the fine identification and long-term stable monitoring of high-speed railway steep slope defects are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI INTERCITY RAILWAY CO LTD
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies for monitoring steep slopes on high-speed railways lack modeling for geometric consistency between multiple inspection results, leading to misjudgments of changes in perspective or lighting as actual damage changes. This results in insufficient stability of the identification results and difficulty in distinguishing between structural changes and surface appearance changes, thus reducing the accuracy of the judgment.
By combining YOLOv5 with the improved STANet, and through geometric alignment under mileage and extrinsic parameter constraints, confidence embedding, correlation volume construction and offset sampling attention are introduced. Combined with phase change coding and historical baseline hierarchical early warning, the system can achieve refined monitoring and long-term stable monitoring of the condition of steep slopes on high-speed railways.
By integrating YOL0v5 and the improved STANet, cross-temporal geometric alignment was achieved, improving the stability of change detection. False changes were suppressed through dual decoding of structure and appearance. Combined with change phase encoding and historical baseline hierarchical early warning, refined identification and long-term stable monitoring of high-speed railway steep slope defects were realized.
Smart Images

Figure CN122368569A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and deep learning technology, and in particular to a method for monitoring and identifying the condition of steep slopes on high-speed railways based on YOLOv5. Background Technology
[0002] With the continuous expansion of high-speed railway construction and the increasing proportion of lines in mountainous and hilly areas, steep slopes have become one of the important infrastructure issues affecting railway operation safety. Affected by multiple factors such as rainfall erosion, freeze-thaw cycles, weathering, and geological structure, steep slopes are prone to defects such as crack propagation, rock spalling, and rockfall accumulation. If these defects are not detected and assessed in time, they can pose significant hidden dangers to train operation safety. For the monitoring and defect identification of slopes along high-speed railways, existing technologies are gradually introducing image acquisition equipment, drone inspection platforms, and deep learning-based automatic identification algorithms to replace manual inspection methods and improve inspection efficiency and coverage. Currently, widely used solutions often employ convolutional neural networks for target detection in single-phase images or combine two-phase images to extract change areas, used to locate cracks, spalling, and rockfall areas.
[0003] Existing target detection models typically identify objects directly from single inspection images, lacking modeling for the geometric consistency between multiple inspections within the same mileage interval. When faced with changes in the inspection platform's posture, differences in shooting angles, and distance fluctuations, they easily misjudge changes in angle or lighting as genuine damage changes, leading to insufficient stability in the identification results. Most existing change detection networks rely on simple feature difference or attention mechanisms for cross-temporal comparison, failing to fully integrate inspection trajectories and mileage information from outside the camera for accurate alignment. This makes it difficult to achieve reliable pixel-level correspondences in scenarios with dramatic spatial undulations, such as steep slopes. Furthermore, existing methods often treat the entire changed area as a risk indicator, lacking the ability to distinguish between structural changes and surface appearance changes. Factors such as post-rain wetness, shading, or vegetation cover often cause large-area pseudo-change responses, thereby reducing the accuracy of identifying real engineering risks.
[0004] Therefore, how to provide a YOLOv5-based method for monitoring and identifying the condition of steep slopes on high-speed railways is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5. This invention achieves cross-temporal geometric alignment under mileage and extrinsic parameter constraints by integrating YOLOv5 and an improved STANet. It introduces confidence embedding, correlation volume construction, and offset sampling attention to improve the stability of change detection. It employs dual decoding of structure and appearance to suppress spurious changes. By combining change phase encoding and historical baseline hierarchical early warning, it achieves refined identification and long-term stable monitoring of the evolution of diseases in steep slopes of high-speed railways.
[0006] A method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to an embodiment of the present invention includes the following steps: Step 1: Collect slope images of the same mileage interval at the first and second times, and obtain the corresponding mileage markers and camera extrinsic data; Step 2: Based on the mileage markers and camera extrinsic data, perform viewpoint reprojection on the slope image at the first moment to generate a reprojected image, and calculate the pixel correspondence to form an alignment confidence map; Step 3: Input the slope image at the second time step into the YOLOv5 detection network, and output the category label and bounding box coordinates of the disease targets; Step 4: Input the reprojected image and the slope image at the second time step into the improved STANet change detection network, and perform weighted fusion on the intermediate features based on the alignment confidence map to output the change feature map; Step 5: Input the change feature map into the structural change decoding head and the appearance change decoding head respectively to generate the structural change probability map and the appearance change probability map, and generate the risk change probability map; Step 6: Extract the target region from the risk change probability map based on the bounding box coordinates, calculate the change phase and generate the change phase code, and fuse the change phase code with the category label to generate the state category code; Step 7: Based on the state category code and risk change probability map, calculate the changes in crack length, spalling area and rockfall coverage area, and output the early warning level and disease location results in combination with the historical baseline distribution.
[0007] Optionally, step one specifically includes: Slope inspection images are collected along the high-speed railway line at preset sampling intervals, and the inspection area is divided into multiple mileage intervals according to the line mileage. At the first and second time points, corresponding slope images were acquired for the same mileage interval. Simultaneously acquire camera extrinsic data corresponding to the slope image at the first time point and the slope image at the second time point. The camera extrinsic data includes camera spatial position and camera attitude parameters. The slope images at the first and second times are associated and stored with the mileage interval identifier, acquisition timestamp, and camera extrinsic data.
[0008] Optionally, step two specifically involves: Based on the camera extrinsic data corresponding to the slope image at the first moment and the camera extrinsic data corresponding to the slope image at the second moment, the relative pose transformation relationship between the camera poses at the two moments is calculated in a unified line coordinate system. Based on the relative pose transformation relationship, a pixel back projection model is constructed, and each pixel in the slope image at the first moment is mapped to three-dimensional space according to the corresponding ray direction. By combining the terrain model or depth estimation results corresponding to the mileage interval of the slope, spatial intersection point calculation is performed on the ray and the terrain model to obtain the three-dimensional coordinates of the pixel; The three-dimensional coordinates are reprojected onto the imaging plane at the second time based on the camera extrinsic data at the second time, generating a reprojected image. A pixel-by-pixel position comparison is performed between the reprojected image and the slope image at the second time step. The matching weight is calculated based on the distance between the reprojected coordinates and the target pixel coordinates, and the matching weight is normalized to form an alignment confidence map.
[0009] Optionally, step three specifically includes: Radial distortion correction is performed based on the camera intrinsic parameters corresponding to the slope image at the second time point, and bilinear resampling is performed on the slope image at the second time point according to the preset inspection imaging scale; The resampled slope image at the second time step is input into the YOLOv5 detection network backbone to obtain multi-level convolutional feature maps. In the feature fusion layer, channel recalibration matrix and spatial consistency mapping constraints are applied to the multi-level convolutional feature maps to generate multi-scale detection feature maps. Based on the bounding box size distribution of cracks, spalling, falling rocks and protective structure anomalies in historical inspection images of mileage intervals, the width and height intervals of each category in pixel space are statistically analyzed, and a time-stable anchor box set is constructed on the multi-scale detection feature map according to the width and height intervals. The center coordinate offset and width and height parameters of the bounding box are regressed at the corresponding positions in the time-stable anchor box set, and the disease category probability vector is generated simultaneously to form a disease target candidate set; Based on the intersection-union ratio (IU) threshold between bounding boxes in the disease target candidate set, perform class-by-class spatial suppression processing, and output the disease category label and bounding box coordinates in the disease target set.
[0010] Optionally, step four specifically involves: The improved STANet change detection network includes a dual-temporal encoder, an aligned confidence embedding layer, a cross-temporal correlation construction layer, a cross-temporal attention fusion layer, and a change feature decoder; The reprojected image and the slope image at the second time step are respectively input into the dual-temporal encoder. The dual-temporal encoder is composed of a shared parameter convolutional backbone network and a multi-scale feature pyramid, and outputs a first-temporal multi-scale feature set and a second-temporal multi-scale feature set. The aligned confidence map is input into the aligned confidence embedding layer. The aligned confidence map is resampled scale by scale according to the downsampling factor of each scale feature map in the first phase multi-scale feature set to obtain the scale-by-scale confidence feature map. The scale-by-scale confidence feature map is then concatenated with the first phase feature map and the second phase feature map of the corresponding scale to generate the scale-by-scale confidence enhancement feature map. For each scale of the confidence-enhanced feature map, a local window correlation calculation is performed. The local window correlation calculation includes determining a preset window range centered on each position in the second temporal feature map, retrieving candidate positions in the first temporal feature map within the preset window range, calculating the similarity between the second temporal feature vector and the first temporal feature vector of the candidate position, and forming a scale-wise correlation volume feature tensor. A position-wise gating coefficient matrix is generated from the scale-wise confidence feature map. The position-wise gating coefficient matrix is then multiplied with the scale-wise correlation volume feature tensor. The result of the multiplication operation is then normalized to obtain the confidence-constrained correlation volume. In the cross-temporal attention fusion layer, a cross-temporal sampling offset set is generated for each position in the second temporal feature map based on the confidence constraint correlation. Offset sampling is performed in the first temporal feature map according to the cross-temporal sampling offset set to obtain an aligned sampling feature set. The second temporal feature vector is used as the query vector, and the feature vectors in the aligned sampling feature set are used as the key vector and value vector. Cross-temporal attention calculation is performed, and a weighted aggregation operation is performed on the key-value features to output a scale-wise fused feature map. The scale-wise fused feature map is input into the change feature decoder, which includes a top-down upsampling path and cross-scale jump connections. The change feature decoder performs cross-scale fusion on the fused feature map at each scale and outputs a change feature map.
[0011] Optionally, step five specifically includes: The change feature map is input into a shared coding branch, which consists of multi-layer convolution operators and downsampling units, and outputs a basic change feature tensor. The basic change feature tensor is input into the structural change decoding branch and the appearance change decoding branch respectively. The structural change decoding branch is connected in sequence to the directional convolution operator group, the dilated convolution operator group and the scale aggregation operator group. The directional convolution operator group includes multiple convolution kernels with different orientations. The appearance change decoding branch is connected in sequence to the frequency domain decomposition operator group, the color channel transformation operator group and the scale fusion operator group. In the structural change decoding branch, the pixel gradient direction distribution is calculated on the feature map output by the scale aggregation operator group, and continuous response regions are filtered according to a preset direction consistency threshold to generate a structural change probability map. In the appearance change decoding branch, the brightness difference magnitude and local texture correlation are calculated on the feature map output by the scale fusion operator group, and high-frequency disturbance regions are filtered according to a preset frequency band suppression threshold to generate an appearance change probability map. In the risk fusion layer, a pixel-by-pixel scaling operation is performed on the structural change probability map and the appearance change probability map, and upper and lower limit clipping is performed on the mapping result to generate a risk change probability map.
[0012] Optionally, step six specifically includes: Based on the bounding box coordinates corresponding to the disease target, the target area is extracted from the risk change probability map corresponding to the slope image at the first time and the slope image at the second time. The number of pixels in the target area whose risk change probability is greater than the preset change threshold is counted, and the change ratio at the first time and the change ratio at the second time are calculated respectively. Perform a difference operation on the percentage change at the first time point and the percentage change at the second time point to obtain the difference in percentage change, and calculate the rate of change per unit time in combination with the time interval between the first time point and the second time point; Based on the correspondence between the change ratio difference and the unit time change rate and the preset phase threshold range, the disease target is divided into new phase, extended phase, stable phase and retraction phase, and the corresponding phase number is written into the change phase code. The changed phase code is mapped to a phase vector in one-hot encoding form, and then concatenated with the category vector corresponding to the disease target category label to generate a state category code.
[0013] Optionally, step seven specifically includes: Select the disease target set corresponding to the disease category label according to the state category code, and extract the target area in the risk change probability map according to the bounding box coordinates; Binarization is performed on pixels within the target area whose risk change probability is greater than the risk threshold configured by the system to generate a target mask. Connected component labeling is performed on the target mask and connected components with a number of pixels less than the minimum connected component threshold configured by the system are filtered out to form an effective change mask. When the disease category label is crack, skeleton extraction processing is performed on the effective change mask to generate a crack skeleton pixel set. The adjacent connection relationship between skeleton pixels in the crack skeleton pixel set is counted and the number of connection segments is accumulated. The accumulated number of connection segments is converted into crack length change based on the inspection imaging scale. When the disease category label is peeling, the number of pixels in the effective change mask is counted and converted into the change in peeling area according to the inspection imaging scale. When the disease category label is falling rocks, the number of pixels in the effective change mask is counted and converted into the change in falling rock coverage area according to the inspection imaging scale. The changes in crack length, peeling area, and rockfall coverage area corresponding to this inspection are compared with the quantile threshold set of the historical baseline distribution. The interval comparison results are mapped to the warning level, and the warning level and disease location results are output.
[0014] The beneficial effects of this invention are: This invention constructs a collaborative framework integrating YOLOv5 target detection and improved STANet cross-temporal change analysis. Based on mileage constraints and camera extrinsic-driven geometric reprojection, it establishes a pixel-level alignment confidence modeling mechanism. Addressing the instability in change recognition caused by perspective fluctuations, lighting differences, and terrain undulations in high-speed railway steep slope inspections, it introduces a joint design of alignment confidence embedding, local correlation volume construction, and cross-temporal offset sampling attention calculation, significantly improving the accuracy of cross-temporal feature alignment and consistency with real change response. In the change analysis stage, it constructs dual decoding branches for structural and appearance changes, using directional convolution, dilated convolution, and frequency domain decomposition operators for collaborative modeling. Geometric contour evolution and surface texture perturbation, combined with pixel-by-pixel proportional mapping to form a risk change probability map, effectively suppresses spurious change interference caused by rain stains, shadows, and vegetation; in the state modeling stage, a change phase encoding rule is introduced to quantify the crack expansion, spalling growth, and rockfall evolution process into four phases: new, expansion, stable, and shrinkage, which are then fused with the detection category to form a state category encoding; further, by combining the mileage interval-level historical baseline distribution and quantile threshold mapping strategy, graded early warning and spatial positioning output are provided for changes in crack length, spalling area, and rockfall coverage, realizing refined identification, long-term stable monitoring, and engineering-level risk early warning of the high-speed railway steep slope disease evolution process. Attached Figure Description
[0015] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1This is a schematic diagram of the overall process of a high-speed railway steep slope condition monitoring and identification method based on YOLOv5 proposed in this invention; Figure 2 This is an overall structural diagram of the improved STANet change detection network in this invention; Figure 3 This is a schematic diagram of the process for calculating and outputting early warnings based on the changes in crack length, spalling area, and rockfall coverage according to historical baseline distribution in this invention. Detailed Implementation
[0016] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0017] refer to Figure 1-3 A method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 includes the following steps: Step 1: Collect slope images of the same mileage interval at the first and second times, and obtain the corresponding mileage markers and camera extrinsic data; Step 2: Based on the mileage markers and camera extrinsic data, perform viewpoint reprojection on the slope image at the first moment to generate a reprojected image, and calculate the pixel correspondence to form an alignment confidence map; Step 3: Input the slope image at the second time step into the YOLOv5 detection network, and output the category label and bounding box coordinates of the disease targets; Step 4: Input the reprojected image and the slope image at the second time step into the improved STANet change detection network, and perform weighted fusion on the intermediate features based on the alignment confidence map to output the change feature map; Step 5: Input the change feature map into the structural change decoding head and the appearance change decoding head respectively to generate the structural change probability map and the appearance change probability map, and generate the risk change probability map; Step 6: Extract the target region from the risk change probability map based on the bounding box coordinates, calculate the change phase and generate a change phase code, and fuse the change phase code with the category label to generate a state category code; Step 7: Based on the state category code and the risk change probability map, calculate the change in crack length, the change in spalling area, and the change in rockfall coverage area, and output the early warning level and disease location results in combination with the historical baseline distribution.
[0018] In this embodiment, step one specifically includes: Slope inspection images are collected along the high-speed railway line at preset sampling intervals, and the inspection area is divided into multiple mileage intervals according to the line mileage. At the first and second time points, corresponding slope images were acquired for the same mileage interval. Simultaneously acquire camera extrinsic data corresponding to the slope image at the first time point and the slope image at the second time point. The camera extrinsic data includes camera spatial position and camera attitude parameters. The slope images at the first and second times are associated and stored with the mileage interval identifier, acquisition timestamp, and camera extrinsic data.
[0019] In this implementation, the slope inspection along the high-speed railway is completed by an imaging device mounted on a track inspection vehicle or a drone. The imaging device includes a visible light camera and a positioning and attitude measurement unit, which includes a satellite positioning module and an inertial measurement unit. Image acquisition is triggered along the railway line at a preset sampling interval, which is set to 5 to 30 meters based on the distance along the railway line. The inspection area is divided into multiple continuous mileage intervals according to the railway mileage, with each mileage interval corresponding to a length of 50 to 200 meters and assigned a unique number. Slope images are acquired for the same mileage interval at a first time and a second time. The corresponding camera extrinsic parameter data is acquired synchronously, including the spatial position coordinates in the track coordinate system and attitude parameters such as heading angle, pitch angle, and roll angle, and is synchronized with the image exposure time timestamp.
[0020] In this embodiment, step two specifically includes: Based on the camera extrinsic data corresponding to the slope image at the first moment and the camera extrinsic data corresponding to the slope image at the second moment, the relative pose transformation relationship between the camera poses at the two moments is calculated in a unified line coordinate system. Based on the relative pose transformation relationship, a pixel back projection model is constructed, and each pixel in the slope image at the first moment is mapped to three-dimensional space according to the corresponding ray direction. By combining the terrain model or depth estimation results corresponding to the mileage interval where the slope is located, spatial intersection point calculation is performed on the ray and the terrain model to obtain the three-dimensional coordinates of the pixel; The three-dimensional coordinates are reprojected onto the imaging plane at the second time based on the camera extrinsic data at the second time, generating a reprojected image. A pixel-by-pixel position comparison is performed between the reprojected image and the slope image at the second time step. The matching weight is calculated based on the distance between the reprojected coordinates and the target pixel coordinates, and the matching weight is normalized to form an alignment confidence map.
[0021] In this implementation, the terrain model adopts a three-dimensional voxel occupancy model corresponding to the mileage interval. The three-dimensional voxel occupancy model is divided into regular cubic units under a unified route coordinate system. Each cubic unit stores an occupancy probability value, which is generated by accumulating multiple inspection point clouds or stereo matching results. The spatial intersection calculation includes: generating a three-dimensional ray based on the back projection direction of pixels in the slope image at the first moment, with the camera's spatial position as the starting point; determining the sequence of voxel units that the three-dimensional ray will traverse sequentially according to voxel grid indexing rules; following a coarse-to-fine hierarchical search strategy, firstly detecting voxel units with an occupation probability exceeding a first threshold along the ray direction in the low-resolution voxel level as candidate intersection intervals; continuing to traverse voxel units along the ray direction in the high-resolution voxel level corresponding to the candidate intersection intervals, and detecting voxel units with an occupation probability exceeding a second threshold; when the three-dimensional ray first enters a voxel unit with an occupation probability exceeding the second threshold, taking the center position of the voxel unit as the initial intersection point estimate; defining a local voxel set near the initial intersection point estimate, and performing multiple refinement searches in the local voxel set based on the voxel boundary and the ray direction to determine the final three-dimensional coordinates of the intersection point between the ray and the slope entity; In the aforementioned voxel occupancy model, each voxel unit stores an occupancy probability value between 0 and 1. A candidate crossover threshold of 0.35 to 0.55 is used at the low-resolution voxel level, and a crossover determination threshold of 0.65 to 0.85 is used at the high-resolution voxel level. The side length of the low-resolution voxels is set to 0.8 meters to 2.0 meters, and the side length of the high-resolution voxels is set to 0.1 meters to 0.3 meters. A step size of 0.5 meters to 1.5 meters is used along the ray direction in the coarse layer stage, and a step size of 0.05 meters to 0.2 meters is used in the fine layer stage. A local search region with a side length of 0.5 meters to 1.5 meters is constructed near the initial intersection point to refine the intersection point.
[0022] In this embodiment, step three specifically includes: Radial distortion correction is performed based on the camera intrinsic parameters corresponding to the slope image at the second time point, and bilinear resampling is performed on the slope image at the second time point according to the preset inspection imaging scale; The resampled slope image at the second time step is input into the YOLOv5 detection network backbone to obtain multi-level convolutional feature maps. In the feature fusion layer, channel recalibration matrix and spatial consistency mapping constraints are applied to the multi-level convolutional feature maps to generate multi-scale detection feature maps. Based on the bounding box size distribution of cracks, spalling, falling rocks and protective structure anomalies in historical inspection images of mileage intervals, the width and height intervals of each category in pixel space are statistically analyzed, and a time-stable anchor box set is constructed on the multi-scale detection feature map according to the width and height intervals. The center coordinate offset and width and height parameters of the bounding box are regressed at the corresponding positions in the time-stable anchor box set, and the disease category probability vector is generated simultaneously to form a disease target candidate set; Based on the intersection-union ratio (IU) threshold between bounding boxes in the disease target candidate set, perform class-by-class spatial suppression processing, and output the disease category label and bounding box coordinates in the disease target set.
[0023] In this implementation, the inspection imaging scale is obtained by calibration of the inspection equipment before deployment, including imaging resolution and lens field of view parameters. The imaging resolution is set to 0.5 cm to 2 cm per pixel corresponding to the actual length, and the field of view is set to 40 degrees to 75 degrees, which serves as a unified benchmark for subsequent image resampling. The spatial consistency mapping constraint is obtained by back-calculation of the sampling positions of feature maps of different scales in the original image coordinate system. A pixel coordinate mapping table between feature layers is constructed and a spatial constraint matrix is generated accordingly. The spatial constraint matrix performs matrix multiplication on the feature channels at the corresponding positions during the fusion stage. The intersection-union ratio (IUGR) threshold is pre-configured by the system and set to 0.45 to 0.65, which is used to determine whether the bounding boxes overlap during class-by-class spatial suppression processing.
[0024] In this embodiment, step four specifically includes: The improved STANet change detection network includes a dual-temporal encoder, an aligned confidence embedding layer, a cross-temporal correlation construction layer, a cross-temporal attention fusion layer, and a change feature decoder; The reprojected image and the slope image at the second time step are respectively input into the dual-temporal encoder. The dual-temporal encoder is composed of a shared parameter convolutional backbone network and a multi-scale feature pyramid, and outputs a first-temporal multi-scale feature set and a second-temporal multi-scale feature set. The aligned confidence map is input into the aligned confidence embedding layer. The aligned confidence map is resampled scale by scale according to the downsampling factor of each scale feature map in the first phase multi-scale feature set to obtain the scale-by-scale confidence feature map. The scale-by-scale confidence feature map is then concatenated with the first phase feature map and the second phase feature map of the corresponding scale to generate the scale-by-scale confidence enhancement feature map. For each scale of the confidence-enhanced feature map, a local window correlation calculation is performed. The local window correlation calculation includes determining a preset window range centered on each position in the second temporal feature map, retrieving candidate positions in the first temporal feature map within the preset window range, calculating the similarity between the second temporal feature vector and the first temporal feature vector of the candidate position, and forming a scale-wise correlation volume feature tensor. A position-wise gating coefficient matrix is generated from the scale-wise confidence feature map. The position-wise gating coefficient matrix is then multiplied with the scale-wise correlation volume feature tensor. The result of the multiplication operation is then normalized to obtain the confidence-constrained correlation volume. In the cross-temporal attention fusion layer, a cross-temporal sampling offset set is generated for each position in the second temporal feature map based on the confidence constraint correlation. Offset sampling is performed in the first temporal feature map according to the cross-temporal sampling offset set to obtain an aligned sampling feature set. The second temporal feature vector is used as the query vector, and the feature vectors in the aligned sampling feature set are used as the key vector and value vector. Cross-temporal attention calculation is performed, and a weighted aggregation operation is performed on the key-value features to output a scale-wise fused feature map. The scale-wise fused feature map is input into the change feature decoder, which includes a top-down upsampling path and cross-scale jump connections. The change feature decoder performs cross-scale fusion on the fused feature map at each scale and outputs a change feature map.
[0025] In this implementation, the improved STANet change detection network inherits the dual-temporal input mode and encoder-decoder structure of the STANet network in its overall framework. The two temporal slope images are respectively fed into a convolutional encoder with shared parameters to extract multi-scale features, and a cross-scale representation is formed through a multi-level feature pyramid. In the decoding stage, the spatial resolution is restored step by step along the top-down path and the change feature map is output by combining jump connections. The above process maintains the original STANet network's joint modeling method for multi-scale spatial information and temporal differences. Building upon this foundation, the improved STANet change detection network introduces an aligned confidence embedding layer, a cross-temporal correlation construction layer, and a cross-temporal attention fusion layer. It performs scale-wise embedding on the aligned confidence map formed from the mileage constraint reprojection step, and combines it with the two-temporal features to constitute confidence enhancement features. Within each scale, it constructs local window correlation volumes and generates position-wise gating coefficient matrices, applying confidence modulation to the correlation volumes. Furthermore, it generates a set of cross-temporal sampling offset vectors based on the confidence constraint correlation volumes, performs offset sampling on the first-temporal feature map, and completes feature aggregation through cross-temporal attention calculation, thereby forming a fused feature map for decoding. Through the above improvements, the change detection process has been expanded from the original single feature difference method to a confidence-constrained correlation modeling and offset sampling fusion mechanism. This enables the cross-temporal feature alignment process and geometric reprojection results to form a synergistic constraint, reducing false change responses caused by viewpoint offset and illumination differences, and enhancing the ability to express structural changes such as crack propagation, new spalling, and rockfall accumulation. This improves the stability and consistency of change area location in long-term inspection scenarios of steep slopes.
[0026] In this embodiment, step five specifically includes: The change feature map is input into a shared coding branch, which consists of multi-layer convolution operators and downsampling units, and outputs a basic change feature tensor. The basic change feature tensor is input into the structural change decoding branch and the appearance change decoding branch respectively. The structural change decoding branch is connected in sequence to the directional convolution operator group, the dilated convolution operator group and the scale aggregation operator group. The directional convolution operator group includes multiple convolution kernels with different orientations. The appearance change decoding branch is connected in sequence to the frequency domain decomposition operator group, the color channel transformation operator group and the scale fusion operator group. In the structural change decoding branch, the pixel gradient direction distribution is calculated on the feature map output by the scale aggregation operator group, and continuous response regions are filtered according to a preset direction consistency threshold to generate a structural change probability map. In the appearance change decoding branch, the brightness difference magnitude and local texture correlation are calculated on the feature map output by the scale fusion operator group, and high-frequency disturbance regions are filtered according to a preset frequency band suppression threshold to generate an appearance change probability map. In the risk fusion layer, a pixel-by-pixel scaling operation is performed on the structural change probability map and the appearance change probability map, and upper and lower limit clipping is performed on the mapping result to generate a risk change probability map.
[0027] In this implementation, the directional convolution operator group in the structural change decoding branch uses four sets of two-dimensional convolution kernels with different directions. The kernel size is set to 3×3, and the direction angles correspond to 0°, 45°, 90°, and 135°, respectively. The dilated convolution operator group uses a two-level dilated convolution structure with dilation rates of 2 and 4. The scale aggregation operator group performs channel concatenation on the output features with different dilation rates and then performs compression through 1×1 convolution. During the pixel gradient direction screening process, regions with gradient direction differences between adjacent pixels not exceeding 15° are determined as continuous response regions, and the structural change probability threshold is set to 0.6 to 0.8. In the appearance change decoding branch, the frequency domain decomposition operator group uses two-dimensional discrete cosine transform to perform frequency band separation on the feature map and selects pixel positions with a mid-to-high frequency energy ratio higher than 0.35 as candidate regions. The color channel transformation operator group maps RGB features to the Lab color space. The brightness difference amplitude threshold is set to 15 to 30 gray levels, and the texture correlation threshold is set to 0.4 to 0.6. In the risk fusion layer, a scaling factor of 0.6 to 0.8 is applied to the structural change probability map, and a scaling factor of 0.2 to 0.4 is applied to the appearance change probability map. The fusion result is then limited to the range of 0 to 1 and output as a risk change probability map.
[0028] In this embodiment, step six specifically includes: Based on the bounding box coordinates corresponding to the disease target, the target area is extracted from the risk change probability map corresponding to the slope image at the first time and the slope image at the second time. The number of pixels in the target area whose risk change probability is greater than the preset change threshold is counted, and the change ratio at the first time and the change ratio at the second time are calculated respectively. Perform a difference operation on the percentage change at the first time point and the percentage change at the second time point to obtain the difference in percentage change, and calculate the rate of change per unit time in combination with the time interval between the first time point and the second time point; Based on the correspondence between the change ratio difference and the unit time change rate and the preset phase threshold range, the disease target is divided into new phase, extended phase, stable phase and retraction phase, and the corresponding phase number is written into the change phase code. The changed phase code is mapped to a phase vector in one-hot encoding form, and then concatenated with the category vector corresponding to the disease target category label to generate a state category code.
[0029] In this implementation, the change threshold and phase threshold range are obtained offline from the historical inspection database. The probability distribution of risk changes formed by multiple inspections within the same mileage range is analyzed by quantiles, and different quantile ranges are mapped to four types of phases: new, expanded, stable, and contracted. The time interval of the rate of change per unit time is directly calculated from the collection timestamp. The category vector is output by the YOLOv5 detection network classification head and normalized. The phase vector and category vector are concatenated in the same feature dimension order to form a state category code, which is written into the inspection result record table for subsequent mileage range-level risk assessment and historical baseline update.
[0030] In this embodiment, step seven specifically includes: Select the disease target set corresponding to the disease category label according to the state category code, and extract the target area in the risk change probability map according to the bounding box coordinates; Binarization is performed on pixels within the target area whose risk change probability is greater than the risk threshold configured by the system to generate a target mask. Connected component labeling is performed on the target mask and connected components with a number of pixels less than the minimum connected component threshold configured by the system are filtered out to form an effective change mask. When the disease category label is crack, skeleton extraction processing is performed on the effective change mask to generate a crack skeleton pixel set. The adjacent connection relationship between skeleton pixels in the crack skeleton pixel set is counted and the number of connection segments is accumulated. The accumulated number of connection segments is converted into crack length change based on the inspection imaging scale. When the disease category label is peeling, the number of pixels in the effective change mask is counted and converted into the change in peeling area according to the inspection imaging scale. When the disease category label is falling rocks, the number of pixels in the effective change mask is counted and converted into the change in falling rock coverage area according to the inspection imaging scale. The changes in crack length, peeling area, and rockfall coverage area corresponding to this inspection are compared with the quantile threshold set of the historical baseline distribution. The interval comparison results are mapped to the warning level, and the warning level and disease location results are output.
[0031] In this implementation, the risk threshold and the minimum connected component threshold are determined offline based on historical inspection data within the same mileage interval and are updated periodically with each inspection batch. The skeleton extraction process uses a thinning operator to converge the binary mask into a single-pixel width curve structure. The inspection imaging scale is obtained by jointly converting the equipment calibration parameters and the shooting distance, and is used to map the number of pixels to physical length or area. The historical baseline distribution records the statistical sequences of the changes in crack length, the changes in peeling area, and the changes in rockfall coverage area in multiple inspections. The historical baseline distribution is maintained using a sliding time window method, with each mileage interval independently storing the change sequence of the most recent multiple inspections. The quantile threshold set is calculated and generated from the change sequence and is updated in real time as new data is written.
[0032] Example 1: To verify the feasibility of this invention in practice, it was applied to a section of steep slopes with a continuous length of approximately 12 kilometers along a high-speed railway line in a mountainous area of southwestern China. This section has significant topographic relief, complex lithology, and locally exhibits strong weathering layers and well-developed joints and fissures. During the flood season, it frequently experiences hazards such as crack expansion, localized spalling, and rockfall. Traditional manual inspection methods rely on experience-based judgment, which is inefficient and makes it difficult to generate long-term quantitative comparative data. Previous automated methods based on single-phase image recognition are affected by changes in shooting angle, lighting differences, and vegetation obstruction during multiple inspections, resulting in a high false alarm rate and making it difficult to consistently reflect the true evolution trend of the damage.
[0033] In this embodiment, the inspection platform uses a track inspection vehicle equipped with a high-definition visible light camera and an inertial navigation positioning unit to run along the line and periodically photograph the slope, with an inspection interval of once every two weeks. The system first divides the inspection area according to the line mileage, with each 200-meter interval as a mileage interval. In two inspection batches, slope images corresponding to the same interval are collected, and the spatial position and attitude parameters of the camera are recorded simultaneously. Subsequently, according to the method described in step two of this invention, the relative transformation relationship between the camera poses at two time points is calculated under a unified line coordinate system. Pixel-level backprojection and three-dimensional reprojection processing are performed on the image at the first time point. Under the constraints of the digital terrain model, a reprojected image with the same viewpoint as the second time point is generated, and pixel matching weights are further calculated to form an alignment confidence map, which is used to constrain subsequent cross-temporal feature fusion.
[0034] In the target detection phase, the slope image at the second time step, after distortion correction and scale normalization, is input into the YOLOv5 detection network backbone. Multi-scale feature fusion is achieved through channel recalibration matrix and spatial consistency mapping matrix. Simultaneously, a time-stable anchor frame set is constructed based on the size distribution of cracks, spalling, and falling rocks in historical inspections within this mileage interval, ensuring scale consistency of the detection results across multiple inspection batches. The output disease category labels and bounding box coordinates serve as the location basis for subsequent change analysis.
[0035] In the change detection phase, the reprojected image and the second-time image are simultaneously fed into the improved STANet change detection network. Pixel alignment reliability is introduced into the feature space through an alignment confidence embedding layer. Local window correlation volumes are constructed at each scale and confidence-gated modulation is applied. Simultaneously, a cross-temporal phase-shifted sampling attention mechanism is used to spatially compensate for the first-time features. Finally, the decoder outputs a change feature map. Subsequently, the change feature map enters a dual decoding branch for structural and appearance changes. The structural branch captures the crack edge direction and geometric continuity through directional convolution and dilated convolution, while the appearance branch characterizes brightness and texture perturbations through frequency domain decomposition and color space mapping, forming a unified risk change probability map in the risk fusion layer.
[0036] During the state modeling and engineering quantity calculation phase, the system extracts the target area from the risk change probability map based on the detection box, counts the proportion of pixels exceeding the risk threshold, and calculates the rate of change per unit time based on the time interval between two inspections. The system then classifies the defects into four phases: new, expanding, stable, and shrinking, and generates state category codes. Furthermore, the system performs skeletonization processing on the crack targets and converts their physical length according to the inspection imaging scale. It counts the number of pixels in the spalling and rockfall areas and converts them into actual areas. Simultaneously, it compares the current results with the historical baseline distribution formed by the most recent 12 inspections within the same mileage interval, outputs a three-level early warning level, and marks the spatial location of the defects on the GIS platform.
[0037] To verify the beneficial effects of the present invention, during a six-month trial run of the line, the method of the present invention was compared and evaluated with the traditional single-phase YOLO detection method and the conventional dual-phase change detection method. The experimental results are shown in Table 1.
[0038] Table 1. Performance Comparison of Different Methods in Mountainous Steep Slope Inspection
[0039] As shown in Table 1, the method of this invention achieves optimal performance across all four key indicators. The cross-batch consistency index measures the spatial overlap of detection results for the same diseased area in two consecutive inspections; a value closer to 1 indicates higher stability. This invention reduces the false alarm rate to 4.6% by fusing geometric reprojection constraints and confidence-guided cross-temporal methods, a reduction of over 50% compared to conventional change detection. In terms of crack length and spalling area measurement, the average error is controlled within 0.15 meters or 0.15 square meters, significantly better than the comparative methods. Furthermore, the tiered early warning mechanism based on historical baselines achieves an early warning compliance rate of 92.7%, effectively reducing the workload of on-site verification.
[0040] The results of the above implementation show that the present invention can stably complete cross-temporal disease identification, evolution status determination and engineering quantity quantification in the scenario of high-speed railways in complex mountainous areas. It can also achieve the early warning effect of engineering availability level through risk classification output driven by historical baseline, which fully verifies the feasibility and significant technical advantages of the present invention in actual deployment.
[0041] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5, characterized in that, Includes the following steps: Step 1: Collect slope images of the same mileage interval at the first and second times, and obtain the corresponding mileage markers and camera extrinsic data; Step 2: Based on the mileage markers and camera extrinsic data, perform viewpoint reprojection on the slope image at the first moment to generate a reprojected image, and calculate the pixel correspondence to form an alignment confidence map; Step 3: Input the slope image at the second time step into the YOLOv5 detection network, and output the category label and bounding box coordinates of the disease targets; Step 4: Input the reprojected image and the slope image at the second time step into the improved STANet change detection network, and perform weighted fusion on the intermediate features based on the alignment confidence map to output the change feature map; Step 5: Input the change feature map into the structural change decoding head and the appearance change decoding head respectively to generate the structural change probability map and the appearance change probability map, and generate the risk change probability map; Step 6: Extract the target region from the risk change probability map based on the bounding box coordinates, calculate the change phase and generate the change phase code, and fuse the change phase code with the category label to generate the state category code; Step 7: Based on the state category code and the risk change probability map, calculate the change in crack length, the change in spalling area, and the change in rockfall coverage area, and output the early warning level and disease location results in combination with the historical baseline distribution.
2. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step one specifically involves: Slope inspection images are collected along the high-speed railway line at preset sampling intervals, and the inspection area is divided into multiple mileage intervals according to the line mileage. At the first and second time points, corresponding slope images were acquired for the same mileage interval. Simultaneously acquire camera extrinsic data corresponding to the slope image at the first time point and the slope image at the second time point. The camera extrinsic data includes camera spatial position and camera attitude parameters. The slope images at the first and second times are associated and stored with the mileage interval identifier, acquisition timestamp, and camera extrinsic data.
3. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step two specifically involves: Based on the camera extrinsic data corresponding to the slope image at the first moment and the camera extrinsic data corresponding to the slope image at the second moment, the relative pose transformation relationship between the camera poses at the two moments is calculated in a unified line coordinate system. Based on the relative pose transformation relationship, a pixel back projection model is constructed, and each pixel in the slope image at the first moment is mapped to three-dimensional space according to the corresponding ray direction. By combining the terrain model or depth estimation results corresponding to the mileage interval of the slope, spatial intersection point calculation is performed on the ray and the terrain model to obtain the three-dimensional coordinates of the pixel; The three-dimensional coordinates are reprojected onto the imaging plane at the second time based on the camera extrinsic data at the second time, generating a reprojected image. A pixel-by-pixel position comparison is performed between the reprojected image and the slope image at the second time step. The matching weight is calculated based on the distance between the reprojected coordinates and the target pixel coordinates, and the matching weight is normalized to form an alignment confidence map.
4. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step three specifically involves: Radial distortion correction is performed based on the camera intrinsic parameters corresponding to the slope image at the second time point, and bilinear resampling is performed on the slope image at the second time point according to the preset inspection imaging scale; The resampled slope image at the second time step is input into the YOLOv5 detection network backbone to obtain multi-level convolutional feature maps. In the feature fusion layer, channel recalibration matrix and spatial consistency mapping constraints are applied to the multi-level convolutional feature maps to generate multi-scale detection feature maps. Based on the bounding box size distribution of cracks, spalling, falling rocks and protective structure anomalies in historical inspection images of mileage intervals, the width and height intervals of each category in pixel space are statistically analyzed, and a time-stable anchor box set is constructed on the multi-scale detection feature map according to the width and height intervals. The center coordinate offset and width and height parameters of the bounding box are regressed at the corresponding positions in the time-stable anchor box set, and the disease category probability vector is generated simultaneously to form a disease target candidate set; Based on the intersection-union ratio (IU) threshold between bounding boxes in the disease target candidate set, perform class-by-class spatial suppression processing, and output the disease category label and bounding box coordinates in the disease target set.
5. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step four specifically involves: The improved STANet change detection network includes a dual-temporal encoder, an aligned confidence embedding layer, a cross-temporal correlation construction layer, a cross-temporal attention fusion layer, and a change feature decoder; The reprojected image and the slope image at the second time step are respectively input into the dual-temporal encoder. The dual-temporal encoder is composed of a shared parameter convolutional backbone network and a multi-scale feature pyramid, and outputs a first-temporal multi-scale feature set and a second-temporal multi-scale feature set. The aligned confidence map is input into the aligned confidence embedding layer. The aligned confidence map is resampled scale by scale according to the downsampling factor of each scale feature map in the first phase multi-scale feature set to obtain the scale-by-scale confidence feature map. The scale-by-scale confidence feature map is then concatenated with the first phase feature map and the second phase feature map of the corresponding scale to generate the scale-by-scale confidence enhancement feature map. For each scale of the confidence-enhanced feature map, a local window correlation calculation is performed. The local window correlation calculation includes determining a preset window range centered on each position in the second temporal feature map, retrieving candidate positions in the first temporal feature map within the preset window range, calculating the similarity between the second temporal feature vector and the first temporal feature vector of the candidate position, and forming a scale-wise correlation volume feature tensor. A position-wise gating coefficient matrix is generated from the scale-wise confidence feature map. The position-wise gating coefficient matrix is then multiplied with the scale-wise correlation volume feature tensor. The result of the multiplication operation is then normalized to obtain the confidence-constrained correlation volume. In the cross-temporal attention fusion layer, a cross-temporal sampling offset set is generated for each position in the second temporal feature map based on the confidence constraint correlation. Offset sampling is performed in the first temporal feature map according to the cross-temporal sampling offset set to obtain an aligned sampling feature set. The second temporal feature vector is used as the query vector, and the feature vectors in the aligned sampling feature set are used as the key vector and value vector. Cross-temporal attention calculation is performed, and a weighted aggregation operation is performed on the key-value features to output a scale-wise fused feature map. The scale-wise fused feature map is input into the change feature decoder, which includes a top-down upsampling path and cross-scale jump connections. The change feature decoder performs cross-scale fusion on the fused feature map at each scale and outputs a change feature map.
6. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step five specifically involves: The change feature map is input into a shared coding branch, which consists of multi-layer convolution operators and downsampling units, and outputs a basic change feature tensor. The basic change feature tensor is input into the structural change decoding branch and the appearance change decoding branch respectively. The structural change decoding branch is connected in sequence to the directional convolution operator group, the dilated convolution operator group and the scale aggregation operator group. The directional convolution operator group includes multiple convolution kernels with different orientations. The appearance change decoding branch is connected in sequence to the frequency domain decomposition operator group, the color channel transformation operator group and the scale fusion operator group. In the structural change decoding branch, the pixel gradient direction distribution is calculated on the feature map output by the scale aggregation operator group, and continuous response regions are filtered according to a preset direction consistency threshold to generate a structural change probability map. In the appearance change decoding branch, the brightness difference magnitude and local texture correlation are calculated on the feature map output by the scale fusion operator group, and high-frequency disturbance regions are filtered according to a preset frequency band suppression threshold to generate an appearance change probability map. In the risk fusion layer, a pixel-by-pixel scaling operation is performed on the structural change probability map and the appearance change probability map, and upper and lower limit clipping is performed on the mapping result to generate a risk change probability map.
7. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step six specifically involves: Based on the bounding box coordinates corresponding to the disease target, the target area is extracted from the risk change probability map corresponding to the slope image at the first time and the slope image at the second time. The number of pixels in the target area whose risk change probability is greater than the preset change threshold is counted, and the change ratio at the first time and the change ratio at the second time are calculated respectively. Perform a difference operation on the percentage change at the first time point and the percentage change at the second time point to obtain the difference in percentage change, and calculate the rate of change per unit time in combination with the time interval between the first time point and the second time point; Based on the correspondence between the difference in the percentage of change and the rate of change per unit time and the preset phase threshold range, the disease target is divided into new phase, extended phase, stable phase and regressed phase, and the corresponding phase number is written into the change phase code. The changed phase code is mapped to a phase vector in one-hot encoding form, and then concatenated with the category vector corresponding to the disease target category label to generate a state category code.
8. The method for monitoring and identifying the condition of steep slopes in high-speed railways based on YOLOv5 according to claim 1, characterized in that, Step seven specifically involves: Select the disease target set corresponding to the disease category label according to the state category code, and extract the target area in the risk change probability map according to the bounding box coordinates; Binarization is performed on pixels within the target area whose risk change probability is greater than the risk threshold configured by the system to generate a target mask. Connected component labeling is performed on the target mask and connected components with a number of pixels less than the minimum connected component threshold configured by the system are filtered out to form an effective change mask. When the disease category label is crack, skeleton extraction processing is performed on the effective change mask to generate a crack skeleton pixel set. The adjacent connection relationship between skeleton pixels in the crack skeleton pixel set is counted and the number of connection segments is accumulated. The accumulated number of connection segments is converted into crack length change based on the inspection imaging scale. When the disease category label is peeling, the number of pixels in the effective change mask is counted and converted into the change in peeling area according to the inspection imaging scale. When the disease category label is falling rocks, the number of pixels in the effective change mask is counted and converted into the change in falling rock coverage area according to the inspection imaging scale. The changes in crack length, peeling area, and rockfall coverage area corresponding to this inspection are compared with the quantile threshold set of the historical baseline distribution. The interval comparison results are mapped to the warning level, and the warning level and disease location results are output.