A real-time end-to-end detection method for cracks in a highway tunnel lining
Patent Information
- Application Number
- CN202611407924.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-10-30
AI Technical Summary
然而,此类框架面向通用目标设计,其骨干网络对高长宽比线状目标的各向异性特征提取能力不足;颈部多头自注意力模块对空间位置不具备显式的归纳偏置,缺乏对裂缝方向连续性的几何形态约束;传统步长卷积下采样在降低分辨率的同时容易削弱细线状边缘的高频信息;此外,现有基于交并比的边界框回归损失对跨尺度目标的优化力度不一致,难以同时兼顾宽度仅数像素的微小裂缝与延伸数米的贯穿裂缝的回归精度
1、本发明通过在骨干网络中引入轴向上下文增强模块,主路径采用大核条带卷积分别沿水平与垂直方向建立各向异性感受野,辅助路径通过全局平均池化与外积组合构建完整的二维轴向上下文增强项,两路径协同作用显著增强了对高长宽比线状目标的方向性特征提取能力,有效抑制了复杂背景纹理引起的伪检;同时,外层通道压缩-级联-恢复结构使骨干网络在提升表征能力的同时实现了模型轻量化,相比基线模型参数量降低25.9%,计算复杂度降低29.4%,为工程部署提供了充足的算力冗余。
Smart Images

Figure CN123015525A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision target detection technology, specifically relating to a real-time end-to-end detection method for cracks in the lining of highway tunnels. Background Technology
[0002] Tunnel lining cracks are a significant apparent defect reflecting the degradation of the lining structure's performance, and are crucial for tunnel safety operation and maintenance decisions. Traditional detection methods mainly rely on manual visual inspection, which is inefficient and the results are susceptible to subjective factors, making it difficult to meet the needs of large-scale, high-frequency inspections. In recent years, deep learning-based target detection methods have been introduced into the field of crack detection. A Chinese patent with publication number CN110689538A discloses a method for detecting tunnel lining cracks in images. This scheme uses a Faster R-CNN network to detect crack candidate boxes in a sliding window image and combines a connected component algorithm to remove false cracks. Another Chinese patent with publication number CN117934473B discloses a deep learning-based method for detecting apparent cracks in highway tunnels. This scheme uses the YOLO series network as its basic framework and introduces an attention mechanism to improve the backbone network to adapt to crack recognition in complex backgrounds. However, the aforementioned single-stage and two-stage detection methods rely on post-processing steps such as nonmaximum suppression, and their backbone networks employ approximately isotropic square receptive fields, which limits their ability to model globally consistent crack targets with slender, high aspect ratios.
[0003] Transformer-based end-to-end detection frameworks, through ensemble prediction and matching learning, structurally avoid reliance on non-maximum suppression and achieve good results in general object detection scenarios. However, these frameworks are designed for general targets, and their backbone networks lack the ability to extract anisotropic features from high aspect ratio linear targets; the neck multi-head self-attention module lacks explicit inductive bias for spatial location and lacks geometric constraints on the continuity of crack direction; traditional stride convolution downsampling tends to weaken high-frequency information of thin linear edges while reducing resolution; in addition, existing bounding box regression losses based on intersection-union ratio have inconsistent optimization strength for targets across scales, making it difficult to simultaneously ensure the regression accuracy of tiny cracks only a few pixels wide and through cracks extending several meters. These problems collectively lead to the need to improve the detection accuracy and localization stability of existing end-to-end detection frameworks when dealing with slender linear targets such as tunnel lining cracks. Summary of the Invention
[0004] To address the aforementioned technical problems with existing tunnel lining cracks, this invention provides a real-time end-to-end detection method for highway tunnel lining cracks.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for real-time end-to-end detection of cracks in the lining of highway tunnels includes the following steps: S1. Collect images of highway tunnel lining under multiple working conditions, construct a lining crack dataset containing crack samples with multiple scales, multiple illuminations, and multiple occlusion interferences, scale the images to a uniform size and label the true boundary boxes of the cracks, and divide them into training set and validation set according to the proportion. S2. Construct the TCD-DETR model and make four structural improvements to the baseline RT-DETR-L: embed a cross-stage cascaded bilinear axial context enhancement module CSC-BACA into the backbone network; replace the original AIFI module in the neck area with a hybrid distance self-attention feature interaction module HSFI; integrate the frequency domain-aware dynamic downsampling module FADS into the feature interaction downsampling path; and use the SDG-IOU dynamic intersection-union ratio hybrid loss function to complete the model training optimization in the head boundary regression branch. S3. The TCD-DETR model was iteratively trained until convergence using the AdamW optimizer, cosine annealing learning rate decay strategy, and Mosaic data augmentation. S4. Input the tunnel lining image to be detected into the trained TCD-DETR model. No NMS post-processing is required. The model outputs crack detection boxes and class confidence scores end-to-end, thus completing the automated detection of lining cracks.
[0006] The CSC-BACA module in step S2 includes a BACA bilinear axial context enhancement block and a cross-stage cascade structure. The BACA block sets up a main path and an auxiliary path. The main path extracts the horizontal and vertical slender crack features through strip convolution and suppresses background interference with weights. The auxiliary path performs one-dimensional axial global average pooling on the basic features and generates global two-dimensional context features through outer product broadcasting. The dual-path features are fused to output features that enhance the axial continuity of the crack. In step S2, the HSFI module sets up two types of sub-attention heads in parallel: Manhattan distance self-attention MaSA and Huber distance self-attention HuSA. MaSA relies on linear Manhattan distance to model the global long-range dependence of long straight cracks, while HuSA uses piecewise Huber distance. In the near-distance range, a second attenuation is used to enhance the local details of crack bending and bifurcation, while in the far-distance range, a linear attenuation is used to preserve long-range feature dependence. The outputs of the two types of attention heads are fused to achieve multi-scale crack feature interaction.
[0007] In step S2, the FADS module sets up a frequency domain sensing branch and a residual downsampling branch in parallel. The frequency domain sensing branch performs a local DCT discrete cosine transform on the input features to split them into multiple frequency domain sub-bands. The weights of each frequency band are adaptively calibrated using a lightweight two-layer MLP to highlight the high-frequency details of the crack edge. The residual branch uses a depthwise separable convolution with a stride of 2 to complete spatial downsampling. The outputs of the two branches are added and fused element by element, preserving the high-frequency information of the crack fine line edge during the downsampling process.
[0008] In step S2, the SDG-IOU dynamic intersection-union ratio loss function is a weighted mixture of GIoU loss and improved SDIoU loss. The improved SDIoU loss uses the geometric mean of the predicted box and the true box area to construct a symmetric scale factor, introduces a logarithmic scale squared penalty term to constrain the crack scale deviation, and adaptively adjusts the scale penalty weight through a dynamic gating mechanism to achieve accurate regression of the bounding boxes of small and large cross-scale cracks.
[0009] The execution flow of the BACA bilinear axial context enhancement block is as follows: Input feature x is processed through a 5×5 depthwise separable convolution to extract shared basic features f; Main path: Horizontal and vertical strip convolution is used to extract anisotropic slender crack features, which are then multiplied element-wise with the original input features to achieve irrelevant background suppression; Auxiliary path: Perform horizontal global average pooling H on the basic feature f respectively. GAP Vertical global average pooling V GAP The global two-dimensional context features are generated by outer product broadcast multiplication, and then the global context features z are obtained by 1×1 pointwise convolution and GELU nonlinear activation. The main path output feature is added to the auxiliary path feature z element by element to output a single block axial enhancement feature; The CSC-BACA cross-stage cascaded structure consists of two sets of CBS channel transformation modules, an intermediate BACA block connected in series, and optional residual connections. It strengthens the characterization of crack direction and continuity across stages, while simultaneously reducing the overall number of model parameters and computational overhead.
[0010] The one-dimensional axial Huber distance logarithmic offset calculation method of HuSA is as follows: Let the relative distance between tokens along the one-dimensional axis be d = |ij|, δ be the local threshold, γ be the attenuation base, and α = logγ; When d ≤ δ, the spatial bias term is α・d 2 / (2δ); When d > δ, the spatial bias term is α・(d-δ / 2); The complete HuSA attention weights are obtained by fusing the one-dimensional Huber bias in height and width dimensions. MaSA Manhattan self-attention uses a fixed linear decay bias α·d, and the HuSA and MaSA multi-head parallel output channels are spliced together to complete the multi-scale feature interaction of the HSFI module.
[0011] The processing steps for the frequency domain sensing branch in the FADS module are as follows: Perform a locally normalized 2-point DCT orthogonal transform with a step size of 2 on the input features to decompose and obtain the low-frequency subband F.ll Horizontal high-frequency subband F lh Vertical high-frequency subband F hl Diagonal high-frequency subband F hh Four sets of frequency band coefficients; Global compression statistics are performed on the four frequency bands to obtain single scalar responses, which are then input into a two-layer lightweight MLP to generate adaptive frequency band weights. The coefficients of each frequency band are weighted and calibrated using weights. The weighted frequency band feature channels are concatenated and then compressed back to the original channel dimension through a 3×3 convolution to obtain the frequency domain sensing branch output; The residual branch uses a 3×3 depthwise separable convolution with the number of groups equal to the number of channels, and sets the stride=2 to complete spatial downsampling; The outputs of the frequency domain sensing branch and the residual branch are added element by element to form the final downsampling feature of the FADS module.
[0012] The improved SDIoU loss is constructed as follows: Formula for calculating the symmetry scaling factor β:
[0013] Among them, w p h p with w gt h gt δ represents the width and height of the predicted bounding box and the ground truth bounding box, respectively, and δ∈(0,1] is a hyperparameter; Standard penalty items The dynamic gating weight γ = β / δ, and the total scale penalty term is γ·s; SDIoU basic terms combine the Euclidean distance between the center points of the ground truth bounding box and the predicted bounding box, the diagonal of the minimum bounding rectangle, and the total scale penalty term; Formula for calculating mixed loss: λ∈[0,1] is the equilibrium hyperparameter, and the synchronous and accurate regression of the boundaries of fine narrow cracks and wide through cracks is achieved through joint optimization.
[0014] The dataset construction and training hyperparameter configuration in step S1 are as follows: The dataset includes a self-built tunnel lining crack dataset and the open-source TTD tunnel dataset. The self-built dataset contains 2,600 images with a resolution of 640×640, collected from the tunnel arch, sidewall, and invert area. The samples include various crack morphologies such as straight lines, curves, meshes, and branches, covering interference scenarios such as low light, strong reflection, and pipeline obstruction. The training set and validation set are randomly divided in a 7:3 ratio. Model training hyperparameters: AdamW optimizer initial learning rate 0.0002, weight decay coefficient 0.0005, batch size set to 16, total training epochs 200, training process uses cosine annealing learning rate decay strategy and Mosaic data augmentation.
[0015] The performance metrics of the TCD-DETR model trained in step S3 meet the following requirements: On the tunnel crack test set collected in the field, the precision was 92.2%, the recall was 88.1%, the mAP50 was 92.0%, and the mAP50:95 was 64.3%. The model had 24.3M parameters and a computational complexity of 76.2 GFLOPs, which is a 25.9% reduction in parameters and a 29.4% reduction in computation compared to the baseline RT-DETR-L. On the open-source TTD cross-domain tunnel dataset, the mAP50 reached 78.5%, and the false negative rate was lower than that of the YOLO series and other DETR-class comparison detection algorithms.
[0016] Compared with the prior art, the beneficial effects of this invention are: 1. This invention introduces an axial context enhancement module into the backbone network. The main path uses large-kernel strip convolution to establish anisotropic receptive fields along the horizontal and vertical directions respectively. The auxiliary path constructs a complete two-dimensional axial context enhancement term through a combination of global average pooling and outer product. The synergistic effect of the two paths significantly enhances the ability to extract directional features of linear targets with high aspect ratios and effectively suppresses false detections caused by complex background textures. At the same time, the outer channel compression-cascade-recovery structure enables the backbone network to achieve model lightweighting while improving representation capabilities. Compared with the baseline model, the number of parameters is reduced by 25.9% and the computational complexity is reduced by 29.4%, providing sufficient computing power redundancy for engineering deployment.
[0017] 2. This invention replaces the standard multi-head self-attention module with a hybrid distance self-attention feature interaction module in the neck network. The parallel Manhattan distance self-attention head and Huber distance self-attention head respectively undertake the complementary functions of modeling the long-range coherence of macroscopic straight cracks and modeling the local smooth continuity of microscopic curved cracks. The linear decay bias of the Manhattan distance head provides stable global position awareness for large-scale straight structures, while the near-range quadratic and far-range linear piecewise decay bias of the Huber distance head provides smoother context aggregation gradients in the local neighborhood. The synergistic effect of the two types of attention heads effectively suppresses the breakage and diffusion of subtle features in cross-scale feature interaction, enabling the neck network to have explicit spatial structure priors, improving the detection recall rate of multi-morphological cracks. Compared with the baseline model, the recall rate is improved by 4.4%, and the mAP50 reaches 92.0%.
[0018] 3. This invention designs a frequency domain-aware dynamic downsampling module. The frequency domain-aware branch uses a fixed normalized 2-point discrete cosine transform basis matrix to decompose the input features into four frequency domain sub-bands. The frequency band dynamic reweighting unit dynamically calibrates each sub-band with sample-adaptive scalar weights, preserving high-frequency detail information related to crack edges during the downsampling stage. The residual branch maintains local continuity with depthwise separable convolution with a stride of 2. The two-way additive fusion enables the structure-sensitive modulation of the frequency domain branch as compensation for the residual baseline. This improves the fidelity of downsampled features for fine linear structures without introducing additional parameters, overcoming the defect of traditional stride convolution downsampling that weakens high-frequency edge information.
[0019] 4. This invention proposes a hybrid bounding box regression loss and improves the scale dynamic intersection-union ratio loss by constructing a symmetric scale factor using the geometric mean of the predicted box and the true box area, thus eliminating the asymmetry defect of the original method. The logarithmic scale squared penalty term directly constrains the absolute deviation of width and height in the logarithmic domain, and the dynamic gating weights enable the scale penalty to be adaptively activated with the target scale, avoiding excessive constraints on small targets. Combined with the generalized intersection-union ratio loss to maintain the gradient guidance ability of non-overlapping regions, the hyperparameter λ flexibly adjusts the contributions of both, achieving balanced multi-scale regression optimization for cracks ranging from tiny cracks with a width of only a few pixels to through cracks extending for several meters, significantly improving the bounding box localization accuracy of cross-scale targets, with an mAP50:95 of 64.3%. Attached Figure Description
[0020] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0021] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0022] Figure 1 This is a schematic diagram of the overall network architecture of the method in this embodiment; Figure 2 This is a schematic diagram of the axial context enhancement module in this embodiment; Figure 3 This is a schematic diagram of the hybrid distance self-attention feature interaction module in this embodiment; Figure 4 This is a schematic diagram of the frequency domain sensing dynamic downsampling module in this embodiment; Figure 5 This is a schematic diagram of the frequency band dynamic reweighting unit in this embodiment; Figure 6 This is the Grad-CAM++ heatmap for this embodiment; Figure 7 This is a graph showing the performance comparison results of the various algorithms in this embodiment; Figure 8 This is the detection image at high brightness in this embodiment; Figure 9 This is the detection image at low brightness in this embodiment; Figure 10 This is a detection diagram when there are interfering objects in this embodiment. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. These descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the claims of the present invention. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0025] The overall architecture of TCD-DETR for detecting cracks in highway tunnel lining proposed in this embodiment is as follows: Figure 1 As shown, the TCD-DETR algorithm significantly enhances RT-DETR through several key modifications. First, a CSC-BACA module is designed in the backbone network, which strengthens the extraction capability of local continuity and directional features of cracks through orientation-aware convolution and gating interaction mechanisms. Second, HSFI is constructed in the neck network, which enhances the long-range dependency and coherence modeling between multi-scale features by injecting Manhattan distance and Huber distance spatial priors in parallel. Third, FADS is designed to perform dynamic downsampling while preserving high-frequency information in the frequency domain, thus mitigating the loss of crack edge details. Finally, the SDG-IOU loss function is proposed, which improves the regression accuracy for cracks of different scales through an adaptive gradient adjustment mechanism.
[0026] Tunnel lining cracks in engineering inspection scenarios often exhibit characteristics such as elongated and continuous shape, significant directionality, low contrast, and complex background interference. Existing RT-DETR-L, using the HGNetv2 backbone, primarily relies on conventional local convolution operators. Its feature extraction typically depends on an approximately isotropic square receptive field, making it difficult to explicitly model the anisotropic long-range context required for high aspect ratio structures like cracks. To enhance the backbone network's ability to represent elongated targets and anisotropic contexts, this embodiment proposes a Bilinear Axial Context Augmentation Block (BACA Block) and a Cross-Stage Cascade BACA Module (CSC-BACA Module) based on the design principles of Strip Pooling and Strip R-CNN. Figure 2 As shown.
[0027] Specifically, the BACA Block consists of a main path that emphasizes local directional representation and an auxiliary path that aggregates global axial context. First, the input feature x is processed by a 5×5 depthwise separable convolution to extract the basic feature f shared by both paths. Then, the main path uses a large-kernel strip convolution to extract directional features along the horizontal and vertical directions, thereby enhancing the representation of slender and narrow structures, and performs element-wise reweighting (x⊙y) on the input features to suppress background interference from irrelevant regions. At the same time, the auxiliary path models the context from a broader perspective, performing global average pooling on the shared features along the horizontal and vertical directions to form two one-dimensional contexts V. GAP ∈R H×1 With H GAP ∈R 1×W And combine them into a two-dimensional context enhancement term V through outer product broadcast multiplication. GAP ⊙H GAP This process yields complete global context information; then, a 1×1 pointwise convolution projection and GELU function are used for non-linear activation to obtain feature z. Finally, element-wise addition with the main path output yields the complete output feature x. i This design achieves both local boundary stability and long-range structural consistency while remaining computationally lightweight.
[0028] Building upon this foundation, the CS-BACA Module employs a cross-stage cascaded structure: two CBS modules perform channel compression and recovery of features, with a BACA Block concatenated in the middle to progressively enhance axial context modeling capabilities. Residual connections are selectively introduced to preserve original feature information based on configuration. Compared to the original RT-DETR-L backbone network, which primarily uses conventional local convolutional concatenation, the CSC-BACA Block introduces directional continuity modeling and bilinear context enhancement at the backbone stage. This makes it more adept at maintaining the coherence of crack responses and suppressing texture false detections in complex contexts, thus providing a more effective feature representation mechanism for crack disease detection.
[0029] Tunnel lining cracks face challenges in the feature fusion stage, including difficulties in aligning slender topologies, weak multi-directional response, and background interference. The AIFI module in the baseline neck employs a conventional multi-head self-attention mechanism, which lacks explicit inductive bias for spatial location and thus lacks geometric constraints on cracks, which possess strong directional continuity. Therefore, this embodiment improves the neck feature fusion stage by proposing a Hybrid-distance Self-attention Feature Interaction (HSFI) mechanism. Specifically, HSFI constructs a Manhattan distance self-attention mechanism (MaSA) and a self-designed Huber self-attention mechanism (HuSA) in parallel across multiple channels. Figure 3 As shown, it is embedded in the neck to replace the original AIFI (Attention-based Intra-scale Feature Integration) structure. The HSFI module borrows the overall architecture of RMT in its structural design, adopts its axial decomposition attention and feedforward network dual-branch residual organization method, and inherits the ability to explicitly model the relative positional relationship within the sequence, thereby achieving efficient detection of target spatial structure perception during neck feature interaction.
[0030] Using Manhattan distance as an explicit spatial prior provides the model with global-scale position awareness through stable linear decay. However, its distance penalty increases uniformly with displacement, resulting in a relatively abrupt decay change in the local neighborhood. This makes it difficult to smoothly aggregate the context of fine-grained crack structures, limiting the model's accuracy in modeling complex local morphologies such as bending and bifurcation. Inspired by the Huber loss function, this embodiment designs a Huber self-attention head that focuses on fine local boundaries and bending morphologies. It uses quadratic growth in the near-distance range to enhance the smoothness and continuity of local features, while degenerating to linear growth in the far-distance range to avoid the loss of long-range dependencies due to excessive decay. The Huber distance is defined as follows: Given a relative token distance d = |ij| along a one-dimensional axis and d ≥ 0, and a local threshold parameter δ > 0 controlling the quadratic and linear boundaries, this embodiment defines the normalized Huber distance function as:
[0031] The normalized Huber distance function exhibits the following physical geometric properties in the spatial self-attention channel: In the short-range interval (d≤δ), since the distance follows a quadratic curve (d... 2 The gradient increases by √(2δ), and its derivative changes continuously with displacement, providing a smoother, more curvature nearest-neighbor gradient compared to ordinary linear metrics. In the long-distance range (d>δ), the Huber distance automatically degenerates into a linear change (d-δ / 2), and its growth rate is basically consistent with that of the Manhattan distance. This avoids the long-range perception amnesia problem caused by the distance of higher powers decaying too quickly at long distances.
[0032] HSFI inherits the axial decomposition idea of RMT, constructing Huber attenuation matrices along the two one-dimensional axes of height (H) and width (W). Its one-dimensional attenuation expressions in the height and width directions are:
[0033] Where γ∈(0,1) is the decay base of the corresponding self-attention head. To ensure strict alignment with the efficient logits + mask matrix addition in PyTorch and maintain numerical stability, this embodiment implicitly implements multiplicative decay in the logarithmic domain (Log-bias). Let α=logγ<0 to represent the logarithmic domain decay coefficient, then the actual calculation method of the one-dimensional Huber space bias (Log-bias mask) in the code is expressed as follows:
[0034] Based on the Huber one-dimensional axial attention calculation formula in the width and height directions, the overall Huber self-attention calculation method is finally derived:
[0035]
[0036] While the Huber head provides more continuous and high-resolution correlation strength locally, HSFI retains the Manhattan head as a supplement in another subset of attention heads to prevent overly conservative inductive biases in large-scale linear crack modeling due to the use of nonlinear curvature in all heads. The Manhattan attention head produces a linear bias with a constant gradient along a one-dimensional axis, i.e.:
[0037] By employing a hybrid approach of two attention mechanisms, HSFI achieves multi-dimensional complementarity of spatial priors: one attention head leverages the Manhattan distance wrestling prior to focus on capturing the structural coherence of long-distance, highly directional macroscopic cracks; the other attention head utilizes fine-tuning of the Huber distance to concentrate on recovering the topological information of fragmented, curved, and directionally variable microscopic crack edges. The synergistic effect of both enhances the response capability to multi-morphological cracks while suppressing false positives and false negatives caused by complex backgrounds.
[0038] In fine-grained structure perception tasks such as crack detection, downsampling is used to expand the receptive field and construct hierarchical semantics. However, traditional downsampling operators such as stride convolution, while reducing resolution, tend to weaken fine-line edge information and produce varying degrees of loss in semantics and structure; while using only fixed transformations (such as wavelet transform) will destroy the column-by-column response connectivity of features, thus generating cross-layer column semantic gaps [24-25]. Based on this, inspired by the idea of co-modeling prior-driven decomposition and data-driven learning in the same sampling structure in ASCNet, this embodiment designs a frequency-domain-aware dynamic downsampling module. By combining the frequency domain representation of Discrete Cosine Transform (DCT) with lightweight residual downsampling and designing dynamic calibration of frequency band weights, the downsampling process can better preserve the structural information related to cracks while compressing resolution.
[0039] Specifically, FADS consists of two parallel branches: one is a frequency-domain-aware branch, which first performs DCT decomposition on the input features to obtain four frequency band responses, then dynamically reweights the frequency bands to highlight more useful frequency components, and uses a 3×3 ordinary convolution to complete channel fusion; the other is a residual branch, which uses a lightweight depthwise separable convolution to directly perform spatial downsampling with a stride of 2 to preserve local continuous structure. Finally, the outputs of the two branches are summed element-wise to obtain the downsampling result, such as... Figure 4 As shown.
[0040] (1) Symbol Conventions Let the input features be:
[0041] Where B is the batch size, C is the number of channels, and (H, W) is the spatial resolution (H and W are both even numbers). The FADS output is:
[0042] FADS consists of two branches: (i) a frequency domain sensing branch and (ii) a residual branch. The final output is obtained by element-wise addition and fusion.
[0043] (2) Frequency-aware branch This embodiment performs a local discrete cosine transform (DCT) on the input feature X, using a fixed normalized 2-point DCT basis matrix:
[0044] A local orthogonal transformation with a step size of 2 is performed on the input features in the spatial dimension, resulting in four sets of coefficient responses at the output scale (H / 2, W / 2). In implementation, this operation is equivalent to rearranging the spatial information onto a (H / 2, W / 2) grid and performing the transformation within each local neighborhood. The bilateral transform is then performed; subsequently, the four response coefficients are concatenated along the channel dimension to obtain:
[0045] It is divided into four sub-bands {F ll F lh F hl F hh Each sub-band is B×C×H / 2×W / 2. Where F... llThe model favors local low-frequency / mean components, while the remaining subbands characterize differential responses in different directions. Considering that variations in crack morphology, background texture, and lighting conditions can lead to different importance of each subband to the task, this embodiment introduces a lightweight frequency reweighting unit. Inspired by the global statistical concept of squeeze in SENet, this embodiment compresses the spatial and channel responses of each subband into a scalar description to characterize the overall response intensity of that subband. Subsequently, a lightweight two-layer MLP is used to obtain the weights of the four subbands. Furthermore, shared scaling is applied to each sub-band, meaning that all channels and positions within the same frequency band share the same scalar weight. This process achieves adaptive frequency band dynamic weighting, thereby dynamically adjusting the contribution of high-frequency and directional variation information during the downsampling stage, such as... Figure 5 As shown.
[0046] Subsequently, the recalibrated F is fused using a 3×3 convolution and compressed back into the C channel to obtain the frequency domain sensing branch output:
[0047] (3) Residual branching and dual-path fusion To provide a stable spatial domain shortcut and maintain local continuity, the residual branch downsamples X using a 3×3 degree separable convolution with stride=2 (groups=C), resulting in...
[0048] The final output is obtained by adding the two branches element by element. This additive fusion allows the structure-sensitive modulation provided by the frequency domain branch to serve as a compensation term for the residual baseline, thereby improving the fidelity and robustness of the downsampled features for crack and fine-line structures without introducing additional parameters.
[0049] In general object detection, IoU-based loss functions have become the mainstream paradigm for bounding box regression. For example, GIoU, by introducing a minimum bounding rectangle penalty term on top of IoU, effectively alleviates the gradient vanishing problem when the predicted and ground truth boxes do not overlap. Its definition is:
[0050] Among them B p With B gt Let C represent the predicted bounding box and the ground truth bounding box, respectively, and let C be the minimum bounding rectangle of the two.
[0051] However, GIoU lacks the ability to explicitly model the absolute scale differences of bounding boxes. In particular, crack targets have a wide scale range, from tiny cracks only a few pixels wide to through cracks extending several meters, making it difficult for GIoU to maintain consistent optimization strength across scale regressions. Therefore, this embodiment borrows from and improves upon the design concept of Scale-based Dynamic IoU (SDIoU). The original SDIoU adjusts the weights of the center point distance penalty term and the IoU term using a dynamic coefficient β, but its β only depends on the area of one side of the ground truth box, lacking symmetry and failing to constrain the scale deviation itself. Therefore, this embodiment proposes an improved SDIoU, whose core improvements include: (1) Symmetry scaling factor β is constructed using the geometric mean of the areas of the predicted bounding box and the ground truth bounding box, so that it symmetrically reflects the scale information of both:
[0052] Where w p h p with w gt h gt δ and φ are the width and height of the predicted bounding box and the ground truth bounding box, respectively. δ∈(0,1] is a hyperparameter, and δ1 is an empirical normalization factor.
[0053] (2) Explicit scale penalty Introducing a logarithmic scaling penalty term s directly constrains the absolute deviation of the predicted bounding box from the ground truth bounding box in width and height:
[0054] (3) Dynamic gating: Let γ = β / δ as the dynamic weight of s, so that the scale penalty only takes effect when the target scale is large (β approaches δ), thus avoiding imposing too strong a scale constraint on small targets.
[0055] In summary, the improved SDIoU loss function is defined as follows:
[0056] in: , , In the formula ρ 2 C is the square of the Euclidean distance from the center point. 2The sum of the squares of the diagonals of the minimum bounding rectangle is used. Compared to the original SDIoU, the improved version provides a more comprehensive and symmetrical model of scale differences, better adapting to the cross-scale characteristics of cracked targets. To retain the stability of GIoU in a general overlap metric and improve the sensitivity of SDIoU in cross-scale localization, this embodiment designs a hybrid loss function, adjusting the relative contributions of both through the hyperparameter λ∈[0,1].
[0057] in:
[0058] Compared to the baseline, this hybrid loss function strategy retains the gradient guidance capability of GIoU in non-overlapping regions while incorporating the fine-tuning of scale differences by improved SDIoU, thereby achieving more robust bounding box regression in multi-scale crack target detection.
[0059] This embodiment uses a self-built tunnel lining crack dataset and the TTD open-source dataset for training and testing. The self-built dataset consists of 2600 high-resolution images of highway tunnels with different operating years, geological conditions, and structural types. During image acquisition, different areas within the tunnel (arch, sidewalls, invert) and various shooting angles were considered to enhance sample diversity. Each image contains at least one crack target, with diverse crack morphologies, including straight, curved, mesh, and branching cracks, and varying sizes (from several centimeters to several meters). Crack widths range from minute cracks (d<1mm) to wide cracks (d>5mm). The lighting conditions are complex, including low illumination, uneven lighting, localized strong reflections, and shadow occlusion within the tunnel. Furthermore, some samples contain interference from construction joints, pipelines, or dust obstructions, affecting the complete representation of the crack targets to varying degrees. All images were finely annotated using the Labelimg annotation tool to generate corresponding annotation files. The original image size was uniformly normalized to 640×640 pixels and stored in JPEG format. In this embodiment, the dataset is randomly divided into a training set of 1819 images and a validation set of 781 images in a ratio of approximately 7:3. The distribution of crack morphology, illumination, and interference factors in each subset remains consistent with the original dataset.
[0060] To evaluate the performance of the TCD-DETR algorithm in detecting cracks in highway tunnels, this embodiment conducted experiments in the following environment: operating system Windows 11, processor 12th Gen Intel(R) Core(TM) i9-12900KF CPU @3.20 GHz, RAM 32GB, graphics card Nvidia GeForce RTX 3090 (24GB), and deep learning framework PyTorch 2.0.0+cu118.
[0061] To ensure the reliability and repeatability of the experiment, the key hyperparameters in this embodiment are set as follows: all input images are uniformly scaled to 640×640 pixels during both training and testing. The model is trained using the AdamW optimizer for a total of 200 training epochs to ensure sufficient model convergence. The initial learning rate is set to 0.0002, and a cosine annealing learning rate decay strategy is used to stabilize the training process. The weight decay coefficient is set to 0.0005, and the batch size is set to 16, achieving a balance between hardware memory capacity and training stability. During training, a Mosaic data augmentation strategy is used to improve the model's generalization ability. Non-maximum suppression and other similar strategies are not used in the post-processing stage, fully leveraging the inherent advantages of the RT-DETR end-to-end detection framework to maintain a simple and efficient detection process.
[0062] This embodiment uses precision (P), recall (R), and mean average precision (mAP) as evaluation metrics to comprehensively measure the algorithm's detection performance. The calculation methods for each metric are as follows: Precision P represents the proportion of correctly predicted positive samples out of all predicted positive samples, and is defined as:
[0063] Recall R represents the proportion of correctly predicted positive samples out of all true positive samples, and is defined as:
[0064] Where TP (True Positive) represents the number of correctly predicted positive samples, FP (False Positive) represents the number of incorrectly predicted positive samples, and FN (False Negative) represents the number of incorrectly predicted negative samples. Average Precision (AP) measures the detection accuracy for a single class and is obtained by integrating the area under the precision-recall curve (PR curve). The formula is as follows:
[0065] The mean precision (AP) is the average of the AP values across all classes, reflecting the overall performance of the model on multi-class detection tasks. The calculation formula is:
[0066] Where N represents the total number of categories, AP i This represents the average precision value of the i-th category.
[0067] In addition, this embodiment also introduces metrics for evaluating model complexity and computational efficiency, including gigabit floating-point operations (GFLOPs) and the number of parameters (Params), to measure the computational complexity and memory usage of the model.
[0068] To verify the contribution of each improved module proposed in this embodiment to crack detection performance and to analyze the interaction between different module combinations, a set of ablation experiments was designed in this embodiment, as shown in Table 1. The baseline model used in this embodiment is based on the RT-DETR architecture, and four key improved modules are gradually integrated on this basis: CSC-BACA, HSFI, FADS, and SDG-IOU. Since each module acts on different positions of the detection model, their combination and mutual influence have different contributions to the final performance. It is necessary to systematically analyze the independent gain of a single module and the synergistic effect of multiple modules used together. Therefore, eight configurations were set up for the ablation experiments, starting from the baseline model RT-DETR-L, gradually adding single modules, combining them in pairs, and finally integrating all modules to systematically evaluate the contribution of each module to the final detection performance. In Table 1, "✓" indicates that the corresponding module is enabled, and "×" indicates that it is not enabled. All experiments used the same training strategy, data augmentation, and test set. The evaluation metrics included precision (P), recall (R), F1 score, mean accuracy mAP50, and mAP50:95.
[0069] Table 1 Ablation Experiment Results
[0070] Experiment 1 was a pure baseline model without any improvements, used to establish a lower bound on performance. Experiments 2, 3, 4, and 6 introduced CSC-BACA, HSFI, FADS, and SDG-IOU separately to observe the independent gains of each module. In terms of model size, introducing CSC-BACA alone significantly reduced the number of parameters from 32.8M in the baseline to 21.1M, indicating that this backbone improvement provides significant lightweight benefits while enhancing representation capabilities. Experiment 7 simultaneously used CSC-BACA and HSFI to preliminarily explore the synergistic effect of enhanced feature extraction and self-attention mechanisms. Experiment 8 further added FADS to verify the improvement effect of frequency domain awareness on the basis of the above modules. Experiment 9 integrated all four modules to obtain the final performance of the complete model. Notably, introducing HSFI alone only slightly changed the number of parameters from 32.8M to 32.3M, while introducing FADS alone increased the number of parameters to 36.5M, indicating that the performance gain brought by the frequency domain branch comes with a certain parameter overhead. The data in the table shows that each individual module brings a certain performance improvement compared to the baseline model, with CSC-BACA and FADS showing particularly significant improvements in recall. When all three modules (CSC-BACA, HSFI, and FADS) work together, the recall reaches a maximum of 88.2%. The final complete model achieves optimal results in most metrics, with precision, recall, F1 score, mAP50, and mAP50:95 reaching 92.2%, 88.1%, 90.0%, 92.0%, and 64.3%, respectively, representing improvements of 2.4%, 4.4%, 4.0%, 3.2%, and 3.3% compared to the baseline. This verifies the complementarity between modules and the effectiveness of the overall architecture. Furthermore, the complete model has 24.3M parameters, significantly lower than the baseline's 32.8M, indicating that despite the introduction of multiple module enhancements, the overall model maintains good lightweight design.
[0071] To delve deeper into the impact mechanism of each improved module on feature extraction, this embodiment employs gradient-weighted class activation mapping (Grad CAM++) to visualize and analyze the model's attention distribution. The results are as follows: Figure 6As shown, the activation regions of the baseline RT-DETR-L are relatively dispersed, and the response intensity to the crack region is insufficient. After introducing CBS-BACA, the activation regions begin to converge towards the crack trunk, but the response intensity still attenuates at the crack edge and the boundary with the background. On this basis, adding HSFI and FADS significantly enhances the activation intensity of the crack outline in the heatmap, and the response region reaches high values both inside and at the crack edge, indicating that frequency domain-aware downsampling effectively improves the model's sensitivity to high-frequency edge features, while hybrid multi-head attention ensures the long-range response coherence along the crack direction. The activation regions of the complete model A+B+C perfectly match the actual crack morphology, covering both the crack trunk and accurately responding to the branches and endpoint regions, demonstrating the synergistic effect of each improved module. This is consistent with the result that the mAP50 increased from 88.8% to 92.0% in the quantitative index.
[0072] To comprehensively evaluate the effectiveness of the method in this embodiment, it is compared with 12 algorithms that have performed well in the field of target detection in recent years. These algorithms include one-stage detection algorithms such as YOLOX-M, YOLOv7-P5, YOLOv10-M, YOLOv13-L, YOLOv26-L, Edge-YOLO, and Gold-YOLO, as well as end-to-end detection algorithms such as RF-DETR, RT-DETR, RT-DETRv2-L, RT-DETRv2-X, and UAV-DETR. Figure 7 This provides a more intuitive view of the performance distribution of each algorithm across four metrics: P, R, mAP50, and mAP50:95. TCD-DETR consistently performs at the best or near-best level across all four metrics, demonstrating a clear overall performance advantage. Among the compared one-stage detection algorithms, Gold-YOLO achieved 91.9% mAP50 and 92.0% precision, performing best among similar methods. However, its recall (84.2%) is significantly lower than TCD-DETR (88.1%), and its parameter count reaches 41.3 M, resulting in substantial computational overhead. Edge-YOLO, with its RepConv structure, achieved 90.7% mAP50 and 87.2% recall, striking a good balance between lightweight design and detection capability. YOLOv26-L, the latest YOLO model, achieved 89.5% mAP50, but its precision was only 84.6%, indicating a higher number of false positives. Among end-to-end detection algorithms, the RT-DETR series performed stably, with RT-DETR-L achieving an mAP50 of 89.9%, RT-DETRv2-X 89.4%, and UAV-DETR 89.5%, showing relatively close performance. Although RF-DETR achieved an mAP50 of only 73.1% on this dataset, significantly lower than other comparative methods, its computational complexity was only 31.9 GFLOPs, indicating that this architecture has great potential for lightweight deployment.
[0073] Specifically, compared to the representative end-to-end method RT-DETR-L, TCD-DETR improves P, R, mAP50, and mAP50:95 by 2.4%, 4.4%, 4.0%, and 3.2%, respectively; compared to the latest one-stage method YOLOv26-L, it improves by 7.6%, 2.9%, 2.5%, and 0.9%, respectively. Compared to the latest end-to-end architecture UAV-DETR, TCD-DETR is 5.7%, 2.5%, and 3.9% higher in R, mAP50, and mAP50:95, respectively. Although P is slightly lower by 0.3%, its overall detection capability is significantly superior. Furthermore, TCD-DETR has only 24.3 M parameters and a computational complexity of 76.2 GFLOPs, which is significantly lower than RT-DETR-L (32.8 M, 108.0 GFLOPs) and RT-DETR-X (67.3 M, 232.3 GFLOPs), achieving a better balance between accuracy and efficiency.
[0074] Table 2 Comparison of experimental results
[0075] To further verify the generalization ability and robustness of the proposed model on cross-scenario crack data, this embodiment introduces the TACK Tunnel Data (TTD) dataset, which summarizes tunnel cracks, and conducts robustness testing experiments. The TTD dataset covers various complex tunnel surface imaging scenarios, with significant differences in crack morphology and scale, and is often accompanied by realistic interference factors such as illumination changes, shadows, texture noise, and dirt occlusion, thus more closely resembling the complex conditions in engineering applications. In the experiment, this embodiment selects representative images from the TTD dataset for testing to evaluate the model's detection performance on cross-domain data; the quantitative results of this embodiment's method and other comparative algorithms on this test set are summarized in the table.
[0076] Table 3. Results of comparative experiments on open-source datasets
[0077] On the TTD dataset, TCD-DETR achieved an mAP50 of 78.5% and a recall of 73.3%, outperforming the best-in-class comparison method RT-DETR-L by 2.9% and 11.4%, respectively, confirming the good generalization ability of the proposed method in cross-scenario crack detection tasks. Notably, while RT-DETR-L had a higher P-index (87.8%) than TCD-DETR (83.6%), its recall (61.9%) was significantly lower than TCD-DETR (73.3%), indicating that TCD-DETR maintains high precision while having a lower false negative rate for crack targets, demonstrating stronger defect detection capabilities in practical engineering applications. This result further validates the contribution of the improved modules proposed in this embodiment to the model's cross-domain generalization performance.
[0078] To verify the detection capability of the proposed network model, this section provides actual crack detection maps to compare the detection results of different models. Some results are shown below. Figures 8-10 As shown, the red boxes are the ground truth boxes, and the purple boxes are the prediction boxes of each model.
[0079] Figure 8 This is a detection image of cracks under high brightness. The image shows that Gold-YOLO, RT-DETR, RT-DETR-X, UAV-DETR, and the improved model have the highest detection accuracy and perform best. The other models failed to accurately detect both cracks. YOLOX, YOLOv7, YOLOv10, YOLOv13, YOLOv26, and Edge-YOLO tend to detect only the main crack area at the top, missing smaller cracks corresponding to the smaller boxes at the bottom to varying degrees. This indicates that these models are insufficiently sensitive to weak textures and small-scale targets under high brightness and low contrast backgrounds. While RF-DETR and RT-DETR-L can identify small cracks, they suffer from false positives: the former incorrectly identifies two cracks as one, while the latter's detection results contain redundant boxes, leading to inaccurate results.
[0080] Figure 9 This is a detection image of crack damage under low brightness. Figure 9In the analysis, YOLOv10, YOLOv13, YOLOv26, Edge-YOLO, RF-DETR, RT-DETR, and UAV-DETR failed to identify the crack in the upper left corner of the image. This may be because the gradient difference between the background pixels and the crack pixels is small, causing the model to fail to locate the crack during detection. YOLOX, YOLOv7, Gold-YOLO, RT-DETR-L, RT-DETR-X, and TCD-DETR identified this small crack, but the first five algorithms all had problems with localization bias or redundant detection boxes. The improved model showed better consistency in box shape and position, indicating that its regression of small targets was more stable.
[0081] Figure 10 This is the detection image of cracks in the presence of interfering elements. As can be seen from the image, YOLOv7 and YOLOv10 show significant prediction gaps in this case, and RF-DETR also exhibits a tendency to miss detections. This indicates that some models lack robustness and are prone to missed detections when faced with interfering elements and non-uniform textures. RT-DETR and RT-DETR-L show multiple redundant boxes, reflecting their unstable crack detection under background interference. While YOLOv26, Edge-YOLO, and RT-DETR-X models can locate cracks, there is a certain deviation between the detection boxes and the labeled boxes, resulting in inaccurate detection results. Among them, the improved model has a more compact localization and the highest confidence score, demonstrating better anti-interference and bounding box regression capabilities.
[0082] The above description only illustrates the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention, and all such changes should be included within the protection scope of the present invention.
Claims
1. A method for real-time end-to-end detection of cracks in the lining of highway tunnels, characterized in that, Includes the following steps: S1. Collect images of highway tunnel lining under multiple working conditions, construct a lining crack dataset containing crack samples with multiple scales, multiple illuminations, and multiple occlusion interferences, scale the images to a uniform size and label the true boundary boxes of the cracks, and divide them into training set and validation set according to the proportion. S2. Construct the TCD-DETR model and make four structural improvements to the baseline RT-DETR-L: embed a cross-stage cascaded bilinear axial context enhancement module CSC-BACA into the backbone network; replace the original AIFI module in the neck area with a hybrid distance self-attention feature interaction module HSFI; integrate the frequency domain-aware dynamic downsampling module FADS into the feature interaction downsampling path; and use the SDG-IOU dynamic intersection-union ratio hybrid loss function to complete the model training optimization in the head boundary regression branch. S3. The TCD-DETR model was iteratively trained until convergence using the AdamW optimizer, cosine annealing learning rate decay strategy, and Mosaic data augmentation. S4. Input the tunnel lining image to be detected into the trained TCD-DETR model. No NMS post-processing is required. The model outputs crack detection boxes and class confidence scores end-to-end, thus completing the automated detection of lining cracks.
2. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 1, characterized in that, The CSC-BACA module in step S2 includes a BACA bilinear axial context enhancement block and a cross-stage cascade structure. The BACA block sets up a main path and an auxiliary path. The main path extracts the horizontal and vertical slender crack features through strip convolution and suppresses background interference with weights. The auxiliary path performs one-dimensional axial global average pooling on the basic features and generates global context information through outer product broadcasting. The dual-path feature fusion outputs features that enhance the axial continuity of the crack. In step S2, the HSFI module sets up two types of sub-attention heads in parallel: Manhattan distance self-attention MaSA and Huber distance self-attention HuSA. MaSA relies on linear Manhattan distance to model the global long-range dependence of long straight cracks, while HuSA uses piecewise Huber distance. In the near-distance range, a second attenuation is used to enhance the local details of crack bending and bifurcation, while in the far-distance range, a linear attenuation is used to preserve long-range feature dependence. The outputs of the two types of attention heads are fused to achieve multi-scale crack feature interaction.
3. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 1, characterized in that, In step S2, the FADS module sets up a frequency domain sensing branch and a residual downsampling branch in parallel. The frequency domain sensing branch performs DCT discrete cosine transform on the input features to split them into multiple frequency domain sub-bands. The weights of each frequency band are adaptively calibrated through a lightweight two-layer MLP to highlight the high-frequency details of the crack edge. The residual branch uses a depthwise separable convolution with a stride of 2 to complete spatial downsampling. The outputs of the two branches are added and fused element by element, preserving the high-frequency information of the crack fine line edge during the downsampling process.
4. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 1, characterized in that, In step S2, the SDG-IOU dynamic intersection-union ratio loss function is a weighted mixture of GIoU loss and improved SDIoU loss. The improved SDIoU loss uses the geometric mean of the predicted box and the true box area to construct a symmetric scale factor, introduces a logarithmic scale squared penalty term to constrain the crack scale deviation, and adaptively adjusts the scale penalty weight through a dynamic gating mechanism to achieve accurate regression of the bounding boxes of small and large cross-scale cracks.
5. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 2, characterized in that, The execution flow of the BACA bilinear axial context enhancement block is as follows: Input feature x is processed by 5×5 DWConv to extract shared basic features f; Main path: Horizontal and vertical strip convolution is used to extract anisotropic slender crack features, which are then multiplied element-wise with the original input features to achieve irrelevant background suppression; Auxiliary path: Perform horizontal global average pooling H on the basic feature f respectively. GAP Vertical global average pooling V GAP The global two-dimensional context features are generated by outer product broadcast multiplication, and then the global context features z are obtained by 1×1 pointwise convolution and GELU nonlinear activation. The main path output feature is added to the auxiliary path feature z element by element to output a single block axial enhancement feature; The CSC-BACA cross-stage cascaded structure consists of two sets of CBS channel transformation modules, an intermediate BACA block connected in series, and optional residual connections. It strengthens the characterization of crack direction and continuity across stages, while simultaneously reducing the overall number of model parameters and computational overhead.
6. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 2, characterized in that, The one-dimensional axial Huber distance logarithmic offset calculation method of HuSA is as follows: Let the relative distance between tokens along the one-dimensional axis be d = |ij|, δ be the local threshold, γ be the attenuation base, and α = logγ; When d ≤ δ, the spatial bias term is α・d 2 / (2δ); When d > δ, the spatial bias term is α・(d-δ / 2); The complete HuSA attention weights are obtained by fusing the one-dimensional Huber bias in height and width dimensions. MaSA Manhattan self-attention uses a fixed linear decay bias α·d, and the HuSA and MaSA multi-head parallel output channels are spliced together to complete the multi-scale feature interaction of the HSFI module.
7. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 3, characterized in that, The processing steps for the frequency domain sensing branch in the FADS module are as follows: Perform a locally normalized 2-point DCT orthogonal transform with a step size of 2 on the input features to decompose and obtain the low-frequency subband F. ll Horizontal high-frequency subband F lh Vertical high-frequency subband F hl Diagonal high-frequency subband F hh Four sets of frequency band coefficients; Global compression statistics are performed on the four frequency bands to obtain single scalar responses, which are then input into a two-layer lightweight MLP to generate adaptive frequency band weights. The coefficients of each frequency band are weighted and calibrated using weights. The weighted frequency band feature channels are concatenated and then compressed back to the original channel dimension through a 3×3 convolution to obtain the frequency domain sensing branch output; The residual branch uses a 3×3 depthwise separable convolution with the number of groups equal to the number of channels, and sets the stride=2 to complete spatial downsampling; The outputs of the frequency domain sensing branch and the residual branch are added element by element to form the final downsampling feature of the FADS module.
8. The method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 4, characterized in that, The improved SDIoU loss is constructed as follows: Formula for calculating the symmetry scaling factor β: Among them, w p h p with w gt h gt δ represents the width and height of the predicted bounding box and the ground truth bounding box, respectively, and δ∈(0,1] is a hyperparameter; Standard penalty items The dynamic gating weight γ = β / δ, and the total scale penalty term is γ·s; SDIoU basic terms combine the Euclidean distance between the center points of the ground truth bounding box and the predicted bounding box, the diagonal of the minimum bounding rectangle, and the total scale penalty term; Formula for calculating mixed loss: λ∈[0,1] is the equilibrium hyperparameter, and the synchronous and accurate regression of the boundaries of minute narrow cracks and wide through cracks is achieved through joint optimization.
9. A method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 1, characterized in that, The dataset construction and training hyperparameter configuration in step S1 are as follows: The dataset includes a self-built tunnel lining crack dataset and the open-source TTD tunnel dataset. The self-built dataset contains 2,600 images with a resolution of 640×640, collected from the tunnel arch, sidewall, and invert areas. The samples include various crack morphologies such as straight lines, curves, meshes, and branches, covering interference scenarios such as low light, strong reflection, corrosion damage, and pipeline obstruction. The training set and validation set are randomly divided in a 7:3 ratio. Model training hyperparameters: AdamW optimizer initial learning rate 0.0002, weight decay coefficient 0.0005, batch size set to 16, total training epochs 200, training process uses cosine annealing learning rate decay strategy and Mosaic data augmentation.
10. A method for real-time end-to-end detection of cracks in highway tunnel lining according to claim 1, characterized in that, The performance metrics of the TCD-DETR model trained in step S3 satisfy the following: On the tunnel crack test set collected in the field, the precision was 92.2%, the recall was 88.1%, the mAP50 was 92.0%, and the mAP50:95 was 64.3%. The model had 24.3M parameters and a computational complexity of 76.2 GFLOPs, which is a 25.9% reduction in parameters and a 29.4% reduction in computation compared to the baseline RT-DETR-L. On the open-source TTD cross-domain tunnel dataset, the mAP50 reached 78.5%, and the false negative rate was lower than that of the YOLO series and other DETR-class comparison detection algorithms.
Citation Information
Patent Citations
Tunnel lining crack image detection method
CN110689538A
A method for detecting apparent cracks in highway tunnels based on deep learning
CN117934473B
