A method for constructing a waterproof roll crack detection model
By constructing a crack detection model for waterproof membranes and utilizing bending detection and crack detection sub-modules, combined with high-frequency feature extraction and comparative learning, the problems of low efficiency and poor accuracy in existing technologies for crack detection of waterproof membranes are solved, achieving more efficient and accurate crack detection.
Patent Information
- Application Number
- CN202410958756.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-07-17
AI Technical Summary
Existing methods for detecting cracks in waterproof membranes rely on manual identification, which is inefficient and easily affected by light and operator fatigue, resulting in inaccurate test results, especially for tiny cracks at bends.
A crack detection model for waterproof membranes was constructed, including a bending detection submodule and a crack detection submodule. The YOLOv9 model was used to detect bending parts, and the detection accuracy was improved by high-frequency feature extraction and frequency-spatial feature fusion. The model was optimized by combining comparative learning and pre-trained samples.
It improves the accuracy and efficiency of crack detection in waterproof membranes, reduces false detections, saves computational resources and time, enhances the ability to detect small cracks, and reduces the risk of model overfitting.
Smart Images

Figure CN118918074B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image intelligent recognition, and in particular to a construction method of a waterproof roll crack detection model. BACKGROUND
[0002] The waterproof roll plays a vital role in the construction project, and its low-temperature flexibility is a key performance indicator to ensure that it is flexible and not prone to hardening and cracking when used in a low-temperature environment. The quality of the waterproof material used in the current construction site is uneven, and it is difficult to achieve rapid detection. When the low-temperature flexibility of the waterproof roll is unqualified, it may cause the building to leak in a low-temperature environment, affecting the engineering quality.
[0003] The traditional low-temperature flexibility detection method of the waterproof roll mostly relies on the naked eye of the detection personnel, which is easily affected by the laboratory site light, test conditions and human fatigue factors, and there may be deviations in the judgment of small cracks. For the waterproof roll, cracks usually occur at the bending part of the waterproof roll. For the vertical direction of the crack, there will be a frequency transformation from the low-frequency signal of the flat image to the high-frequency signal of the sharp deformation. In the existing crack detection scheme, there is no model for detecting the cracks of the waterproof roll by utilizing the crack characteristics of the waterproof roll, resulting in low detection efficiency and inaccurate detection results when using the existing model to detect the cracks of the waterproof roll. SUMMARY
[0004] In view of the above analysis, the embodiments of the present application aim to provide a construction method of a waterproof roll crack detection model to solve the problems of low detection efficiency and inaccurate detection results of the existing crack detection model in detecting the cracks of the waterproof roll.
[0005] The purpose of the present application is mainly realized through the following technical solutions:
[0006] The present application provides a construction method of a waterproof roll crack detection model, comprising the following steps:
[0007] A training data set of the waterproof roll crack detection model is constructed; the training data set comprises: a sample image, a bending part image in the sample image, and crack information corresponding to the bending part;
[0008] A waterproof roll crack detection model is trained based on the training data set to obtain a trained waterproof roll crack detection model; the trained waterproof roll crack detection model is used for crack detection of the bending part of the waterproof roll subjected to low-temperature flexibility test; wherein the waterproof roll crack detection model comprises a bending detection sub-module and a crack detection sub-module.
[0009] Further, the bending detection submodule uses a YOLOv9 model for detecting the bending part of the waterproof roll, and obtains an image of the bending part of the waterproof roll.
[0010] Further, 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 bending part image.
[0012] The spatial feature extraction module is used to obtain RGB features of different scales of the bending part image.
[0013] The frequency-domain spatial feature mixing module is used to fuse 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] Further, in the high-frequency feature extraction module, after the bending part image is converted from spatial domain to frequency domain by discrete cosine transformation, a high-frequency enhanced image is obtained by increasing the weight of the high-frequency region of the picture through a filter; after the high-frequency enhanced image is restored to spatial domain by inverse discrete cosine transformation, it passes through three convolution layers respectively to obtain high-frequency features of three different scales.
[0016] Further, the spatial feature extraction module uses a YOLOv9 model that removes the input layer and the detection head, including a backbone network layer and a multi-scale feature fusion layer.
[0017] The backbone network layer is used to extract features of the bending 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] Further, in the frequency-domain spatial feature mixing module, the high-frequency features and the RGB features are multiplied by matrix to obtain mixed frequency-domain features.
[0020] The mixed frequency-domain features are respectively multiplied by matrix with the high-frequency features and the RGB features to obtain high-frequency enhanced features and RGB enhanced features.
[0021] The high-frequency enhanced features and the RGB features are added by matrix to obtain high-frequency enhanced-RGB fusion features.
[0022] The RGB enhanced features and the high-frequency features are added by matrix to obtain RGB enhanced-high-frequency fusion features.
[0023] perform matrix channel fusion on the high-frequency enhanced-RGB fusion feature and the RGB enhanced-high-frequency fusion feature 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 a plurality of pre-training data groups;
[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 bending part images and crack information corresponding to the bending parts;
[0027] Each pre-training data group includes a plurality of pre-training sample pairs; wherein the pre-training sample pair includes a positive sample and a negative sample; the positive sample in each pre-training data group is a picture of the same crack region, and the negative sample includes a plurality of pictures of crack-free regions with the same size as the positive sample and two pictures extracted on both sides of the long side of the positive sample with the same size as the positive sample.
[0028] Further, the training waterproofing membrane crack detection model includes:
[0029] The bending detection submodule is trained by loading the bending detection training data set to obtain a trained bending detection submodule;
[0030] The backbone network of the spatial feature extraction module of the crack detection submodule is pre-trained based on contrast learning by loading the plurality of pre-training data groups to obtain a pre-trained backbone network;
[0031] The crack detection submodule containing the pre-trained backbone network is trained by loading the crack detection training data set to obtain a trained crack detection submodule;
[0032] Based on the trained bending detection submodule and the trained crack detection submodule, a trained waterproofing membrane crack detection model is obtained.
[0033] Further, the loading of the plurality of pre-training data groups to pre-train the backbone network of the spatial feature extraction module of the crack detection submodule based on contrast learning to obtain a crack detection basic backbone network includes:
[0034] For each pre-training data group, the pre-training sample pair is loaded, the backbone network of the spatial feature extraction module of the crack detection submodule is trained using a contrast loss function, the backbone network parameters of the spatial feature extraction module are updated using gradient backpropagation, and the backbone network parameters of the spatial feature extraction module are saved after training is completed.
[0035] Further, the loading the bending detection training data set trains the bending detection sub-module to obtain a trained bending detection sub-module, comprising: 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 distributed focal length loss function, training the bending detection sub-module, using a stochastic gradient descent method to update the parameters of the bending detection sub-module by back propagation, and obtaining the trained bending detection sub-module.
[0036] The loading the crack detection training data set trains the crack detection sub-module containing a pre-trained backbone network to obtain a trained crack detection sub-module, comprising: 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 distributed focal length loss function, training the crack detection sub-module, using a stochastic gradient descent method to update the parameters of the crack detection sub-module by back propagation, and obtaining the trained crack detection sub-module.
[0037] Compared with the prior art, the present application can at least achieve one of the following beneficial effects:
[0038] 1. The waterproofing membrane crack detection model is constructed, and the problems of low efficiency of artificial recognition of waterproofing membrane cracks, influence of factors such as light conditions, operator fatigue and subjective judgment on crack detection accuracy are solved.
[0039] 2. For waterproofing membranes, cracks usually occur at the bending part of the waterproofing membrane, the waterproofing membrane crack detection model of the present application first detects the bending part of the waterproofing membrane using the bending detection sub-module, and then further judges whether there is a crack using the crack detection sub-module, which is more targeted than directly detecting cracks in waterproofing membrane images, and can improve the detection accuracy of these areas.
[0040] 3. The waterproofing membrane crack detection model of the present application uses the bending detection sub-module to detect the bending part of the waterproofing membrane, which can reduce detection in areas without cracks, thereby reducing false positives due to random textures or material unevenness, and reducing the image range that needs to be detected at high resolution, thereby saving computing resources and time.
[0041] 4. Since the samples of waterproof membranes are usually unbalanced in industrial scenarios, meaning that the number of normal waterproof membrane samples is much greater than the number of samples of cracked waterproof membranes, this invention pre-trains the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model using a contrastive learning-based method. This allows the backbone network layer of the crack detection submodule to learn the intra-class consistency and out-of-class difference features of waterproof membrane cracks, thereby improving the detection effect of the waterproof membrane crack detection model and reducing model overfitting.
[0042] 5. In constructing training sample pairs for the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model based on contrastive learning, the negative samples include two images of the same size as the positive samples extracted from both sides of the long side of the positive samples in the same training data group. By selecting areas similar to the crack area but not actually containing cracks as negative samples, the model can learn the subtle differences between cracks and normal areas, enhance the difference of features, and more accurately identify crack areas.
[0043] 6. In the crack detection submodule of the waterproof membrane crack detection model, this invention extracts high-frequency feature information that is difficult to detect in the RGB space of the membrane image, which can better identify the existence of cracks, enhance the feature representation of small cracks, and thus improve the model's ability to detect small cracks.
[0044] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0045] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0046] Figure 1 This is a flowchart illustrating a method for constructing a crack detection model for waterproof membrane in an embodiment of the present invention.
[0047] Figure 2 This is a schematic diagram of the structure of the waterproof membrane crack detection model in an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram of the bending detection submodule of the waterproof membrane crack detection model in this embodiment of the invention;
[0049] Figure 4A structural schematic diagram of a main network of a bending detection submodule of a waterproof roll crack detection model in an embodiment of the present application is shown in the figure.
[0050] Figure 5 A structural schematic diagram of a multi-scale feature fusion layer of the bending detection submodule of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure.
[0051] Figure 6 A structural schematic diagram of a bending detection head of the bending detection submodule of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure.
[0052] Figure 7 A structural schematic diagram of a crack detection submodule of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure.
[0053] Figure 8 A flowchart of a frequency-space feature mixing module of the crack detection submodule of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure.
[0054] Figure 9 A training flowchart of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure.
[0055] Figure 10 A structural schematic diagram of a multi-level auxiliary information layer, an auxiliary reversible branch and an auxiliary detection head of the bending detection submodule of the waterproof roll crack detection model in the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0056] The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, which form a part of this application. The accompanying drawings illustrate the principles of the present application and, together with the description, serve to explain the present application, but are not intended to limit the scope of the present application.
[0057] One specific embodiment of the present application discloses a construction method of a waterproof roll crack detection model, as shown in the figure, comprising the following steps S1-S2: Figure 1
[0058] Step S1, constructing a training data set of the waterproof roll crack detection model; the training data set comprises: a sample image, a bending part image in the sample image and crack information corresponding to the bending part.
[0059] Further, the training data set comprises a bending detection training data set, a crack detection training data set and a plurality of pre-training data groups;
[0060] The bending detection training data set comprises a sample image and a corresponding bending part image in the sample image;
[0061] The crack detection training data set comprises a bending part image and crack information corresponding to the bending part.
[0062] The plurality of pre-training data sets each include a plurality of pre-training sample pairs; wherein the pre-training sample pair includes a positive sample and a negative sample; the positive sample in each pre-training data set is a picture of the same crack region, and the negative sample includes a plurality of pictures of crack-free regions with the same size as the positive sample and two pictures with the same size as the positive sample extracted on both sides of the long side of the positive sample.
[0063] Specifically, for the bending detection training data set and the crack detection training data set, according to the size, position, shape and other characteristics of the waterproof coiled material crack, the LabelImg software is used to accurately mark the crack defects and the bending part of the coiled material, draw the most accurate rectangular frame in the crack and bending of all the pictures to be marked, and name the marked rectangular frame (true value frame) as crack and bending, and save all the marked rectangular frames in the YOLO data format.
[0064] It should be noted that, in order to avoid overfitting of the waterproof coiled material crack detection model, the data set should include a large number of images under various conditions. However, for industrial scenes, the samples of waterproof coiled materials are usually unbalanced, that is, the number of normal waterproof coiled material samples is much larger than that of waterproof coiled material crack samples. Therefore, the embodiment uses a contrast learning-based method to pre-train the waterproof coiled material crack detection model, so that it learns the intra-class consistency and inter-class difference feature representation of the waterproof coiled material crack, lays a foundation for formal training of the model, improves the detection effect of the model, and reduces the generation of model overfitting.
[0065] Specifically, the waterproof coiled material crack is usually a horizontal rectangular crack, therefore, when constructing the negative sample of the pre-training sample pair, the pictures with the same size as the positive sample are extracted on both sides of the long side of the positive sample, by selecting a region similar to the crack region but actually containing no crack as the negative sample, the model can learn the subtle differences between the crack and the normal region, and enhance the difference of the features.
[0066] Step S2, training a waterproof coiled material crack detection model based on the training data set to obtain a trained waterproof coiled material crack detection model; the trained waterproof coiled material crack detection model is used for crack detection of the bending part of the waterproof coiled material subjected to low-temperature flexibility test; wherein the waterproof coiled material crack detection model includes a bending detection sub-module and a crack detection sub-module.
[0067] Specifically, the model structure of the waterproof coiled material crack detection model is as shown in Figure 2
[0068] For the waterproofing membrane, cracks usually occur at the bending part of the waterproofing membrane. The waterproofing membrane crack detection model constructed in the embodiment first detects the bending part of the waterproofing membrane using the bending detection submodule, and then further judges whether there is a crack in the picture of the bending part through the crack detection submodule. In this way, the crack detection is more targeted, the detection resources are concentrated in the bending part of the waterproofing membrane, the detection accuracy of these areas can be improved, and the detection in the areas without cracks is reduced, thereby reducing the false detection caused by random texture or material unevenness.
[0069] Further, the bending detection submodule uses a YOLOv9 model for detecting the bending part of the waterproofing membrane to obtain the image of the bending part of the waterproofing membrane.
[0070] Specifically, as shown in Figure 3 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 for pre-processing the image of the waterproofing membrane sample, and the pre-processing includes image denoising and image enhancement.
[0072] The image denoising uses a ZS-N2N denoising algorithm based on a convolutional neural network. Compared with traditional filtering denoising methods such as mean filtering algorithm and Gaussian filtering algorithm, the traditional methods have great limitations in processing complex noise, preserving image details, and adapting to different scales of noise. The filtering denoising algorithm based on a convolutional neural network can automatically learn noise features, effectively model noise, maximize the preservation of original image information, and improve image quality.
[0073] To solve the problem of low contrast between the crack area and the background of the waterproofing membrane, the application adopts an image enhancement method of histogram equalization to improve the image contrast. This method re-distributes the gray values of the original image, expands the gray values with small proportion in the image, and compresses the gray values with large proportion, so that the image gray scale presents a uniform distribution. After histogram equalization, the contrast between the crack target area and the background is higher, the details of the image are clearer, and the whole image has more semantic information, which will help to improve the accuracy of crack defect detection.
[0074] The backbone network, as Figure 4As shown, the features are extracted from the preprocessed image to 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 a high-efficiency attention network layer, which is used to enhance the feature extraction capability and improve the accuracy of target detection; and the Adown layer is a down-sampling layer, which is used to reduce the input vector by half and then pass it to the next layer.
[0075] The multi-scale feature fusion layer, as shown in Figure 5 includes a small target detection layer, a medium target detection layer and a large target detection layer, each of which focuses on different size of detail information, and is used for fusing the features from the backbone network.
[0076] The bending detection head, as shown in Figure 6 includes a bounding box regressor (Box) and a classifier (Cls), which are used to output the prediction box and the prediction label of the target detection layer output by the multi-scale feature fusion layer. It should be noted that, in the embodiment, the multi-scale feature fusion layer of the bending detection sub-module includes three target detection layers, and therefore, the bending detection head of the bending detection sub-module also has three, which are used to predict the features output by the target detection layers of different scales.
[0077] It should be noted that, among the detection boxes output by the bending detection sub-module, the prediction boxes with a confidence lower than 0.25 are removed, and then the detection boxes with a high overlap degree are removed through non-maximum suppression, and finally the label with the highest class confidence is selected as the classification label of the prediction box, to obtain the picture of the bending part of the waterproof roll material.
[0078] Further, as shown in Figure 7 the crack detection sub-module includes a high-frequency feature extraction module, a spatial domain 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 bending part image.
[0080] Specifically, there is a lot of feature information in the frequency domain information of the waterproof roll material crack image that is difficult to detect in the RGB space. Therefore, it is far from enough for the model to rely only on the RGB spatial domain information of the waterproof roll material image. For example, when a crack appears on the waterproof roll material, there will be a frequency transformation from the low-frequency signal of the flat image to the high-frequency signal of the sharp deformation in the vertical direction of the crack, which is difficult to perceive by the RGB space.
[0081] Further, in the high-frequency feature extraction module, the bending part image is converted from the spatial domain to the frequency domain through discrete cosine transformation, and a high-frequency enhanced image is obtained by increasing the high-frequency region weight of the picture through a filter; the high-frequency enhanced image is restored to the spatial domain through inverse discrete cosine transformation, and then passes through three convolution layers to obtain high-frequency features of three different scales.
[0082] Specifically, the discrete cosine transformation is a mathematical transformation for converting a signal from a spatial domain to a frequency domain, which can decompose an image into different frequency components. The filter is used to increase the high-frequency region weight of the picture and reduce the low-frequency region weight of the picture to highlight the crack and other detail features in the image. The inverse discrete cosine transformation is the inverse process of the discrete cosine transformation, which 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 bending part image.
[0084] Further, the spatial domain feature extraction module uses a YOLOv9 model removing the input layer and the detection head, which includes a backbone network layer and a multi-scale feature fusion layer.
[0085] The backbone network layer is used to extract features of the bending 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 bending part image extracts features through the backbone network layer of the spatial domain feature extraction module, and converts the image into a feature representation with rich semantic information. The Silence layer is used to pass the input information to the backbone network layer; the Conv layer is a convolution layer used to extract local features of the image; the GELAN layer is a high-efficiency attention network layer used to enhance the feature extraction capability and improve the accuracy of target detection; and the Adown layer is a down-sampling layer used to reduce the input vector by half and then pass 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 of which focuses on different size of detail information and is used to fuse the features from the backbone network.
[0089] It should be noted that the three different scale high frequency features obtained by the three convolutional layers of the output map of the high frequency feature extraction module correspond one-to-one with the three scale RGB features output by the spatial feature extraction module, and are used for feature fusion in the frequency domain and spatial domain feature mixing module. For example, the three scales are 160x160x128, 80x80x256, and 40x10x512, respectively.
[0090] The frequency domain and spatial domain feature mixing module is configured to perform feature fusion on high frequency features and RGB features of the same scale.
[0091] Further, in the frequency domain and spatial domain feature mixing module, the high frequency features and the RGB features are multiplied by matrices to obtain mixed frequency domain features.
[0092] The mixed frequency domain features are respectively multiplied by matrices with the high frequency features and the RGB features to obtain high frequency enhanced features and RGB enhanced features.
[0093] The high frequency enhanced features and the RGB features are matrix added to obtain high frequency enhanced-RGB fusion features.
[0094] The RGB enhanced features and the high frequency features are matrix added to obtain RGB enhanced-high frequency fusion features.
[0095] The high frequency enhanced-RGB fusion features and the RGB enhanced-high frequency fusion features are matrix channel fused to obtain fusion features.
[0096] Specifically, as shown in Figure 8 The frequency domain and spatial domain feature mixing module uses high frequency features and RGB features to calculate cross-attention weights, then uses cross-attention matrices to enhance spatial and frequency domain attention features, and finally combines the spatial and frequency domain attention features together for output.
[0097] The crack detection head is configured to detect crack information in the fused features.
[0098] Specifically, the model structure of the crack detection head of the crack detection sub-module uses the detection head structure of the YOLOv9 model. After removing the predicted boxes with a confidence lower than 0.25 in the output detection boxes, and removing the detection boxes with high overlap through non-maximum suppression, the classification label with the highest class confidence is selected as the classification label of the predicted box, to obtain the crack information of the waterproofing membrane.
[0099] Further, as shown in Figure 9 The training waterproofing membrane crack detection model includes steps S201-S204.
[0100] Step S201, load the bending detection training data set to train the bending detection sub-module to obtain a trained bending detection sub-module.
[0101] Further, load the bending detection training data set, use the combination of the bounding box intersection over union loss function, the classification loss function and the confidence loss function, train the bending detection sub-module, use the stochastic gradient descent method to update the parameters of the bending detection sub-module by back propagation, and obtain the trained bending detection sub-module.
[0102] Specifically, as shown in Figure 10 The bending detection sub-module further includes a multi-level auxiliary information layer and an auxiliary reversible branch in the training; the multi-level auxiliary information layer is an integrated network inserted between the auxiliary reversible branch and the backbone network of the bending detection sub-module, used to receive gradient information of all target objects, aggregate the gradient information of all target objects in multiple levels of auxiliary information, and deliver the gradient information to the backbone network of the bending detection sub-module for weight update; it should be noted that this module is only used in the training mode because the returned gradient is obtained from the auxiliary reversible branch.
[0103] The structure of the auxiliary reversible branch is consistent with that of the backbone network, which is used to help the backbone network of the bending detection sub-module to better obtain rich return gradient information in the training process, and discard the branch in the inference process, so as to improve the detection speed of the model without losing accuracy.
[0104] The output features of the auxiliary reversible branch are output through the auxiliary detection head to output the prediction box and the prediction label of the bending part, which are used to calculate the loss together with the prediction box and the prediction label of the bending part output by the bending detection head, so as to provide more gradient information in the training process and help to accelerate the convergence of the model.
[0105] Further, 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, considers 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 the binary cross-entropy loss function.
[0107] The distribution focal loss function is the DFL (Distribution Focal Loss) loss function.
[0108] Specifically, in the training process, the bounding box intersection over union loss, the classification loss and the distribution focal loss are added to obtain the total loss, and the total loss is used to optimize the parameters of the bending detection sub-module through back propagation.
[0109] Step S202, load the plurality of pre-training data sets to pre-train the backbone network of the spatial feature extraction module of the crack detection sub-module based on contrastive learning, and obtain a pre-trained backbone network.
[0110] Further, for each pre-training data set, load the pre-training sample pair, train the backbone network of the spatial feature extraction module of the crack detection sub-module using the contrastive loss function, update the backbone network parameters of the spatial feature extraction module using gradient back propagation, and save the backbone network parameters of the spatial feature extraction module after training.
[0111] Specifically, during training, the positive sample is input into the decoder (the backbone network structure of the spatial feature extraction module) to obtain a positive sample feature vector matrix, the negative sample is input into the dynamic decoder (the backbone network structure for training in the spatial feature extraction module) to obtain a negative sample feature vector matrix, the positive sample feature vector matrix and the negative sample feature vector matrix are multiplied to calculate the contrastive loss, and the gradient of the contrastive loss is back propagated to the decoder. 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, which can be updated from the decoder parameters at a small scale. The model can slowly adapt to new knowledge and avoid performance fluctuations caused by large-scale updates, while allowing the dynamic decoder to learn from the decoder, which may help to introduce feature diversity and improve the generalization ability of the model to different categories.
[0114] For example, the contrastive loss function can use a temperature scaled cross-entropy loss function.
[0115] Step S203, load the crack detection training data set to train the crack detection sub-module containing the pre-trained backbone network to obtain a trained crack detection sub-module.
[0116] Further, load the crack detection training data set, use the combination of the bounding box small target detection loss function, the classification loss function and the distribution focal loss function to train the crack detection sub-module, use the stochastic gradient descent method to update the parameters of the crack detection sub-module by back propagation, and obtain a trained crack detection sub-module.
[0117] Specifically, in the waterproofing membrane crack image, there are many small crack images. When calculating the bounding box loss, the evaluation index based on the intersection over union is very sensitive to the position deviation of small objects, greatly reducing the detection performance of the model. Therefore, the embodiment uses a bounding box small target detection loss function, i.e., a normalized Wasserstein distance (NWD) function, as an evaluation index to measure the similarity between two bounding boxes.
[0118] When training the crack detection sub-module, the classification loss function and the distribution focal loss function use the same loss function as the bending detection sub-module, i.e., the binary cross-entropy loss function and the DFL (Distribution Focal Loss) loss function, respectively.
[0119] In the training process, the bounding box small target detection loss, the classification loss, and the distribution focal loss are added to obtain the total loss, and the total loss is optimized by backpropagation to optimize the parameters of the crack detection sub-module.
[0120] Step S204, based on the trained bending detection sub-module and the trained crack detection sub-module, a trained waterproofing membrane crack detection model is obtained.
[0121] Another embodiment of the present application is a method for detecting cracks in waterproofing membranes based on the above-constructed waterproofing membrane crack detection model, comprising: obtaining images of a plurality of waterproofing membrane samples subjected to low-temperature flexibility testing; inputting each image into the trained waterproofing membrane crack detection model to detect cracks in the bending part, and obtaining crack information of the bending part of each sample, including: the image of the waterproofing membrane sample is subjected to the bending detection sub-module of the waterproofing membrane crack detection model to obtain an image of the bending part in the waterproofing membrane; the image of the bending part in the waterproofing membrane is subjected to the crack detection sub-module to obtain crack information of the bending part; when the number of waterproofing membrane samples with cracks exceeds a preset value, it is judged that the current low-temperature flexibility test is unqualified.
[0122] In summary, the construction method of the waterproofing membrane crack detection model of the embodiment of the present application has the following beneficial effects:
[0123] 1. The present application solves the problem of low efficiency of artificial recognition of waterproofing membrane cracks, which is easily affected by factors such as light conditions, operator fatigue, and subjective judgment, resulting in low accuracy of crack detection by constructing a waterproofing membrane crack detection model.
[0124] 2. For waterproof membranes, cracks usually appear at the bends. The waterproof membrane crack detection model of this invention first uses the bend detection submodule to detect the bends of the waterproof membrane, and then uses the crack detection submodule to further determine whether cracks exist. Compared with directly detecting cracks on the waterproof membrane image, this is more targeted and can improve the detection accuracy of these areas.
[0125] 3. The waterproof membrane crack detection model of the present invention uses a bending detection submodule to detect the bending of the waterproof membrane, which can reduce the detection in areas where no cracks appear, thereby reducing false detections caused by random textures or material inhomogeneity. In addition, it reduces the image range that needs to be detected at high resolution, thereby saving computing resources and time.
[0126] 4. Since the samples of waterproof membranes are usually unbalanced in industrial scenarios, meaning that the number of normal waterproof membrane samples is much greater than the number of samples of cracked waterproof membranes, this invention pre-trains the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model using a contrastive learning-based method. This allows the backbone network layer of the crack detection submodule to learn the intra-class consistency and out-of-class difference features of waterproof membrane cracks, thereby improving the detection effect of the waterproof membrane crack detection model and reducing model overfitting.
[0127] 5. In constructing training sample pairs for the backbone network layer of the crack detection submodule of the waterproof membrane crack detection model based on contrastive learning, the negative samples include two images of the same size as the positive samples extracted from both sides of the long side of the positive samples in the same training data group. By selecting areas similar to the crack area but not actually containing cracks as negative samples, the model can learn the subtle differences between cracks and normal areas, enhance the difference of features, and more accurately identify crack areas.
[0128] 6. In the crack detection submodule of the waterproof membrane crack detection model, this invention extracts high-frequency feature information that is difficult to detect in the RGB space of the membrane image, which can better identify the existence of cracks, enhance the feature representation of small cracks, and thus improve the model's ability to detect small cracks.
[0129] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing a crack detection model for waterproof membrane rolls, characterized in that, Includes the following steps: A training dataset for constructing a crack detection model for waterproof membrane rolls is provided. The training dataset includes: sample images, images of the curved portions of the sample images, and crack information corresponding to the curved portions. A trained waterproof membrane crack detection model is obtained by training the aforementioned training dataset. This model is used to detect cracks at bending points of waterproof membranes that have undergone low-temperature flexibility testing. The model includes a bending detection submodule and a crack detection submodule. After detecting bends in the waterproof membrane using the bending detection submodule, the crack detection submodule further determines whether cracks exist in the images of the bends. The crack detection submodule includes a high-frequency feature extraction module, a spatial feature extraction module, a frequency-spatial feature mixing module, and a crack detection head. The high-frequency feature extraction module acquires high-frequency features at different scales from the bending point images output by the bending detection submodule. The spatial feature extraction module acquires RGB features at different scales from the bending point images output by the bending detection submodule. The frequency-spatial feature mixing module fuses the high-frequency features and RGB features of the same scale. The crack detection head detects crack information in the fused features.
2. The method according to claim 1, characterized in that, The bending detection submodule uses the YOLOv9 model to detect the bending parts of the waterproof membrane and obtain images of the bending parts of the waterproof membrane.
3. The method according to claim 2, characterized in that, In the high-frequency feature extraction module, the image of the curved part is transformed from the spatial domain to the frequency domain through discrete cosine transform, and then the high-frequency region weight of the image is increased by a filter to obtain a high-frequency enhanced image. The high-frequency enhanced image is restored to the spatial domain through inverse discrete cosine transform and then passed through three convolutional layers to obtain high-frequency features at three different scales.
4. The method according to claim 2, characterized in that, The spatial feature extraction module uses a YOLOv9 model with the input layer and detector head removed, including a backbone network layer and a multi-scale feature fusion layer; The backbone network layer is used to extract features from the image of the curved portion; The multi-scale feature fusion layer includes three target detection layers of different scales, which are used to fuse features from the backbone network and output RGB features of three different scales.
5. The method according to any one of claims 1-4, characterized in that, In the frequency-domain and spatial-domain feature mixing module, the high-frequency features and the RGB features are multiplied by a matrix to obtain mixed frequency-domain features; The hybrid frequency domain features are multiplied by the high-frequency features and the RGB features respectively to obtain high-frequency enhanced features and RGB enhanced features; The high-frequency enhancement feature and the RGB feature are matrix-added to obtain the high-frequency enhancement-RGB fusion feature; The RGB enhancement feature and the high-frequency feature are matrix-added to obtain the RGB enhancement-high-frequency fusion feature; The high-frequency enhanced-RGB fusion feature and the RGB enhanced-high-frequency fusion feature are fused into a matrix channel to obtain the fusion feature.
6. The method according to claim 1, characterized in that, The training dataset includes a bending detection training dataset, a crack detection training dataset, and several pre-training data sets. The bending detection training dataset includes sample images and images of the bending parts in the corresponding sample images; The crack detection training dataset includes images of the bending areas and crack information corresponding to the bending areas; The plurality of pre-training data sets, each pre-training data set including a plurality of pre-training sample pairs; wherein, each pre-training sample pair includes a positive sample and a negative sample; the positive sample in each pre-training data set is an image of the same crack region, and the negative sample includes a plurality of images of crack-free regions of the same size as the positive sample, as well as two images of the same size as the positive sample extracted from both sides of the long side of the positive sample.
7. The method according to claim 6, characterized in that, The training model for detecting cracks in waterproof membrane includes: The bending detection training dataset is loaded to train the bending detection submodule, resulting in a trained bending detection submodule. The pre-trained backbone network of the spatial feature extraction module of the crack detection submodule is pre-trained based on contrastive learning by loading the aforementioned pre-trained data sets to obtain the pre-trained backbone network. The crack detection training dataset is loaded to train the crack detection submodule containing the pre-trained backbone network to obtain the 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.
8. The method according to claim 7, characterized in that, The process of loading the plurality of pre-trained data sets to pre-train the backbone network of the spatial feature extraction module of the crack detection submodule based on contrastive learning yields a basic backbone network for crack detection, comprising: For each pre-trained data set, load the pre-trained sample pairs, train the backbone network of the spatial feature extraction module of the crack detection submodule using the contrastive loss function, update the backbone network parameters of the spatial feature extraction module using gradient backpropagation, and save the backbone network parameters of the spatial feature extraction module after training.
9. The method according to claim 8, characterized in that, The step of loading the bending detection training dataset to train the bending detection submodule to obtain a trained bending detection submodule includes: loading the bending detection training dataset, training the bending detection submodule using a combination of bounding box intersection-union loss function, classification loss function and distributed focal length loss function, and updating the parameters of the bending detection submodule by backpropagation using stochastic gradient descent to obtain a trained bending detection submodule. The step of loading the crack detection training dataset to train the crack detection submodule containing the pre-trained backbone network to obtain the trained crack detection submodule includes: loading the crack detection training dataset, training the crack detection submodule using a combination of bounding box small target detection loss function, classification loss function and distributed focal length loss function, updating the parameters of the crack detection submodule using stochastic gradient descent for backpropagation, and obtaining the trained crack detection submodule.
Citation Information
Patent Citations
Power transmission line strain clamp defect detection method based on multi-network fusion model
CN115018818A