Construction method of self-adaptive supervision high-resolution weld defect detection model

By improving the UNet encoder and designing a multi-scale segmentation head module, combined with the deep supervision loss function, an adaptively supervised high-resolution weld defect detection model is constructed, which solves the problem of insufficient adaptive recognition capabilities in the existing technology and achieves for accurate detection of defects in high-resolution weld images.

CN118570487APending Publication Date: 2024-08-30XIAN TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410595689.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing technology has insufficient adaptive recognition and adjustment capabilities when detecting defects in high-resolution weld images. Traditional networks ignore local and multi-scale information, resulting in inaccurate detection of small-sized defects.

Method used

Improve the UNet encoder, combine multi-scale dilated convolution and Tokenized-MLP, design a cross-layer feature fusion module and a multi-scale segmentation head module based on HDCAC, and introduce a three-layer scale deep supervision loss function to build an adaptive supervised high-level Resolution weld defect detection model.

Benefits of technology

It improves the detection accuracy and robustness of defects at different scales, can more effectively extract local and global features of images, and enhances the sensitivity and robustness of the model to defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570487A
    Figure CN118570487A
Patent Text Reader

Abstract

The invention relates to the technical field of computer technology and modern manufacturing, in particular to a method for constructing a self-adaptive supervised high-resolution weld defect detection model, which comprises the following steps of: improving a Unet network, and combining a multi-scale expansion-multilayer perceptron network and a multi-scale feature extraction technology to obtain an adaptive supervised high-resolution weld defect detection model; a dynamic kernel adaptive segmentation head based on a hybrid expansion convolution attention mechanism is designed, a depth supervision loss function under a three-layer scale is proposed, a depth supervision mechanism is introduced, and supervised learning is performed on defects of different levels of the network. Experiments are carried out on a real high-resolution welding seam data set through the model constructed by the method, and the experimental result shows that compared with traditional network models such as U2Net and UNext, the method can detect and identify various types of defects in the welding seam more accurately, has good robustness and generalization ability, and can be used for detecting and identifying various types of defects in the welding seam more accurately. And a reliable automatic detection means is provided for the production of high-quality welding products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the fields of computer technology and modern manufacturing technology, and in particular to a method for constructing an adaptively supervised high-resolution weld defect detection model. Background Art

[0002] In the modern manufacturing industry, welding is a common process, widely used in aviation, automotive castings and other fields. However, due to many factors in the welding process, such as operating skills, equipment status and material quality, defects may appear in the weld. These defects will have a negative impact on the welding quality and workpiece performance, so accurately detecting and identifying weld defects is crucial to ensure product quality.

[0003] Methods based on traditional image processing and deep neural networks have been well applied in weld defect detection. Traditional image processing generally uses defect target segmentation and extraction, artificial defect feature selection, artificial feature description calculation-statistics and other methods or shallow network recognition to achieve quantitative detection of weld defects. However, the methods that rely on image preprocessing and feature extraction are not robust and can only be adapted to some scenarios. In recent years, defect detection methods based on deep neural networks have made significant progress. For example, the patent "New Energy Battery Defect Detection Method Based on Deep Learning Semantic Segmentation" with publication number CN113592813B proposes that although the detection recognition of the network is improved, it is not suitable for high-resolution image tasks. The UNet network model is also commonly used in industrial defect detection applications. It is named because of its U-shaped structure. It can effectively combine global information and local information through feature fusion, but the problem is that when the image resolution is too large, there will be computational redundancy and it is impossible to accurately detect small and precise objects. The Tokenized-MLP (Tokenized-Multilayerperceptron) multilayer perceptron module is often used for feature extraction and modeling in image segmentation networks. It is suitable for data parallel processing, but it is difficult to accurately find the optimal solution due to the characteristics of the network structure, and optimization is required. Therefore, the existing methods have the following shortcomings in the defect detection task of high-resolution weld images: 1. The welds in high-resolution images usually have complex structures and multiple types of defects, and the traditional network lacks the ability to adaptively identify and adjust defects. 2. Traditional networks usually only focus on the global features of the entire image, while ignoring local and multi-scale information, resulting in inaccurate detection of small-size defects. Summary of the invention

[0004] In view of the above, the present invention proposes a method for constructing an adaptively supervised high-resolution weld defect detection model to solve the defects in the above-mentioned prior art.

[0005] The technical solution adopted by the present invention is as follows:

[0006] A method for constructing an adaptively supervised high-resolution weld defect detection model comprises the following steps:

[0007] Step 1. Improve the UNet encoder and use the improved encoder to extract features to obtain five feature maps of different sizes;

[0008] Step 2. Concatenate the feature map obtained in step 1 with the feature map of the same size obtained by upsampling the UNet decoder to achieve feature fusion;

[0009] Step 3. Construct a multi-scale segmentation head module based on the HDCAC dynamic kernel.

[0010] Step 4. Design a deep supervision loss function at three-layer scale, and train the designed network to obtain a trained network model.

[0011] Furthermore, the improved UNet encoder in step 1 specifically includes the following steps:

[0012] Step 1.1, construct a multi-scale dilated convolution module: take the UNet network as the basic backbone network, in the shallow part of the network, use dilated convolution instead of ordinary convolution in the last layer; in the deep part of the network, use dilated convolution with different dilated convolution rates to replace all ordinary convolution layers; the feature definition of the multi-scale dilated backbone network is as follows:

[0013] F U =U(f(x))+f(x) (1)

[0014]

[0015] Among them, f(x) is the intermediate feature map, U k Represents K-based dilated convolution.

[0016] Step 1.2, replace the first three convolution modules and the last three pooling modules of the traditional UNet network model with the multi-scale dilated convolution module;

[0017] Step 1.3, replace the fourth and fifth convolution modules and the first and second pooling modules of the traditional UNet network model with the Token-Multilayer Perceptron module. The specific operation formula is as follows:

[0018] T W =Tokenize(Shift W (X)) (3)

[0019] Y=f(DWConv(MLP(T W ))) (4)

[0020] TH =Tokenize(Shift H (X)) (5)

[0021] Y=f(LN(T+MLP(GELU(T H )))) (6).

[0022] Furthermore, in the process of implementing feature fusion in step 2, a CFF cross-layer feature fusion module is introduced when the first layer and the second layer feature map are spliced. The specific steps are as follows:

[0023] 2.1,The internal operation steps of the CFF module are: upsampling the feature map obtained in step 1 to obtain a feature map of the same size, connecting it through Conat, performing convolution operation, then performing Relu function operation, and finally performing convolution operation again to obtain a feature map;

[0024] 2.2, the level calculation formula of the CFF module is:

[0025] CFF_2=Conv(Conv(Cat(X1,U2(X2)))) (7)

[0026] CFF_3=Conv(Conv(Cat(X1,U2(X2),U4(X3)))) (8)

[0027] Where X k represents the feature map output by the multi-scale expansion module, Cat(X) represents the Concat operation, U k Represents an upsampling operation.

[0028] Furthermore, the HDCAC design in step 3 is as follows:

[0029] It includes five branches. The first branch dilates the input feature map through convolution to obtain the intermediate feature. Figure 1 ; The second branch is to directly obtain the intermediate features without any processing of the input feature map Figure 2 ; The third branch is to dilate the input feature map and convolve it to obtain the intermediate feature Figure 3 ; The fourth branch is to obtain the intermediate features by dilating the input feature map Figure 4 ; The fifth branch is to pass the input feature map through the spatial channel attention mechanism to obtain the intermediate feature Figure 5 ; The above five intermediate feature maps are fused together and then subjected to a normal convolution to obtain the output feature map of this module.

[0030] Furthermore, the multi-scale segmentation head module in step 3 is designed as follows: the intermediate features obtained by HDCAC are Figure 6It is divided into two branches. The first branch enters the KG core generation module and interacts with the intermediate features. Figure 6 Enter the Kn algorithm to obtain intermediate features Figure 7 , the intermediate features Figure 7 After passing through the Pn module and then upsampling once, it is combined with the intermediate features Figure 7 Enter the Ku core update module together, and repeat this process to obtain the final output feature map.

[0031] Furthermore, the deep supervision loss function at three scales in step 4 is as follows:

[0032] L1=Dice(P0,G)+Bce(P0,G) (17)

[0033]

[0034]

[0035]

[0036] Among them, G represents the true value, P represents the model prediction output value, Interpolation represents linear interpolation, and this paper uses bilinear interpolation to downsample the true value. Accumulate the loss values ​​of multiple scales L1, L2, L3, L DSL as the final forward propagation loss.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] 1. The present invention proposes a method for constructing an adaptively supervised high-resolution weld defect detection model. The constructed network model combines multi-scale dilated convolution with a multi-layer perceptron, redesigns the encoding and decoding structure, and can effectively extract local and global features in the image.

[0039] 2. The present invention introduces a cross-layer feature fusion module CFF to further improve the detection performance of the segmentation network for multi-scale welding defects and designs a multi-scale dynamic kernel segmentation head based on a hybrid dilated convolution attention mechanism. The head can adaptively adjust the receptive field size of the convolution kernel and capture more comprehensive global information, thereby improving the detection accuracy of defects of different scales.

[0040] 3. The introduction of a three-level deep supervision loss function can better downsample the true value. By supervising defects at different levels of the network, the sensitivity and robustness of the model to defects can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is the overall flow chart of the present invention;

[0042] Figure 2 It is the overall structure diagram of the high-resolution weld defect detection network model of the present invention;

[0043] Figure 3 Figure 1 is a schematic diagram of a multi-scale dilated convolution module A, and Figure 2 is a schematic diagram of a multi-scale dilated convolution module B.

[0044] Figure 4 This is the internal structure diagram of the CFF module;

[0045] Figure 5 This is the module structure diagram of Tokenized-MLP multi-layer perceptron;

[0046] Figure 6 Schematic diagram for multi-scale segmentation of the head design;

[0047] Figure 7 This is a visualization analysis diagram of real industrial quality inspection data results (1);

[0048] Figure 8 Figure (2) shows the visualization analysis of real industrial quality inspection data results. DETAILED DESCRIPTION

[0049] The present invention will be further described in detail below through the accompanying drawings and embodiments.

[0050] See also Figure 1 In a preferred embodiment of the present invention, a method for constructing an adaptively supervised high-resolution weld defect detection model comprises the following steps:

[0051] Step 1: Send the dataset image to the improved encoder network for feature extraction. The encoder has a total of five layers, and a total of five feature maps of different sizes are obtained:

[0052] The improved encoding network is a feature extraction network with UNet as the backbone network. The specific feature extraction process is as follows:

[0053] 1.1, Constructing a multi-scale dilated convolution module: The multi-scale dilated module is based on the UNet network as the backbone network. The structure of the multi-scale dilated module A is to increase the number of layers on the traditional UNet network, and replace the ordinary convolution with a dilated convolution with a size of 3×3 and a convolution rate of 2 in the last layer of the encoder. For example, the first multi-scale dilated convolution module adopts a seven-layer network structure, and the second multi-scale dilated convolution module adopts a six-layer network structure; the third multi-scale dilated module uses an ordinary convolution with a convolution kernel size of 3×3 in the shallow part of the network (1st and 2nd layers); in the deep part of the network (3rd, 4th, and 5th layers), all ordinary convolutions are replaced by two dilated convolutions with a convolution kernel size of 3×3 and a convolution rate of 2. When passing through the multi-scale dilated convolution module, the input image is first losslessly compressed to a preliminary effective feature map of 512×512×3, and a 512×512×64 image is obtained through a 3×3 ordinary convolution with 64 channels and an expanded convolution. Then a 2×2 maximum pooling operation is performed to obtain the feature Figure 1 . For features Figure 1 Repeat the above operation to obtain the feature Figure 2 . The feature Figure 2 Through two dilated convolutions and 2×2 maximum pooling operations, the feature Figure 3 , the feature Figure 3 Perform the above operation twice to obtain the feature Figure 4 and Features Figure 5 The feature maps are fused and used as the input feature maps of the next module. The feature definition of the multi-scale expansion backbone network is as follows:

[0054] F U =U(f(x))+f(x) (1)

[0055]

[0056] Among them, f(x) is the intermediate feature map, U k Represents K-based dilated convolution.

[0057] 1.2, replace the first three convolution modules and the last three pooling modules of the traditional UNet network model with the multi-scale expansion module; 1.3, replace the fourth and fifth convolution modules and the first and second pooling modules of the traditional UNet network model with the Tokenized-MLP multi-layer perceptron module. The specific operation formula is as follows:

[0058] T W =Tokenize(Shift W (X)) (3)

[0059] Y=f(DWConv(MLP(T W ))) (4)

[0060] T H =Tokenize(Shift H (X)) (5)

[0061] Y=f(LN(T+MLP(GELU(T H )))) (6)

[0062] Step 2: Concatenate the obtained feature map with the feature map of the same size obtained by upsampling the decoder to achieve feature fusion:

[0063] In this step, the CFF cross-layer feature fusion module is introduced when the first and second layer feature maps are spliced. The specific implementation process is as follows:

[0064] 2.1, upsample the feature map obtained in step 1.1 to obtain a feature map of the same size, connect it through Conat, and perform a convolution operation with a convolution kernel size of 1×1, a step size of 1, and an output channel number of 64. Then, perform a Relu function operation, and finally perform a convolution operation with a convolution kernel size of 3×3, a step size of 1, a padding of 1, and an output channel number of 64 to obtain the feature map.

[0065] 2.2, Step 2.1, the level calculation formula that needs to be introduced into the CFF module is:

[0066] CFF_2=Conv(Conv(Cat(X1,U2(X2)))) (7)

[0067] CFF_3=Conv(Conv(Cat(X1,U2(X2),U4(X3)))) (8)

[0068] Where X k represents the feature map output by the multi-scale expansion module, Cat(X) represents the Concat operation, U k Represents an upsampling operation.

[0069] Step 3: The feature maps obtained in step 2 are integrated into the multi-scale segmentation information through the multi-scale segmentation head module based on the HDCAC dynamic kernel to obtain the final segmentation result:

[0070] The specific operations are as follows:

[0071] 3.1, the HDCAC module is designed as follows: it is divided into five branches. The first branch passes the input feature map through a dilated convolution with a convolution kernel size of 3×3 and a dilation rate of 1 to obtain the intermediate feature Figure 1 ; The second branch is to directly obtain the intermediate features without any processing of the input feature map Figure 2; The third branch is to pass the input feature map through a convolution with a convolution kernel size of 3×3 and a dilation convolution rate of 1 and a convolution kernel size of 3×3 and a dilation convolution rate of 2 to obtain the intermediate feature Figure 3 ; The fourth branch is to obtain the intermediate feature map by passing the input feature map through a dilated convolution with a convolution kernel size of 3×3 and a dilated convolution rate of 1, a dilated convolution with a convolution kernel size of 3×3 and a dilated convolution rate of 2, and a dilated convolution with a convolution kernel size of 3×3 and a dilated convolution rate of 4. Figure 4 ; The fifth branch is to pass the input feature map through the spatial channel attention mechanism to obtain the intermediate feature Figure 5 ; The above five intermediate feature maps are fused together, and then subjected to a 1×1 ordinary convolution to obtain the output feature map of this module.

[0072] 3.2, the specific operation of the multi-scale segmentation head module is as follows: the upsampled feature map of the multi-scale expansion module is first processed by the HDCAC module, and the intermediate feature map is obtained. Figure 1 It is divided into two branches. The first branch enters the KG core generation module and interacts with the intermediate features. Figure 1 Enter the Kn algorithm to obtain intermediate features Figure 2 , the intermediate features Figure 2 First pass through the Pn module and then upsample once, and then compare with the intermediate features Figure 2 Enter the Ku core update module together, and repeat this process to obtain the final output feature map. The specific formula is as follows:

[0073] K3=Conv(LT(AAP(F HDCAC_3 (D3)))) (9)

[0074]

[0075]

[0076] F HDCAM (i) = HDC (D (i)) + AM (D (i)) (12)

[0077] F HDCAC (i)=Conv(HDC(D(i))+AM(D(i))) (13)

[0078] HDC(D(i))=Conv1(D(i))+D(i)+Conv2(Conv3(D(i)))+Conv4(Conv5(Conv6(D(i)))) (14)

[0079]

[0080] {P HDCAC}=Sigmoid{P1,P2,P3} (16)

[0081] Among them, the KG module aggregates features into K×K through adaptive average pooling operation, uses 1×1 convolution for dimensionality reduction, and generates 64 initial segmentation kernels. Represents Multiplication, Sigmoid represents Sigmoid function, LT represents linear transformation, G represents gates, K2 represents new kernels, HDCAC module is designed based on hybrid dilated convolution attention mechanism module, HDC represents hybrid dilated convolution module, AM represents feature attention mechanism module, Sigmoid represents Sigmoid activation function, U2(·) represents 2x upsampling, and U4(·) represents 4x upsampling.

[0082] Step 4: Design a deep supervision loss function at three scales and train the designed network:

[0083] The calculation formula of the deep supervision loss function at the three-layer scale is as follows:

[0084] L1=Dice(P0,G)+Bce(P0,G) (17)

[0085]

[0086]

[0087]

[0088] Among them, G represents the true value, P represents the model prediction output value, Interpolation represents linear interpolation, and this paper uses bilinear interpolation to downsample the true value. Accumulate the loss values ​​of multiple scales L1, L2, L3, L DSL as the final forward propagation loss.

[0089] The trained network model is tested on the data set (HRWD-Xray), the performance analysis results are obtained, and it is used on real industrial data.

[0090] In order to reflect the effect of the multi-scale expansion-multi-layer perceptron network model of the present invention, the present invention performs defect segmentation on the HRWD-Xray dataset. In the training and verification stages of the multi-scale expansion-multi-layer perceptron network model on the HRWD-Xray dataset, the parameters involved in step 4 are set as follows: the training batch size is set to 4, Adam is used as the optimizer, the learning rate is set to 1e-4, and the number of iteration steps is uniformly set to 150. The computer equipment and experimental environment configuration are shown in Table 1.

[0091] Table 1 Computer equipment and experimental environment configuration table

[0092]

[0093]

[0094] During the test, it is compared with multiple related networks, and the evaluation indicators such as DICE, Precision, Jaccard, VOE, RVD are used for analysis and comparison, as shown in Table 2.

[0095] Table 2 Performance of network models on high-resolution HRWD-Xray dataset

[0096]

[0097] It can be seen from Table 2 that (1) the average test indicators of the multi-scale expansion-multi-layer perceptron network model of the present invention have certain advantages over traditional network models such as UNext, U2Net, and UNet, proving that the model constructed in this paper can be well applied and is more suitable for application in actual occasions. This provides a practical, effective and feasible solution for the intelligent identification of weld defects, and has good application prospects. (2) The multi-scale expansion-multi-layer perceptron network model of the present invention, DICE, VOE, RVD, Precision and Jaccard indicators are all ranked first. Combined with the comprehensive analysis of Table 2, it can be seen that the model designed in this paper can realize quantitative detection of defects with lower algorithm complexity, and proposes an effective solution for high-resolution defect detection.

[0098] The above is an explanation of the specific implementation of the present invention, rather than a limitation of the present invention. Those skilled in the relevant technical field can also make various equivalent technical solutions without departing from the scope of the present invention, so all equivalent technical solutions should be included in the patent protection scope of the present invention.

Claims

1. A method for constructing an adaptively supervised high-resolution weld defect detection model, characterized in that: The steps include: Step 1. Improve the UNet encoder and use the improved encoder to extract features to obtain five feature maps of different sizes; Step 2. Concatenate the feature map obtained in step 1 with the feature map of the same size obtained by upsampling the UNet decoder to achieve feature fusion; Step 3. Construct a multi-scale segmentation head module based on the HDCAC dynamic kernel. Step 4. Design a deep supervision loss function at three-layer scale, and train the designed network to obtain a trained network model.

2. The method for constructing an adaptively supervised high-resolution weld defect detection model according to claim 1, characterized in that: The improved UNet encoder in step 1 specifically includes the following steps: Step 1.1, construct a multi-scale dilated convolution module: take the UNet network as the basic backbone network, in the shallow part of the network, use dilated convolution instead of ordinary convolution in the last layer; in the deep part of the network, use dilated convolution with different dilated convolution rates to replace all ordinary convolution layers; the feature definition of the multi-scale dilated backbone network is as follows: F U =U(f(x))+f(x) (1) Among them, f(x) is the intermediate feature map, U k Represents K-based dilated convolution. Step 1.2, replace the first three convolution modules and the last three pooling modules of the traditional UNet network model with the multi-scale dilated convolution module; Step 1.3, replace the fourth and fifth convolution modules and the first and second pooling modules of the traditional UNet network model with the Token-Multilayer Perceptron module. The specific operation formula is as follows: T W =Tokenize(Shift W (X)) (3) Y=f(DWConv(MLP(T W ))) (4) T H =Tokenize(Shift H (X)) (5) Y=f(LN(T+MLP(GELU(T H )))) (6)。 3. The method for constructing the adaptively supervised high-resolution weld defect detection model according to claim 2 is characterized in that: In the process of implementing feature fusion in step 2, a CFF cross-layer feature fusion module is introduced when the first and second layer feature maps are spliced. The specific steps are as follows: 2.1,The internal operation steps of the CFF module are: upsampling the feature map obtained in step 1 to obtain a feature map of the same size, connecting it through Conat, performing convolution operation, then performing Relu function operation, and finally performing convolution operation again to obtain a feature map; 2.2, the level calculation formula of the CFF module is: CFF_2=Conv(Conv(Cat(X1,U2(X2)))) (7) CFF_3=Conv(Conv(Cat(X1,U2(X2),U4(X3)))) (8) Where X k represents the feature map output by the multi-scale expansion module, Cat(X) represents the Concat operation, U k Represents an upsampling operation.

4. The method for constructing the adaptively supervised high-resolution weld defect detection model according to claim 3 is characterized in that: The HDCAC design in step 3 is as follows: It includes five branches. The first branch performs dilated convolution on the input feature map to obtain intermediate feature map 1. The second branch directly performs dilated convolution on the input feature map without any processing to obtain intermediate feature map 2. The third branch performs dilated convolution on the input feature map to obtain intermediate feature map 3. The fourth branch performs dilated convolution on the input feature map to obtain intermediate feature map 4. The fifth branch performs spatial channel attention mechanism on the input feature map to obtain intermediate feature map 5. The above five intermediate feature maps are fused and then subjected to an ordinary convolution to obtain the output feature map of this module.

5. The method for constructing the adaptively supervised high-resolution weld defect detection model according to claim 3 is characterized in that: The multi-scale segmentation head module in step 3 is designed as follows: the intermediate feature map 6 obtained by HDCAC is divided into two branches. The first branch enters the KG core generation module and then enters the Kn algorithm with the intermediate feature map 6 to obtain the intermediate feature map 7. The intermediate feature map 7 first passes through the Pn module and then through an upsampling, and then enters the Ku core update module together with the intermediate feature map 7, and so on and so forth to obtain the final output feature map.

6. The method for constructing the adaptively supervised high-resolution weld defect detection model according to claim 3 is characterized in that: The deep supervision loss function at three scales in step 4 is as follows: L1=Dice(P0,G)+Bce(P0,G) (17) Among them, G represents the true value, P represents the model prediction output value, Interpolation represents linear interpolation, and this paper uses bilinear interpolation to downsample the true value. Accumulate the loss values ​​of multiple scales L1, L2, L3, L DSL as the final forward propagation loss.