A bridge disease detection method based on three-module collaborative improvement of YOLOv8-seg
By collaboratively improving the three modules of the YOLOv8-seg model, the problems of multi-scale, irregular shape and complex background interference in bridge defect detection were solved, and high-precision bridge defect detection and evaluation were achieved.
Patent Information
- Application Number
- CN202611092266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-11-20
AI Technical Summary
The existing YOLOv8-seg model has limitations in the extraction of backbone features, the SPPF module of the neck, the insufficient adaptability of the detection head, and the isolation of improvement technology in the inspection of bridge defects by UAVs. As a result, the rate of missed detection and false detection is high, and it is difficult to effectively handle the multi-scale, irregular shape and complex background interference of bridge defects.
The Bridge-Deformable-ECA, Bridge-SPPF-GAM, and Bridge-Adapt-Head modules are used to improve YOLOv8-seg. Through deformable convolution, dynamic pooling, and attention mechanisms, feature extraction, multi-scale fusion, and segmentation output are synergistically optimized to form a complete bridge defect detection process.
It achieves refined feature extraction, multi-scale feature fusion, and high-precision segmentation of bridge defects, reducing the rate of missed and false detections, and generating visualized defect segmentation masks and quantitative evaluation data.
Smart Images

Figure CN123142017A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image algorithm processing, specifically a bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg. Background Technology
[0002] The existing YOLOv8-seg model has a core deficiency in the scenario of UAV inspection of bridge defects because it is not customized and optimized for the characteristics of bridge defects, and the existing improvement technologies are scattered and have not formed a joint application: 1. Regarding backbone feature extraction: The C2f structure relied upon by the original YOLOv8-seg (which is no longer used in the method proposed in this study) has significant adaptation difficulties. This structure uses a uniform convolutional kernel for feature extraction, but the morphology of bridge surface defects varies greatly—cracks and exposed rebar are often elongated and irregularly distributed, while spalling and hole-like defects have significant spans in area scale. A single-size convolutional kernel is difficult to effectively capture such multi-scale targets simultaneously. In addition, images taken during actual inspections generally contain interference factors such as railing obstruction, light and shadow projection, and paint texture. These background information are easily confused with the defect areas in terms of visual features, and the existing module does not provide effective noise filtering methods, ultimately resulting in a high rate of missed detections and false detections.
[0003] 2. Limitations of the neck SPPF module: The native SPPF relies on several sets of pooling kernels of fixed size to complete multi-scale feature stitching, and the receptive field range is completely fixed. It cannot adaptively lock targets of different scales such as peeling and small holes according to the size of bridge defects. At the same time, the module does not embed attention weight allocation logic, and background noise such as wall weeds and supports cannot be effectively suppressed. The feature fusion effect of large and small defects is poor, and small targets such as tiny holes are very easy to lose feature information.
[0004] 3. Limitations of Detection Head Adaptability: The original YOLOv8-seg segmentation head uses the same process to handle features at different scales, which is unsuitable for targets like bridge cracks. In actual shooting, micro-cracks occupy very few pixels in the entire image, and their edge transitions are relatively blurry. The symmetric feature extraction method does not adjust the weights or receptive field separately for these small targets, resulting in a significant deviation between the predicted bounding box and the actual direction of the crack. In addition, during drone operations, the alternation of light and shadow caused by changes in the angle of sunlight, as well as the occlusion caused by scaffolding and pipelines, are unavoidable. As a result, some effective features of the target area are lost, but the existing detection module does not compensate for this, ultimately resulting in inaccurate coordinate regression and broken or missing segmentation masks.
[0005] 4. The isolation of existing improvement technologies: Existing related papers have adopted deformable convolution to optimize irregular target recognition, various attention networks to complete feature fusion, and lightweight methods to compress the detection head. However, most of these improvements are only suitable for single detection scenarios. Bridge defects such as cracks and spalling simultaneously present multiple challenges, including slender and irregular shapes, large scale spans, cluttered backgrounds, and difficulties in simultaneously handling segmentation and localization. Currently, there is a lack of a complete set of improvement ideas that coordinate the optimization of the backbone, cross-scale fusion, and detection head. At the same time, mature modules such as deformable convolution, ECA attention, GAM attention, and dynamic pooling are rarely specifically adjusted to suit the features of bridge inspection images. A search of the patent database also revealed that there is currently no integrated solution that embeds three sets of customized modules into YOLOv8-seg to specifically solve the problem of multiple detection of bridge defects. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention proposes a bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg. The technical problem to be solved by this invention is achieved through the following technical solution: A bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg, the method comprising: Step 1: Collect images of the bridge using drones; The second step is to perform preprocessing on the acquired bridge images, including resolution scaling, pixel value normalization, and color gamut uniform correction. Then, the Mosaic strategy is used to expand the samples. The processed images are then sent to the backbone network to extract multi-layer features. Step 3: The preprocessed image is fed into the backbone network, and basic feature extraction is completed through three layers of downsampling convolution. The network embeds a Deformable-ECA combination module, which adapts to slender and irregularly shaped diseases such as cracks by deformable convolution. At the same time, it uses an attention mechanism to filter out irrelevant background interference and finally outputs a multi-dimensional backbone feature map containing disease details. Step 4: The feature map output by the backbone network is fed into the neck SPPF-GAM composite module. Multi-scale information acquisition is completed by dynamic pooling, and then the disease area is given higher weight by GAM attention to correct and optimize the features. The processed features are then fused with the features of other layers in the neck to filter and retain key information related to bridge disease in the three-layer scale. Step 5: Feature detection and segmentation. Input the feature maps at three scales into the detection + segmentation decoupling head to predict the disease bounding box coordinates, confidence level, category, and pixel-level mask feature map, respectively. Step 6: Post-processing of model output results: First, non-maximum suppression is used to remove overlapping redundant detection boxes, then the network output mask is decoded to restore the true outline of bridge cracks, and the predicted coordinates are mapped back to the original input image resolution. After processing, a visualization of the superimposed disease segmentation mask can be generated, and quantitative evaluation data such as disease size and area can be output simultaneously.
[0007] The third step includes the following processing steps: S1: Input convolutional layer, where the input content includes the number of input channels and the number of output channels, used for feature dimensionality reduction and dimensionality unification; S2: Capture irregular disease characteristics through variable convolution residual sets; S3: Attention weighting is achieved through the ECA attention module, lightweight enhancement of disease characteristics; S4: Output the backbone feature map adapted to bridge defects.
[0008] The fourth step includes the following processing steps: S1: Receives the high-dimensional feature map output by the backbone network; S2: Dynamic cross-scale pooling is performed. Three sets of adaptive pooling branches are set up internally. The size of the pooling kernel of each branch is adaptively adjusted based on the disease scale variance calculation unit. The feature information corresponding to the large and small types of bridge diseases is captured respectively. The output features of each branch are then processed by the Conv, BN, and SiLU combination layer to complete channel shuffling and feature interoperability, thereby alleviating the problem of insufficient single-scale feature extraction capability. S3: By using parallel weighting of the channel attention branch and spatial attention branch in the GAM attention module, the channel correlation and spatial positioning accuracy of multi-scale disease features are enhanced; S4: Compress and filter redundant features through channel dimension to output the fused multi-scale disease feature map.
[0009] Step 5 includes the following processing steps: S1: Feature input processing, receives the three scale feature maps output from the neck, unifies the dimensions through 1x1 convolution, and then inputs them into the asymmetric processing branch; S2: The positioning branch adopts "endpoint coordinate prediction + Focaler-IoU loss" to predict the two ends of the crack (x1,y1), (x2,y2) and the width offset, focusing on the sample samples of medium and low bridge defects that are difficult to locate. S3: Feature compensation, through strip convolution + attention weighted structure, extracts disease edge features through 1x7 and 7x1 strip convolution, further suppressing background noise; S4: The segmentation branch uses a dynamic upsampling module combined with the Dice loss function to enhance the mask continuity of narrow cracks and output pixel-level mask feature maps.
[0010] The beneficial effects of this invention are: 1. The Bridge-Deformable-ECA module, Bridge-SPPF-GAM module, and Bridge-Adapt-Head module proposed in this invention are not commonly used ready-made modules in the field of graphics processing. Instead, they are innovative modules formed by customizing, structurally integrating, and adding functional layers based on basic technical units such as deformable convolution v2, ECA, GAM, and SPPF, and for the actual application scenario of UAV inspection of bridge defects. 2. All the technical designs of the three modules (such as the offset learning logic of deformable convolution, the adaptive kernel_size calculation of ECA, the dynamic pooling kernel range of SPPF, and the endpoint localization strategy of the detection head) are designed around the four specific pain points of bridge defects: "slender / irregular shape, multi-scale distribution, complex background interference, and local occlusion", and are not simply the application of basic technical units. 3. Three-Module Collaborative Innovation: This invention integrates three optimization modules into the YOLOv8-seg network, establishing a complete processing flow from refined defect feature extraction and multi-scale feature fusion to adaptive segmentation output. The entire solution addresses multiple challenges such as complex bridge defect morphology, large scale differences, and cluttered backgrounds through collaborative module optimization, a significant departure from current research approaches that mostly focus on improving only a single network layer. Attached Figure Description
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0012] Figure 1 This is a flowchart of the Bridge-Deformable-ECA module of the present invention; Figure 2 This is a flowchart of the Bridge-SPPF-GAM module of the present invention; Figure 3 This is a flowchart of the Bridge-Adapt-Head module of the present invention; Figure 4 This is a flowchart of the improved YOLOv8-seg model processing method of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be described more clearly and completely below with reference to the accompanying drawings in the embodiments. Of course, the described embodiments are only a part of the present invention and not all of it. Based on this embodiment, other embodiments obtained by those skilled in the art without creative effort are all within the protection scope of the present invention.
[0014] like Figures 1 to 4 As shown, a bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg is characterized by the following: Step 1: Collect images of the bridge using drones; The second step is to perform preprocessing on the acquired bridge images, including resolution scaling (320×320), pixel value normalization (divided by 255), color gamut uniform correction, and then expand the samples using the Mosaic strategy. The processed images are then fed into the backbone network to extract multi-layer features. Step 3: The preprocessed image is fed into the backbone network, and basic feature extraction is completed through three layers of downsampling convolution. The network embeds a Deformable-ECA combination module, which adapts to slender and irregularly shaped diseases such as cracks by deformable convolution. At the same time, it uses an attention mechanism to filter out irrelevant background interference and finally outputs a multi-dimensional backbone feature map containing disease details. Step 4: The feature map output by the backbone network is fed into the neck SPPF-GAM composite module. Multi-scale information acquisition is completed by dynamic pooling, and then the disease area is given higher weight by GAM attention to correct and optimize the features. The processed features are then fused with the features of other layers in the neck to filter and retain key information related to bridge disease in the three-layer scale. Step 5: Feature detection and segmentation. Input the feature maps at three scales into the detection + segmentation decoupling head to predict the disease bounding box coordinates, confidence level, category, and pixel-level mask feature map, respectively. Step 6: Post-processing of model output results: First, non-maximum suppression is used to remove overlapping redundant detection boxes, then the network output mask is decoded to restore the true outline of bridge cracks, and the predicted coordinates are mapped back to the original input image resolution. After processing, a visualization of the superimposed disease segmentation mask can be generated, and quantitative evaluation data such as disease size and area can be output simultaneously.
[0015] In the above method steps: the third step is the processing of the Bridge-Deformable-ECA backbone module, the fourth step is the processing of the Bridge-SPPF-GAM neck module, and the fifth step is the processing of the Bridge-Adapt-Head detection head module. The three modules are integrated into the YOLOv8-seg model, replacing the original C2f module, SPPF module and detection head.
[0016] The third step includes the following processing steps: S1: Input convolutional layer, where the input includes the number of input channels and the number of output channels, used for feature dimensionality reduction and dimensionality unification; a 1x1 convolutional kernel is used, with the number of input channels being c_in and the number of output channels being c_mid (c_mid=256, which can be adjusted according to the model scale), used for feature dimensionality reduction and dimensionality unification; S2: Capturing irregular disease features through variable convolutional residual groups; the variable convolutional residual groups consist of 4 customized residual units connected in series. Each unit has a structure of "deformable convolution (offset adaptation modification) + BN + SiLU + occlusion feature compensation branch + residual connection", with c_mid input and output channels. Irregular disease features are dynamically captured through crack direction perception factors. The residual units of "deformable convolution + BN + SiLU + ECA" avoid gradient vanishing during deep feature extraction and improve the model's ability to extract weak disease features (such as narrow cracks). Deformable Convolution v2 is used to replace the native fixed-size convolution. The sampling position of the convolution kernel is dynamically adjusted through offset learning to adapt to slender and irregular shaped defects such as bridge cracks and exposed rebar, thus solving the problem of incomplete feature capture by fixed convolution kernels. S3: Attention weighting is achieved through the ECA attention module, lightweight enhancement of disease characteristics; In the ECA attention module: the number of input channels is c_mid, and an adaptive kernel_size related to texture complexity is adopted (calculation formula: kernel_size=2×round (log2(c_mid))+1, with an additional +2 when the texture complexity is high). Channel attention weighting is achieved through depthwise separable convolution, which lightly enhances disease features. After deformable convolution, an ECA (Efficient Channel Attention) module is introduced, which directly weights the channel features without dimensionality reduction. Compared with SE attention, it is more lightweight and can accurately enhance the disease feature channels, suppress background noise (such as railing shadows and fog interference), and solve the problem of complex background confusion. S4: Uses a 1x1 convolution kernel, with c_mid as the input channel and c_out as the output channel (c_out=512), for feature upscaling, and outputs a backbone feature map adapted to bridge defects.
[0017] The above steps are used to solve problems such as incomplete extraction of bridge slender / irregular defects, false detection / missed detection caused by complex background noise, and difficulty in capturing weak defect features.
[0018] The fourth step includes the following processing steps: S1: Receives the high-dimensional feature map output by the backbone network; S2: Dynamic cross-scale pooling is performed. Three sets of adaptive pooling branches are set up internally. The size of the pooling kernel of each branch is adaptively adjusted based on the disease scale variance calculation unit. The feature information corresponding to the large and small types of bridge diseases is captured respectively. The output features of each branch are then processed by the Conv, BN, and SiLU combination layer to complete channel shuffling and feature interoperability, thereby alleviating the problem of insufficient single-scale feature extraction capability. Variance thresholds: small scale < 0.3, medium scale 0.3 to 0.7, large scale > 0.7; Dynamically allocate pooling kernel size: Branch 1: 3x3 to 7x7, Branch 2: 7x7 to 11x11, Branch 3: 11x11 to 15x15; The original fixed-size (5x5, 9x9, 13x13) pooling kernels were replaced with a "dynamic pooling driven by the scale variance of defects + cross-scale interaction" structure. By calculating the scale variance of defects in the input feature map (large-scale spalling variance > medium-scale voids > small-scale exposed rebar variance), the coverage range of the pooling kernels was dynamically adjusted (3x3 to 15x15). 3x3 to 7x7 is suitable for small-scale defects such as exposed rebar, 7x7 to 11x11 is suitable for medium-scale defects such as voids, and 11x11 to 15x15 is suitable for large-scale defects such as concrete spalling, thus accurately adapting to the multi-scale defect characteristics of bridges. S3: By using parallel weighting of the channel attention branch and spatial attention branch in the GAM attention module, the channel correlation and spatial positioning accuracy of multi-scale disease features are enhanced; In the GAM attention module: the number of input channels is 3×c_out, and the channel correlation and spatial positioning accuracy of multi-scale disease features are enhanced by parallel weighting through "channel attention branch (scale weight adaptation) + spatial attention branch (key area focus)". After pooling feature stitching, a GAM global attention module is introduced. The channel attention branch strengthens the feature channel weights of defects at different scales (the channel weights of small-scale defects are increased by 1.2 to 1.5 times). The spatial attention branch combines the spatial distribution characteristics of bridge defects (mostly concentrated at the bottom of the beam and the side of the pier) to increase the spatial weights of key areas. At the same time, it realizes dual-dimensional weighting of channels and space, solving the defect of the original SPPF that "only merges but does not focus". S4: Uses a 1x1 convolution kernel, with 3×c_out input channels and c_out output channels. Redundant features are filtered through channel dimension compression (compression ratio 0.5), and the output is a fused multi-scale disease feature map.
[0019] Step 5 includes the following processing steps: S1: Feature input processing, receiving three scale feature maps (256, 512, and 1024 channels respectively) from the neck output, unifying the dimensions through 1x1 convolution, and then inputting them into the asymmetric processing branch; S2: The positioning branch adopts "endpoint coordinate prediction + Focaler-IoU loss" to predict the two ends of the crack (x1,y1), (x2,y2) and the width offset, focusing on the sample samples of medium and low bridge defects that are difficult to locate. The positioning branch adopts the "endpoint coordinate prediction" logic, which improves the positioning accuracy of slender defects by predicting the two ends of the crack (x1, y1) and (x2, y2) and the width offset. S3: Feature compensation, through strip convolution + attention weighted structure, extracts disease edge features through 1x7 and 7x1 strip convolution, further suppressing background noise; S4: The segmentation branch uses a dynamic upsampling module (upsampling ratio 2 to 4 adaptively adjusted), combined with the Dice loss function, to enhance the mask continuity of narrow cracks and output pixel-level mask feature maps; The segmentation branch introduces a dynamic upsampling module, which adaptively adjusts the upsampling ratio (2 to 4 times) according to the complexity of the texture of the disease edge to ensure the continuity of the segmentation mask for narrow cracks; A combination of "Focaler-IoU + Dice loss" is adopted. Focaler-IoU addresses the sample imbalance problem of bridge defects (more crack samples and fewer exposed rebar samples) by optimizing the learning weights of easy and difficult samples, thereby improving the detection accuracy of minor defects. Dice loss addresses the segmentation requirements of small cracks by strengthening pixel-level matching of the mask region and reducing the segmentation and breakage problem of narrow cracks.
[0020] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely prisms of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claims. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg, characterized in that: The method includes: Step 1: Collect images of the bridge using drones; The second step is to perform preprocessing on the acquired bridge images, including resolution scaling, pixel value normalization, and color gamut uniform correction. Then, the Mosaic strategy is used to expand the samples. The processed images are then sent to the backbone network to extract multi-layer features. Step 3: The preprocessed image is fed into the backbone network, and basic feature extraction is completed through three layers of downsampling convolution. The network embeds a Deformable-ECA combination module, which adapts to slender and irregularly shaped diseases such as cracks by deformable convolution. At the same time, it uses an attention mechanism to filter out irrelevant background interference and finally outputs a multi-dimensional backbone feature map containing disease details. Step 4: The feature map output by the backbone network is fed into the neck SPPF-GAM composite module. Multi-scale information acquisition is completed by dynamic pooling, and then the disease area is given higher weight by GAM attention to correct and optimize the features. The processed features are then fused with the features of other layers in the neck to filter and retain key information related to bridge disease in the three-layer scale. Step 5: Feature detection and segmentation. Input the feature maps at three scales into the detection + segmentation decoupling head to predict the disease bounding box coordinates, confidence level, category, and pixel-level mask feature map, respectively. Step 6: Post-processing of the model output results: First, non-maximum suppression is used to remove overlapping redundant detection boxes, then the network output mask is decoded to restore the true contour of the bridge crack, and the predicted coordinates are mapped back to the original input image resolution.
2. The bridge defect detection method based on the three-module collaborative improvement of YOLOv8-seg according to claim 1, characterized in that: The third step includes the following processing steps: S1: Input convolutional layer, where the input content includes the number of input channels and the number of output channels, used for feature dimensionality reduction and dimensionality unification; S2: Capture irregular disease characteristics through variable convolution residual sets; S3: Achieve attention weighting through the ECA attention module to enhance disease characteristics in a lightweight manner; Step 4: Output the backbone feature map adapted to bridge defects.
3. The bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg according to claim 1, characterized in that: The fourth step includes the following processing steps: S1: Receives the high-dimensional feature map output by the backbone network; S2: Dynamic cross-scale pooling is performed. Three sets of adaptive pooling branches are set up internally. The size of the pooling kernel of each branch is adaptively adjusted based on the disease scale variance calculation unit. The feature information corresponding to the large and small types of bridge diseases is captured respectively. The output features of each branch are then processed by the Conv, BN, and SiLU combination layer to complete channel shuffling and feature interoperability, thereby alleviating the problem of insufficient single-scale feature extraction capability. S3: By using parallel weighting of the channel attention branch and spatial attention branch in the GAM attention module, the channel correlation and spatial positioning accuracy of multi-scale disease features are enhanced; S4: Compress and filter redundant features through channel dimension to output the fused multi-scale disease feature map.
4. The bridge defect detection method based on a three-module collaborative improvement of YOLOv8-seg according to claim 1, characterized in that: Step 5 includes the following processing steps: S1: Feature input processing, receives the three scale feature maps output from the neck, unifies the dimensions through 1x1 convolution, and then inputs them into the asymmetric processing branch; S2: The positioning branch adopts "endpoint coordinate prediction + Focaler-IoU loss" to predict the two ends of the crack (x1,y1), (x2,y2) and the width offset, focusing on the sample samples of difficult bridge defects in medium and low-grade bridges; S3: Feature compensation, through strip convolution + attention weighted structure, extracts disease edge features through 1x7 and 7x1 strip convolution, further suppressing background noise; S4: The segmentation branch uses a dynamic upsampling module combined with the Dice loss function to enhance the mask continuity of narrow cracks and output pixel-level mask feature maps.
