A welding seam defect intelligent identification method based on a visual conversion layer and instance segmentation
Patent Information
- Application Number
- CN202211729164.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-12-30
AI Technical Summary
[0006]本发明要解决的技术问题是针对现代工业场景中的人工检测、难定量问题和实例分割方法的感受野受限问题,提供一种基于视觉转换层和实例分割的缺陷智能识别方法
[0063] The beneficial effects of adopting the above technical solution are as follows: This invention provides an intelligent weld defect recognition method based on a visual transformation layer and instance segmentation. First, it enhances the contrast between defects and the background from two perspectives: firstly, it employs multiple data preprocessing methods to optimize the features of all defects from a data processing perspective; secondly, it uses a visual transformation layer algorithm to adaptively weight and adjust defect features from a network structure perspective, allowing the network to automatically focus on defect features; furthermore, it integrates multi-scale features extracted from the backbone network to enhance the network's receptive field and semantic information representation ability, thereby meeting the need to segment defects at different scales; finally, it uses a linear combination of a prediction mask and mask coefficients to generate the final mask, regressing the accurate edges of the defects, thus significantly improving the precise quantitative rating of weld defects.
Smart Images

Figure SMS_4 
Figure QLYQS_1 
Figure SMS_128
Abstract
Description
Technical Field
[0001] This invention relates to the fields of welding non-destructive testing technology and computer vision, and in particular to an intelligent method for identifying weld defects based on a visual conversion layer and instance segmentation. Background Technology
[0002] Welding technology is widely used in aerospace, machinery manufacturing, and other fields. Due to varying skill levels among welders, defects such as circular defects, strip defects, lack of fusion, incomplete penetration, and cracks inevitably occur during actual welding operations (the above categories are based on the classification in the national standard NB / T 47013-2015, "Non-destructive Testing of Pressure Equipment"). To ensure the quality of welding projects and avoid significant losses to the natural environment, socio-economic development, and public safety caused by accidents, it is essential to strictly adhere to national non-destructive testing standards for weld defect inspection.
[0003] Manual defect inspection is a traditional method for detecting defects in pipeline welds, but it has several drawbacks. First, inspectors often possess varying levels of professional skills and experience, and their understanding of weld quality inspection standards differs, leading to discrepancies in the results for the same weld. Second, inspectors struggle to accurately quantify defects, finding it difficult to quantitatively analyze indicators such as defect length and area. Finally, manual visual inspection is inefficient and incurs significant time and financial costs. Therefore, considering these factors, manual visual inspection is increasingly unable to meet the high-efficiency needs of modern industry. Currently, instance segmentation methods in the field of computer vision can effectively compensate for the shortcomings of manual inspection, allowing all weld data to be viewed according to national standards.
[0004] With the emergence of algorithms such as Mask R-CNN and YOLACT in the field of instance segmentation in recent years, the accuracy of instance segmentation methods has gradually improved. Instance segmentation is an end-to-end approach. It takes the entire defect image as input and outputs the fitted edge with manually labeled data, as well as the coordinates of key edge points. This not only greatly improves production efficiency and automation but also facilitates information integration, meeting the requirements of intelligent production under big data. The defect segmentation based on instance segmentation methods consists of five steps: defect image preprocessing, defect feature fusion, defect classification, defect bounding box regression, and defect mask generation. Instance segmentation methods achieve accurate extraction of defect edges and accurately determine whether each pixel in the defect image belongs to a defect through five steps: inputting the defect image, fusing defect features, classifying defect categories, regressing defect bounding boxes, and generating defect masks. This enables accurate determination, precise location, accurate quantification, and accurate rating of defects, replacing manual visual inspection. However, the receptive field of instance segmentation methods is limited, resulting in insufficient feature extraction capabilities of deep neural networks.
[0005] With the development of computer vision in recent years, researchers often add attention networks to the backbone network to improve the feature extraction capabilities of deep networks. This allows the network to automatically focus on features, resulting in richer and more comprehensive feature extraction. Inspired by attention networks, this invention proposes a visual transformation layer consisting of two image preprocessing methods. This transformation layer reduces noise and enhances defect features by superimposing and fusing the two preprocessed images, thereby improving the network's feature extraction capabilities. Summary of the Invention
[0006] The technical problem this invention aims to solve is the difficulty in quantifying defects caused by manual inspection in modern industrial scenarios, as well as the limited receptive field of instance segmentation methods. It provides an intelligent defect recognition method based on a visual conversion layer and instance segmentation. The specific steps are as follows:
[0007] Step 1: Based on the principle of X-ray digital imaging, the image information is converted into digital signals using photoelectric technology and digital processing technology, and then scanned using an X-ray film scanner to obtain the original image of the weld defect.
[0008] Step 2: The first data preprocessing method, namely grayscale normalization and morphological closing operation, is used to preprocess the original image of the pipeline weld defect.
[0009] Step 2.1: Input the industrial negative as an image grayscale matrix According to formula (1), the mean of the image grayscale matrix is calculated. with standard deviation :
[0010]
[0011] in It is the mean. It is the standard deviation. and These are the width and height of the image, respectively. and Represents the rows and columns of the image grayscale matrix;
[0012] Step 2.2: Set the dispersion threshold Based on the mean and standard deviation Perform the transformation shown in formula (2):
[0013]
[0014] in, Actual standard deviation Standard deviation from the benchmark The ratio, It is the baseline value of the mean;
[0015] Step 2.3: Perform the image morphological closing operation, as shown in formula (3):
[0016]
[0017] in, The output image grayscale matrix; It is a sliding window matrix; Indicates an etching operation; This indicates an expansion operation.
[0018] Step 3: The original image is optimized using the second image preprocessing method, which involves grayscale normalization and histogram equalization.
[0019] Step 3.1: The input industrial negative is an image grayscale matrix. According to formulas (1) and (2), grayscale normalization is performed;
[0020] Step 3.2: Extract the function based on the histogram according to formula (4). calculate histogram :
[0021]
[0022] in, Grayscale value;
[0023] Step 3.3: To obtain the equalization transformation function Establish the mathematical relationship shown in formula (5):
[0024]
[0025] in, Represents the image grayscale matrix grayscale value, Represents the grayscale matrix of the equalized output image. grayscale value;
[0026] Step 3.4: Based on the uniform distribution of the histogram, obtain... ,in, For image Medium pixel grayscale value Quantity, This represents the total number of gray levels; then it undergoes an equalization transformation. Transform formula (5) into formula (6):
[0027]
[0028] Step 3.5: At this point, the equalization transformation function is obtained as shown in formula (7):
[0029]
[0030] Step 3.6: According to formulas (6) and (7), the gray values of each pixel in the image after equalization transformation can be obtained:
[0031]
[0032] This is the output image.
[0033] Step 4: Process the image grayscale matrix from steps 2 and 3. and A new image grayscale matrix is obtained by superimposing the data on the channels. ,Will and The two images are fused at the channel level and fed into the backbone network to extract features. The extracted features are then processed through three steps: feature fusion, detection head, and semantic segmentation layer, to obtain bounding boxes and masks. The specific steps are as follows:
[0034] Step 4.1: Label the defects in the pipe weld data, create a dataset, set the ratio of training set to test set to 8:2, and pre-set anchor frames; the specific method is as follows:
[0035] For each pixel of the image, generate Anchor frames with different aspect ratios, each aspect ratio having three different scales, meaning one pixel has... An anchor frame is used to facilitate the detection of targets of different shapes;
[0036] Step 4.2: Scale the image to a fixed size. (unit: );
[0037] Step 4.3: Based on the image obtained in Step 4.2, perform visual transformation processing; the visual transformation layer consists of convolutional layers, activation layers and pooling layers, keeping the image scale and channels unchanged, and performing convolutional weighting and non-linear activation operations on the image data to obtain the transformed image;
[0038] Step 4.4: Perform a weighted summation on the two images obtained in Steps 4.2 and 4.3. The resulting image size and number of channels are the same as in Step 4.2.
[0039] Step 4.5: Input the image obtained in Step 4.4 into the backbone network to extract features;
[0040] The backbone network is divided into three distinct stages, each extracting a feature map; ultimately, it outputs feature maps at three scales, with the following sizes: , , ;
[0041] Step 4.6: Input the three feature maps obtained in Step 4.5 into the Feature Pyramid (FPN) structure to fuse features, and then... The feature map is downsampled to obtain Feature maps and Feature maps, and send all feature maps into the detection head, The feature maps are fed into the semantic segmentation layer;
[0042] Step 4.7: The detection head model consists of two convolutional layers; the second layer has three parallel branches; the semantic segmentation layer consists of five convolutional layers and one upsampling layer; based on the feature map input in Step 4.6, the detection head and segmentation layer will predict the classification confidence. Mask coefficient Border coordinates and the original mask ;
[0043] Step 4.8: Calculate the mask coefficient obtained from the detection head. The original mask obtained from the semantic segmentation layer Linear combination for prediction mask The number of predicted masks is equal to the number of categories in the training labels. As shown in formula (9):
[0044]
[0045] in, This is the number of masks set manually, usually 32; Indicates the first Class of defects One mask coefficient; Indicates the first Class of defects A mask; It is a channel-level connection function, ultimately yielding a set of predicted masks for each category. Obtaining masks for each category of defects using a linear combination method reduces the computational cost of the machine and accelerates model training and inference.
[0046] Step 4.9: Calculate the classification loss Border loss Mask loss Semantic segmentation loss ;
[0047] Based on the classification confidence level obtained in step 4.7 Mask coefficient Border coordinates The prediction mask obtained in step 4.8 The anchor frame in step 4.1 and actual labels Calculate loss :
[0048]
[0049] in, The bounding box localization loss is based on the SmoothL1 loss function, and its formula is as follows:
[0050]
[0051] It is a classification loss based on the OHEM loss function, and its formula is as follows:
[0052]
[0053] and These are the mask loss and semantic segmentation loss, respectively, based on the binary cross-entropy (BCE) loss function, and their formulas are as follows:
[0054]
[0055]
[0056] Step 4.10: The result obtained from the calculation in step 4.9 After continuous training until the loss function stabilizes, an instance segmentation model is obtained. Test set The detection results are obtained by inputting the data into the detection model. .
[0057] Step 5: Analyze the test results The specific steps for performing nonmaximum suppression are as follows:
[0058] Step 5.1: Traverse the test set All test images Feed into the instance segmentation model Get the test results for each image ,Pick All border coordinate sets (Number of elements is) Traversal Each border in Perform the calculation using formula (15):
[0059]
[0060] in, For the detection box Cross-union matrix, for Except Detection boxes other than those in the outer frame;
[0061] Step 5.2: Setting threshold ,like Then compare the first The first detection box and the first Classification confidence of each detection box and The size of the bounding boxes and masks with higher confidence is determined, while the bounding boxes and masks with lower confidence are deleted.
[0062] Step 5.3: Repeat step 5.2 until the last detection box in the image has been traversed, finally obtaining the precise target region. and mask .
[0063] The beneficial effects of adopting the above technical solution are as follows: This invention provides an intelligent weld defect recognition method based on a visual transformation layer and instance segmentation. First, it enhances the contrast between defects and the background from two perspectives: firstly, it employs multiple data preprocessing methods to optimize the features of all defects from a data processing perspective; secondly, it uses a visual transformation layer algorithm to adaptively weight and adjust defect features from a network structure perspective, allowing the network to automatically focus on defect features; furthermore, it integrates multi-scale features extracted from the backbone network to enhance the network's receptive field and semantic information representation ability, thereby meeting the need to segment defects at different scales; finally, it uses a linear combination of a prediction mask and mask coefficients to generate the final mask, regressing the accurate edges of the defects, thus significantly improving the precise quantitative rating of weld defects. Attached Figure Description
[0064] Figure 1 This is a general flowchart of the method provided in the embodiments of the present invention;
[0065] Figure 2 This is a flowchart of the first data preprocessing algorithm provided in an embodiment of the present invention;
[0066] Figure 3 This is a flowchart of the second data preprocessing method provided in an embodiment of the present invention;
[0067] Figure 4 This is a network structure diagram of the visual conversion layer provided in an embodiment of the present invention. Detailed Implementation
[0068] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0069] The method in this embodiment fuses the preprocessed image, feeds it into an image transformation layer for channel-level transformation, and then proceeds through steps such as backbone network feature extraction, neck network feature fusion, and detection head prediction of category bounding boxes and masks to achieve accurate defect segmentation. The overall method flow is as follows: Figure 1 As shown, the processing steps are as follows:
[0070] Step 1: Based on the principle of X-ray digital imaging, the image information is converted into digital signals using photoelectric technology and digital processing technology. Then, an X-ray film scanner is used to scan the raw weld defect image, which is then sent to a computer. The computer configuration is as follows:
[0071]
[0072] Step 2: The first data preprocessing method, namely grayscale normalization and morphological closing operation, is used to preprocess the original image of the pipeline weld defect. The process is as follows: Figure 2 As shown;
[0073] Step 2.1: Input the industrial negative as an image grayscale matrix According to formula (1), the mean of the image grayscale matrix is calculated. with standard deviation :
[0074]
[0075] in It is the mean. It is the standard deviation. and These are the width and height of the image, respectively. and Represents the rows and columns of the image grayscale matrix;
[0076] Step 2.2: Set the dispersion threshold It is 60, based on the mean. and standard deviation Perform the transformation shown in formula (2):
[0077]
[0078] in, Actual standard deviation Standard deviation from the benchmark The ratio, It is the baseline value of the mean;
[0079] Step 2.3: Perform the image morphological closing operation, as shown in formula (3):
[0080]
[0081] in, The output image grayscale matrix; It is a sliding window matrix; Indicates an etching operation; This indicates an expansion operation.
[0082] Step 3: The second image preprocessing method, grayscale normalization and histogram equalization, is used to optimize the original image. The process is as follows: Figure 3 As shown;
[0083] Step 3.1: The input industrial negative is an image grayscale matrix. According to formulas (1) and (2), grayscale normalization is performed;
[0084] Step 3.2: Extract the function based on the histogram according to formula (4). calculate histogram :
[0085]
[0086] in, Grayscale value;
[0087] Step 3.3: To obtain the equalization transformation function Establish the mathematical relationship shown in formula (5):
[0088]
[0089] in, Represents the image grayscale matrix grayscale value, Represents the grayscale matrix of the equalized output image. grayscale value;
[0090] Step 3.4: Based on the uniform distribution of the histogram, obtain... ,in, For image Medium pixel grayscale value Quantity, The total number of gray levels is 256; then equalization transformation is performed. Transform formula (5) into formula (6):
[0091]
[0092] Step 3.5: At this point, the equalization transformation function is obtained as shown in formula (7):
[0093]
[0094] in, For any input image, The pixel grayscale value in this image is Quantity;
[0095] Step 3.6: According to formulas (6) and (7), the gray values of each pixel in the image after equalization transformation can be obtained:
[0096]
[0097] To output the image;
[0098] Step 4: Process the image grayscale matrix from steps 2 and 3. and A new image grayscale matrix is obtained by superimposing the data on the channels. ,Will and The two images are fused at the channel level and fed into the backbone network to extract features. The extracted features are then processed through three steps: feature fusion, detection head, and semantic segmentation layer, to obtain bounding boxes and masks. The specific steps are as follows:
[0099] Step 4.1: Label the defects in the pipe weld data, create a dataset, set the ratio of training set to test set to 8:2, and pre-set anchor frames; the specific method is as follows:
[0100] For each pixel in the image, three anchor boxes with different aspect ratios are generated. Each aspect ratio is further divided into three different scales, meaning that a pixel has... An anchor frame is used to facilitate the detection of targets of different shapes;
[0101] Step 4.2: Transfer the image Scaling to a fixed size (unit: );
[0102] Step 4.3: Perform visual transformation processing on the image obtained in Step 4.2. The visual transformation layer in this embodiment contains three branches, and its structure is as follows: Figure 4 As shown: The first branch consists of two... It consists of convolutional layers with ReLU nonlinear activation, after the first... In convolutional layers, the number of channels first decreases to half of the original number of channels. After passing through a second convolutional layer, the number of channels increases to the original number; the second branch consists of one... The first branch consists of convolutional layers, with the number of channels remaining constant; the third branch is a residual connection with no convolutional structure, and the number of channels remains constant; finally, the number of channels obtained from the three branches is linearly added together to obtain the output of the visual conversion layer.
[0103] Step 4.4: Perform a weighted summation on the two images obtained in Steps 4.2 and 4.3. The resulting image size and number of channels are the same as in Step 4.2.
[0104] Step 4.5: Input the image obtained in step 4.4 into the backbone network to extract features. In this example, the backbone network is ResNet50.
[0105] The backbone network is divided into three distinct stages, each extracting a feature map; ultimately, it outputs feature maps at three scales, with the following sizes: , , ;
[0106] Step 4.6: Input the three feature maps obtained in Step 4.5 into the Feature Pyramid (FPN) structure to fuse features, and then... The feature map is downsampled to obtain Feature maps and Feature maps, and send all feature maps into the detection head, The feature maps are fed into the semantic segmentation layer;
[0107] Step 4.7: The detection head model consists of two convolutional layers; the second layer has three parallel branches; the semantic segmentation layer consists of five convolutional layers and one upsampling layer; based on the feature map input in Step 4.6, the detection head and segmentation layer will predict the classification confidence. Mask coefficient Border coordinates and the original mask ;
[0108] Step 4.8: Calculate the mask coefficient obtained from the detection head. The original mask obtained from the semantic segmentation layer Linear combination for prediction mask The number of predicted masks is equal to the number of categories in the training labels. ;
[0109] Step 4.9: Calculate the classification loss Border loss Mask loss Semantic segmentation loss ;
[0110] Based on the classification confidence level obtained in step 4.7 Mask coefficient Border coordinates The prediction mask obtained in step 4.8 The anchor frame in step 4.1 and actual labels Calculate loss :
[0111]
[0112] in, The bounding box localization loss is based on the SmoothL1 loss function, and its formula is as follows:
[0113]
[0114] It is a classification loss based on the OHEM loss function, and its formula is as follows:
[0115]
[0116] and These are the mask loss and semantic segmentation loss, respectively, based on the binary cross-entropy (BCE) loss function, and their formulas are as follows:
[0117]
[0118]
[0119] Step 4.10: The result obtained from the calculation in step 4.9 After continuous training until the loss function stabilizes, an instance segmentation model is obtained. Test set The detection results are obtained by inputting the data into the detection model. ;
[0120] Step 5: Analyze the test results The specific steps for performing nonmaximum suppression are as follows:
[0121] Step 5.1: Traverse the test set All test images Feed into the instance segmentation model Get the test results for each image ,Pick All border coordinate sets (Number of elements is) Traversal Each border in Perform the calculation using formula (14):
[0122]
[0123] in, For the detection box Cross-union matrix, for Except Detection boxes other than those in the outer frame;
[0124] Step 5.2: Setting threshold ,like Then compare the first The first detection box and the first Classification confidence of each detection box and The size of the bounding boxes and masks with higher confidence is determined, while the bounding boxes and masks with lower confidence are deleted.
[0125] Step 5.3: Repeat step 5.2 until the last detection box in the image has been traversed, finally obtaining the precise target region. and mask
[0126] Based on the above steps, we obtain the final result, and we will infer the result. With tags Compare the results and base them on the correct predictions. Total number of inference results Total number of tags Using formulas (15) and (16), calculate the following indices:
[0127]
[0128]
[0129]
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A method for intelligent identification of weld defects based on visual transformation layer and instance segmentation, characterized in that: Includes the following steps: Step 1: Based on the principle of X-ray digital imaging, the image information is converted into digital signals using photoelectric technology and digital processing technology, and then scanned using an X-ray film scanner to obtain the original image of the weld defect. Step 2: The first data preprocessing method, namely grayscale normalization and morphological closing operation, is used to preprocess the original image of the pipeline weld defect. Step 2.1: To obtain the probability distribution statistics of the weld defect image, calculate the mean and standard deviation of the image grayscale matrix; Step 2.2: To prevent the overall brightness of the grayscale matrix of the weld defect image from being too dark, the brightness of the image is adaptively adjusted by taking into account both the degree of dispersion and the average level and setting a threshold. Step 2.3: Perform the image morphological closing operation, as shown in formula (1): ; wherein, is the output image gray scale matrix; is the sliding window matrix; denotes an erosion operation; denotes a dilation operation; Step 3: The original image is optimized using the second image preprocessing method, which involves grayscale normalization and histogram equalization. Step 3.1: The input industrial negative is a gray-scale matrix of the image and is normalized to gray scale. Step 3.2: Extracting the histogram based on formula (2) Compute the histogram of : ; wherein is a gray value; Step 3.3: To derive the equalization transform function , a mathematical relationship as shown in equation (3) is established: ; in, Represents the image grayscale matrix grayscale value, Represents the grayscale matrix of the equalized output image. grayscale value; Step 3.4: Based on the uniform distribution of the histogram, obtain... ,in, For image Medium pixel grayscale value Quantity, This represents the total number of gray levels; then it undergoes an equalization transformation. Transform formula (3) into formula (4): ; Step 3.5: At this point, the equalization transformation function is obtained as shown in formula (5): ; Step 3.6: According to formulas (4) and (5), the gray values of each pixel in the image after equalization transformation can be obtained: ; To output the image; Step 4: Process the image grayscale matrix from steps 2 and 3. and A new image grayscale matrix is obtained by superimposing the data on the channels. ,Will and The two images are fused at the channel level and fed into the backbone network to extract features. The extracted features are then processed through three steps: feature fusion, detection head, and semantic segmentation layer, to obtain bounding boxes and masks. The specific steps are as follows: Step 4.1: Label the defects in the pipe weld data, create a dataset, set the ratio of training set to test set to 8:2, and pre-set anchor frames; the specific method is as follows: For each pixel of the image, generate Anchor frames with different aspect ratios, each aspect ratio having three different scales, meaning one pixel has... An anchor frame is used to facilitate the detection of targets of different shapes; Step 4.2: Transfer the image Scaling to a fixed size ,unit: ; Step 4.3: Based on the image obtained in Step 4.2, perform visual transformation processing; the visual transformation layer consists of convolutional layers, activation layers and pooling layers, keeping the image scale and channels unchanged, and performing convolutional weighting and non-linear activation operations on the image data to obtain the transformed image; Step 4.4: Perform a weighted summation on the two images obtained in Steps 4.2 and 4.
3. The resulting image size and number of channels are the same as in Step 4.
2. Step 4.5: Input the image obtained in Step 4.4 into the backbone network to extract features; The backbone network is divided into three distinct stages, each extracting a feature map; ultimately, it outputs feature maps at three scales, with the following sizes: , , ; Step 4.6: Input the three feature maps obtained in Step 4.5 into the Feature Pyramid (FPN) structure to fuse features, and then... The feature map is downsampled to obtain Feature maps and Feature maps, and send all feature maps into the detection head, The feature maps are fed into the semantic segmentation layer; Step 4.7: The detection head model consists of two convolutional layers; the second layer has three parallel branches; the semantic segmentation layer consists of five convolutional layers and one upsampling layer; based on the feature map input in Step 4.6, the detection head and segmentation layer will predict the classification confidence. Mask coefficient Border coordinates and the original mask ; Step 4.8: Calculate the mask coefficient obtained from the detection head. The original mask obtained from the semantic segmentation layer Linear combination for prediction mask The number of predicted masks is equal to the number of categories in the training labels. ; Step 4.9: Calculate the classification loss Border loss Mask loss Semantic segmentation loss ; Based on the classification confidence level obtained in step 4.7 Mask coefficient Border coordinates The prediction mask obtained in step 4.8 The anchor frame in step 4.1 and actual labels Calculate loss : ; in, The bounding box localization loss is based on the SmoothL1 loss function, and its formula is as follows: ; It is a classification loss based on the OHEM loss function, and its formula is as follows: ; and These are the mask loss and semantic segmentation loss, respectively, based on the binary cross-entropy (BCE) loss function, and their formulas are as follows: ; ; Step 4.10: The result obtained from the calculation in step 4.9 After continuous training until the loss function stabilizes, an instance segmentation model is obtained. Test set The detection results are obtained by inputting the data into the detection model. ; Step 5: Analyze the test results The specific steps for performing nonmaximum suppression are as follows: Step 5.1: Traverse the test set All test images Feed into the instance segmentation model Get the test results for each image ,Pick All border coordinate sets The number of elements is ; Traversal Each border in Perform the calculation using formula (12): ; in, For the detection box Cross-union matrix, for Except Detection boxes other than those in the outer frame; Step 5.2: Setting threshold ,like Then compare the first The first detection box and the first Classification confidence of each detection box and The size of the bounding boxes and masks with higher confidence is determined, while the bounding boxes and masks with lower confidence are deleted. Step 5.3: Repeat step 5.2 until the last detection box in the image has been traversed, finally obtaining the precise target region. and mask .
2. The intelligent weld defect recognition method based on visual conversion layer and instance segmentation according to claim 1, characterized in that, Step 2.1 specifically includes the following: The input industrial film is an image grayscale matrix. ;Calculate the mean of the image grayscale matrix according to formula (13). with standard deviation : ; in It is the mean. It is the standard deviation. and These are the width and height of the image, respectively. and Represents the rows and columns of the image grayscale matrix.
3. The intelligent weld defect recognition method based on visual conversion layer and instance segmentation according to claim 1, characterized in that, Step 2.2 specifically includes the following: Set a threshold for dispersion Based on the mean and standard deviation Perform the transformation shown in formula (14): ; in, Actual standard deviation Standard deviation from the benchmark The ratio, It is the mean baseline value.
4. The intelligent weld defect recognition method based on visual conversion layer and instance segmentation according to claim 1, characterized in that, Step 4.3 specifically includes the following: Based on the image obtained in step 4.2, a visual transformation process is performed; the visual transformation layer contains three branches: the first branch consists of two... It consists of convolutional layers with ReLU nonlinear activation, after the first... In the convolutional layer, the number of channels first decreases to one-quarter of the original number, then after the second convolutional layer, the number of channels increases back to the original number; the second branch consists of one... The first branch consists of convolutional layers with the number of channels remaining constant; the second branch is a residual connection with no convolutional structure and the number of channels remains constant; finally, the number of channels obtained from the three branches is linearly added together to obtain the output of the visual conversion layer.
5. The intelligent weld defect recognition method based on visual conversion layer and instance segmentation according to claim 1, characterized in that, Step 4.8 specifically includes the following: The mask coefficient obtained from the detection head The original mask obtained from the semantic segmentation layer Linear combination for prediction mask As shown in formula (15): ; in, The number of masks is set manually. Indicates the first Class of defects One mask coefficient; Indicates the first Class of defects A mask; It is a channel-level connection function, which ultimately yields a set of prediction masks for each category; Obtaining masks for each type of defect using a linear combination method reduces the computational cost of the machine and accelerates the training and inference speed of the model.
Citation Information
Patent Citations
Mobile phone screen defect segmentation method, device and equipment based on converged network
CN111553929A