A multi-label bridge surface defect detection method and system based on deep learning
Through a multi-label bridge surface defect detection method based on deep learning, using data enhancement and model modification, the problem of multi-category bridge defect detection is solved, achieving more efficient detection performance and faster model training.
Patent Information
- Application Number
- CN202311175892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-09-13
AI Technical Summary
It is difficult for existing technology to effectively detect multi-category and multi-target bridge defects, especially when defect categories overlap and appearance differences are large, and multi-label bridge defect detection is a difficult task.
A multi-label bridge surface defect detection method based on deep learning is used to obtain and enhance the surface image data of reinforced concrete bridges, modify the YOLOv5 model to the BDYOLO model, use the ACmix module to replace the original backbone module, and use multi-label softmax to replace the classification loss function , combined with offline data enhancement and self-attention mechanism, to improve the detection performance of the model.
It achieves a more balanced distribution and faster model convergence of multi-category bridge defects, improves detection performance in complex scenarios, and significantly improves the accuracy and speed of bridge defect detection.
Smart Images

Figure CN117408947B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a multi-label bridge surface defect detection method and system based on deep learning. Background Art
[0002] Surface defect detection of concrete structures is an important part of structural health monitoring. In order to ensure the safe operation of bridges, it is necessary to conduct regular inspections and maintenance. During the construction and use of bridges, affected by factors such as construction materials, processes, extreme weather and vehicle overload, structural or non-structural damage will inevitably occur, causing obvious diseases. If the bridge is inspected and repaired in time, the maintenance cost of the bridge will be greatly reduced and the service life of the bridge will be extended.
[0003] To assess the structural safety of concrete bridges, it is necessary to determine their degradation by accurately identifying all defect types. Bridge defects tend to be small, and different types of defects are prone to occur in the same area. While we can treat each type of defect independently, overlapping defects are more serious from a structural safety perspective. The need to identify these multi-category, multi-target defects forms the basis of a challenging real-world task that is further complicated by various environmental factors. This requires computer vision techniques that can handle such a rich appearance space.
[0004] Some scholars have combined regional convolutional neural networks (R-CNN) with morphological post-processing to detect and segment bridge cracks. However, most deep learning methods can only detect one disease and cannot comprehensively evaluate the health of the bridge. With the development of multi-scale detection networks, various bridge damage detection algorithms have emerged. Some studies have shown that the use of you only look once (YOLO) network can well detect four diseases of bridge cracks, spalling, honeycombs and missing reinforcement. This method introduces a transfer learning method and a batch regularization method based on YOLOv3. In addition, a new fully convolutional neural network (FCN) based on dense networks and transfer learning methods is proposed to detect and segment four diseases of cracks, honeycombs, weathering and holes. However, in practical applications, most of the research on bridge defect detection focuses on single-label detection, and it is still a great challenge for bridge defect detection with overlapping defect categories. In addition, different types of bridge defects have significant differences in appearance, and the defects may overlap, and the effective detection or classification of multi-label bridge defects is a difficult task. Summary of the invention
[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0006] In view of the above existing problems, the present invention is proposed. Therefore, the present invention provides a multi-label bridge surface defect detection method based on deep learning, which is used to solve the problems of uneven spatial distribution of bridge defects and lack of overlap in bridge defect category detection in practical problems.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] In a first aspect, the present invention provides a multi-label bridge surface defect detection method based on deep learning, comprising:
[0009] Acquire surface image data of several reinforced concrete bridges to construct an image dataset, and use an offline data enhancement method to process the dataset to increase the number of images;
[0010] The YOLOv5 model is modified to construct a BDYOLO model and the processed data set is trained by the BDYOLO model.
[0011] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, surface image data of several reinforced concrete bridges are obtained, including cracks, peeling, weathering, exposed rods, corrosion stains and defect-free background.
[0012] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, the data set is processed by an offline data enhancement method to increase the number of images, including:
[0013] The data set is randomly enhanced by changing hue, changing saturation, randomly flipping and using Gaussian noise to enhance and expand the images in the data set.
[0014] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, wherein: modifying the YOLOv5 model includes:
[0015] Use the ACmix module to replace the last CBS module of the backbone in the YOLOv5 model, and use multi-label softmax to replace the original classification loss function.
[0016] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, the ACmix module is used to replace the last CBS module of the backbone in the YOLOv5 model, including:
[0017] First, the input features are convolutionally projected to obtain a set of sub-features consisting of 3×N feature maps;
[0018] Secondly, two different forms are used: the upper part processes the input features through convolution, and the output is fconv; the second half uses the self-attention method to aggregate the intermediate features into N groups; each group contains 3 feature maps: query, key and value, and a multi-head self-attention model is used at the same time, and the output is fat;
[0019] Finally, the results of the two forms are weighted summed, with the weights controlled by two learnable scalars.
[0020] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, the multi-label softmax is used to replace the original classification loss function, including:
[0021] The multi-label softmax representation of a bounding box b is:
[0022]
[0023] Among them, y i represents the label and C represents the number of categories.
[0024] As a preferred solution of the multi-label bridge surface defect detection method based on deep learning described in the present invention, it also includes:
[0025] θ * It is expressed as:
[0026] Among them, z i represents the response of the i-th category.
[0027] In a second aspect, the present invention provides a multi-label bridge surface defect detection system based on deep learning, which comprises:
[0028] A bridge image acquisition and processing module is used to acquire surface image data of several reinforced concrete bridges to construct an image data set, and use an offline data enhancement method to process the data set to increase the number of images;
[0029] The bridge model training module is used to modify the YOLOv5 model to build a BDYOLO model and train the processed data set through the BDYOLO model.
[0030] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: the processor implements any step of the above method when executing the computer program.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: the computer program implements any step of the above method when executed by a processor.
[0032] Compared with the prior art, the beneficial effects of the invention are as follows: the present invention increases the number of defective images by removing some background images through enhancement operations on the image data set, making the distribution of various labels more balanced; designing a multi-label softmax to replace the original classification loss function can avoid unnecessary losses due to multi-label problems, and concentrate the gradient on a more valuable basis to accelerate the convergence speed and accuracy of the model; embedding ACmix into the YOLOv5 model to replace the fourth CBS module; taking into account both global and local features, thereby improving the network's detection performance of bridge defects in complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0034] Figure 1 This is an overall flow chart of a multi-label bridge surface defect detection method based on deep learning according to an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of a BDYOLO model of a multi-label bridge surface defect detection method based on deep learning according to an embodiment of the present invention;
[0036] Figure 3 This is a diagram showing the replacement of the ACmix module of the multi-label bridge surface defect detection method based on deep learning according to an embodiment of the present invention;
[0037] Figure 4 This is a diagram of detection results under different circumstances of a multi-label bridge surface defect detection method based on deep learning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0039] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0040] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0041] Example 1
[0042] Reference Figures 1 to 3 , which is the first embodiment of the present invention, provides a multi-label bridge surface defect detection method based on deep learning, comprising:
[0043] S1. Obtain surface image data of several reinforced concrete bridges to construct an image dataset, and use an offline data enhancement method to process the image dataset to increase the number of images;
[0044] Further, the image dataset contains: cracks, spalling, weathering, exposed poles, corrosion stains, and defect-free background;
[0045] Furthermore, the offline data enhancement method includes: randomly using a data enhancement method of changing hue, changing saturation, random flipping and Gaussian noise for the image data set to enhance and expand the images in the data set;
[0046] It should be noted that data enhancement methods are not limited to the above processing methods;
[0047] S2, modify the YOLOv5 model to build a BDYOLO model and train the processed data set through the BDYOLO model;
[0048] refer to Figure 2 , is the BDYOLO model;
[0049] Further, the modified model YOLOv5 model includes:
[0050] Use the ACmix module to replace the last CBS module in the backbone of the YOLOv5 model, and use multi-label softmax to replace the original classification loss function;
[0051] Further, refer to Figure 3 ; Use the ACmix module to replace the last CBS module in the backbone of the YOLOv5 model. The steps are as follows:
[0052] First, the input features are convolutionally projected to obtain a set of sub-features consisting of 3×N feature maps;
[0053] Secondly, two different forms are used: the upper part processes the input features through convolution, and the output is fconv; the second half uses the self-attention method to aggregate the intermediate features into N groups; each group contains 3 feature maps: query, key and value, and a multi-head self-attention model is used at the same time, and the output is fat;
[0054] Finally, the two forms of results are weighted and summed, with the weights controlled by two learnable scalars;
[0055] It should be noted that softmax, as one of the most widely used loss functions in deep learning, is expressed as follows:
[0056]
[0057] In the above formula, θ is expressed as:
[0058]
[0059] Among them, z i represents the response of the i-th category, y i represents the label, C represents the number of categories; it is in ∑y i = 1 performs well in single-label recognition; however, the situation is different when it comes to multi-label recognition; in the traditional target detection training scheme, each bounding box is assigned only one label during training, ignoring other true value labels; if all m (m>1) true value labels belonging to K = {k|k∈C, yk=1} are forced to be assigned to the bounding box during training, the scores of multiple labels will constrain each other; when calculating the gradient of each true value label, it is as follows:
[0060]
[0061] When mθ i >1, even if z i is one of the ground-truth labels, z i It will also be optimized to be lower, which is the wrong optimization direction;
[0062] Furthermore, the multi-label softmax representation of a bounding box b is:
[0063]
[0064] θ * It is expressed as:
[0065]
[0066] It should be noted that, unlike the suppression of responses from all other categories in the ground truth category in softmax, multiple softmax eliminates the suppression effect between explicitly co-existing categories; for example, when assigning multiple truth labels K = {k|k∈C, yk=1} to a bounding box during training; when calculating the score of class K, since (1–y i ) structure, the influence of all other ground truth classes K is ignored, and the score of each correct class is improved; this avoids unnecessary losses due to the multi-label problem, and the gradient can be more concentrated.
[0067] Furthermore, this embodiment also provides a multi-label bridge surface defect detection system based on deep learning, including:
[0068] A bridge image acquisition and processing module is used to acquire surface image data of several reinforced concrete bridges to construct an image data set, and use an offline data enhancement method to process the data set to increase the number of images;
[0069] The bridge model training module is used to modify the YOLOv5 model to build a BDYOLO model and train the processed data set through the BDYOLO model.
[0070] This embodiment also provides a computer device, which is applicable to the multi-label bridge surface defect detection method based on deep learning, including:
[0071] Memory and processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the multi-label bridge surface defect detection method based on deep learning as proposed in the above embodiment.
[0072] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0073] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the multi-label bridge surface defect detection method based on deep learning as proposed in the above embodiment is implemented.
[0074] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0075] Example 2
[0076] Reference Figure 4 , which is the second embodiment of the present invention, provides a multi-label bridge surface defect detection method based on deep learning, comprising:
[0077] The beneficial effects of the method of the present invention are verified by means of simulation experiments;
[0078] In order to verify the improvement of BDYOLO, various comparison models are tested in the experiments; Table 1 shows the experimental results of our proposed model on our test set, where all processes are carried out under the same experimental conditions;
[0079] Table 1 Codebrim comparative experiment
[0080]
[0081] As shown in Table 1, compared with the initial YOLOv5, BDYOLO improves mAP by 5.2% and FPS by 4.9%. In addition, the recall and precision are also improved. Due to the addition of ACmix, the parameters are also reduced, indicating that after optimization, the model can detect bridge defects better and faster. YOLOv7 has a large number of basic model parameters and computational complexity, but it is not as effective as the basic YOLOv5 model in multi-label detection. Like YOLOv7, YOLOX is not as effective in multi-label detection. This study conducted experiments on the state-of-the-art YOLOv8 model and listed the results. In terms of multi-label detection, BDYOLO still has advantages in accuracy and speed. In addition, our model requires less time and GPU memory during training. YOLOv8 takes 10 hours to execute 300 epochs and occupies 6.51GB GPU memory, while our YOLOv8 only takes 7 hours and occupies 5.62GB GPU memory.
[0082] At the same time, this study also used the popular DETR and deformable DETR for comparative experiments; the experiments showed that the effects of these models on multi-label bridge defects were not as good as expected, with only 0.42 and 0.46 mAP respectively, which did not reach the level of the YOLOv5 baseline model;
[0083] In actual industrial applications, several different types of defect images were selected for testing, and the prediction results are as follows: Figure 4 As shown in the figure, the detection results of single target, multi-target and multi-label scenarios are given respectively, which proves that the model has good detection performance for bridge defects and multi-label targets.
[0084] After rigorous ablation experiments, the effectiveness of BDYOLO in multi-label bridge defect detection was verified. In order to verify the modification of the softmax activation function in this study, ablation experiments were performed using the original softmax and baseline models, and their performance comparisons are shown in Table 2. The experiment shows that using multiple softmax alone can obtain an mAP of 0.667, which is higher than 0.582 of BCE and 0.626 of baseline softmax.
[0085] After a large number of experimental attempts, we found that inserting ACmix into the backbone network to replace the last layer of CBS has the most significant effect. Compared with the CBS structure, ACmix not only effectively improves the mAP of the model, but also reduces the computational complexity of the model. This is because it replaces pure convolution with a combination of convolution and self-attention mechanism, and the computational overhead of the self-attention mechanism is smaller than that of convolution operation. More importantly, ACmix extracts complex features with different receptive fields and improves the sensitivity to small objects.
[0086] Table 2 Ablation experiments of each module on Codebrim
[0087]
[0088] From Table 2, we can see that the effect of using ACmix increases mAP by 2.7% compared to the baseline model;
[0089] Finally, in order to strictly prove the effectiveness of the optimization method in this paper, 5 independent experiments were carried out on the models before and after optimization, and the experimental results were subjected to variance analysis; the result p<0.01; the above statistical analysis proves that the optimization method in this paper is effective.
[0090] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A multi-label bridge surface defect detection method based on deep learning, characterized in that: include: Obtain surface image data of several reinforced concrete bridges and construct an image dataset; The dataset is processed using an offline data enhancement method to increase the number of images; Modify the YOLOv5 model to construct a BDYOLO model and train the processed data set through the BDYOLO model; Among them, modifying the YOLOv5 model includes: Use the ACmix module to replace the last CBS module in the backbone of the YOLOv5 model, and use multi-label softmax to replace the original classification loss function; Using the ACmix module to replace the last CBS module in the backbone of the YOLOv5 model includes: First, the input features are convolutionally projected to obtain a set of sub-features consisting of 3×N feature maps; Secondly, two different forms are used: the upper part processes the input features through convolution, and the output is fconv; the second half uses the self-attention method to aggregate the intermediate features into N groups; each group contains 3 feature maps: query, key and value, and a multi-head self-attention model is used at the same time, and the output is fat; Finally, the two forms of results are weighted and summed, with the weights controlled by two learnable scalars; Using multi-label softmax to replace the original classification loss function includes: The multi-label softmax representation of a bounding box b is: Among them, y i represents the label, and C represents the number of categories; θ * It is expressed as: Among them, z i represents the response of the i-th category.
2. The multi-label bridge surface defect detection method based on deep learning as claimed in claim 1, characterized in that: Acquire surface image data of several reinforced concrete bridges, including: cracks, spalling, weathering, exposed rods, corrosion stains, and defect-free background.
3. The multi-label bridge surface defect detection method based on deep learning according to claim 1 or 2, characterized in that: The dataset is processed using an offline data enhancement method to increase the number of images, including: The data set is randomly enhanced by changing hue, changing saturation, randomly flipping and using Gaussian noise to enhance and expand the images in the data set.
4. A multi-label bridge surface defect detection system based on deep learning, based on the multi-label bridge surface defect detection method based on deep learning according to any one of claims 1 to 3, characterized in that: include: A bridge image acquisition and processing module is used to acquire surface image data of several reinforced concrete bridges to construct an image data set, and use an offline data enhancement method to process the data set to increase the number of images; The bridge model training module is used to modify the YOLOv5 model to build a BDYOLO model and train the processed data set through the BDYOLO model.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Cited By
Concrete defect classification method and system based on interpretable model
CN122737595A
