A precision and efficiency balanced detection algorithm for bridge apparent disease
Patent Information
- Application Number
- CN202610895799.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-10-16
AI Technical Summary
然而,当该架构直接应用于桥梁病害检测并面向边缘计算终端部署时,其原始设计难以适配病害的特殊形态与严苛的算力约束,庞大的参数规模与高昂的计算开销导致端侧实时推理难以实现
[0016]1、本发明提出端到端协同优化检测路径,融合轻量化可变形主干、非对称重参数化编码器与动态聚焦损失函数,突破传统固定感受野局限,实现不规则病害自适应对齐与高效表征,检测结果准确可靠。
Smart Images

Figure CN122929384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a bridge surface defect detection algorithm, specifically a detection algorithm that balances accuracy and efficiency for bridge surface defects, belonging to the fields of computer vision, deep learning, data science, and engineering application technology. Background Technology
[0002] Regular inspections of bridge surface defects are crucial for assessing structural health and developing scientific maintenance strategies. Traditional manual inspections rely heavily on the experience of inspectors, making them susceptible to subjective judgment, working environment, and fatigue. This leads to the risk of missing hidden defects such as minute cracks and flaking with blurred edges, and is insufficient to meet the demands of large-scale, routine, and efficient bridge inspections. With the development of intelligent inspection equipment such as drones and mobile robots, deep learning-based automated visual inspection technology is gradually becoming the mainstream approach for identifying bridge surface defects. However, in actual inspection scenarios, image acquisition is easily affected by factors such as changes in lighting, shooting angle, background texture interference, and differences in target scale. Some defects present challenges in the image domain, such as weak features, unclear boundaries, or irregular shapes, placing higher demands on the robustness and generalization ability of detection algorithms. Therefore, developing high-precision, highly adaptable, lightweight automated inspection technology is of significant engineering value for achieving early detection and accurate location of various bridge defects under complex conditions.
[0003] Among numerous object detection architectures, Transformer-based models (such as...) Figure 2The RT-DETR shown, with its global context awareness and end-to-end optimization features, effectively overcomes the limitations of the local receptive field of traditional CNNs, demonstrating significant advantages in the identification of defects in complex backgrounds. However, when this architecture is directly applied to bridge defect detection and deployed to edge computing terminals, its original design struggles to adapt to the special morphology of defects and stringent computational constraints. The massive parameter scale and high computational overhead make real-time inference on the edge difficult to achieve. It is under this dual challenge of accuracy requirements and deployment limitations that existing detection architectures still face three major systemic bottlenecks when dealing with bridge surface defect tasks: First, there is an inherent contradiction between geometric deformation adaptation capability and lightweight deployment. Existing lightweight improvements mostly rely on standard convolutional replacement or network pruning. Although this reduces the number of parameters, the fixed square receptive field is difficult to fit the bending extension trajectory of cracks and the twisted boundaries of peeling, resulting in insufficient geometric feature alignment. Efficiency improvements often come at the cost of significant accuracy loss. Second, the interaction efficiency of topological features of multi-scale defects is low. Bridge defects span a wide range of scales and vary in shape. Traditional feature fusion often employs fixed-weight strategies, lacking adaptive weighting mechanisms for slender cracks and irregular patches. This makes weak features easily drowned out by background noise during deep semantic transmission, and redundant computation further exacerbates the conflict between feature representation and real-time inference. Third, the bounding box regression loss and the geometric prior of the defects are not co-optimized. Mainstream solutions often use general IoU series losses for unified regression, without explicitly modeling the aspect ratio characteristics of slender targets. Moreover, uneven gradient distribution occurs when facing extremely difficult samples and small targets, easily causing jitter in the center point positioning of the predicted box and missed detections. The complex modules introduced to compensate for accuracy further disrupt the balance between accuracy and efficiency. Summary of the Invention
[0004] To address the aforementioned technical issues, this invention provides a detection algorithm that balances accuracy and efficiency for bridge surface defects. The aim is to solve the problems faced in edge deployment scenarios for intelligent bridge inspection based on a Transformer-based detection architecture. It is suitable for high-precision, low-overhead automated detection solutions for resource-constrained edge inspection terminals. Under the constraints of model parameter quantity and floating-point computational complexity, it achieves high recall and accurate boundary regression for multiple types of bridge surface defects, thereby overcoming the bottleneck between "accurate characterization of complex defect morphology" and "lightweight deployment at the edge."
[0005] To achieve the above objectives, the present invention provides an algorithm for balancing accuracy and efficiency in detecting apparent defects in bridges, characterized by the following steps: S1. Collect high-resolution images of apparent defects on multiple bridges and preprocess them to construct a bridge defect dataset. S2, use image annotation tools to accurately annotate the diseased areas in the high-definition images of bridge surface defects collected in step S1, and generate corresponding bounding box labels. S3, Based on the collected data on the irregular morphology and scale differences of bridge defects, a lightweight deformable backbone network LD-Backbone module is constructed. S4. To improve the efficiency of feature fusion mechanisms in the characterization of slender / irregular diseases, an asymmetric reparameterized encoder (ARP-Encoder) module is constructed. S5. To address the issues of uneven gradient distribution for extremely difficult samples and jitter in the localization of slender targets in bridge defect detection, a dynamic focusing shape constraint DF-WIoU loss function is established. S6. Integrate the LD-Backbone module built in step S3, the ARP-Encoder module built in step S4, and the DF-WIoU loss function in step S5 into the RT-DETR architecture to build an LB-RTDETR architecture that supports end-to-end training. S7 presents the original RT-DETR architecture and the visualization results of the LB-RTDETR architecture constructed in step S6, as well as comparative and ablation experiments.
[0006] Further, step S7 includes the following steps: S71. Based on the constructed bridge defect dataset, RT-DETR and LB-RTDETR are trained end-to-end. Based on the training weights, the detection results of the test set are superimposed on the original image using visualization technology to intuitively compare the detection effect and localization accuracy of the two models in cracks, spalling, water seepage spots and efflorescence targets. S72, under the same dataset and experimental configuration, a lightweight CNN model and a Transformer variant were selected as the benchmark for comparison. Precision, Recall, mAP50, APs, APm, APl, number of parameters and floating-point operation were used as evaluation indicators to verify the comprehensive advantages of LB-RTDETR in the trade-off between accuracy and efficiency. S73 employs multiple ablation experiment combinations, and by sequentially introducing or replacing the LD-Backbone, ARP-Encoder, and DF-WIoU modules, quantitatively evaluates the independent contribution and synergistic gain of each core component to the model's detection accuracy, small target recall rate, and lightweight metrics.
[0007] Further, step S1 includes the following steps: S11 uses drones to collect high-definition images of the surfaces of multiple bridges under complex lighting and multi-view conditions, covering four typical diseases: cracks, spalling, water seepage spots and efflorescence. S12, Based on the high-resolution images of the bridge surface collected in step S11, size normalization and dataset partitioning are performed to construct a benchmark dataset for model training and generalization capability verification.
[0008] Furthermore, step S2, which involves precise annotation using an image annotation tool, includes the following steps: S21 utilizes the Roboflow platform for disease data management, and completes accurate annotation of large-scale image data through intelligent rectangle tools and category mapping mechanisms; S22, the image annotations completed in step S21 are saved in TXT text format, containing bounding box coordinates and category information, forming a supervision signal that the model can read.
[0009] Furthermore, the construction of the LD-Backbone module in step S3 also includes the following steps: S31 uses two strides of convolution in the Stem module to achieve fast downsampling, and then builds a three-stage single-block feature extraction architecture, which greatly reduces network depth and basic computational redundancy. S32 uses the DE-Bottleneck structure, which couples deformable convolution with efficient multi-scale attention, as the basic building block, and sequentially connects four processing stages: 1×1 convolution dimensionality reduction, geometric adaptive convolution, attention enhancement, and 1×1 convolution dimensionality increase.
[0010] Furthermore, the construction of the DE-Bottleneck module in step S32 also includes the following steps: S321 introduces deformable convolution to replace standard convolution. It dynamically adjusts the sampling grid through learnable spatial offset and modulation scalar to achieve adaptive receptive field shape to fit irregular boundaries. S322, after deformable convolution, serially couples the EMA module, and performs secondary filtering of features through cross-dimensional one-dimensional global pooling and gating mechanism, which enhances channel discrimination and suppresses complex background noise.
[0011] Furthermore, the construction of the ARP-Encoder module in step S4 includes the following steps: S41, construct an enhanced CSP topology, input the multi-scale features after channel splicing into a 1×1 convolution for dimensionality reduction mapping and then split them into two paths to achieve efficient interaction between features of adjacent levels; S42 introduces asymmetric depth convolution at the key bottleneck position of the enhanced CSP topology, decomposing the standard convolution into horizontal and vertical parallel branches to expand the receptive field along the crack direction. S43, In step S41, the reparameterized RepVGG module is integrated into the main bottleneck. During the training phase, a multi-branch gradient flow of 3×3 convolution, 1×1 convolution and identity mapping is constructed to enrich the representation. During the inference phase, the linear equivalence principle is used to fuse it into a single 3×3 convolution to achieve zero additional computational overhead. S44 adds the nonlinear transformation features of the main path and the linear features of the secondary path element by element, and combines them with a lightweight Transformer encoder layer to achieve the unification of local geometric priors and global semantics.
[0012] Furthermore, establishing the DF-WIoU loss function in step S5 includes the following steps: S51, based on the WIoU v3 framework, calculate the intersection-union ratio, the Euclidean distance between the center points of the predicted box and the ground box, and the diagonal distance of the minimum bounding rectangle to construct the basic regression loss; S52 introduces a Gaussian non-monotonic focusing mechanism, which dynamically allocates gradient gain and sets upper and lower cutoff limits based on target quality to avoid training dominated by extremely difficult samples or annotation noise.
[0013] Furthermore, the gradient dynamic allocation mechanism in step S52 also includes the following steps: S521, explicitly calculate the aspect ratio difference between the predicted box and the actual box, construct a shape-aware factor, and specifically constrain the boundary regression consistency of slender diseases; S522 integrates the dynamic focusing factor and shape-aware factor into the loss calculation, adjusting sample weights only during the backpropagation stage to ensure zero computational overhead during the forward inference stage.
[0014] Furthermore, the construction of LB-RTDETR in step S6 also includes the following steps: S61 uses LD-Backbone to replace the original ResNet backbone network of RT-DETR, and utilizes its three-level single-block simplified architecture to output P3 / P4 / P5 multi-scale features, reducing network depth while retaining geometric adaptability. S62 replaces the original hybrid encoder with ARP-Encoder, and achieves the unification of local geometric prior and global contextual semantics through asymmetric deep convolution and reparameterization strategies, while eliminating redundant computational overhead. S63 uses DF-WIoU to replace the standard bounding box regression loss during the training phase, co-optimizing the classification branch and regression branch to achieve a global balance between detection accuracy and inference efficiency.
[0015] Advantages and effects of the present invention:
[0016] 1. This invention proposes an end-to-end collaborative optimization detection path, which integrates a lightweight deformable trunk, an asymmetric reparameterized encoder, and a dynamic focusing loss function. This breaks through the limitations of traditional fixed receptive fields, achieves adaptive alignment and efficient characterization of irregular diseases, and provides accurate and reliable detection results.
[0017] 2. Compared with traditional convolutional detection models based on fixed receptive fields, this invention has strong resistance to background interference. By using a learnable sampling grid to accurately fit the path of the defect, it effectively solves the problem that subtle defects are easily buried by deep noise. In actual inspection, there is no need to rely on cumbersome image enhancement or post-processing.
[0018] 3. Compared with the existing Transformer detection architecture that introduces a high-overhead attention mechanism, this invention adopts asymmetric convolution and reparameterization strategy to avoid redundant computation of global self-attention, and achieves an equivalent fusion of "multi-branch training and single-path inference", which significantly improves feature representation ability without increasing inference latency.
[0019] 4. Compared with the use of a general regression loss function, this invention introduces a dynamic focusing factor and aspect ratio shape constraint, abandons the uniform weight gradient backpropagation, and specifically optimizes difficult samples and slender targets, effectively suppressing prediction box positioning jitter and improving model convergence stability. Attached Figure Description
[0020] Figure 1 This is a flowchart of a detection algorithm for balancing accuracy and efficiency in detecting apparent defects of bridges, as described in this invention.
[0021] Figure 2 This is a diagram of the RT-DERT architecture.
[0022] Figure 3 This is a diagram of the LD-Backbone architecture.
[0023] Figure 4 This is a diagram of the DE-Bottlemeck architecture.
[0024] Figure 5 This is a diagram comparing convolutional sampling methods.
[0025] Figure 6 This is a diagram of the APR-Encoder architecture.
[0026] Figure 7 This is a structural diagram of the reparameterized RepVGG module.
[0027] Figure 8 Schematic diagram of loss function optimization.
[0028] Figure 9 This is a diagram of the LB-RTDETR architecture.
[0029] Figure 10 A visualization of the RT-DETR and LB-RTDETR results.
[0030] Figure 11 A diagram showing the accuracy-efficiency trade-off between different experimental models.
[0031] Figure 12 A comparative chart was provided for the ablation experiment components. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention. It should be noted that these specific embodiments are not intended to limit the scope of protection of the present invention.
[0033] like Figures 1 to 10 This specific embodiment provides an algorithm that balances accuracy and efficiency for addressing apparent defects in bridges, including the following steps:
[0034] S1: Collect 6400 high-resolution images of apparent defects on multiple bridges, perform preprocessing and dataset partitioning, and construct a bridge defect dataset. The preprocessing and dataset partitioning also include the following steps: S11 used a DJI Mavic 3 drone and its onboard 4 / 3-inch CMOS Hasselblad camera to collect high-resolution images of the surfaces of multiple bridges under complex lighting and multi-view conditions, covering four typical types of defects: cracks, spalling, wetspots, and efflorescence. A total of 6,400 images were collected. All images ensured that the texture of the defect areas was clear and the lighting distribution was representative of the engineering site. S12, perform standardized preprocessing on the 6400 images collected in step S11: First, scale all images to a resolution of 640×640 while maintaining the original aspect ratio, and fill blank areas with grayscale pixels to eliminate geometric deformation interference; then, divide the dataset into a training set of 5020 images, a validation set of 690 images, and a test set of 690 images according to a fixed ratio to construct a bridge disease benchmark dataset with a standardized structure and balanced category distribution, providing data support for model training and generalization ability verification.
[0035] S2, use an image annotation tool to accurately annotate the diseased areas in the high-definition image of bridge surface disease after preprocessing in step S1, and generate corresponding bounding box labels. The precise annotation using image annotation tools includes the following steps: S21. The Roboflow platform is used for disease data management and annotation task distribution. Through the intelligent rectangle tool and the predefined category mapping mechanism (0: Crack, 1: Spalling, 2: Wetspot, 3: Efflorescence), the fine annotation of the bridge appearance image dataset divided in step S1 is completed in batches. S22. Export the annotation results completed in step S21 into the YOLO standard TXT text format. The file content includes the normalized bounding box center coordinates (x_center, y_center), relative width and height (width, height), and corresponding disease category labels, forming a supervision signal that the model can efficiently read.
[0036] S3, as Figure 3 As shown, based on the characteristics of irregular morphology and large scale differences of bridge defects, a lightweight deformable backbone network (LD-Backbone) module is constructed; the construction of the LD-Backbone module includes the following steps: S31 uses two 3×3 convolutional layers with a stride of 2 in the Stem module to achieve fast downsampling, reducing the input image size to H / 4×W / 4; then a three-stage single-block (Stage 2~4) feature extraction architecture is constructed, which outputs multi-scale feature maps (P3, P4, P5) of H / 8×W / 8, H / 16×W / 16, and H / 32×W / 32 in sequence, with the number of channels configured as 128, 256, and 512 respectively, which greatly reduces the network depth and basic computational redundancy; S32, such as Figure 4 As shown, a Bottleneck structure (DE-Bottleneck) coupled with Depth-wise DCNv2 (DW DCNv2) and Efficient Multi-Scale Attention (EMA) is created as the basic building block of LD-Backbone. The four processing stages of 1×1 convolution dimensionality reduction, geometric adaptive convolution, attention enhancement and 1×1 convolution dimensionality increase are sequentially connected to realize a complete feature processing flow of channel compression, geometric alignment, semantic filtering and channel restoration. The creation of the DE-Bottleneck structure also includes the following steps: S321 introduces DW DCNv2 to replace the standard convolution. By adding learnable spatial offsets (Offset) and modulation scalars (Mask) to the preset sampling grid, the receptive field shape is dynamically adjusted to adaptively fit irregular disease boundaries such as spalling. The mathematical expression of the DCNv2 convolution output is: ; in, For output position, For relative sampling points, and These are the offset and modulation weights learned by the network, respectively; such as Figure 5 As shown, This drives the sampling points to undergo nonlinear displacement from the regular grid (blue dots) to precisely align with the crack direction (red dot trajectory), while Background noise is suppressed by adjusting the sampling point weights (manifested as changes in point size and transparency), thereby ensuring the output features. Focus on areas with effective disease control.
[0037] S322, after DW DCNv2, serially couples the EMA module, captures long-distance dependencies through cross-dimensional one-dimensional global pooling (H×1 in the height direction and 1×W in the width direction), generates gated weights through 1×1 convolution dimensionality reduction and fusion and 3×3 convolution, and then performs secondary filtering of features through the Sigmoid activation function, effectively enhancing channel discrimination and suppressing complex background noise.
[0038] S4, as Figure 6 As shown, to address the inefficiency of traditional feature fusion mechanisms in the characterization of slender / irregular diseases, an asymmetric reparameterization encoder (ARP-Encoder) module is constructed. The construction of the ARP-Encoder module also includes the following steps: S41 constructs an enhanced CSP topology (Asymmetric CSP Block, ACSP), employing a "splitting-reassembling" mechanism to concatenate features from adjacent layers and reduce dimensionality through 1×1 convolutions. A dual-path parallel structure is then designed: the main path extracts complex nonlinear features, while the secondary path constructs linear shortcuts to preserve original information. Finally, the residuals are summed for output, effectively enhancing the model's ability to express multi-scale information. S42 introduces asymmetric depthwise convolution (ADWConv) and a reparameterized RepVGG module at the critical bottleneck location of ACSP, such as... Figure 7 As shown, the standard convolution is decomposed into horizontal and vertical parallel branches, and a multi-branch inference single-path structure is integrated for training. The construction of the ADWConv and reparameterized RepVGG modules also includes the following steps: The introduction of the S421 ADWConv module decouples the standard square convolution kernel into two independent parallel branches: a horizontal branch (1×K) and a vertical branch (K×1), which extract the texture responses of the horizontal extension and vertical expansion, respectively. Its forward propagation is formally described as follows: ; Where X is the input feature map, Y is the output feature map, and K is the odd-numbered convolutional kernel size, this design significantly expands the effective receptive field along the crack direction at low cost; such as Figure 6 As shown in the ACSP module in the lower right corner, when the input feature map... When representing crack textures on a bridge surface, standard square convolution kernels often struggle to simultaneously capture both horizontally extending long cracks and vertically expanding spalling edges. Introducing ADWConv improves this. The branches are specifically responsible for capturing laterally extending crack features (such as horizontal cracks), while The branch focuses on vertical textures (such as vertical water seepage marks). The two are fused additively to produce a better output feature map. It can simultaneously include information on slender diseases in both horizontal and vertical directions, and the computational cost is only that of standard... Convolution .
[0039] S422, a cascaded reparameterized RepVGG module, constructs three gradient flow channels in parallel during the training phase: a 3×3 convolution, a 1×1 convolution, and an identity mapping. The forward propagation formula is defined as: ; During the inference phase, the linear superposition property of convolution and BatchNorm is utilized to equivalently collapse multi-branch parameters into a single 3×3 convolutional layer, achieving a zero-additional-latency structure fusion of "multi-branch training, single-path inference"; for example... Figure 6 As shown in the Re-parameterized RepVGG Block in the lower right corner, during the model training phase, in order to enhance the feature extraction capability for irregular defects (such as pits with varying shapes), we constructed three gradient flows using the following formula: Branches capture local spatial details (such as pit edges). The branches fuse information between channels (such as the correlation between color and texture), while the Identity branch preserves the original features to prevent gradient vanishing. This multi-branch structure enriches the feature representation. During actual deployment and inference, these three branches are fused into a single branch based on the linear superposition property of the formula. Convolutional layers enable rapid detection with zero additional computational overhead without sacrificing accuracy.
[0040] S423 performs element-wise addition and recombination of the nonlinear features of the main path after processing by ADWConv and RepVGG with the linear features of the secondary path. A lightweight Transformer encoder layer is then connected after the deep feature nodes of P4 / P5. Through the self-attention mechanism, it captures long-distance dependencies across scales and achieves the organic unity of local geometric deformation priors and global contextual semantics.
[0041] S5 addresses the issues of uneven gradient distribution for extremely difficult samples and jitter in the localization of slender targets in bridge defect detection by creating a dynamic focusing shape constraint loss function (Dynamic Focal-WioU, DF-WIoU). The creation of the DF-WIoU function also includes the following steps: S51, based on the WIoU v3 framework, calculate the intersection-over-union ratio (IoU), the squared Euclidean distance between the center points of the predicted box and the ground truth box, and the squared diagonal distance of the minimum bounding rectangle, and construct the basic bounding box regression loss as a benchmark metric for gradient optimization; S52 introduces a Gaussian non-monotonic focusing mechanism and a shape-aware factor to construct a collaborative optimization strategy for gradient dynamic allocation and geometric constraints. The strategy for co-optimizing gradient dynamic allocation and geometric constraints also includes the following steps: S521, Calculate the Gaussian non-monotonic focusing factor The gradient gain is dynamically allocated based on the target quality (i.e., IoU value), and the peak parameter is set. Furthermore, gradient truncation is performed on low-quality (IoU < 0.3) and high-quality (IoU > 0.9) samples using an indicator function to avoid training dominated by extremely difficult samples or annotation noise; the aspect ratio difference between the predicted bounding box and the ground truth bounding box is explicitly calculated to construct a shape-aware factor. This approach specifically constrains the aspect ratio consistency of prediction frames for slender defects (such as cracks), thereby improving the geometric stability of boundary regression. S522 integrates the dynamic focusing factor and shape-aware factor into the loss calculation and applies upper and lower limit truncation to the gain. =0.5, =2.5), the final bounding box loss is defined as: ; like Figure 8 As shown, to address the localization jitter problem in traditional methods where the predicted bounding box (red dashed line) covers the target but the aspect ratio is mismatched, this formula... The method generates a strong gradient force perpendicular to the boundary (shown by the blue arrow in the figure), forcing the "fat" predicted box to shrink in the height direction to fit the true geometry of the slender crack. This mechanism only adjusts the sample weights to optimize the gradient flow during the backpropagation stage, without adding any additional operators during the forward inference process, ensuring zero computational overhead for accuracy improvement. The classification loss simultaneously adopts the Varifocal Loss (VFL) framework, and the quality label uses the IoU between the predicted box and the ground truth box. The focusing parameter γ=2.0 and the balance coefficient α=0.75 achieve collaborative optimization of classification and regression.
[0042] S6, integrate the LD-Backbone module built in step S3, the ARP-Encoder module built in step S4, and the DF-WIoU loss function built in step S5 into the RT-DETR architecture, replacing the original backbone, encoder, and loss function, thereby constructing... Figure 9 The diagram shows an LB-RTDETR (Lightweight Bridge RTDETR) architecture that supports end-to-end training. The construction of the LB-RTDETR architecture also includes the following steps: S61 uses LD-Backbone to replace the original ResNet backbone network of RT-DETR, and utilizes its three-level single-block simplified architecture to output P3 / P4 / P5 multi-scale features, reducing the network depth while retaining the geometric adaptability to irregular defects. S62 replaces the original hybrid encoder with ARP-Encoder, and achieves the unification of local geometric priors and global semantics through asymmetric depthwise convolution and structural reparameterization strategies, while eliminating redundant computational overhead. S63. During the training phase, DF-WIoU is used to replace the standard bounding box regression loss, co-optimizing the classification branch (Varifocal Loss, VFL) and regression branch to achieve a global balance between detection accuracy and inference efficiency. All models in this invention are trained on hardware equipped with an NVIDIA L40 graphics processing unit (GPU) and implemented using the PyTorch 2.1.0 deep learning framework. Specific training parameter configurations are shown in Table 1.
[0043] Table 1 Training parameter configuration
[0044] ;
[0045] S7 presents the visualization results of the original RT-DETR and the LB-RTDETR constructed in step S6, and conducts multi-model comparison experiments and modular ablation experiments to comprehensively evaluate the accuracy-efficiency co-optimization capability of the proposed algorithm. The visualization, comparative experiments, and ablation experiments also include the following steps: S71, based on the constructed bridge defect dataset, end-to-end training of RT-DETR and LB-RTDETR is performed. After training, the optimal weights are loaded, and visualization techniques are used to overlay the test set detection results onto the original image, such as... Figure 10 As shown, a direct comparison of the two models in terms of detection performance, localization accuracy, and background suppression capability for targets such as cracks, peeling, water stains, and efflorescence verifies the superiority of LB-RTDETR in scenes with blurred boundaries and complex textures. S72 selects mainstream lightweight CNN models and advanced Transformer variants as comparison benchmarks. Mainstream lightweight CNN models are YOLOv8n, YOLOv10n, YOLO11n, or YOLO11s, while advanced Transformer variants are RT-DETR, GM-DETR, or UCRT-DETR. Precision, Recall, mAP50, APs, APm, APl, number of parameters (Params / M), floating-point operations (FLOPs / G), end-to-end inference speed (FPS), and single-frame inference latency (Latency / ms) are selected as evaluation metrics. The reason for selecting these evaluation metrics is that mAP50 comprehensively measures the overall accuracy of the model under medium localization thresholds; APs specifically evaluates the detection capability of small targets (area <32² pixels); Params and FLOPs directly reflect the model's storage requirements and computational complexity; and FPS and Latency directly determine the model's real-time response capability on edge computing terminals. These four metrics together constitute the core basis for the accuracy-efficiency trade-off analysis. All models were trained in a unified environment (300 epochs for YOLO series, 120 epochs for Transformer series, with a unified batch size of 1 for inference speed testing), and the results are shown in Table 2. LB-RTDETR, with 10.07M parameters and 15.52G FLOPs, achieved mAP50=83.1%, APs=0.285, and Recall=0.931. In terms of real-time performance, LB-RTDETR achieved an end-to-end inference speed of 59.55 FPS with a single-frame latency of only 16.8ms; compared to the original RT-DETR (40.58 FPS, latency 24.6 ms), its throughput increased by 46.7%, while the single-frame latency decreased by 31.8%. This performance stems from the collaborative design of a lightweight deformable backbone network and an asymmetric reparameterized encoder, effectively eliminating redundant computational branches in traditional models. Overall, LB-RTDETR occupies the optimal region in the accuracy-efficiency Pareto front, such as... Figure 11 As shown, this fully demonstrates its potential for real-time deployment on resource-constrained edge devices.
[0046] Table 2 Results of multi-model comparison experiments
[0047] .
[0048] S73, multiple ablation experiment combinations were designed. By sequentially introducing LD-Backbone, ARP-Encoder, and DF-WIoU modules, the independent contributions and synergistic gains of each core component to the model's detection accuracy and various indicators were quantitatively evaluated. Five control groups were set up: baseline (RT-DETR), LD-Backbone only (Expert1), LD-Backbone and ARP-Encoder (Expert2), LD-Backbone and DF-WIoU (Expert3), and the complete model (LB-RTDETR). The data in Table 3 are compared with... Figure 12 A comparison of the contributions of the ablation experiment components reveals a significant cumulative effect in the performance gains of each module. Specifically, the introduction of LD-Backbone alone increases mAP50 by 2.5% (to 0.826) and reduces Params by 37.8%; ARP-Encoder further compresses Params to 10.07M and reduces FLOPs to 15.52G, ensuring the stability of linear features; DF-WIoU, through dynamic focusing and shape-aware mechanisms, increases APs from 0.243 to 0.285 (an increase of 17.3%). With the synergistic effect of the three modules, LB-RTDETR achieves a breakthrough in both accuracy and efficiency while halving the number of parameters, fully validating the engineering applicability and deployment potential of the proposed architecture in complex bridge environments.
[0049] Table 3 Experimental results for each module
[0050] .
[0051] S74. To verify the robustness of LB-RTDETR on unseen data, 690 test images, independent of the training set, were selected for generalization testing. The test set and training set both belong to the bridge appearance inspection scenario, but the test set includes specific images that were absolutely unseen during the model training phase. As shown in Table 4, the optimal weights of the original RT-DETR and LB-RTDETR were loaded for inference, and quantitative analysis was performed from two dimensions: false positive suppression and false negative improvement.
[0052] S741, taking the water stain category as an example in a scenario with strong reflective interference. The mAP50 of the RT-DETR category is only 0.379, indicating a significant number of false detections caused by strong reflectivity; the LB-RTDETR improves the mAP50 of this category to 0.418 (a relative improvement of approximately 10.1%). This demonstrates that the background suppression capability of the EMA module in the LD-Backbone can effectively reduce false detections caused by strong reflective noise.
[0053] In S742, under vegetation occlusion scenarios, the recall of cracks was used as the metric. RT-DETR achieved a crack-class recall of 0.898 (false negative rate of 10.2%), while LB-RTDETR improved this to 0.915 (false negative rate reduced to 8.5%). This indicates that optimizing the receptive field through asymmetric depthwise convolution in the ARP-Encoder helps reduce false negatives caused by occlusion.
[0054] Based on the above analysis, LB-RTDETR demonstrates stronger scenario adaptability and robustness in the absence of available data. Combined with the ablation experiment results of S73, each module not only brings gains in standard metrics but also plays a targeted improvement role in challenging scenarios.
[0055] Table 4. Verification Table of Defect Generalization Ability for Each Category
[0056] .
Claims
1. A precision-efficiency balanced detection algorithm for bridge surface defects, characterized in that... Includes the following steps: S1. Collect high-resolution images of apparent defects on multiple bridges and preprocess them to construct a bridge defect dataset. S2, use image annotation tools to accurately annotate the diseased areas in the high-definition images of bridge surface defects collected in step S1, and generate corresponding bounding box labels. S3. Based on the collected data on the irregular morphology and scale differences of bridge defects, a lightweight deformable backbone network LD-Backbone module is constructed. S4. To improve the efficiency of feature fusion mechanisms in the characterization of slender / irregular diseases, an asymmetric reparameterized encoder (ARP-Encoder) module is constructed. S5. To address the issues of uneven gradient distribution for extremely difficult samples and jitter in the localization of slender targets in bridge defect detection, a dynamic focusing shape constraint DF-WIoU loss function is established. S6. Integrate the LD-Backbone module built in step S3, the ARP-Encoder module built in step S4, and the DF-WIoU loss function in step S5 into the RT-DETR architecture to build an LB-RTDETR architecture that supports end-to-end training. S7 presents the original RT-DETR architecture and the visualization results of the LB-RTDETR architecture constructed in step S6, as well as comparative and ablation experiments.
2. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... Step S7 includes the following steps: S71. Based on the constructed bridge defect dataset, RT-DETR and LB-RTDETR are trained end-to-end. Based on the training weights, the detection results of the test set are superimposed on the original image using visualization technology to intuitively compare the detection effect and localization accuracy of the two models in cracks, spalling, water seepage spots and efflorescence targets. S72, under the same dataset and experimental configuration, a lightweight CNN model and a Transformer variant were selected as the benchmark for comparison. Precision, Recall, mAP50, APs, APm, APl, number of parameters and floating-point operation were used as evaluation indicators to verify the comprehensive advantages of LB-RTDETR in the trade-off between accuracy and efficiency. S73 employs multiple ablation experiment combinations, and by sequentially introducing or replacing the LD-Backbone, ARP-Encoder, and DF-WIoU modules, quantitatively evaluates the independent contribution and synergistic gain of each core component to the model's detection accuracy, small target recall rate, and lightweight metrics.
3. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... Step S1 includes the following steps: S11 uses drones to collect high-definition images of the surfaces of multiple bridges under complex lighting and multi-view conditions, covering four typical diseases: cracks, spalling, water seepage spots and efflorescence. S12, Based on the high-resolution images of the bridge surface collected in step S11, size normalization and dataset partitioning are performed to construct a benchmark dataset for model training and generalization capability verification.
4. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... Step S2, using image annotation tools for precise annotation, includes the following steps: S21 utilizes the Roboflow platform for disease data management, and completes accurate annotation of large-scale image data through intelligent rectangle tools and category mapping mechanisms; S22, the image annotations completed in step S21 are saved in TXT text format, containing bounding box coordinates and category information, forming a supervision signal that the model can read.
5. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... The construction of the LD-Backbone module in step S3 also includes the following steps: S31 uses two strides of convolution in the Stem module to achieve fast downsampling, and then builds a three-stage single-block feature extraction architecture, which greatly reduces network depth and basic computational redundancy. S32 uses the DE-Bottleneck structure, which couples deformable convolution with efficient multi-scale attention, as the basic building block, and sequentially connects four processing stages: 1×1 convolution dimensionality reduction, geometrically adaptive convolution, attention enhancement, and 1×1 convolution dimensionality increase.
6. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 5, characterized in that... The construction of the DE-Bottleneck module in step S32 also includes the following steps: S321 introduces deformable convolution to replace standard convolution. It dynamically adjusts the sampling grid through learnable spatial offset and modulation scalar to achieve adaptive receptive field shape to fit irregular boundaries. S322, after deformable convolution, serially couples the EMA module, and performs secondary filtering of features through cross-dimensional one-dimensional global pooling and gating mechanism, which enhances channel discrimination and suppresses complex background noise.
7. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... The construction of the ARP-Encoder module in step S4 includes the following steps: S41, construct an enhanced CSP topology, input the multi-scale features after channel splicing into a 1×1 convolution for dimensionality reduction mapping and then split them into two paths to achieve efficient interaction between features of adjacent levels; S42 introduces asymmetric depth convolution at the key bottleneck position of the enhanced CSP topology, decomposing the standard convolution into horizontal and vertical parallel branches to expand the receptive field along the crack direction. S43, In step S41, the reparameterized RepVGG module is integrated into the main bottleneck. During the training phase, a multi-branch gradient flow of 3×3 convolution, 1×1 convolution and identity mapping is constructed to enrich the representation. During the inference phase, the linear equivalence principle is used to fuse it into a single 3×3 convolution to achieve zero additional computational overhead. S44 adds the nonlinear transformation features of the main path and the linear features of the secondary path element by element, and combines them with a lightweight Transformer encoder layer to achieve the unification of local geometric priors and global semantics.
8. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... Step S5, establishing the DF-WIoU loss function, includes the following steps: S51, based on the WIoU v3 framework, calculate the intersection-union ratio, the Euclidean distance between the center points of the predicted box and the ground box, and the diagonal distance of the minimum bounding rectangle to construct the basic regression loss; S52 introduces a Gaussian non-monotonic focusing mechanism, which dynamically allocates gradient gain based on target quality and sets upper and lower cutoff limits to avoid training dominated by extremely difficult samples or annotation noise.
9. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 8, characterized in that... The gradient dynamic allocation mechanism in step S52 also includes the following steps: S521, explicitly calculate the aspect ratio difference between the predicted box and the actual box, construct a shape-aware factor, and specifically constrain the boundary regression consistency of slender diseases; S522 integrates the dynamic focusing factor and shape-aware factor into the loss calculation, adjusting sample weights only during the backpropagation stage to ensure zero computational overhead during the forward inference stage.
10. The accuracy-efficiency balance detection algorithm for bridge surface defects according to claim 1, characterized in that... Step S6, which involves constructing the LB-RTDETR, also includes the following steps: S61 uses LD-Backbone to replace the original ResNet backbone network of RT-DETR, and utilizes its three-level single-block simplified architecture to output P3 / P4 / P5 multi-scale features, reducing network depth while retaining geometric adaptability. S62 replaces the original hybrid encoder with ARP-Encoder, and achieves the unification of local geometric prior and global contextual semantics through asymmetric deep convolution and reparameterization strategies, while eliminating redundant computational overhead. S63 uses DF-WIoU to replace the standard bounding box regression loss during the training phase, co-optimizing the classification branch and regression branch to achieve a global balance between detection accuracy and inference efficiency.