Bridge surface disease detection method based on improved yolov8 target detection
By introducing the SCSA module, BiFPN-SNI network, and T-head structure into the YOLOv8 model, the problems of feature mixing, redundancy, and misalignment in bridge defect detection are solved, improving detection accuracy and efficiency, and achieving more accurate defect identification and assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-10
AI Technical Summary
Existing YOLOv8 target detection models suffer from several defects in bridge defect detection, including background noise mixed with effective features, feature channel redundancy or mutual interference, semantic misalignment, incorrect matching of small target edge pixels, and spatial misalignment between classification and regression tasks, resulting in insufficient detection accuracy and efficiency.
The SCSA module is introduced into the backbone network of YOLOv8, the BiFPN-SNI structure is adopted in the neck network, and the T-head and SIoU loss functions are used in the head network to improve feature extraction and prediction box optimization, forming the BiFPN-SNI network, which enhances feature fusion and prediction accuracy.
The model's robustness and detection accuracy in complex scenarios were improved, computational load was reduced, small target detection capability was enhanced, and more accurate identification and severity assessment of bridge defects were achieved.
Smart Images

Figure CN121236606B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of image data processing, in particular to a bridge surface disease detection method based on improved Yolov8 target detection. BACKGROUND
[0002] As an important part of modern transportation infrastructure, bridges have extremely important economic, social and safety significance. As an important transportation hub, bridges bring convenience to people's travel. Various diseases on the surface of the bridge can harm the safety, durability and functionality of the bridge, and pose a safety hazard to drivers and pedestrians. As the number of bridges increases and the service life of the bridges extends, the probability of diseases on the bridges gradually increases. Therefore, it is particularly important to identify the diseases on the surface of the bridge in a timely and accurate manner. The current bridge disease detection technology mainly includes two categories: non-contact measurement-based detection technology and target recognition-based detection technology.
[0003] (1) Non-contact measurement-based detection method. For example, Mo Chunhua's paper proposes a non-contact bridge crack detection method based on fusion of real scene three-dimensional model and infrared image. A fine real scene three-dimensional model of the bridge is constructed through air-ground multi-source heterogeneous data fusion, and is spatially matched and fused with the infrared two-dimensional crack image to realize rapid identification and accurate positioning of the crack in the real scene three-dimensional model. For another example, researchers such as Zhong Xinguo use a rotary-wing unmanned aerial vehicle as a working platform, use an IMETRUM non-contact measuring instrument to verify the reliability of the airborne imaging quality of the unmanned aerial vehicle in a hovering state, and through the synchronous measurement of the additional distance of the bridge crack image by adding a three-point laser to the airborne camera and the camera shutter, a crack width distribution map that meets the accuracy requirements of bridge crack width identification is obtained through a series of calculation methods such as image preprocessing programs suitable for unmanned aerial vehicle imaging.
[0004] However, the non-contact measurement-based detection method often needs a long time to process and analyze a large amount of data, which is not suitable for real-time application, and the high-end equipment used in the method has a high cost.
[0005] (2) Target detection-based disease detection method. For example, Huang Aiguo proposes a ConvNeXt bridge disease detection network model based on feature fusion to improve the accuracy of bridge surface disease detection. Zhao Cheng proposes an improved YOLOv4 bridge surface disease detection method. The team of Zhou Qingsong proposes an improved YOLOv3 high-accuracy bridge surface disease detection and identification method.
[0006] Although YOLO technology has been introduced into the field of bridge disease detection, there are still many problems, such as: YOLOv3 improves the detection of small targets by introducing three different scale output layers, but this increases the complexity and computational load of the model, and YOLOv3 uses 9 different Anchor Boxes, which may cause overfitting or redundant detection frame problems. Due to the complex multi-scale prediction mechanism of YOLOv3, its training and inference speed is slow, and in the deployment of resource-limited environments, performance bottlenecks may also be encountered. YOLOv5 improves ease of use and performance by rewriting the code base and using the PyTorch framework, but it also removes certain complex components such as FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) structures, which may affect the small target detection capability in the bridge disease detection task, resulting in a decrease in the detection accuracy of small defects such as cracks and corrosion, and the multi-scale target detection capability in complex backgrounds will also be limited. When there are diseases such as spalling and exposed reinforcement in a region, the absence of FPN and PAN may cause YOLOv5 to be unable to effectively detect all types of diseases in this environment, especially small targets with similar background colors. YOLOv7 also does not perform well in small target detection tasks and is not lightweight enough in situations where computing resources are limited.
[0007] The backbone network of YOLOv8 includes a backbone network, a neck network, and a head network. The backbone network and the neck network contain a large number of C2f modules, the neck network adopts the PAN-FPN architecture, and the head network performs position and class prediction in the regression branch and the classification branch based on the Anchor free algorithm.
[0008] C2f module (CSP Bottleneck with 2 Convolutions) is the core component of the YOLOv8 backbone network and neck network. The YOLOv8 backbone network includes 4 C2f modules from top to bottom. Each C2f module includes a first convolutional layer (Conv1), a split layer (Split), n bottleneck layers (Bottleneck), a channel concatenation layer (Concat), and a second convolutional layer (Conv2) from top to bottom. The C2f module better aggregates multi-scale information by concatenating the outputs of different bottleneck layers and the original feature map, and can compress the feature map through convolution operation to reduce the amount of calculation while maintaining or enhancing the expression ability of the model. Although the C2f module can effectively extract features, it has limited processing of background noise. The channel concatenation layer further mixes background noise with effective features of the residual branch, and a large number of feature channels are generated after channel concatenation, which leads to redundancy or mutual interference of the fused features obtained after concatenation, thereby diluting useful features. In complex scenes, semantic misplacement may occur in the channel concatenation layer fusion of C2f.
[0009] PAN-FPN architecture: PAN (Feature Pyramid Network) is a bottom-up feature aggregation, and FPN (Path Aggregation Network) is a top-down feature pyramid. PAN-FPN concatenates FPN and PAN two paths together to form a "double pyramid" neck structure, allowing gradient flow and feature flow to cross layers back and forth. However, there are the following problems: (1) PAN-FPN usually uses indiscriminate summation or concatenation operations when fusing features from different levels, assuming that all input features contribute equally to the output features. However, different resolution features obviously contain different information, and this static fusion method cannot adapt to the importance changes of different scale features in complex scenes. (2) PAN-FPN needs to pass through all intermediate layers when transmitting feature information, which can easily lead to feature information dilution or gradient disappearance. (3) PAN-FPN has some single-input edge nodes that only receive single-source features and cannot participate in multi-scale fusion, but still need to perform convolution, normalization, and other operations, leading to computational redundancy. To address the above problems, BiFPN (Bidirectional Feature Pyramid Network) is proposed.
[0010] BiFPN is a multi-scale feature fusion network used to replace the traditional FPN-PAN, which takes into account the accuracy and efficiency. It combines the "top-down" and "bottom-up" paths into a layer of "bidirectional" modules that can be repeatedly stacked, and introduces learnable weights to determine the importance of each input feature, thus completing more comprehensive cross-scale information exchange within the same network layer. In the "bottom-up" path, the image is enlarged through upsampling operation, and in the "top-down" path, the image is reduced through convolution operation. It can correspondingly solve the above three problems of PAN-FPN, which are: (1) BiFPN adopts a weighted fusion mechanism, which adds a weight to each scale feature for fusion. By adjusting the contribution of each scale, it dynamically adjusts the multi-scale feature fusion. (2) BiFPN adds a residual connection, which can promote efficient circulation and fusion of feature information, fuse more features without significantly increasing the cost, and alleviate the problem of gradient disappearance. (3) BiFPN removes these single-input edge nodes, reducing the complexity and computational overhead of the model while maintaining performance.
[0011] Noun explanation:
[0012] SCSA (Spatial-Channel Synergistic Attention) includes two sub-modules, SMSA and PCSA. The SMSA (Shared Multi-Semantic Spatial Attention) module is used to generate uniform spatial attention weights based on the input feature map and multiply the original image to obtain enhanced features, providing "spatial prior" for subsequent channel recalibration. The PCSA (Progressive Channel-wise Self-Attention) module uses self-attention mechanisms to calculate the similarity and contribution between channels, thereby reducing the semantic differences between different sub-features in SMSA. The input feature map is enhanced in space by SMSA and then enhanced in channel by PCSA to obtain the output.
[0013] The SNI module (Soft Nearest-Neighbor Interpolation) is a "zero parameter and zero additional delay" upsampling technique designed to alleviate the feature misplacement problem that occurs when FPN / PAN-like structures fuse "high layer to low layer". Its core idea is to replace the original "hard copy" nearest neighbor interpolation with "softened" weighting, so that the larger the magnification, the less interference high-level semantics has on low-level details, thus preserving texture and reducing fusion difficulty.
[0014] Task-aligned Head (T-Head) is a kind of head structure for detecting head structure, including a feature extractor and two TAP (Task-aligned Predictor), the feature extractor uses N layers of convolution to process the feature map of FPN to obtain fused features, and then the fused features are respectively predicted through the classification TAP and the positioning TAP to output categories and positions.
[0015] SIoU (Soft Intersection over Union) is an improved type of bounding box regression loss function proposed in the field of object detection, which optimizes detection accuracy by fusing angle, distance and shape factors, and has been applied in YOLO series algorithms. SUMMARY
[0016] The purpose of the present application is to provide a bridge surface disease detection method based on improved Yolov8 target detection, which solves the defects of mixed background noise and effective features, redundant feature channels or mutual interference of each channel feature, semantic mislocation, small target edge pixel error matching and classification and regression task space mislocation in the existing target detection model.
[0017] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows: a bridge surface disease detection method based on improved Yolov8 target detection, comprising the following steps:
[0018] S1, obtaining a bridge disease detection dataset D, wherein the sample is an image containing a disease area and a category label, and the category includes crack, spalling and exposed reinforcement;
[0019] S2, constructing a bridge disease detection network, comprising S21-S22;
[0020] S21, obtaining a YOLOv8 network, including a backbone network, a neck network and a head network, the backbone network includes four C2f modules from top to bottom, and the neck network adopts a PAN-FPN structure;
[0021] S22, improving the YOLOv8 network to obtain the bridge disease detection network, specifically:
[0022] Introducing SCSA module in the last three C2f modules of the backbone network, constructing a BiFPN-SNI network to replace the neck network, and the head network adopts T-head;
[0023] The BiFPN-SNI network comprises a first SNI module, a first BiFPN channel splicing layer, a first C2f module, a second SNI module, a second BiFPN channel splicing layer, a second C2f module, a first convolutional layer, a third BiFPN channel splicing layer, a third C2f module, a second convolutional layer, a fourth BiFPN channel splicing layer and a fourth C2f module connected in sequence.
[0024] The sample generates the first feature map to the third feature map F3 from top to bottom through the backbone network, wherein F1 is sent to the second BiFPN channel splicing layer, F2 is sent to the first BiFPN channel splicing layer, the output of F2 and the first C2f module is sent to the third BiFPN channel splicing layer, F3 is input into the first SNI module and the fourth BiFPN channel splicing layer, the output end of the second C2f module is connected to the input end of the first convolutional layer, and the second C2f module, the third C2f module and the fourth C2f module are respectively taken as the first output end to the third output end of the neck network and connected to the head network.
[0025] S3, selecting a loss function SIoU, training the bridge disease detection network to convergence by minimizing SIoU with the dataset D, and obtaining a bridge disease detection model;
[0026] S4, obtaining a bridge image to be recognized, identifying a disease area and a category through the bridge disease detection model, marking the disease area pixels as white and the rest as black, and obtaining a disease area mask image.
[0027] As preferred: further comprising the following steps:
[0028] S5, for the disease area mask image obtained in S4, if the category is spalling or exposed reinforcement, step S6 is executed, and if the category is crack, step S7 is executed;
[0029] S6, first disease degree evaluation, comprising S61-S62;
[0030] S61, calculating the disease area A from the disease area mask image, A=N white ×R 2 , wherein N white is the total number of white pixels, is a scale factor for representing the actual physical length corresponding to 1 pixel;
[0031] S62, calculating the first disease degree according to the following formula:
[0032] ,
[0033] In the formula, A0 is the actual area of the bridge member where the disease area is located, and g1≤1.0 is mild disease, 1.0≤g1≤2.0 is moderate disease, and g1≥2.0 is severe disease.
[0034] S7, second disease degree evaluation, comprising S71-S72;
[0035] S71, extracting crack skeleton from the disease area mask image, calculating the length L and the maximum width W of the crack skeleton max ;
[0036] S72, calculating the second disease degree according to the following formula:
[0037] ,
[0038] In the formula, L0 is the actual length of the bridge member where the disease area is located, and g2≤1.0 is mild disease, 1.0≤g2≤2.0 is moderate disease, and g2≥2.0 is severe disease.
[0039] As a preferred, the bridge disease detection dataset D comprises a CODEBRIM dataset and a dacl10k dataset.
[0040] As a preferred, in S22, SCSA modules are introduced into the last three C2f modules of the backbone network, comprising steps Sa1-Sa2:
[0041] Sa1, the last two layers of the C2f module are respectively a channel concatenation layer and a convolution layer, and an SCSA module is connected in series between the channel concatenation layer and the convolution layer to obtain a C2f-SCSA module;
[0042] Sa2, replacing the last three C2f modules of the backbone network with C2f-SCSA modules.
[0043] As a preferred, two SNI modules are used to perform nearest neighbor interpolation operation on the input features to obtain corresponding output features, and the four BiFPN channel concatenation layers are all BiFPN channel concatenation layers.
[0044] As a preferred, in S71, specifically:
[0045] Sb1, extracting the crack skeleton from the disease area mask image to generate a skeleton line;
[0046] Sb2, counting the total number L of white pixels in the skeleton line white According to the formula L=L white ×R, the length L of the crack skeleton is calculated;
[0047] Sb3, overlapping the crack skeleton with the disease area mask image, and extracting the maximum width W of the crack skeleton based on the skeleton line using eight-direction search method on the disease area mask image max .
[0048] The backbone network, neck network and head network of the YOLOv8 network are improved when the bridge disease detection network is constructed.
[0049] Regarding the backbone network: a SCSA module is connected between the last two layers (channel concatenation layer and convolution layer) of the C2f module to obtain a C2f-SCSA module. The C2f-SCSA module is used to replace the last three C2f modules of the backbone network, so that the SCSA module is introduced into the last three C2f modules of the backbone network. The channel concatenation layer of the second last layer outputs fusion features, and the SCSA module includes an SMSA module and a PCSA module. The shared multi semantic space attention of the SMSA module is used to highlight the target region in the fusion features and suppress background noise, and the semantic defects of the fusion features are alleviated, so that the semantics of the fusion features are more consistent, and the robustness of the model in a complex scene is improved. The progressive channel self-attention of the PCSA module is used to dynamically improve the weight of the target related channel and reduce the weight of the background related channel, so as to solve the defects of channel redundancy of the C2f module and improve the efficiency and performance of the model.
[0050] Regarding the neck network: a BiFPN-SNI network is designed to replace the original neck network, and the original neck network is an FPN-PAN structure. Four channel concatenation layers of the BiFPN-SNI network are introduced, which are the first BiFPN channel concatenation layer to the fourth BiFPN channel concatenation layer. Two SNI modules are also introduced, which are the first SNI module to the fourth SNI module. Combined with several C2f structures and convolution layers, a new BiFPN channel structure, BiFPN-SNI network, is formed. Compared with the existing FPN-PAN structure of the neck network, the redundant path can be removed, the lightweight design can be realized, and the calculation amount can be reduced. The SNI module is used for up-sampling of input features. It can assign weights to the neighbor pixels of the target pixel in inverse proportion to the distance, avoid feature misalignment caused by hard matching, and retain more effective details through soft weighting, so as to overcome the technical problem that the up-sampling module easily matches small target edge pixels to the background area, affecting the fine information of high-resolution features. The SNI module has no additional parameters, and can improve the accuracy while ensuring the lightweight advantage when combined with the BiFPN structure.
[0051] Regarding the head network and the loss function: the T-head with task alignment branch is selected as the head network, and the loss function SIoU with angle and distance penalty mechanism is selected to make the prediction box closer to the real box faster. The improved backbone network and neck network are combined.
[0052] Compared with the prior art, the advantages of the present application are:
[0053] (1) In the C2f module of the backbone network, an SCSA module is introduced, and a C2f-SCSA module is designed, wherein the SCSA module further includes an SMSA module and a PCSA module. The C2f-SCSA module can extract multi-semantic spatial features, calibrate channel semantics, solve the problems of insufficient multi-semantic utilization and unrelieved semantic difference of the traditional attention, can suppress background noise and focus on key areas, and solve the channel redundancy problem. Finally, the features output by the C2f-SCSA module have the characteristics of higher feature quality, more effective information, stronger feature extraction ability for small targets in complex scenes, and high model robustness.
[0054] (2) The BiFPN-SNI network is designed to replace the original PAN-FPN structure in the neck network. The BiFPN-SNI network removes the redundant path compared with the PAN-FPN architecture, belongs to lightweight design, and the calculation amount is relatively reduced. Moreover, the existing BiFPN network relies on the up-sampling result for weighted fusion, but the original up-sampling module is prone to error matching of small target edge pixels to the background area, which affects the fine information of high-resolution features. The SNI module is used to replace the original up-sampling module, which can assign weights to the neighbor pixels of the target pixels in inverse proportion to the distance, avoid the feature misalignment problem caused by hard matching, and retain more effective details through soft weighting. Finally, the BiFPN-SNI network has the advantages of keeping lightweight while effectively improving the precision.
[0055] (3) The head network adopts T-head. The T-head structure generates task interaction features through shared feature extractors, so that the classification and regression branches can perceive each other's prediction state. Based on the task alignment measurement module, the positive samples are dynamically selected, and the weights of the classification and regression branches are dynamically adjusted through the loss feedback of task alignment learning, so that the model dynamically selects better positive samples, realizes the deep alignment of classification and regression tasks, and significantly improves the detection accuracy and convergence stability. The defect of spatial misalignment of the prediction results of the regression branch and the classification branch in the existing YOLOv8 head network is solved.
[0056] (4) The loss function of the application selects SIoU. The angle and distance penalty mechanism of SIoU makes the prediction box closer to the real box faster, and can avoid the problems of gradient shock and slow convergence in the later training.
[0057] (5) Based on the improved bridge disease detection network, after the bridge disease detection model is trained by using the dataset D, it is used to detect the disease area and category in the to-be-identified bridge image, generates a disease area mask image, provides a higher quality feature input for the subsequent disease degree evaluation task, and can obtain more accurate disease area and crack skeleton line, so as to perform more accurate disease degree grading. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 Fig. 13 is a schematic diagram of a C2f-SCSA module structure;
[0059] Figure 2 Fig. 14 is a schematic diagram of introducing an SCSA module into the last three C2f modules of the backbone network;
[0060] Figure 3 Fig. 15 is a schematic diagram of a BiFPN-SNI network structure;
[0061] Figure 4 Fig. 16 is a flowchart of Example 2. DETAILED DESCRIPTION
[0062] The application will be further described below in conjunction with examples and drawings.
[0063] Example 1: Referring to Figures 1-3 A bridge surface disease detection method based on an improved Yolov8 target detection, comprising the following steps:
[0064] S1, obtaining a bridge disease detection dataset D, wherein the sample is an image containing a disease area and a category label, and the category includes cracks, spalling and exposed reinforcement;
[0065] S2, constructing a bridge disease detection network, comprising S21-S22;
[0066] S21, obtaining a YOLOv8 network, including a backbone network, a neck network and a head network, wherein the backbone network comprises four C2f modules from top to bottom, and the neck network adopts a PAN-FPN structure;
[0067] S22, improving the YOLOv8 network to obtain a bridge disease detection network, specifically:
[0068] Introducing an SCSA module into the last three C2f modules of the backbone network, constructing a BiFPN-SNI network to replace the neck network, and adopting a T-head for the head network;
[0069] The BiFPN-SNI network comprises a first SNI module, a first BiFPN channel splicing layer, a first C2f module, a second SNI module, a second BiFPN channel splicing layer, a second C2f module, a first convolutional layer, a third BiFPN channel splicing layer, a third C2f module, a second convolutional layer, a fourth BiFPN channel splicing layer and a fourth C2f module connected in sequence;
[0070] The sample generates first feature map to F1~third feature map F3 from top to bottom through the backbone network, wherein F1 is sent to the second BiFPN channel splicing layer, F2 is sent to the first BiFPN channel splicing layer, the output of F2 and the first C2f module is sent to the third BiFPN channel splicing layer, F3 is input into the first SNI module and the fourth BiFPN channel splicing layer, the output end of the second C2f module is connected to the input end of the first convolutional layer, and the second C2f module, the third C2f module and the fourth C2f module are respectively connected as the first output end~third output end of the neck network, and the head network is connected;
[0071] S3, selecting a loss function SIoU, training the bridge disease detection network to convergence by minimizing SIoU with the dataset D, and obtaining a bridge disease detection model;
[0072] S4, obtaining a bridge image to be recognized, identifying a disease area and a category through the bridge disease detection model, marking the disease area pixels as white and the rest as black, and obtaining a disease area mask image.
[0073] In the embodiment, the bridge disease detection dataset D includes a CODEBRIM dataset and a dacl10k dataset.
[0074] In S22, SCSA modules are introduced into the last three C2f modules of the backbone network, including steps Sa1~Sa2:
[0075] Sa1, the last two layers of the C2f module are respectively a channel splicing layer and a convolutional layer, and the SCSA module is connected in series between the channel splicing layer and the convolutional layer, to obtain a C2f-SCSA module;
[0076] Sa2, replacing the last three C2f modules of the backbone network with the C2f-SCSA module.
[0077] The two SNI modules are used for nearest neighbor interpolation operation on the input features to obtain corresponding output features; and the four BiFPN channel splicing layers are all channel splicing layers of BiFPN.
[0078] Embodiment 2: see Figures 1-4 On the basis of embodiment 1, in addition to steps S1~S4, steps S5~S7 are further included.
[0079] S5, for the disease area mask image obtained in S4, if the category is spalling or exposed reinforcement, step S6 is executed, and if the category is crack, step S7 is executed;
[0080] S6, first disease degree evaluation, including S61~S62;
[0081] S61, calculating the disease area area A from the disease area mask image, A=N white ×R2 wherein, N white is the total number of white pixels, is a scale factor, used to represent the actual physical length corresponding to 1 pixel;
[0082] S62, the first disease degree is calculated according to the following formula:
[0083] ,
[0084] In the formula, A0 is the actual area of the bridge member where the disease area is located, and g1≤1.0 is mild disease, 1.0≤g1≤2.0 is moderate disease, and g1≥2.0 is severe disease;
[0085] S7, the second disease degree evaluation includes S71-S72;
[0086] S71, the crack skeleton is extracted from the disease area mask image, and the length L and the maximum width W of the crack skeleton are calculated max , specifically including Sb1-Sb3:
[0087] Sb1, the crack skeleton is extracted from the disease area mask image, and the skeleton line is generated, and the method for extracting the skeleton line of the crack includes a lookup table method and a ZS algorithm;
[0088] Sb2, the total number of white pixels L in the skeleton line is counted white , the crack skeleton length L is calculated according to the formula L=L white ×R;
[0089] Sb3, the crack skeleton is overlapped with the disease area mask image, and the maximum width W of the crack skeleton is extracted on the disease area mask image based on the skeleton line using an eight-direction search method max ;
[0090] S72, the second disease degree is calculated according to the following formula:
[0091] ,
[0092] In the formula, L0 is the actual length of the bridge member where the disease area is located, and g2≤1.0 is mild disease, 1.0≤g2≤2.0 is moderate disease, and g2≥2.0 is severe disease.
[0093] In the first disease degree evaluation and the second disease degree evaluation of the embodiment:
[0094] If the first disease degree g1 is less than or equal to 1.0, it means that the area A of the disease area accounts for less than 20% of the actual area A0 of the bridge component, which is mild disease, if 1.0≤g1≤2.0, the area A of the disease area accounts for 20%~40% of the actual area A0 of the bridge component, which is defined as moderate disease, if g1≥2.0, the proportion is more than 40%, which is severe disease;
[0095] The second disease degree g2 is determined according to the following formula: , the maximum value of the two items is selected by comparison and ( ), if both are less than 1, that is, if W max <1.5mm and L and L0 account for less than 1 / 3, then g2≤1.0, which is defined as mild disease in the present application; if the maximum value of the two items is between 1.0 and 2.0, that is, either 1.5mm≤W max ≤3.0mm, or , then 1.0≤g2≤2.0, which is defined as moderate disease, if W max >3.0mm and / or , then g2≥2.0, which is severe disease.
[0096] Example 3: Under the same experimental conditions, the detection performance comparison experiments are carried out by using YOLOv5, YOLOv8 and the model of the present application, and the experimental results are used to evaluate the performance of the algorithm in the present research by using the performance indexes of precision Precision, recall rate Recall and all class average precision value mAP, as shown in Table 1. The training environment is: GPU: NVIDIA GeForce RTX 4050; system: WINDOWS 11.
[0097] Table 1: Comparison results of detection performance of different detection models
[0098] Model Name Precision Recall mAP50 mAP50-90 The Invention 0.82 0.747 0.842 0.571 YOLOv5 0.71 0.643 0.721 0.427 YOLOv8 0.76 0.718 0.764 0.538
[0099] In Table 1: IoU is the intersection over union, the English full name is Intersection over Union, mAP50 represents the average precision when IoU is set to 0.5, and mAP50-90 represents the average precision when IoU is from 0.5 to 0.95 with a step of 0.05. IoU is the intersection over union between the predicted box and the real box.
[0100] From Table 1, it can be seen that the precision, recall rate Recall, mAP50 and mAP50-90 of the present application are better than those of YOLOv5 and YOLOv8.
[0101] The above merely describes preferred embodiments of the present application, and is not used to limit the present application, any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A bridge surface disease detection method based on improved Yolov8 target detection, characterized in that, The method comprises the following steps: S1, acquiring a bridge disease detection data set D, wherein the sample is an image containing a disease area and a category label, and the category includes cracks, spalling and exposed reinforcement; S2, constructing a bridge disease detection network, comprising S21-S22; S21, acquiring a YOLOv8 network, comprising a backbone network, a neck network and a head network, wherein the backbone network comprises four C2f modules from top to bottom, and the neck network adopts a PAN-FPN structure; S22, improving the YOLOv8 network to obtain the bridge disease detection network, specifically: Introducing SCSA modules into the last three C2f modules of the backbone network, constructing a BiFPN-SNI network to replace the neck network, and adopting a T-head for the head network; The BiFPN-SNI network comprises a first SNI module, a first BiFPN channel splicing layer, a first C2f module, a second SNI module, a second BiFPN channel splicing layer, a second C2f module, a first convolutional layer, a third BiFPN channel splicing layer, a third C2f module, a second convolutional layer, a fourth BiFPN channel splicing layer and a fourth C2f module connected in sequence; The sample generates first feature map F1 to third feature map F3 from top to bottom through the backbone network in sequence, wherein F1 is sent to the second BiFPN channel splicing layer, F2 is sent to the first BiFPN channel splicing layer, the output of F2 and the first C2f module is sent to the third BiFPN channel splicing layer, F3 is input into the first SNI module and the fourth BiFPN channel splicing layer, the output end of the second C2f module is connected to the input end of the first convolutional layer, and the second C2f module, the third C2f module and the fourth C2f module are respectively connected to the first output end to the third output end of the neck network and connected to the head network; S3, selecting a loss function SIoU, training the bridge disease detection network to convergence by using the data set D to minimize SIoU, and obtaining a bridge disease detection model; S4, acquiring a bridge image to be recognized, identifying the disease area and the category through the bridge disease detection model, marking the disease area pixels as white and the rest as black, and obtaining a disease area mask image; In S22, SCSA modules are introduced into the last three C2f modules of the backbone network, comprising steps Sa1-Sa2: Sa1, the last two layers of the C2f module are a channel splicing layer and a convolutional layer respectively, and an SCSA module is connected in series between the channel splicing layer and the convolutional layer to obtain a C2f-SCSA module; Sa2, replacing the last three C2f modules of the backbone network with the C2f-SCSA module; The two SNI modules are used for nearest neighbor interpolation operation on the input features to obtain corresponding output features, and the four BiFPN channel splicing layers are all BiFPN channel splicing layers.
2. The bridge surface disease detection method based on improved Yolov8 target detection according to claim 1, characterized in that: Further comprising the following steps: S5, for the disease area mask image obtained in S4, if the category is spalling or exposed reinforcement, executing step S6, and if the category is crack, executing step S7; S6, first disease degree evaluation, comprising S61-S62; S61, calculate the disease area A from the disease area mask image, A=N white ×R 2 wherein, N white is the total number of white pixels, is a scale factor for representing the actual physical length corresponding to 1 pixel; S62, calculating the first disease degree according to the following formula: , In the formula, A0 is the actual area of the bridge member where the disease area is located, and g1≤1.0 is mild disease, 1.0≤g1≤2.0 is moderate disease, and g1≥2.0 is severe disease; S7, second disease degree evaluation, including S71-S72; S71, extract the crack skeleton from the disease area mask image, calculate the length L and the maximum width W of the crack skeleton max ; S72, calculating the second disease degree according to the following formula: , In the formula, L0 is the actual length of the bridge member where the disease area is located, and g2≤1.0 is mild disease, 1.0≤g2≤2.0 is moderate disease, and g2≥2.0 is severe disease.
3. The bridge surface disease detection method based on improved Yolov8 target detection of claim 1, characterized in that, The bridge disease detection dataset D includes a CODEBRIM dataset and a dacl10k dataset.
4. The bridge surface disease detection method based on improved Yolov8 target detection according to claim 2, characterized in that, In S71, specifically: Sb1, extracting a crack skeleton from the disease area mask image to generate a skeleton line; Sb2, total number of white pixels in the statistical skeleton line L white According to the formula L = L white × R, the crack skeleton length L is calculated; Sb3, overlapping the crack skeleton with the disease area mask image, extracting the maximum width W of the crack skeleton on the disease area mask image based on the skeleton line using an eight-direction search method max .
Citation Information
Patent Citations
PCB small target defect detection method based on improved YOLOv8x
CN119722669A
PCB surface defect detection method based on improved YOLOv5 algorithm
CN119810035A