Tunnel lining crack detection method based on improved RT-DETR

By improving the directional perception backbone network, cross-scale feature fusion, and dual-branch collaborative feature enhancement module of the RT-DETR model, the problems of insufficient feature perception and background interference in the detection of cracks in the lining of highway tunnels were solved, and efficient and accurate crack detection was achieved.

CN121685461APending Publication Date: 2026-03-17SHANXI JIAOKE INFORMATION SYST ENG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-17

Smart Images

  • Figure CN121685461A_ABST
    Figure CN121685461A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of crack detection, and discloses a tunnel lining crack detection method based on improved RT-DETR, and the specific technical scheme is as follows: firstly, a new backbone network structure is proposed, a direction sensing backbone network models a long-distance spatial dependency relationship of cracks through a strip-shaped weighting mechanism, and the ability of extracting morphological characteristics of the cracks is enhanced; secondly, a soft up-sampling technology is introduced into a cross-scale feature fusion module, so that the problem of multi-scale feature dislocation is solved through adaptive weight adjustment; finally, a double-branch collaborative feature enhancement module is introduced, differential characterization of a crack target and a complex background is enhanced through the synergistic effect of a space branch and a global context guiding branch, and the algorithm provided by the invention is remarkably improved compared with a reference model RT-DETR in a crack detection task; according to the method, the problems of feature confusion and background interference in tunnel crack detection are effectively solved, and a basis is provided for intelligent tunnel apparent disease detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of crack detection technology, specifically relating to an improved RT-DETR algorithm for detecting cracks in highway tunnel lining. Background Technology

[0002] Highway tunnels are a key component of modern transportation infrastructure, and the integrity of their lining structure directly affects operational safety. Cracks, as the most common early defects in tunnel linings, need to be detected accurately and efficiently for timely maintenance. Traditional manual inspection methods are labor-intensive, subjective, and inefficient, while existing vision-based automatic inspection algorithms perform poorly in complex tunnel environments.

[0003] Traditional methods have three major limitations: (1) Insufficient crack feature perception. Cracks are long, thin, low-contrast, and irregular in shape, making them easy to miss under uneven lighting and surface stains; (2) Feature fusion confusion. Existing frameworks (such as FPN and PANet) have spatial misalignment in cross-scale feature fusion, and the upsampling process leads to blurred edges of fine-grained cracks; (3) Background interference. Complex tunnel backgrounds (stains / textures / shadows) can cause false detections due to insufficient target-background differentiation.

[0004] RT-DETR (Real-Time Detection Transformer) is a real-time object detection model based on the Transformer architecture. Its core design goal is to achieve real-time inference speed while maintaining high detection accuracy. It mainly optimizes the high computational complexity of traditional DETR series models and is the first to surpass YOLO series models in real-time detection tasks. Its main decoder dynamically filters the initial query based on the IoU score between predicted and ground truth bounding boxes, prioritizing high-confidence features to address the inconsistency between classification scores and localization accuracy, significantly improving detection quality. Through the Transformer's global attention mechanism, it directly outputs non-overlapping detection boxes, eliminating the post-processing step of non-maximum suppression (NMS) required by traditional detectors (such as YOLO), and avoiding accuracy fluctuations and speed degradation caused by NMS parameter tuning.

[0005] In improvements to RT-DETR, Xinbiao Lu et al. replaced the original backbone with VanillaNet and combined large-kernel convolution with small-kernel convolution to enhance local feature extraction capabilities. Huaxiang Zhang et al. addressed challenges in UAV images, such as small targets, occlusions, and high-frequency details, by proposing a multi-scale feature fusion and frequency enhancement module to preserve high-frequency details and improve the feature discrimination of small targets in complex backgrounds. Yansong Peng et al. did not adjust the backbone network or feature fusion module as in traditional methods, but instead reconstructed the bounding box regression task, proposing refined probability distribution modeling to replace traditional coordinate regression. However, this method relies on deep, high-quality predictions, limiting the effectiveness of shallow distillation.

[0006] In summary, from an industrial perspective, different optimization angles and methods are needed for different problems. Although the above methods have improved accuracy and regression performance, it remains a challenge to improve accuracy through targeted algorithm improvements for detecting cracks in highway tunnel linings. Summary of the Invention

[0007] To address the technical problems of insufficient crack detection, feature fusion confusion, and false detection caused by background interference in existing technologies, this invention provides an improved crack detection algorithm for highway tunnel lining based on RT-DETR, which can significantly improve detection quality.

[0008] To achieve the above objectives, the technical solution adopted by this invention is: a tunnel lining crack detection method based on improved RT-DETR, the specific steps of which are as follows: Step 1: Construct a direction-aware backbone network. Input images are fed into the direction-aware backbone network. The direction-aware backbone network models the long-distance spatial dependencies of cracks through a strip-weighted mechanism. This mechanism uses asymmetric convolution kernels (such as 1×3 and 3×1) to extract features along the horizontal and vertical directions, forming a strip-weighted map, which enhances the ability to capture the morphology of slender cracks. The direction-aware backbone network outputs a layered base feature map.

[0009] Step 2: The hierarchical base feature maps are input into the cross-scale feature fusion module. The cross-scale feature fusion module has two adaptive upsampling sub-modules. Adaptive weights are used to adjust the upsampling. The cross-scale feature fusion module aligns the resolution of feature maps at different levels. Step 3: The fused feature map output by the cross-scale feature fusion module is input into the dual-branch collaborative feature enhancement module. Through the parallel operation of the spatial branch and the global context-guided branch, the crack features are highlighted and the background interference is suppressed. The output feature maps of the two branches are aggregated through the Hadamard product, and finally the feature map is generated and sent to the original decoder module of RT-DETR.

[0010] In step one, the orientation-aware backbone network consists of an HGStem initialization layer (primary feature extraction module), multiple cascaded HGBlock modules (hierarchical residual modules), and a key orientation-aware module. The key direction sensing module captures the long-range spatial dependency of the target crack, as shown in the following equation: (1) (2) (3) X represents the input features of the orientation sensing module, Y represents the output features, GELU represents the Gaussian error linear activation function, BN represents batch normalization to improve model stability, and DWConv represents depthwise convolution. The specific calculation process for orientation-aware attention is as follows: (4) (5) The final output is the product of the original feature map and the weighted feature map.

[0011] in, The input features representing direction-aware attention are represented by asymmetric convolutional kernels of sizes (1,3) and (3,1), which constitute orthogonal direction awareness. σ ☉ represents the Sigmoid function, which compresses the feature response to the interval [0,1] to form a weighted feature map, ☉ represents the Hadamard product, and U is the strip weight.

[0012] In step two, adaptive weight adjustment achieves the alignment and fusion of features across different levels, and its formula is expressed as follows: (6) (7) Where © represents a cascading operation. f() This indicates a bilinear upsampling operation. For target features, Characterized by high-level features Y To output the feature map, Re solution The scaling factor represents the resolution of the feature map. A It is proportional to the resolution of the feature map; When high-level features The resolution is lower than that of the target features When the value of A decreases, the output feature map Y suppresses the high-level semantic interference introduced by upsampling.

[0013] In step three, the dual-branch collaborative feature enhancement module highlights the crack representation. It establishes a differentiated representation between the crack and the background through a dual-branch structure. This module takes the feature map F output by the Fusion module (feature splicing or weighted fusion module) in the CCFM module (cross-scale feature fusion module) as input. Spatial branching is used to model the relationship between feature maps in spatial dimensions, emphasizing the precise location of cracks, edge details, and local geometric features, as shown in the following equation: (8) The global context-guided branch focuses on understanding the complex background features of the tunnel and the differences between cracks and interference, and its formula is expressed as follows: (9) in, softmax For weight normalization, maxpool For max pooling operation, avgpool For the average pooling operation, F1 is the output feature of the spatial branch and F2 is the output feature of the global context-guided branch. In the DCFE module, the weight maps output by the spatial branch and the global context-guided branch are multiplied by the original input feature map, and the two weighted feature maps are subjected to the Hadamard product operation to achieve dual-branch feature aggregation.

[0014] Compared with the prior art, the specific beneficial effects of this invention are reflected in: I. This invention constructs a direction-aware backbone network, models the long-range spatial dependence of cracks by designing a strip weighting mechanism, enhances morphological feature extraction by utilizing directional attention, and captures the linear features of cracks along orthogonal directions with its asymmetric convolution kernel, significantly improving the detection accuracy of slender, low-contrast cracks. Second, this invention introduces soft upsampling in the cross-scale feature fusion module, and uses adaptive weight adjustment upsampling to replace bilinear interpolation, dynamically aligning feature maps at different levels, thus solving feature misalignment while preserving edge details. Third, this invention introduces a dual-branch collaborative feature enhancement module. The collaborative module combines spatial detail modeling with global context guidance, and uses Hadamard product aggregation features to enhance the differential representation of cracks and background, suppressing background interference while enhancing crack feature expression. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the structure of the present invention.

[0016] Figure 2 This is a schematic diagram of the structure of the direction-aware backbone network.

[0017] Figure 3 This is a schematic diagram of the soft upsampling SNI structure.

[0018] Figure 4 This is a schematic diagram of the dual-branch collaborative feature enhancement module.

[0019] Figure 5 This is a schematic diagram showing different crack grades. Figure 5 (a) is a schematic diagram of a minor crack. Figure 5 (b) is a schematic diagram of a minor crack. Figure 5 (c) is a schematic diagram of a minor crack.

[0020] Figure 6 This is a comparison chart of experimental results for the examples; Figure 6 (a) is the original image. Figure 6 (b) shows the experimental results of GT (referring to manually labeled crack standard data used for model training and evaluation). Figure 6 (c) is a graph showing the experimental results of YOLOv8. Figure 6 (d) shows the experimental results of YOLO11. Figure 6 (e) shows the experimental results of RT-DETR. Figure 6 (f) shows the experimental results of Deformable-DETR. Figure 6 (g) is a graph showing the experimental results of the present invention. Detailed Implementation

[0021] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0022] like Figure 1 As shown, the tunnel lining crack detection method based on the improved RT-DETR is as follows: like Figure 2 As shown, a direction-aware backbone network is constructed: the backbone network structure is optimized and improved, and a direction-aware backbone network (OABackbone) is proposed. This structure consists of an HGStem initialization layer, multiple cascaded HGBlock modules, and a key direction-aware module (OAModule). Compared with the original backbone architecture, this network introduces a unique key direction-aware module, which can enhance the feature response in a specific direction (such as horizontal or vertical) and significantly improve the ability to perceive long-range crack structures.

[0023] The key direction sensing module effectively captures the long-range spatial dependency of the target crack, as shown in the following formula: (1) (2) (3) X represents the input features of the orientation sensing module, Y represents the output features, GELU represents the Gaussian error linear activation function, BN represents batch normalization to improve model stability, and DWConv represents depthwise convolution.

[0024] The core of Direction-Aware Attention (OAAttention) is an efficient strip-weighted mechanism, the calculation process of which is as follows: (4) (5) in, The input features representing direction-aware attention are represented by asymmetric convolutional kernels of sizes (1,3) and (3,1), which constitute orthogonal direction awareness. σ ☉ represents the Sigmoid function, which compresses the feature response to the interval [0,1] to form a weighted feature map. ☉ represents the Hadamard product, and U is the strip weight. The final output is the product of the original feature and the weighted feature map, thus achieving adaptive feature enhancement.

[0025] While maintaining excellent feature extraction capabilities, the orientation-aware backbone network can more efficiently handle highway tunnel crack detection scenarios.

[0026] A soft upsampling method is introduced in the cross-scale feature fusion module: In the original Rt-DETR framework, the cross-scale feature fusion module (CCFM) adopts a bilinear upsampling operation. When fusing high- and low-scale features, it is easy to cause feature misalignment due to the representation deviation of features at different levels, which will weaken the ability to capture fine crack textures.

[0027] like Figure 3 As shown, to address the misalignment problem in the point-by-point fusion process of the feature pyramid, a soft upsampling technique (SNI) is introduced. This method replaces the nearest neighbor interpolation in the original framework with soft upsampling, deploying it on the cross-scale connection path. It achieves cross-level feature alignment and fusion through adaptive weight adjustment, and its formula is expressed as follows: (6) (7) Where © represents the cascade operation, f() represents the bilinear upsampling operation, and Re solution The scaling factor represents the resolution of the feature map. A The scaling factor A is proportional to the resolution of the feature map; while the scaling factor A is proportional to the resolution of the feature map; when the high-level features... The resolution is significantly lower than that of the target features. When A becomes smaller, the output feature map Y will suppress the high-level semantic interference introduced by upsampling, thereby better preserving key texture information such as crack edges.

[0028] A dual-branch collaborative feature enhancement module (DCFE module) is introduced: Although the global attention mechanism of the original RT-DETR can model long-range dependencies, it has difficulty capturing the spatial-channel correlation of small cracks and is easily affected by similar backgrounds. Inspired by the spatial context-aware module in FFCA-YOLO, a dual-branch collaborative feature enhancement module (DCFE) is introduced to highlight crack representation. It establishes a differentiated representation between cracks and the background through a dual-branch structure (spatial branch + global context-guided branch). This module takes the feature map F output by the Fusion module in the CCFM module as input.

[0029] The spatial branch focuses on modeling the relationship between feature maps in the spatial dimension, emphasizing the precise location of cracks, edge details, and local geometric features, as shown in the following formula: (8) The global context-guided branch is used to understand the complex background features of the tunnel and the differences between cracks and disturbances (such as stains, textures, and shadow variations), as shown in the following equation: (9) in, softmax For weight normalization, maxpool For max pooling operation, avgpool For the average pooling operation, F1 is the output feature of the spatial branch and F2 is the output feature of the global context-guided branch. In the DCFE module, the weight maps output by the spatial branch and the global context-guided branch are multiplied by the original input feature map, and the two weighted feature maps are subjected to the Hadamard product operation to achieve dual-branch feature aggregation.

[0030] like Figure 4 As shown, the specific structure of the dual-branch collaborative feature enhancement module is as follows: the weight maps output by the spatial branch and the global context-guided branch are multiplied by the original input feature map, respectively. Subsequently, these two weighted feature maps are subjected to a Hadamard product operation to achieve dual-branch feature aggregation. By introducing this structure, the feature differences between the cracked target and the complex background can be effectively established, thereby providing a more robust and discriminative feature input for the subsequent detection head.

[0031] Optimize the overall algorithm structure: Improve the overall structure of the RT-DETR tunnel lining crack detection algorithm as follows: Figure 4As shown, the input image first enters the improved orientation-aware backbone network, which embeds orientation-aware units at its core. These units can efficiently model the long-range spatial dependencies of cracks and enhance the ability to extract morphological features of slender, low-contrast cracks.

[0032] The orientation-aware backbone network outputs hierarchical base feature maps, which are then fed into the CCFM module for fusion. The CCFM module contains two adaptive upsampling sub-modules, replacing standard bilinear or nearest-neighbor interpolation. These sub-modules are responsible for aligning the resolution of feature maps at different levels (such as high-level semantic features and low-level detail features), and achieving accurate cross-scale feature fusion through adaptive weight adjustment, effectively solving the feature misalignment problem while preserving the details of crack edges.

[0033] The fused feature map output by the CCFM module is then input into the dual-branch collaborative feature enhancement module. This module works in parallel through a spatial branch (enhancing precise localization and edge details) and a global context-guided branch (understanding background characteristics and improving target-background discriminability) to collaboratively highlight crack features and suppress complex background interference. The output feature maps of the two branches are aggregated through Hadamard product to finally generate a significantly enhanced and highly discriminative feature map, which is then fed into the original decoder module of RT-DETR.

[0034] Dataset and experimental setup in the example: This dataset is constructed based on high-definition images of a tunnel lining. The original images were acquired by a professional acquisition vehicle with an initial size of 4096×1000 pixels. After data cleaning and processing (including denoising, enhancement, and standardized cropping), standardized images of 512×512 pixels were finally generated, totaling 4592 images.

[0035] Crack width classification is a core indicator for measuring tunnel structural safety. Based on this classification, the safety of highway tunnels can be evaluated. The dataset categorizes cracks into three levels based on safety risk: minor cracks, moderate cracks, and severe cracks. For example... Figure 5 As shown in (a), minor cracks pose a low short-term risk, but monitoring is necessary to prevent their spread; as Figure 5 As shown in (b), the moderate risk level is significant and requires timely grouting repair; Figure 5 As shown in (c), the severe cracks clearly indicate structural damage, which may be accompanied by steel reinforcement corrosion, requiring urgent reinforcement.

[0036] This dataset uses labelimg for data annotation, which is... Figure 5 The diagrams shown illustrate the three levels of cracks. Slightly cracked cracks are extremely difficult to identify, which greatly increases the difficulty of this detection task.

[0037] All experiments were run on fixed NVIDIA RTX 1080 (8GB) hardware to control for variables.

[0038] Comparative ablation experiments were conducted on the datasets in the examples: To verify the effectiveness of the proposed OABackbone backbone network and each optimization module, this experiment was divided into two categories: performance comparison of different backbone networks and module-by-module ablation. The data is shown in Table 1.

[0039] Table 1 Comparative Ablation Experiments

[0040] To compare the performance of different backbone networks, the experiment used CCFM as the basic feature fusion network to test the performance of HGBlock, ResNet50 and OABackbone. HGBlock had the highest localization accuracy of 0.679, but the weakest classification ability, with mAP50 and mAP95 being the lowest. ResNet50 significantly improved classification performance, with mAP50 and mAP95 improving by 3.2% and 12.4% respectively compared to HGBlock, but both localization accuracy and recall decreased slightly. OABackbone achieves performance balance by gradually adding optimization modules. When only CCFM is used, all performance metrics are at an intermediate level. After introducing the SNI module, the feature representation capability is optimized, and mAP50 and mAP95 continue to improve, with only the recall rate slightly decreasing. After adding the DCFE module, the complete model achieves optimal overall performance, with localization accuracy improving to 0.651, recall rate recovering to the optimal level of 0.607, mAP50 jumping to 0.622, a 2.1% improvement over ResNet50, and mAP95 stabilizing at 0.358, a 4.1% improvement over ResNet50.

[0041] Comparative Experiment: This comparative experiment aims to evaluate the performance differences between our method and mainstream target detection models in the task of detecting cracks in highway tunnel lining.

[0042] The experimental results are shown in Table 2. The improved model in the examples performed excellently on key metrics. The recall rate of this method reached 0.607, which is on par with the benchmark RT-DETR and slightly better than other comparative models; the mAP50 was 0.622, an improvement of 5.4% compared to the benchmark RT-DETR's 0.590; the mAP95 was 0.358, an improvement of 17.0% compared to the benchmark RT-DETR's 0.306; the Box value of this method was 0.651, which is slightly lower than the benchmark RT-DETR, but the enhancement through the DCFE module resulted in better performance in terms of precision-recall balance. The average precision of this method is excellent, verifying the effectiveness of OABackbone's strip weighting mechanism and soft upsampling technology in enhancing crack morphology features and solving feature misalignment problems, highlighting the synergistic advantages of global attention and direction awareness.

[0043] From the visual comparison results Figure 6It is clear that the algorithms exhibit significant performance differences in the same scene. Specifically, while YOLOv8's detection boxes can capture the main targets, their accuracy is slightly insufficient, with minor deviations in some boundaries. YOLOv11's detection results are generally balanced, but occasional missed detections occur in small targets or edge regions. RT-DETR's detection boxes show good overall consistency, but some false detections occur in complex background regions. Deformable-DETR shows certain advantages in handling irregular targets, but its box stability is slightly weaker, and some detection boxes exhibit overfitting. The improved algorithm proposed in this invention stands out among all comparisons. Its detection boxes almost completely overlap with the ground truth annotations, not only fully covering all targets but also demonstrating extremely high accuracy in boundary localization, with no obvious missed or false detections. Its overall detection performance is significantly better than other compared algorithms.

[0044] Table 2 Comparative Tests

[0045] This invention proposes an improved RT-DETR algorithm for detecting cracks in highway tunnel linings. Through the collaborative innovation of OABackbone, soft upsampling technology, and the DCFE module, it effectively solves the problems of insufficient crack feature perception, feature fusion confusion, and background interference. Experiments demonstrate that this method significantly outperforms mainstream models in terms of recall and mAP, providing a high-precision and reliable solution for tunnel safety maintenance.

[0046] Experiments show that the proposed method has a recall rate of 60.7% and an mAP50 of 62.2%, which are significantly better than the baseline RT-DETR model, providing a reliable solution for intelligent tunnel detection.

[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the scope of the present invention.

Claims

1. A tunnel lining crack detection method based on improved RT-DETR, characterized in that, The specific steps are as follows: Step one, construct the direction perception backbone network, input the image into the direction perception backbone network, and the direction perception backbone network models the long-distance spatial dependence relationship of the crack through a strip-shaped weighting mechanism, and outputs layered base feature maps; Step two, the layered base feature maps are input into the cross-scale feature fusion module, two adaptive up-sampling sub-modules are arranged in the cross-scale feature fusion module, adaptive weight adjustment is adopted for up-sampling, and the cross-scale feature fusion module aligns the resolutions of different level feature maps; Step three, the fusion feature maps output by the cross-scale feature fusion module are input into the double-branch collaborative feature enhancement module, through the parallel operation of the spatial branch and the global context guiding branch, the crack features are highlighted and the background interference is suppressed, and the output feature maps of the double-branch collaborative feature enhancement module are aggregated through Hadamard product to generate feature maps and sent to the decoder module of RT-DETR.

2. The improved RT-DETR-based tunnel lining crack detection method according to claim 1, wherein, In step one, the direction perception backbone network is composed of an HGStem initialization layer, a plurality of series of HGBlock modules and a key direction perception module; The key direction perception module captures the long-range spatial dependence relationship of the target crack, which is specifically expressed as follows: (1) (2) (3) X is the input feature of the direction perception module, Y is the output feature, GELU is the Gaussian error linear activation function, BN is the batch normalization, and DWConv is the deep convolution; The specific calculation process of the direction perception attention OAAttention is as follows: (4) (5) The final output V is the product of the original feature and the weighted feature map; wherein, represents the input feature of direction-aware attention, the asymmetric convolution kernel with size of (1, 3) and (3, 1) constitutes the orthogonal direction-aware, σ represents the Sigmoid function, the feature response is compressed to the interval [0, 1] to form a weighted feature map, represents the Hadamard product, and U is a strip-shaped weight.

3. The improved RT-DETR-based tunnel lining crack detection method according to claim 2, characterized in that, In step two, adaptive weight adjustment realizes the alignment and fusion of cross-level features, which is expressed as follows: (6) (7) wherein © denotes a concatenation operation, f() denotes a bilinear up-sampling operation, is a target feature, is a high-level feature, Y is an output feature map, Re solution denotes a resolution of a feature map, a scaling factor A is directly proportional to the resolution of the feature map; When the resolution of high-level features is lower than that of target features , A the value becomes smaller, and the output feature map Y suppresses the high-level semantic interference introduced by upsampling.

4. The improved RT-DETR-based tunnel lining crack detection method according to claim 3, characterized in that, In step three, the double-branch collaborative feature enhancement module highlights the crack representation, and establishes the differential representation between the crack and the background through the double-branch structure, and the module takes the feature map F output by the Fusion module in the CCFM module as input; The spatial branch is used to model the relationship of the feature map in the spatial dimension, which is specifically expressed as follows: (8) The specific expression of the global context guiding branch is as follows: (9) wherein, softmax is a weight normalization, maxpool is a max-pooling operation, avgpool is an average-pooling operation, F1 is the output feature of the spatial branch, and F2 is the output feature of the global context guidance branch; in the DCFE module, the weight maps output by the spatial branch and the global context guidance branch are multiplied with the original input feature map respectively, and the Hadamard product operation is performed on the two weight-adjusted feature maps to realize the aggregation of the double-branch features.