Construction method of waterproof roll crack detection model
By constructing a waterproof coil crack detection model, using the bending and crack detection submodule combined with high frequency and airspace characteristics, the problems of low detection efficiency and poor accuracy in the existing technology are solved, and more efficient and accurate waterproof coil crack detection is achieved. .
Patent Information
- Application Number
- CN202410958756.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-17
AI Technical Summary
The existing low-temperature flexibility detection methods for waterproof coils rely on manual judgment, are inefficient and are susceptible to light and operator fatigue, resulting in inaccurate detection results and no crack characteristics of coils are used, resulting in low detection efficiency and poor accuracy.
Build a waterproof coil crack detection model, including a bending detection submodule and a crack detection submodule, use the YOLOv9 model to detect the bending parts, combine high-frequency and airspace feature extraction modules, and integrate features through the frequency domain airspace feature mixing module, and the training data set includes bending and crack information, a comparison learning pre-training backbone network is used to reduce false detection and improve detection accuracy.
It improves the accuracy and efficiency of crack detection of waterproof coil materials, reduces false detection, saves computing resources, enhances the detection ability of small cracks, and reduces the risk of model overfitting.
Smart Images

Figure CN118918074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent image recognition, and in particular to a method for constructing a waterproof coiled material crack detection model. Background Art
[0002] Waterproof membrane plays a vital role in construction projects. Its low-temperature flexibility is a key performance indicator to ensure that it is flexible, not prone to hardening and cracking when used in low-temperature environments. The quality of waterproof materials currently used on construction sites varies greatly, making it difficult to quickly detect. If the low-temperature flexibility of waterproof membranes is unqualified, it may cause the building to leak in low-temperature environments, affecting the quality of the project.
[0003] Traditional low-temperature flexibility detection methods for waterproof membranes mostly rely on the naked eye judgment of inspectors, which are easily affected by laboratory lighting, test conditions and human fatigue factors. There may be deviations in the judgment of tiny cracks. For waterproof membranes, cracks usually appear at the bends of waterproof membranes. In the vertical direction of the cracks, there will definitely be a frequency conversion from a low-frequency signal with a gentle image to a high-frequency signal with a sharp deformation. In the existing crack detection scheme, there is no model for detecting cracks in waterproof membranes using the crack characteristics of waterproof membranes, resulting in low detection efficiency and inaccurate detection results when using existing models for crack detection of waterproof membranes. Summary of the invention
[0004] In view of the above analysis, an embodiment of the present invention aims to provide a method for constructing a crack detection model for waterproof membranes, so as to solve the problem that the existing crack detection model has low detection efficiency and inaccurate detection results when detecting cracks in waterproof membranes.
[0005] The purpose of the present invention is mainly achieved through the following technical solutions:
[0006] The present invention provides a method for constructing a waterproofing roll material crack detection model, comprising the following steps:
[0007] Constructing a training data set for a crack detection model of waterproof coiled material; the training data set includes: a sample image, an image of a bending part in the sample image, and crack information corresponding to the bending part;
[0008] A waterproof roll material crack detection model is trained based on the training data set to obtain a trained waterproof roll material crack detection model; the trained waterproof roll material crack detection model is used to perform crack detection on the bending part of the waterproof roll material that has undergone a low-temperature flexibility test; wherein the waterproof roll material crack detection model includes a bending detection submodule and a crack detection submodule.
[0009] Furthermore, the bending detection submodule uses a YOLOv9 model to detect the bending portion of the waterproofing membrane and obtain an image of the bending portion of the waterproofing membrane.
[0010] Furthermore, the crack detection submodule includes a high-frequency feature extraction module, a spatial feature extraction module, a frequency-domain spatial feature mixing module and a crack detection head;
[0011] The high-frequency feature extraction module is used to obtain high-frequency features of different scales of the curved part image;
[0012] The spatial feature extraction module is used to obtain RGB features of different scales of the curved part image;
[0013] The frequency domain and spatial domain feature mixing module is used to perform feature fusion on the high-frequency features and the RGB features of the same scale;
[0014] The crack detection head is used to detect crack information in the fused features.
[0015] Furthermore, in the high-frequency feature extraction module, after the curved part image is converted from the spatial domain to the frequency domain through discrete cosine transformation, the high-frequency area weight of the image is increased through a filter to obtain a high-frequency enhanced image; the high-frequency enhanced image is restored to the spatial domain through inverse discrete cosine transformation and then passes through three convolution layers respectively to obtain high-frequency features of three different scales.
[0016] Furthermore, the spatial feature extraction module uses a YOLOv9 model with the input layer and the detection head removed, including a backbone network layer and a multi-scale feature fusion layer;
[0017] The backbone network layer is used to extract features of the curved part image;
[0018] The multi-scale feature fusion layer includes three target detection layers of different scales, which are used to fuse the features from the backbone network and output RGB features of three different scales.
[0019] Furthermore, in the frequency domain and spatial domain feature mixing module, the high frequency feature and the RGB feature are matrix multiplied to obtain a mixed frequency domain feature;
[0020] The mixed frequency domain feature is matrix-multiplied with the high frequency feature and the RGB feature respectively to obtain a high frequency enhancement feature and an RGB enhancement feature;
[0021] Performing matrix addition on the high-frequency enhancement feature and the RGB feature to obtain a high-frequency enhancement-RGB fusion feature;
[0022] Performing matrix addition on the RGB enhancement feature and the high-frequency feature to obtain an RGB enhancement-high-frequency fusion feature;
[0023] The high-frequency enhancement-RGB fusion feature and the RGB enhancement-high-frequency fusion feature are fused through matrix channels to obtain a fusion feature.
[0024] Further, the training data set includes a bending detection training data set, a crack detection training data set and several pre-training data sets;
[0025] The bending detection training data set includes sample images and corresponding bending part images in the sample images;
[0026] The crack detection training data set includes a bending part image and crack information corresponding to the bending part;
[0027] The plurality of pre-training data groups, each pre-training data group includes a plurality of pre-training sample pairs; wherein the pre-training sample pairs include a positive sample and a negative sample; the positive sample in each pre-training data group is a picture of the same crack area, and the negative sample includes a plurality of crack-free area pictures of the same size as the positive sample and two pictures of the same size as the positive sample extracted on both sides of the long side of the positive sample.
[0028] Furthermore, the training of the waterproof membrane crack detection model includes:
[0029] Loading the bending detection training data set to train the bending detection submodule to obtain a trained bending detection submodule;
[0030] Loading the plurality of pre-training data groups to perform contrastive learning-based pre-training on the backbone network of the spatial feature extraction module of the crack detection submodule to obtain a pre-trained backbone network;
[0031] Loading the crack detection training data set to train the crack detection submodule of the pre-trained backbone network to obtain a trained crack detection submodule;
[0032] Based on the trained bending detection submodule and the trained crack detection submodule, a trained waterproof membrane crack detection model is obtained.
[0033] Furthermore, the loading of the plurality of pre-training data sets to pre-train the backbone network of the spatial feature extraction module of the crack detection submodule based on contrastive learning to obtain a crack detection basic backbone network includes:
[0034] For each pre-training data group, the pre-training sample pairs are loaded, and the backbone network of the spatial feature extraction module of the crack detection submodule is trained using the contrast loss function. The backbone network parameters of the spatial feature extraction module are updated using gradient back propagation. After the training is completed, the backbone network parameters of the spatial feature extraction module are saved.
[0035] Further, the loading of the bend detection training data set to train the bend detection submodule to obtain a trained bend detection submodule includes: loading the bend detection training data set, using a combination of a bounding box intersection-over-union loss function, a classification loss function, and a distribution focal length loss function to train the bend detection submodule, and using a stochastic gradient descent method to perform back propagation to update parameters of the bend detection submodule to obtain a trained bend detection submodule;
[0036] The method of loading the crack detection training data set to train a crack detection submodule of a pre-trained backbone network to obtain a trained crack detection submodule includes: loading the crack detection training data set, using a combination of a bounding box small target detection loss function, a classification loss function, and a distribution focal length loss function to train the crack detection submodule, and using a stochastic gradient descent method to perform back propagation to update parameters of the crack detection submodule to obtain a trained crack detection submodule.
[0037] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0038] 1. The present invention solves the problem of low accuracy of crack detection due to low efficiency of existing manual identification of cracks in waterproof membranes and susceptibility to factors such as light conditions, operator fatigue and subjective judgment by constructing a crack detection model for waterproof membranes.
[0039] 2. For waterproof roll materials, cracks usually appear at the bending parts of the waterproof roll materials. The waterproof roll material crack detection model of the present invention first uses the bending detection submodule to detect the bending parts of the waterproof roll materials, and then uses the crack detection submodule to further determine whether there are cracks. Compared with directly performing crack detection on the waterproof roll material image, it is more targeted and can improve the detection accuracy of these areas.
[0040] 3. The crack detection model of the waterproof membrane of the present invention uses a bending detection submodule to detect the bending parts of the waterproof membrane, which can reduce the detection in areas where no cracks appear, thereby reducing false detections due to random textures or material inhomogeneities, and reducing the image range that requires high-resolution detection, thereby saving computing resources and time.
[0041] 4. Since for industrial scenarios, samples of waterproof membranes are usually unbalanced, that is, the number of samples of normal waterproof membranes is much larger than the number of samples of cracks in waterproof membranes, the present invention performs a pre-training method based on comparative learning on the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model when training the crack detection submodule of the waterproof membrane crack detection model, so that the backbone network layer of the crack detection submodule learns the intra-class consistency and extra-class difference feature representation of the waterproof membrane cracks, thereby improving the detection effect of the waterproof membrane crack detection model and reducing model overfitting.
[0042] 5. When the present invention constructs a pair of pre-trained training samples based on contrastive learning for the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model, the negative sample includes two pictures with the same size as the positive sample extracted from both sides of the long side of the positive sample in the same training data group. By selecting an area similar to the crack area but actually containing no cracks as a negative sample, the model can learn the subtle differences between cracks and normal areas, enhance the difference in features, and more accurately identify the crack area.
[0043] 6. In the crack detection submodule of the waterproof roll material crack detection model of the present invention, high-frequency feature information that is difficult to detect in the RGB space in the roll material image is extracted, which can better identify the existence of cracks and enhance the characteristic expression of small cracks, thereby improving the model's detection ability for small cracks.
[0044] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0046] Figure 1 It is a schematic diagram of a process of constructing a waterproofing membrane crack detection model in an embodiment of the present invention;
[0047] Figure 2 It is a structural schematic diagram of a waterproof membrane crack detection model in an embodiment of the present invention;
[0048] Figure 3 Schematic diagram of the structure of the bending detection submodule of the waterproof coiled material crack detection model in an embodiment of the present invention;
[0049] Figure 4It is a structural schematic diagram of the backbone network of the bending detection submodule of the waterproof coiled material crack detection model in an embodiment of the present invention;
[0050] Figure 5 Schematic diagram of the structure of the multi-scale feature fusion layer of the bending detection submodule of the waterproof coiled material crack detection model in an embodiment of the present invention;
[0051] Figure 6 It is a structural schematic diagram of a bending detection head of a bending detection submodule of a waterproof coiled material crack detection model in an embodiment of the present invention;
[0052] Figure 7 Schematic diagram of the structure of the crack detection submodule of the waterproof membrane crack detection model in the embodiment of the present invention;
[0053] Figure 8 It is a flow chart of a frequency domain and spatial domain feature mixing module of a crack detection submodule of a waterproof coiled material crack detection model in an embodiment of the present invention;
[0054] Fig. 9 Schematic diagram of the training process of the waterproof membrane crack detection model in an embodiment of the present invention;
[0055] Fig.10 It is a schematic structural diagram of a multi-level auxiliary information layer, an auxiliary reversible branch and an auxiliary detection head of a bending detection submodule of a waterproof coiled material crack detection model in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0057] A specific embodiment of the present invention discloses a method for constructing a crack detection model for waterproofing membranes, such as Figure 1 As shown, the steps S1 to S2 are included:
[0058] Step S1, constructing a training data set for a waterproof membrane crack detection model; the training data set includes: a sample image, an image of a bending part in the sample image, and crack information corresponding to the bending part.
[0059] Further, the training data set includes a bending detection training data set, a crack detection training data set and several pre-training data sets;
[0060] The bending detection training data set includes sample images and corresponding bending part images in the sample images;
[0061] The crack detection training data set includes a bending part image and crack information corresponding to the bending part;
[0062] The plurality of pre-training data groups, each pre-training data group includes a plurality of pre-training sample pairs; wherein the pre-training sample pairs include a positive sample and a negative sample; the positive sample in each pre-training data group is a picture of the same crack area, and the negative sample includes a plurality of crack-free area pictures of the same size as the positive sample and two pictures of the same size as the positive sample extracted on both sides of the long side of the positive sample.
[0063] Specifically, for the bend detection training data set and the crack detection training data set, according to the size, position, shape and other characteristics of the cracks in the waterproof membrane, the LabelImg software is used to accurately mark the crack defects and the bends of the membrane, draw the most accurate rectangular boxes for the cracks and bends in all the images to be marked, and name the marked rectangular boxes (true value boxes) as cracks and bends, and save all the marked rectangular boxes in YOLO data format.
[0064] It should be noted that in order to avoid overfitting of the waterproofing roll crack detection model, the data set should include a large number of images under various conditions. However, for industrial scenarios, the samples of waterproofing rolls are usually unbalanced, that is, the number of samples of normal waterproofing rolls is much larger than the number of samples of waterproofing roll cracks. Therefore, this embodiment uses a contrastive learning-based method to pre-train the waterproofing roll crack detection model, so that it learns the intra-class consistency and extra-class difference feature representation of waterproofing roll cracks, laying the foundation for the formal training of the model, improving the model detection effect, and reducing the generation of model overfitting.
[0065] Specifically, cracks in waterproof membranes are usually transverse rectangular cracks. Therefore, when constructing negative samples of pre-training sample pairs, images of the same size as the positive samples extracted from both sides of the long side of the positive samples are used. By selecting areas that are similar to the crack areas but do not actually contain cracks as negative samples, the model can learn the subtle differences between cracks and normal areas and enhance the diversity of features.
[0066] Step S2: training a waterproof membrane crack detection model based on the training data set to obtain a trained waterproof membrane crack detection model; the trained waterproof membrane crack detection model is used to perform crack detection on the bending part of the waterproof membrane that has undergone a low-temperature flexibility test; wherein the waterproof membrane crack detection model includes a bending detection submodule and a crack detection submodule.
[0067] Specifically, the model structure of the waterproof membrane crack detection model is as follows: Figure 2 shown.
[0068] For waterproof membranes, cracks usually appear at the bends of the waterproof membranes. The waterproof membrane crack detection model constructed in this embodiment first uses the bend detection submodule to detect the bends of the waterproof membranes, and then uses the crack detection submodule to further determine whether cracks exist in the image of the bends. This makes crack detection more targeted and concentrates detection resources on the bends of the waterproof membranes, which can improve the detection accuracy of these areas and reduce detection in areas without cracks, thereby reducing false detections due to random textures or material unevenness.
[0069] Furthermore, the bending detection submodule uses a YOLOv9 model to detect the bending portion of the waterproofing membrane and obtain an image of the bending portion of the waterproofing membrane.
[0070] Specifically, Figure 3 As shown, the bending detection submodule includes: an input layer, a backbone network, a multi-scale feature fusion layer and a bending detection head.
[0071] The input layer is used to preprocess the image of the waterproof coiled material sample, and the preprocessing includes image denoising and image enhancement.
[0072] Among them, the image denoising uses the ZS-N2N denoising algorithm based on convolutional neural networks. Compared with traditional filtering denoising methods such as mean filtering algorithm and Gaussian filtering algorithm, traditional methods have great limitations in dealing with complex noise, retaining image details and adapting to noise of different scales. The filtering denoising algorithm based on convolutional neural networks can automatically learn noise characteristics, effectively model noise, maximize the retention of original image information, and improve image quality.
[0073] In order to solve the problem of low contrast between the crack area of waterproof coiled material and the background, this application adopts the image enhancement method of histogram equalization to improve the image contrast. This method redistributes the grayscale values of the original image, expands the grayscale values that account for a smaller proportion in the image, and compresses the grayscale values that account for a larger proportion, so that the image grayscale is evenly distributed. After histogram equalization, the contrast between the crack target area and the background is higher, the details of the image are clearer, and the entire image has more semantic information, which will help improve the accuracy of crack defect detection.
[0074] The backbone network, such as Figure 4As shown in the figure, it is used to extract features from the preprocessed image and convert the image into a feature representation with rich semantic information. Among them, the Silence layer is used to pass the input information to the backbone network; the Conv layer is a convolutional layer, which is used to extract local features of the image; the GELAN layer is an efficient attention network layer, which is used to enhance the ability of feature extraction and improve the accuracy of target detection; the Adown layer is a downsampling layer, which is used to reduce the input vector by one half before passing it to the next layer.
[0075] The multi-scale feature fusion layer, such as Figure 5 As shown, it includes small target detection layer, medium target detection layer and large target detection layer. Each layer focuses on detail information of different sizes and is used to fuse the features from the backbone network.
[0076] The bending detection head, such as Figure 6 As shown, it includes a bounding box regressor (Box) and a classifier (Cls), which are used to output a prediction box and a prediction label for the target detection layer output by the multi-scale feature fusion layer. It should be noted that, in this embodiment, the multi-scale feature fusion layer of the bending detection submodule includes three target detection layers. Therefore, the bending detection submodule also has three bending detection heads, which respectively predict the features output by target detection layers of different scales.
[0077] It should be noted that, among the detection frames output by the bending detection submodule, after removing the prediction frames with confidence lower than 0.25, the detection frames with higher overlap are removed by non-maximum suppression, and finally the label with the highest category confidence is selected as the classification label of the prediction frame to obtain a picture of the bending part of the waterproof membrane.
[0078] Further, such as Figure 7 As shown, the crack detection submodule includes a high-frequency feature extraction module, a spatial feature extraction module, a frequency domain and spatial domain feature mixing module and a crack detection head;
[0079] The high-frequency feature extraction module is used to obtain high-frequency features of different scales of the curved part image.
[0080] Specifically, there are many feature information in the frequency domain information of the waterproof membrane crack image that are difficult to detect in the RGB space. It is far from enough for the model to rely solely on the RGB spatial domain information of the waterproof membrane image. For example, when a crack appears on the waterproof membrane, there will definitely be a frequency transformation from a low-frequency signal of a smooth image to a high-frequency signal of a sharp deformation in the vertical direction of the crack, and it is difficult to perceive this signal transformation in the RGB space.
[0081] Furthermore, in the high-frequency feature extraction module, after the curved part image is converted from the spatial domain to the frequency domain through discrete cosine transformation, the high-frequency area weight of the image is increased through a filter to obtain a high-frequency enhanced image; the high-frequency enhanced image is restored to the spatial domain through inverse discrete cosine transformation and then passes through three convolution layers respectively to obtain high-frequency features of three different scales.
[0082] Specifically, the discrete cosine transform is a mathematical transformation used to convert signals from the spatial domain to the frequency domain, and can decompose the image into different frequency components. The filter is used to increase the weight of the high-frequency area of the image and reduce the weight of the low-frequency area of the image to highlight the detailed features such as cracks in the image. The inverse discrete cosine transform is the inverse process of the discrete cosine transform, and is used to convert the processed frequency domain data back to the spatial domain.
[0083] The spatial domain feature extraction module is used to obtain RGB features of different scales of the curved part image.
[0084] Furthermore, the spatial feature extraction module uses a YOLOv9 model with the input layer and the detection head removed, including a backbone network layer and a multi-scale feature fusion layer;
[0085] The backbone network layer is used to extract features of the curved part image;
[0086] The multi-scale feature fusion layer includes three target detection layers of different scales, which are used to fuse the features from the backbone network and output RGB features of three different scales.
[0087] Specifically, the image of the curved part is extracted with features through the backbone network layer of the spatial feature extraction module, and the image is converted into a feature representation with rich semantic information. Among them, the Silence layer is used to pass input information to the backbone network layer; the Conv layer is a convolutional layer, which is used to extract local features of the image; the GELAN layer is an efficient attention network layer, which is used to enhance the ability of feature extraction and improve the accuracy of target detection; the Adown layer is a downsampling layer, which is used to reduce the input vector by one half before passing it to the next layer.
[0088] The multi-scale feature fusion layer includes a small target detection layer, a medium target detection layer and a large target detection layer. Each layer focuses on detail information of different sizes and is used to fuse features from the backbone network.
[0089] It should be noted that the high-frequency features of three different scales obtained by the three convolutional layers of the output graph of the high-frequency feature extraction module correspond one-to-one to the RGB features of three scales output by the spatial feature extraction module, and are used for feature fusion in the frequency domain and spatial domain feature mixing module. Exemplarily, the three scales are 160×160×128, 80×80×256, and 40×10×512, respectively.
[0090] The frequency domain and spatial domain feature mixing module is used to perform feature fusion on the high-frequency features and the RGB features of the same scale.
[0091] Furthermore, in the frequency domain and spatial domain feature mixing module, the high frequency feature and the RGB feature are matrix multiplied to obtain a mixed frequency domain feature;
[0092] The mixed frequency domain feature is matrix-multiplied with the high frequency feature and the RGB feature respectively to obtain a high frequency enhancement feature and an RGB enhancement feature;
[0093] Performing matrix addition on the high-frequency enhancement feature and the RGB feature to obtain a high-frequency enhancement-RGB fusion feature;
[0094] Performing matrix addition on the RGB enhancement feature and the high-frequency feature to obtain an RGB enhancement-high-frequency fusion feature;
[0095] The high-frequency enhancement-RGB fusion feature and the RGB enhancement-high-frequency fusion feature are fused through matrix channels to obtain a fusion feature.
[0096] Specifically, Figure 8 As shown, the frequency domain and spatial domain feature mixing module uses high-frequency features and RGB features to calculate the cross-attention weights, and then uses the cross-attention matrix to enhance the attention features of the spatial domain and frequency domain, and finally merges the attention features of the spatial domain and frequency domain together for output.
[0097] The crack detection head is used to detect crack information in the fused features.
[0098] Specifically, the model structure of the crack detection head of the crack detection submodule uses the detection head structure of the YOLOv9 model. In the detection frame output by it, the prediction frame with a confidence level lower than 0.25 is removed, and then the detection frame with a high degree of overlap is removed by non-maximum suppression. Finally, the label with the highest category confidence is selected as the classification label of the prediction frame to obtain the crack information of the waterproof membrane.
[0099] Further, such as Fig. 9 As shown, the training of the waterproofing membrane crack detection model includes steps S201 to S204:
[0100] Step S201: Load the bending detection training data set to train the bending detection submodule to obtain a trained bending detection submodule.
[0101] Furthermore, the bend detection training data set is loaded, and a combination of a bounding box intersection-over-union loss function, a classification loss function, and a confidence loss function is used to train the bend detection submodule. The parameters of the bend detection submodule are updated by back propagation using the stochastic gradient descent method to obtain a trained bend detection submodule.
[0102] Specifically, Fig.10 As shown, the bending detection submodule also includes a multi-level auxiliary information layer and an auxiliary reversible branch during training; the multi-level auxiliary information layer is an integrated network inserted between the auxiliary reversible branch and the main network of the bending detection submodule, which is used to receive the gradient information of all target objects, aggregate the gradient information containing all target objects into multi-level auxiliary information, and pass it to the main network of the bending detection submodule for weight update; it should be noted that this module is only used in training mode because the gradient it returns is obtained from the auxiliary reversible branch.
[0103] The structure of the auxiliary reversible branch is consistent with the backbone network structure, and is used to help the backbone network of the bending detection submodule better obtain rich return gradient information during the training process. Discarding this branch during the reasoning process can improve the detection speed of the model without losing accuracy.
[0104] The output features of the auxiliary reversible branch output the prediction box and prediction label of the curved part through the auxiliary detection head, which are used to calculate the loss together with the prediction box and prediction label of the curved part output by the curved detection head. This can provide more gradient information during the training process and help accelerate the convergence of the model.
[0105] Furthermore, the bounding box intersection over union loss function uses the CIOU loss function, which is an improved version based on the original IOU (Intersection over Union) loss function. It takes into account the complete intersection between target boxes and introduces a correction factor to more accurately measure the similarity between target boxes.
[0106] The classification loss function uses a binary cross entropy loss function.
[0107] The distribution focal loss function is a DFL (Distribution Focal Loss) loss function.
[0108] Specifically, during the training process, the bounding box intersection-over-union loss, the classification loss, and the distribution focal length loss are added together to obtain a total loss, and the total loss is used to optimize the parameters of the bending detection submodule through back propagation.
[0109] Step S202: Load the plurality of pre-training data sets to perform contrastive learning-based pre-training on the backbone network of the spatial feature extraction module of the crack detection sub-module to obtain a pre-trained backbone network.
[0110] Furthermore, for each pre-training data group, the pre-training sample pairs are loaded, and the contrast loss function is used to train the backbone network of the spatial feature extraction module of the crack detection submodule, and the backbone network parameters of the spatial feature extraction module are updated using gradient back propagation. After the training is completed, the backbone network parameters of the spatial feature extraction module are saved.
[0111] Specifically, during training, the positive samples are input into the decoder (the backbone network structure of the spatial feature extraction module) to obtain the positive sample feature vector matrix, and the negative samples are input into the dynamic decoder (the backbone network structure used for training in the spatial feature extraction module) to obtain the negative sample feature vector matrix. After performing matrix multiplication on the positive sample feature vector matrix and the negative sample feature vector matrix and calculating the contrast loss, the gradient of the contrast loss is returned to the decoder, and after updating the decoder parameters, the dynamic decoder parameters are updated using the following formula:
[0112] Dynamic decoder parameters = decoder parameters * 0.001 + previous dynamic decoder parameters * 0.999
[0113] It should be noted that the dynamic decoder parameters are updated synchronously using the above formula. By following the decoder parameter update at a smaller ratio, the model can slowly adapt to new knowledge and avoid performance fluctuations caused by large updates. Allowing the dynamic decoder to learn from the decoder may help introduce feature diversity and improve the model's generalization ability for different categories.
[0114] Exemplarily, the contrast loss function may use a temperature-scaled cross entropy loss function.
[0115] Step S203: Load the crack detection training data set to train the crack detection submodule of the pre-trained backbone network to obtain a trained crack detection submodule.
[0116] Furthermore, the crack detection training data set is loaded, and the crack detection submodule is trained using a combination of a bounding box small target detection loss function, a classification loss function, and a distribution focal length loss function. The parameters of the crack detection submodule are updated by back propagation using the stochastic gradient descent method to obtain a trained crack detection submodule.
[0117] Specifically, there are many small crack images in the crack image of the waterproof membrane. When calculating the bounding box loss, the evaluation index based on the intersection-over-union ratio is very sensitive to the position deviation of tiny objects, which greatly reduces the detection performance of the model. Therefore, this embodiment uses the bounding box small target detection loss function, namely the normalized Wasserstein distance (NWD) function, as an evaluation index to measure the similarity between two bounding boxes.
[0118] When training the crack detection submodule, the classification loss function and the distribution focal loss function use the same loss function as the bending detection submodule, that is, a binary cross entropy loss function and a DFL (Distribution Focal Loss) loss function are used respectively.
[0119] During the training process, the bounding box small target detection loss, the classification loss, and the distribution focal length loss are added together to obtain the total loss, and the total loss is used to optimize the parameters of the crack detection submodule through back propagation.
[0120] Step S204: obtaining a trained waterproof membrane crack detection model based on the trained bending detection submodule and the trained crack detection submodule.
[0121] Another embodiment of the present invention is a method for detecting cracks in waterproof roll materials based on the above-constructed crack detection model for waterproof roll materials, comprising: obtaining images of multiple waterproof roll material samples that have undergone a low-temperature flexibility test; inputting each image into a trained crack detection model for waterproof roll materials to perform crack detection on a bent portion, and obtaining crack information on a bent portion of each sample, including: obtaining an image of a bent portion in the waterproof roll material from the image of the waterproof roll material sample through a bending detection submodule of the waterproof roll material crack detection model; obtaining crack information on the bent portion from the image of the waterproof roll material through the crack detection submodule; when the number of waterproof roll material samples with cracks exceeds a preset value, judging that this low-temperature flexibility test is unqualified.
[0122] In summary, the method for constructing a waterproof membrane crack detection model according to an embodiment of the present invention has the following beneficial effects:
[0123] 1. The present invention solves the problem of low accuracy of crack detection due to low efficiency of existing manual identification of cracks in waterproof membranes and susceptibility to factors such as light conditions, operator fatigue and subjective judgment by constructing a crack detection model for waterproof membranes.
[0124] 2. For waterproof roll materials, cracks usually appear at the bending parts of the waterproof roll materials. The waterproof roll material crack detection model of the present invention first uses the bending detection submodule to detect the bending parts of the waterproof roll materials, and then uses the crack detection submodule to further determine whether there are cracks. Compared with directly performing crack detection on the waterproof roll material image, it is more targeted and can improve the detection accuracy of these areas.
[0125] 3. The crack detection model of the waterproof membrane of the present invention uses a bending detection submodule to detect the bending parts of the waterproof membrane, which can reduce the detection in areas where no cracks appear, thereby reducing false detections due to random textures or material inhomogeneities, and reducing the image range that requires high-resolution detection, thereby saving computing resources and time.
[0126] 4. Since for industrial scenarios, samples of waterproof membranes are usually unbalanced, that is, the number of samples of normal waterproof membranes is much larger than the number of samples of cracks in waterproof membranes, the present invention performs a pre-training method based on comparative learning on the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model when training the crack detection submodule of the waterproof membrane crack detection model, so that the backbone network layer of the crack detection submodule learns the intra-class consistency and extra-class difference feature representation of the waterproof membrane cracks, thereby improving the detection effect of the waterproof membrane crack detection model and reducing model overfitting.
[0127] 5. When the present invention constructs a pair of pre-trained training samples based on contrastive learning for the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model, the negative sample includes two pictures with the same size as the positive sample extracted from both sides of the long side of the positive sample in the same training data group. By selecting an area similar to the crack area but actually containing no cracks as a negative sample, the model can learn the subtle differences between cracks and normal areas, enhance the difference in features, and more accurately identify the crack area.
[0128] 6. In the crack detection submodule of the waterproof roll material crack detection model of the present invention, high-frequency feature information that is difficult to detect in the RGB space in the roll material image is extracted, which can better identify the existence of cracks and enhance the characteristic expression of small cracks, thereby improving the model's detection ability for small cracks.
[0129] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for constructing a crack detection model for waterproof coiled material, characterized in that: The steps include: Constructing a training data set for a crack detection model of waterproof coiled material; the training data set includes: a sample image, an image of a bending part in the sample image, and crack information corresponding to the bending part; A waterproof roll material crack detection model is trained based on the training data set to obtain a trained waterproof roll material crack detection model; the trained waterproof roll material crack detection model is used to perform crack detection on the bending part of the waterproof roll material that has undergone a low-temperature flexibility test; wherein the waterproof roll material crack detection model includes a bending detection submodule and a crack detection submodule.
2. The method according to claim 1, characterized in that: The bending detection submodule uses the YOLOv9 model to detect the bending part of the waterproof coiled material and obtain an image of the bending part of the waterproof coiled material.
3. The method according to claim 2, characterized in that: The crack detection submodule includes a high-frequency feature extraction module, a spatial feature extraction module, a frequency domain and spatial domain feature mixing module and a crack detection head; The high-frequency feature extraction module is used to obtain high-frequency features of different scales of the curved part image; The spatial feature extraction module is used to obtain RGB features of different scales of the curved part image; The frequency domain and spatial domain feature mixing module is used to perform feature fusion on the high-frequency features and the RGB features of the same scale; The crack detection head is used to detect crack information in the fused features.
4. The method according to claim 3, characterized in that: In the high-frequency feature extraction module, the image of the curved part is converted from the spatial domain to the frequency domain through discrete cosine transformation, and then the high-frequency area weight of the image is increased through a filter to obtain a high-frequency enhanced image; the high-frequency enhanced image is restored to the spatial domain through inverse discrete cosine transformation and then passed through three convolution layers respectively to obtain high-frequency features of three different scales.
5. The method according to claim 3, characterized in that: The spatial feature extraction module uses a YOLOv9 model with the input layer and the detection head removed, including a backbone network layer and a multi-scale feature fusion layer; The backbone network layer is used to extract features of the curved part image; The multi-scale feature fusion layer includes three target detection layers of different scales, which are used to fuse the features from the backbone network and output RGB features of three different scales.
6. The method according to any one of claims 3 to 5, characterized in that: In the frequency domain and spatial domain feature mixing module, the high frequency feature and the RGB feature are matrix multiplied to obtain a mixed frequency domain feature; The mixed frequency domain feature is matrix-multiplied with the high frequency feature and the RGB feature respectively to obtain a high frequency enhancement feature and an RGB enhancement feature; Performing matrix addition on the high-frequency enhancement feature and the RGB feature to obtain a high-frequency enhancement-RGB fusion feature; Performing matrix addition on the RGB enhancement feature and the high-frequency feature to obtain an RGB enhancement-high-frequency fusion feature; The high-frequency enhancement-RGB fusion feature and the RGB enhancement-high-frequency fusion feature are fused through matrix channels to obtain a fusion feature.
7. The method according to claim 1, characterized in that: The training data set includes a bending detection training data set, a crack detection training data set and a plurality of pre-training data sets; The bending detection training data set includes sample images and corresponding bending part images in the sample images; The crack detection training data set includes a bending part image and crack information corresponding to the bending part; The plurality of pre-training data groups, each pre-training data group includes a plurality of pre-training sample pairs; wherein the pre-training sample pairs include a positive sample and a negative sample; the positive sample in each pre-training data group is a picture of the same crack area, and the negative sample includes a plurality of crack-free area pictures of the same size as the positive sample and two pictures of the same size as the positive sample extracted on both sides of the long side of the positive sample.
8. The method according to claim 7, characterized in that: The training of the waterproofing membrane crack detection model comprises: Loading the bending detection training data set to train the bending detection submodule to obtain a trained bending detection submodule; Loading the plurality of pre-training data groups to perform contrastive learning-based pre-training on the backbone network of the spatial feature extraction module of the crack detection submodule to obtain a pre-trained backbone network; Loading the crack detection training data set to train the crack detection submodule of the pre-trained backbone network to obtain a trained crack detection submodule; Based on the trained bending detection submodule and the trained crack detection submodule, a trained waterproof membrane crack detection model is obtained.
9. The method according to claim 8, characterized in that: The loading of the plurality of pre-training data sets performs pre-training based on contrastive learning on the backbone network of the spatial feature extraction module of the crack detection submodule to obtain a crack detection basic backbone network, including: For each pre-training data group, the pre-training sample pairs are loaded, and the backbone network of the spatial feature extraction module of the crack detection submodule is trained using the contrast loss function. The backbone network parameters of the spatial feature extraction module are updated using gradient back propagation. After the training is completed, the backbone network parameters of the spatial feature extraction module are saved.
10. The method according to claim 9, characterized in that: The loading of the bending detection training data set to train the bending detection submodule to obtain a trained bending detection submodule includes: loading the bending detection training data set, using a combination of a bounding box intersection-over-union loss function, a classification loss function, and a distribution focal length loss function to train the bending detection submodule, and using a stochastic gradient descent method to perform back propagation to update parameters of the bending detection submodule to obtain a trained bending detection submodule; The method of loading the crack detection training data set to train a crack detection submodule of a pre-trained backbone network to obtain a trained crack detection submodule includes: loading the crack detection training data set, using a combination of a bounding box small target detection loss function, a classification loss function, and a distribution focal length loss function to train the crack detection submodule, and using a stochastic gradient descent method to perform back propagation to update parameters of the crack detection submodule to obtain a trained crack detection submodule.
Citation Information
Patent Citations
Low temperature bending detection method of metal material
CN105865936A
Power transmission line strain clamp defect detection method based on multi-network fusion model
CN115018818A
Scene character detection method and device based on contrast learning feature enhancement
CN117523571A
Method and device for diagnosis of waterproof sheet
JP2011180120A
