Weld defect detection and marking method based on multi-layer CNN and image processing

Through the combination of multi-layer convolutional neural network and support vector machine, weld image features are extracted and defect classification and labeled, which solves the problem of low manual detection efficiency, poor robustness of traditional machine vision detection and large sample size in weld defect detection. Problem, efficient and accurate weld defect detection is achieved.

CN117557497BActive Publication Date: 2025-01-14SHENYANG AEROSPACE UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311362661.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2025-01-14
Estimated Expiration
2043-10-19

AI Technical Summary

Technical Problem

In the existing weld defect detection methods, manual detection efficiency is low and costly. Traditional machine vision detection samples are large in scale, poor in robustness and lack of explanation. Deep convolutional neural networks require expensive and impractical requirements when processing large-scale data sets. , it is difficult to learn potential defect detection from small samples.

Method used

Multi-layer convolutional neural network (CNN) combined with image processing technology, weld image features are extracted through multi-layer convolution and pooling, and defect classification and labeling are used to provide few samples and strong robustness. And an explainable method of detecting weld defects.

Benefits of technology

Ensure defect detection accuracy with relatively few samples, provide defect marking information, improve the efficiency and accuracy of weld defect detection, solve the low manual detection efficiency, poor robustness and large sample size of traditional machine vision detection question.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117557497B_ABST
    Figure CN117557497B_ABST
Patent Text Reader

Abstract

The present invention discloses a weld defect detection and marking method based on multi-layer CNN and image processing. First, the weld image I is preprocessed; then, the preprocessed image is processed by multi-layer convolution and pooling to extract features at different levels to obtain a feature map y; secondly, a 1×1 convolution operation is performed on the feature map y to obtain a segmentation result map u, and then a size regression is performed to obtain a segmentation result map v; finally, the segmentation result map u and the feature map y are feature combined to obtain a feature vector x i , the feature vector x i The image is sent to SVM to obtain defect classification, and at the same time, the segmentation result map v is analyzed for connected domains to obtain defect marking information. The weld defect detection and marking method uses a multi-layer CNN combined with SVM and uses image processing for defect marking, which solves the problems of large defect sample size, low manual detection efficiency and poor robustness of traditional machine vision detection in weld defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial product surface defect detection, and in particular to a weld defect detection and marking method using a multi-layer CNN and image processing. Background Art

[0002] Welding is one of the important processes for many military and civilian products. Welding technology is widely used in aircraft, construction, bridges, vehicles, ships, computers, medical equipment and other industries. The quality of welds has a vital impact on product quality. However, in actual production, due to the influence of production environment or human factors, defects are prone to occur in the weld part. Weld defects refer to the phenomenon that the metal is not connected, not dense or poorly connected at the weld joint during the welding process. There are five main types of defects: cracks (non-linear texture), pores (circular), slag inclusions (irregular shapes), incomplete penetration (straight line located in the center of the weld), and incomplete fusion (straight line on one side, located at the edge of the weld), which greatly reduce the quality of the product and may even cause safety problems in the use of the product. Therefore, how to conduct effective weld defect detection and find problems in time to ensure the quality of welding is of great significance and value to production enterprises.

[0003] At present, weld defect detection is mainly carried out by manual inspection and traditional machine vision inspection. Manual inspection is inefficient, costly, and easily affected by subjective factors and external environment, which seriously affects product quality. When detecting weld defects, traditional machine vision must set clear rules for detection, but it is difficult to use this method to meet the detection requirements in actual production. The appearance of today's industrial products is diverse, making it difficult for many production company employees or technicians to use these special rules to describe the defects of their product weld appearance. Although it is easy for people to understand a defect, it is very difficult to describe it in a programmatic language. With the development of deep learning technology, as a data-driven method that does not require manual design rules, the deep convolutional neural network model can solve the above problems because it can model complex features and is easier to adapt to different products without an explicit feature extraction process. However, deep convolutional networks also have problems in dealing with surface defect detection, namely the need for large-scale data sets for deep networks, and obtaining large-scale defective examples in industrial environments is an expensive and impractical task. Therefore, the network model designed for weld defect detection should meet the following requirements: (1) few samples, that is, it can learn potential defect detection from a few defective examples; (2) robust, that is, in similar problem domains, the network only needs slight hyperparameter adjustment; (3) interpretable, that is, it can provide visual positioning and classification explanations to industry workers. Therefore, it is necessary to provide a new technical solution to reduce the depth of the network, use a small amount of data to design a few-sample, robust and interpretable model to obtain better weld defect detection results, and make up for the shortcomings of the existing technology. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a weld defect detection and marking method based on multi-layer convolutional neural networks (CNN) and image processing. By constructing a multi-layer convolutional neural network to extract image features and locate defects on the weld surface, the features are sent to support vector machines (SVM) to classify the defect images. The defect detection accuracy can be guaranteed when the samples are relatively small, and the marking information of the defects can be given at the same time. The problems of low efficiency and unstable quality of manual detection in existing weld defect detection and large sample size, poor robustness and lack of explanation of traditional machine vision detection are solved.

[0005] The technical solution adopted by the present invention is: a weld defect detection and marking method based on multi-layer CNN and image processing, comprising the following steps:

[0006] Step 1: Preprocessing: Normalize the size of the weld image I to obtain image I1 ;

[0007] Step 2: Multi-layer convolution and pooling: Use multi-layer convolution and pooling to process image I 1 , extract features at different levels and obtain feature map y;

[0008] Step 3: Image segmentation: Perform a 1×1 convolution operation on the feature map y to obtain a segmentation result map u containing n channels, and then perform size regression to obtain the final segmentation result map v of all defects in the weld image I, where n is equal to the number of defect categories;

[0009] Step 4: Defect classification and labeling: Combine the segmentation result map u obtained in step 3 and the feature map y obtained in step 2 to obtain the feature vector x i , then, the feature vector x i The image is sent to SVM to obtain defect classification; the segmentation result image v is analyzed for connected domains to obtain defect marking information.

[0010] Preferably, in step 1, the weld image I is a pixel matrix, and the number of rows of the pixel matrix is ​​the height h of the weld image I 1 , the number of columns of the pixel matrix is ​​the width w of the weld image I 1 , use the bilinear interpolation method to normalize the size of the weld image I to an image I of h×w×1 1 .

[0011] Further preferably, step 2 specifically comprises the following steps:

[0012] Step 2.1: Use the weld image I obtained in step 1 1 As the input matrix, a convolution kernel of size m×m is established, and then the convolution kernel is slid on the input matrix in turn and the inner product operation is performed to obtain the feature map after convolution;

[0013] Step 2.2: Use the convolutional feature map as the input matrix of the pooling part. The pooling part adopts the maximum pooling to establish the matrix q. Slide the matrix q on the input matrix in turn, and select the maximum value within the size range of the matrix q as the output. After the matrix q traverses all positions of the feature map, the pooled feature map is obtained.

[0014] Step 2.3: Create a deeper network through multiple layers of convolution and pooling to extract features at different levels and obtain the feature map y.

[0015] Further preferably, step 2.3 specifically comprises the following steps:

[0016] Step 2.3.1: Convolution and pooling for low-level feature extraction

[0017] The network is created by convolution in step 2.1 and pooling in step 2.2 to extract lower-level features. This part includes two layers of networks. The first layer takes m=5 and the number of convolution kernels is 32, that is, 32 convolution kernels of size 5×5. The second layer is a 2×2 maximum pooling layer. This part extracts low-level features of the image. The input matrix size is h×w×1. After convolution and pooling operations, the final output is a feature map y of size h / 2×w / 2×32. 1 ;

[0018] Step 2.3.2: Multi-layer convolution and pooling for mid-level feature extraction

[0019] The output y of step 2.3.1 1 As the input of this part, this part includes a nine-layer network. The first three layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The fourth layer is a 2×2 maximum pooling layer. The fifth to eighth layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The ninth layer is a 2×2 maximum pooling layer. This part extracts the mid-level features of the image. After multiple layers of convolution and pooling operations, the feature map y with a size of h / 8×w / 8×64 is finally output. 2 ;

[0020] Step 2.3.3: Convolution for high-level feature extraction

[0021] The output y of step 2.3.2 2 As the input of this part, this part is a layer network with m=15 and the number of convolution kernels is 1024, that is, 1024 convolution kernels of size 15×15. This part extracts high-level abstract features and can highly summarize the semantic attributes of the image. After this layer of convolution operation, a feature map y of size h / 8×w / 8×1024 is generated.

[0022] Further preferably, step 3 is as follows:

[0023] The feature map y obtained in step 2 is processed by 1×1 convolution to obtain a segmentation result map u of size h / 8×w / 8×n. Then, bilinear interpolation is applied to regress the segmentation result map to the size of the original weld image I, where n is the number of channels. The n channel images are combined to obtain the final segmentation result map v of all defects in the weld image I. The size of the segmentation result map v is h 1 × 1 ×1.

[0024] Further preferably, in step 4, the feature vector x is obtained i The method is as follows:

[0025] Perform global average pooling on the feature map y of size h / 8×w / 8×1024 and the segmentation result map u of size h / 8×w / 8×n, and then concatenate the two result vectors to obtain a 1×1×z feature vector x. i , where z = 1024 + n. Global average pooling means calculating an average value for all pixels in the feature map of each channel. Each channel corresponds to a mean value, and a feature vector with a dimension equal to the number of channels in the input feature map is obtained.

[0026] Further preferably, in step 4, the method for obtaining the defect classification is as follows:

[0027] Defect classification uses the support vector machine (SVM) method. When performing multi-classification, multiple binary SVMs are used to classify defect samples of a certain category into one category and the remaining samples into another category. In this way, n SVM classifiers are constructed for samples of n categories. After that, the obtained z-dimensional feature vector x i Send it to the n-type defect SVM classifier to obtain the defect classification.

[0028] Further preferably, in step 4, the defect marking information includes the area, length, width and position information of the defect.

[0029] The weld defect detection and marking method provided by the present invention first performs image preprocessing, then performs feature extraction through a multi-layer CNN to obtain a weld surface image feature map and a defect detection segmentation result map, then sends the feature vector to an SVM to obtain a detection result classification, and finally uses an image processing method to obtain defect marking information, wherein the multi-layer CNN is combined with a machine learning algorithm SVM, without the need for manual feature design, thereby improving the detection accuracy, and at the same time, the SVM classification requires a small number of samples, which is consistent with the difficulty in obtaining defect images in actual industrial products, thereby solving the problems of large defect sample size required in existing weld defect detection, low manual detection efficiency, and poor robustness and lack of explanation of traditional machine vision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification.

[0031] Figure 1 A flow chart of a weld defect detection and marking method based on multi-layer CNN and image processing provided by the present invention;

[0032] Figure 2 It is a structural diagram of multi-layer convolution and pooling;

[0033] Figure 3 Schematic diagram of defect marking method.

[0034] in: Figure 2In it, Conv represents the convolution layer, 5×5 represents the size of the convolution kernel, 32 represents the number of convolution kernels, MaxPooling represents the maximum pooling layer, and 2×2 represents the size of the pooling filter. Figure 3 Schematic diagram of the defect marking method, where the black area represents the background part, the white area in the white rectangular box represents the defect part, the area of ​​the defect part is 10, the length is 4, the width is 4, and the position coordinates are (6, 4). DETAILED DESCRIPTION

[0035] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0036] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention will be described in detail below with reference to the accompanying drawings.

[0037] like Figure 1 As shown, the present invention provides a weld defect detection and marking method based on multi-layer CNN and image processing, comprising the following steps:

[0038] Step 1: Preprocessing

[0039] The original weld image I is a pixel matrix, and the number of rows of the pixel matrix is ​​the height h of the weld image I 1 , the number of columns of the pixel matrix is ​​the width w of the weld image I 1 . The structure of CNN is fixed, and the input and output parameters are fixed, so the image size needs to be adjusted. Before using the multi-layer CNN network to extract features, the size of the weld image I is normalized to h×w×1. For images that need to be enlarged, in order to maintain the aspect ratio of the original image, the image padding method is used to change the original image size. The padding method is to use a fixed color consistent with the edge color to fill the edge to ensure that the content in the image is not deformed. For images that need to be reduced, it is necessary to delete some pixels based on the original pixels. The bilinear interpolation method is used to perform three linear interpolations in two directions. The specific operation is to perform two linear interpolation calculations in the X direction and then one interpolation calculation in the Y direction. Finally, an image matrix I with a size of h×w×1 is obtained. 1 .

[0040] Step 2: Multi-layer convolution and pooling

[0041] Step 2.1: Convolution

[0042] Using the image matrix I obtained in step 1 1As the input matrix, an m×m matrix p is established. The matrix p is called the convolution kernel. Then it slides on the input matrix in turn and performs inner product operations. Every time the convolution kernel moves a certain distance, a convolution value is calculated. The convolution value is the feature extracted by the convolution kernel on the input matrix. There are multiple convolution kernels, and each convolution kernel has different internal parameters. Different convolution kernels can extract different types of features. The distance the convolution kernel moves is called the step size. When the convolution kernel slides from top to bottom and from left to right to traverse all positions of the input matrix, the result matrix after convolution is obtained. The result matrix after convolution is called a feature map. After each convolution kernel performs a convolution operation, a corresponding feature map will be obtained. In order to make the input image and the output image consistent in size, the input image is padded before the convolution operation. The padding method is to fill the input matrix with 0 data. After the convolution process, the height and width of the output feature map remain unchanged, but the number of channels changes.

[0043] Step 2.2: Pooling

[0044] Pooling can reduce parameters and computation while retaining the main features, thus preventing overfitting. The convolution-processed feature map is used as the input matrix of the pooling part. The pooling process uses the maximum pooling (MaxPooling), and a 2×2-sized matrix q is established. It slides the input matrix in sequence with a step size of 2, and the maximum value in the 2×2 range is selected as the output. After the matrix q traverses all positions of the feature map, the feature map after maximum pooling is obtained. The height and width of the obtained feature map are halved, and the number of channels remains unchanged.

[0045] Step 2.3: Multi-layer convolution and pooling

[0046] Through multi-layer convolution and pooling, a deeper network is created to extract features at different levels. The structure of multi-layer convolution and pooling is as follows: Figure 2 shown.

[0047] Step 2.3.1: Convolution and pooling for low-level feature extraction

[0048] The network is created by convolution in step 2.1 and pooling in step 2.2 to extract lower-level features. This part includes two layers of networks. The first layer takes m=5 and the number of convolution kernels is 32, that is, 32 convolution kernels of size 5×5. The second layer is a 2×2 maximum pooling layer, which extracts low-level features of the image, such as edge features. The input matrix size is h×w×1. After convolution and pooling operations, the final output feature map y of size h / 2×w / 2×32 is obtained. 1 .

[0049] Step 2.3.2: Multi-layer convolution and pooling for mid-level feature extraction

[0050] The output y of step 2.3.1 1As the input of this part, this part includes a nine-layer network. The first three layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The fourth layer is a 2×2 maximum pooling layer. The fifth to eighth layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The ninth layer is a 2×2 maximum pooling layer. This part extracts mid-level features of the image, such as texture features. After multiple layers of convolution and pooling operations, the feature map y with a size of h / 8×w / 8×64 is finally output. 2 .

[0051] Step 2.3.3: Convolution for high-level feature extraction

[0052] The output y of step 2.3.2 2 As the input of this part, this part is a layer network with m=15 and 1024 convolution kernels, that is, 1024 convolution kernels of size 15×15. This part extracts high-level abstract features and can highly summarize the semantic attributes of the image. After this layer of convolution operation, a feature map y of size h / 8×w / 8×1024 is generated.

[0053] Step 3: Image Segmentation

[0054] For the feature map y obtained in step 2, the size is h / 8×w / 8×1024, and a convolution kernel of size 1×1 is established. The number of channels n is the number of defect categories, and the number of channels n is taken as 5. The convolution kernel is used to slide on the feature map y to convolve the obtained feature map. The distance of each slide is 1, that is, the step size is 1, and the segmentation result map u of size h / 8×w / 8×5 is obtained. Since the size of the segmentation result map is smaller than the size of the original image, it is necessary to apply bilinear interpolation to regress the result map to the size of the original weld image I. The number of channels of the segmentation result map is 5. The 5 channel images are combined to obtain the final segmentation result map v of all defects in the weld image I, with a size of h 1 × 1 ×1.

[0055] Step 4: Defect classification and labeling

[0056] Step 4.1: Get the feature vector

[0057] Perform global average pooling on the feature map y with a size of h / 8×w / 8×1024 generated in step 2 and the segmentation result map u with a size of h / 8×w / 8×5 generated in step 3, and then concatenate the two result vectors to obtain a feature vector x of 1×1×1029. i , where global average pooling refers to calculating an average value for all pixels in the feature map of each channel, with each channel corresponding to a mean value, to obtain a feature vector with a dimension equal to the number of channels in the input feature map.

[0058] Step 4.2: Defect Classification

[0059] Defect classification uses the SVM method. There are 5 categories of weld defects. When performing multi-classification, multiple binary SVMs are used to classify defect samples of a certain category into one category and the remaining samples into another category. In this way, 5 SVM classifiers are constructed for samples of 5 categories. When classifying, the input sample is classified into the category with the largest classification decision function value.

[0060] The SVM classification process is as follows:

[0061] The 1029-dimensional feature vector x obtained in step 4.1 i Sent into a certain type of defect SVM classifier, the original vector x i is finite-dimensional, there must be a high-dimensional feature space where samples can be separated. Let φ(x i ) represents x i After mapping, the linearly separable SVM classification decision function is:

[0062] f(x)=w * φ(x)+b * (1)

[0063] Among them, w * φ(x)+b * To obtain the separating hyperplane, x i is a 1029-dimensional feature vector, w * and b * is the parameter of the decision function, w * and b * The calculation formula is as follows:

[0064]

[0065]

[0066] Among them, y i For x i The class marker, when y i When x is +1, i For a positive example, when y i When x is -1, i For negative examples, is the Lagrange multiplier.

[0067] The input feature vector x i Substitute into f(x), if f(x)>0, then the image I is judged to be an image with a certain type of defect, if f(x)<0, then the image I is judged to be an image without a certain type of defect.

[0068] When different SVMs are used for classification, if there are multiple judgment results that the object is defective, the f(x) in different SVM classifiers are compared, and the maximum value is taken as the final judgment result.

[0069] Step 4.3: Defect Marking

[0070] Step 3 obtains a size h 1 × 1 ×1 binary segmentation result image v, connect domain analysis is performed on the binary image. The connected region in the image refers to the region composed of pixels of the same color and adjacent positions. The color of the pixel in the image represents the category of the pixel, where black pixels represent the background and white pixels represent defects. The area, length, width and other attributes of the defect are calculated through the white connected region. The defect area is obtained by calculating the number of pixels in the white connected region. The length of the outer rectangle of the connected region is the length of the defect region, the width of the outer rectangle is the width of the defect region, and the position of the upper left corner of the outer rectangle is the position of the defect region. The defect region marking result example is as follows: Figure 3 shown.

[0071] The weld defect detection and marking method based on multi-layer CNN and image processing first preprocesses the weld image I to obtain image I 1 ; Then, use the convolution layer to obtain image I 1 The feature map of the weld image is obtained by adding a pooling layer after the convolution layer to reduce the dimension of the feature map. The low-level, medium-level and high-level features are extracted through multi-layer convolution and pooling respectively to obtain the weld image feature map y. Secondly, the feature map y is processed by 1×1 convolution to obtain the segmentation result map u. The segmentation result map u is regressed to obtain the segmentation result map v. Finally, the segmentation result map v is subjected to image processing connected domain analysis and other operations to obtain information such as the defect mark area, length and width. At the same time, the segmentation result map u and the feature map y are subjected to global average pooling operations respectively, and the obtained vectors are concatenated to form a feature vector x. i , the vector x i The method uses multi-layer CNN combined with SVM to detect surface defects of welds, and uses image processing to mark defects, which solves the problems of large defect sample size, low manual detection efficiency, and poor robustness of traditional machine vision detection and lack of explanation in weld defect detection. It has important practical value and significance for the quality inspection of industrial products with welds.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0073] Although the embodiments disclosed in the present invention are as above, the contents described are only embodiments adopted to facilitate understanding of the present invention and are not intended to limit the present invention. Any technician in the field to which the present invention belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in the present invention, but the patent protection scope of the present invention shall still be subject to the scope defined in the attached claims.

[0074] The above are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A weld defect detection and marking method based on multi-layer CNN and image processing, characterized in that: The steps include: Step 1: Preprocessing: Normalize the size of the weld image I to obtain image I1; Step 2: Multi-layer convolution and pooling: Use multi-layer convolution and pooling to process image I1, extract features at different levels, and obtain feature map y; Step 3: Image segmentation: Perform a 1×1 convolution operation on the feature map y to obtain a segmentation result map u containing n channels, and then perform size regression to obtain the final segmentation result map v of all defects in the weld image I, where n is equal to the number of defect categories; Step 4: Defect classification and labeling: Combine the segmentation result map u obtained in step 3 and the feature map y obtained in step 2 to obtain the feature vector x i , then, the feature vector x i Send it into SVM to obtain defect classification; perform connected domain analysis on the segmentation result graph v to obtain defect marking information; Step 2 specifically includes the following steps: Step 2.1: Use the weld image I1 obtained in step 1 as the input matrix, establish a convolution kernel of size m×m, and then slide the convolution kernel on the input matrix in turn and perform inner product operation to obtain the feature map after convolution; Step 2.2: Use the convolutional feature map as the input matrix of the pooling part. The pooling part adopts the maximum pooling to establish the matrix q. Slide the matrix q on the input matrix in turn, and select the maximum value within the size range of the matrix q as the output. After the matrix q traverses all positions of the feature map, the pooled feature map is obtained. Step 2.3: Create a deeper network through multiple layers of convolution and pooling to extract features at different levels and obtain the feature map y; Step 2.3 specifically includes the following steps: Step 2.3.1: Convolution and pooling for low-level feature extraction Create a network through step 2.1 convolution and step 2.2 pooling to extract lower-level features. This part includes two layers of networks. The first layer takes m=5 and the number of convolution kernels is 32, that is, 32 convolution kernels of size 5×5. The second layer is a 2×2 maximum pooling layer. This part extracts low-level features of the image. The input matrix size is h×w×1. After convolution and pooling operations, the final output is a feature map y1 of size h / 2×w / 2×32. Step 2.3.2: Multi-layer convolution and pooling for mid-level feature extraction The output y1 of step 2.3.1 is used as the input of this part. This part includes a nine-layer network. The first three layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The fourth layer is a 2×2 maximum pooling layer. The fifth to eighth layers take m=5, and the number of convolution kernels is 64, that is, 64 convolution kernels of size 5×5 in each layer. The ninth layer is a 2×2 maximum pooling layer. This part extracts the mid-level features of the image. After multiple layers of convolution and pooling operations, the feature map y2 with a size of h / 8×w / 8×64 is finally output; Step 2.3.3: Convolution for high-level feature extraction The output y2 of step 2.3.2 is used as the input of this part. This part is a layer network with m=15 and 1024 convolution kernels, that is, 1024 convolution kernels with a size of 15×15. This part extracts high-level abstract features and can highly summarize the semantic attributes of the image. After this layer of convolution operation, a feature map y with a size of h / 8×w / 8×1024 is generated; Step 3 is as follows: The feature map y obtained in step 2 is processed by 1×1 convolution to obtain a segmentation result map u of size h / 8×w / 8×n. Then, bilinear interpolation is applied to regress the segmentation result map to the size of the original weld image I, where n is the number of channels. The n channel images are combined to obtain the final segmentation result map v of all defects in the weld image I. The size of the segmentation result map v is h1×w1×1; In step 4, we get the feature vector x i The method is as follows: Perform global average pooling on the feature map y of size h / 8×w / 8×1024 and the segmentation result map u of size h / 8×w / 8×n, and then concatenate the two result vectors to obtain a 1×1×z feature vector x. i , where z = 1024 + n, global average pooling means calculating an average value for all pixels in the feature map of each channel, one mean value for each channel, and obtaining a feature vector with the dimension of the number of channels in the input feature map; In step 4, the method for obtaining defect classification is as follows: Defect classification uses the support vector machine (SVM) method. When performing multi-classification, multiple binary SVMs are used to classify defect samples of a certain category into one category and the remaining samples into another category. In this way, n SVM classifiers are constructed for samples of n categories. After that, the obtained z-dimensional feature vector x i Send it to the n-type defect SVM classifier to obtain the defect classification.

2. The weld defect detection and marking method based on multi-layer CNN and image processing according to claim 1 is characterized in that: In step 1, the weld image I is a pixel matrix, the number of rows of the pixel matrix is ​​the height h1 of the weld image I, the number of columns of the pixel matrix is ​​the width w1 of the weld image I, and the size of the weld image I is normalized to an image I1 of h×w×1 using a bilinear interpolation method.

3. The weld defect detection and marking method based on multi-layer CNN and image processing according to claim 1 is characterized in that: In step 4, the defect marking information includes the area, length, width, and location information of the defect.

Citation Information

Patent Citations

  • Polarized SAR image classification method based deep multi-example learning

    CN105894018A