Construction method of texture surface defect detection model based on multi-class decomposition editing

By generating mixed defect images and performing multi-category decomposition and editing, a texture surface defect detection model is constructed, which solves the problem of the difference between artificial defects and real defects and improves the accuracy and detection rate of texture defect detection.

CN115564724BActive Publication Date: 2025-09-26HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211193529.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-09-26
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

In existing unsupervised texture defect detection methods, there are differences between artificial defects and real defects, resulting in poor detection results and making it difficult to apply to industrial scenarios.

Method used

By generating mixed defect images of various basic types, using a multi-category decomposition editing model for feature extraction and decomposition, combining a multi-scale convolution editing module to suppress abnormal features, and constructing a texture surface defect detection model, we learn a universal decomposition expression for texture defects.

Benefits of technology

It improves the accuracy and detection rate of texture defect detection, overcomes the difference between artificial defects and real defects, and improves the detection effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564724B_ABST
    Figure CN115564724B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of image processing and discloses a method for constructing a texture surface defect detection model based on multi-category decomposition and editing. First, a basic transformation image and a random Gaussian mask image are generated by random combination, and a mixed defect image is obtained by fusion; secondly, the features of the mixed defect image are decomposed into different basic transformations, and the obtained basic anomaly score maps are fused to obtain a fused anomaly score map, thereby locating the defect features; finally, the defect part features are suppressed by weighting to become a hole area, and then the hole is edited and completed using its neighborhood information to obtain the edited features, thereby achieving defect suppression and reconstructing the image background, thereby improving the defect detection accuracy. During detection, the residual map between the input image and the reconstructed texture background image is fused with the fused anomaly score map to detect the defect. In this way, the present invention has a high detection accuracy for various defects on different texture surfaces in the absence of defective samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing, and more specifically, relates to a method for constructing a texture surface defect detection model based on multi-category decomposition editing. Background Art

[0002] In industrial scenarios, various types of texture defects are common in many industrial products, such as textiles, leather, nanomaterials, and new display devices (TFT-LCD, OLED), due to the diverse materials and complex manufacturing processes. These defects, defined as localized uneven brightness or damaged texture structures, have a significant impact on user experience and product quality. To improve production quality, texture defect detection has become an integral part of the industrial manufacturing process.

[0003] Among textured surface defect detection methods, automated optical inspection (AOI) is widely used due to its non-contact, high-speed, and high-precision advantages, compared to traditional manual observation methods that are time-consuming and labor-intensive. Within each step of an automated optical inspection system, the defect detection algorithm is the key and core of the system, directly determining the performance of the inspection system. Due to the complex and irregular texture backgrounds, the variable shapes and sizes of defects, and the fact that defect samples in industrial scenarios are often scarce and difficult to collect and annotate, defect detection algorithms face significant challenges.

[0004] In recent years, with the rapid development of deep learning in the field of machine vision, an increasing number of deep learning-based texture defect detection methods have been applied in industrial scenarios. These methods can be divided into supervised and unsupervised methods based on whether the training data contains labeled defect samples. The detection effect of supervised methods is often limited by the defect samples used for training, making them difficult to apply to industrial scenarios. Unsupervised methods do not require defect sample training and have become the predominant method. Because unsupervised methods do not describe defect information, the actual effect is difficult to improve. Currently, defect information is mainly supplemented by artificially creating defects, but there are often certain differences between artificial defects and actual defects, resulting in poor detection results. Therefore, overcoming the difference between artificial defects and real defects and proposing an unsupervised learning-based texture surface defect detection algorithm are key to improving detection accuracy and industrial product quality. Summary of the Invention

[0005] In response to the shortcomings of the existing technology or the need for improvement, the present invention provides a method for constructing a texture surface defect detection model based on multi-category decomposition editing. The purpose is to produce mixed defects of multiple basic types for training, and decompose the mixed defects into basic types, so that the model can learn the general decomposition expression of texture defects without being restricted to the defects of production, thereby overcoming the difference between production defects and real defects, and effectively improving the accuracy of defect detection.

[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for constructing a texture surface defect detection model based on multi-category decomposition editing, comprising:

[0007] Build a texture surface defect detection model; wherein, the texture surface defect detection model includes:

[0008] Random combination generation module, used to generate Gaussian defect masks of different shapes and sizes I mask ; Randomly select a normal image from the training set as the reference image I f ; Construct a random code c, where each element in c represents the weight of an image transformation type, and use each element to generate a corresponding image transformation parameter as a parameter of the image transformation function; use the image transformation function to transform the reference image I f Perform the transformation operation to obtain the transformed image I t ; by I mask Control area, I t and normal image I n Fusion to obtain defect image I a ;

[0009] Multi-category feature library module, used to extract defect images I a Characteristics of Z a ; Build K defect feature libraries L k ,k=1,...,K, K is the number of image variation types, each defect feature library contains M lengths and features Z a Number of channels C l Identical eigenvector entries And all the feature vector entries in each defect feature library are orthogonal to all the feature vector entries in other libraries; calculate the feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m The maximum similarity is denoted as d k ; Based on the maximum similarity corresponding to the K feature libraries, the anomaly score d = [d1,...,d K ]; The abnormal score map is obtained by combining all the feature vectors in feature Za W l and H l is feature Z a The width and height of the k-dimensional anomaly score map Perform fusion to obtain the fusion anomaly score map

[0010] Multi-scale convolutional editing module is used to transform the feature Z a and the inverted Sa Perform pixel-by-pixel multiplication to suppress the defect area features and obtain the weighted feature Z w ; Multi-scale feature editing method is used to Z w Edit and complete it to make it a normal feature Z e ; for Z e Decode and get the reconstructed image

[0011] To minimize I n and The difference between , and minimize S t With decomposition label C t The texture surface defect detection model is trained as the target; wherein the decomposition label C t is the random code c and Gaussian defect mask I mask The result of pixel-wise multiplication and downsampling.

[0012] Furthermore, the generating of corresponding image transformation parameters using each element includes: the image transformation parameters include a base value and a degree of change, and the degree of change is controlled by a weight of the image transformation type represented by the corresponding element in the random code c.

[0013] Furthermore, the extracted defect image I a Characteristics of Z a ,include:

[0014] Extract defect image I through encoder a Characteristics of Z a ; The encoder includes 3 convolutional layers and 2 residual blocks; the convolution kernel of each convolution layer is 3x3, the step size is 1, 2, and 2 respectively, and the number of filter kernels in each layer is 16, 32, and 64 respectively; each residual block contains two convolutional layers with a convolution kernel of 3x3, a step size of 1, and a number of filter kernels of 64, and the residual blocks are connected before and after by residual jump layers.

[0015] Furthermore, the calculation feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m Similarity, including:

[0016] Feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m The distance d k,m The cosine similarity is measured as follows:

[0017]

[0018] Among them, lk,m T Indicates l k,m The transpose of , ||·||2 represents the L2 norm.

[0019] Furthermore, the multi-scale feature editing method is used to edit Z w Edit and complete it to make it a normal feature Z e ,include:

[0020] Use multiple convolutional layers with different kernel sizes to Z w Complete and get the normal editing feature Z e :

[0021] Z e =f c (Z w θ c )

[0022] in, f c (·) and θ c Represent the functions and parameters of the multi-scale convolutional layer respectively.

[0023] Furthermore, the pair Z e Decode and get the reconstructed image include:

[0024] Through the decoder Z e Decode and get the reconstructed image The decoder includes 2 residual blocks and 3 transposed convolutional layers; each residual block contains two convolutional layers with a convolution kernel of 3x3, a stride of 1, and 64 filter kernels, and the residual blocks are connected by residual skip layers; the convolution kernel of each transposed convolutional layer is 3x3, with strides of 2, 2, and 1 respectively, and the number of filter kernels in each layer is 32, 16, and 1 respectively.

[0025] In a second aspect, the present invention provides a texture surface defect detection method based on multi-category decomposition editing, comprising:

[0026] The image to be detected I d Input into the texture surface defect detection model constructed by the method for constructing a texture surface defect detection model based on multi-category decomposition editing described in the first aspect, and obtain the abnormal score map S d and reconstructed images The anomaly score map S d Upsample to get I s , and then the image to be detected I d and reconstructed image The residual image and I s Fusion is performed to obtain the detection result I r .

[0027] Furthermore, the test result I r for:

[0028]

[0029] Where 0≤λ f ≤1 is the weight parameter of the residual image, and |·| represents the absolute value operation.

[0030] In a third aspect, the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is run by a processor, it controls the device where the storage medium is located to execute the method for constructing a texture surface defect detection model based on multi-category decomposition editing as described in the first aspect and / or the method for detecting texture surface defects based on multi-category decomposition editing as described in the second aspect.

[0031] In general, the above algorithm conceived by the present invention can achieve the following beneficial effects compared with existing algorithms:

[0032] 1. The present invention uses a random combination generation module to generate a basic transformation image and a random Gaussian mask image, and fuses them to obtain a mixed defect image. By simulating complex defects through combinations of different categories, the applicability of the algorithm to various defects is improved;

[0033] 2. The present invention uses a multi-category feature library module to decompose mixed defects into basic image transformations, allowing the model to learn how to decompose the various components of the defect and obtain a universal decomposition expression, thereby reducing the difference between manufacturing defects and real defects and improving the detection accuracy of real defects;

[0034] 3. The present invention suppresses abnormal defects determined by the decomposition process by adopting a multi-scale convolution editing module, and uses background neighborhood features of different sizes to edit and replace the suppressed features, thereby suppressing abnormal features and preventing the reconstruction of defects in the reconstructed image, thereby improving the background reconstruction accuracy and the defect detection rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of a network framework for implementing the algorithm according to the present invention;

[0036] Figure 2 Schematic diagram of texture defect detection effect achieved according to the present invention; wherein the first and third rows are images to be detected, and the second and fourth rows are corresponding detection results;

[0037] Figure 3The figure is a schematic diagram of the inkjet printing defect detection effect achieved according to the present invention; wherein the first row is the image to be detected, and the second row is the corresponding detection result. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0039] Example 1

[0040] like Figure 1 As shown, the present invention proposes a method for constructing a texture surface defect detection model based on multi-category decomposition and editing. The texture surface defect detection model includes a random combination generation module, a multi-category feature library module, and a multi-scale convolution editing module. Each module is described in detail below.

[0041] (1) Random combination generation module

[0042] The random combination generation module is based on the assumption that real defects can be obtained from texture background through basic image transformation. It synthesizes artificial defect images I by mixing multiple basic image transformations. a (I a ∈R W×H×1 , W and H represent the width and height of the input image respectively), providing defect images for model training. Its generation process consists of two main parts: random generation of defect masks and defect content generation fusion.

[0043] (1-1) Randomly generate defect masks

[0044] The random defect mask generation process is used to generate Gaussian defect masks of different shapes and sizes, and randomly sample various parameters of the two-dimensional Gaussian function:

[0045]

[0046]

[0047]

[0048]

[0049] Among them, M i ∈R W×H ,x=1,...,W,y=1,...,H are coordinates, A i ,θ i 、 are the parameters of each Gaussian function, namely amplitude, angle, horizontal variance, vertical variance, central horizontal and vertical coordinates, i=1,...,N a , N a Represents the number of Gaussian functions, that is, the number of defective areas in a single image. In the present invention, W=H=256, and other parameters are randomly selected within the following range: 0.3≤A i ≤1, -90°≤θ i ≤90°, 1≤N a ≤ 3. Generate a Gaussian weight map M of random shape and size i (x,y), for each M i (x,y) is thresholded to obtain the Gaussian defect area

[0050]

[0051] in, max(·) represents the maximum value operation, T m is the cutoff threshold, which is set to 0.5 in the present invention. Gaussian defect mask I mask By combining the various Gaussian defect regions get:

[0052]

[0053] Among them, I mask ∈R W×H×1 , is obtained by integrating one or more Gaussian defect regions, so I mask Ability to simulate different shapes not limited to a single Gaussian.

[0054] It should be noted that the Gaussian defect masks I of different shapes and sizes are generated. mask There are many implementation methods, not limited to the specific implementation method introduced above.

[0055] (1-2) Defect content generation and fusion

[0056] The defect content generation fusion process is used to perform a combination of multiple basic image transformations to generate defect content. A defect-free image is randomly selected from the training set as the reference image I f , then I fPerform multiple basic image transformation combinations, for example, including bright, dark, zoom, zoom and rotate, a total of 5 types, and the random code c corresponds to this, including 5 elements: c = [c1, ..., c5], each element controls the corresponding basic image transformation. For different image background modes, the type and number of basic image transformations used can be adjusted accordingly, not limited to the above 5 transformations. In the present invention, c i Randomly select in [0,1].

[0057] After determining the random code c, I f Each basic image will be transformed in different degrees in turn to generate defect content. Taking the above five image transformation methods as an example, the transformation process is affected by the grayscale factor λ g , size factor λ s With the rotation factor λ r Control, respectively, is calculated by the following formula:

[0058]

[0059]

[0060]

[0061] Among them, each α, β and ε are parameters of the basic image transformation: α represents the minimum degree of transformation, that is, the basic value; β represents the interval of the degree of transformation, c i β represents the degree of change; ε represents the random perturbation value to prevent the single solidification of the mode; the superscripts b, d, e, n, and r represent brightness, darkness, enlargement, reduction, and rotation, respectively. In the present invention, they are set as: α b =α e =1.1,α d =α n =0.9,α r =10°;β b =β d =β e =β n =0.5,β r =50°; 0≤ε b ,ε d ,ε e ,ε n ≤0.1, 0≤ε r ≤10°. By comparing the reference image I f Perform combined image transformation of grayscale, size and rotation to obtain the transformed image I t :

[0062] I t =T(I f ;λ g ,λ s ,λr )

[0063] Among them, I f ,I t ∈R W×H×1 , T(·) represents the combined image transformation function. Finally, I mask Control area, I t and normal defect-free image I n Fusion to obtain defect image I a :

[0064] I a (x,y)=I t (x,y)·I mask (x,y)+I n (x,y)·(1-I mask (x,y))

[0065] Among them, I a ∈R W×H×1 For I n The corresponding defect images are used in the network training phase.

[0066] (2) Multi-category feature library module

[0067] The multi-category feature library module is based on the assumption that actual defects can be decomposed into several basic image transformations. a Perform basic image transformation decomposition and then output the fusion anomaly score map S a , to I a Before decomposition, the encoder is used to segment the defect position. a Encoded as latent space feature Z a :

[0068] Z a =f e (I a θ e )

[0069] in, W l , H l and C l are the width, height and number of channels of the latent space feature, which are set to 64, 64 and 16 respectively in this invention, and f e (·) and θ e They represent the encoder function and its parameters respectively.

[0070] I a Encoded as latent space feature Z a Then, the K defect feature libraries L included in the multi-category feature library module are k,k=1,...,K decomposition. Among them, each feature library corresponds to the basic image transformation type used, and both are matrices of the same size, that is, M is the capacity of each feature library, which is set to 50 in this invention. Therefore, each feature library contains M feature vector entries with the same length as the number of latent space feature channels.

[0071] For Z a Each eigenvector z in a , which is consistent with each feature entry l in each feature library k,m The distance d k,m The cosine similarity is measured as follows:

[0072]

[0073] Among them, ||·||2 represents the Euclidean norm, that is, the L2 norm. For a single feature library L k , z a The maximum value of the cosine similarity between the feature entries in the library is z a Similarity d with the library k :

[0074]

[0075] Since the feature library corresponds to each basic image transformation, the feature vector z a It is decomposed into each basic image transformation, d=[d1,...,d K ] corresponds to the abnormal score of each basic transformation. The latent space feature Z a Perform the above processing and calculation on all the eigenvectors in to obtain the basic transformation anomaly score map in Corresponding to each basis image transformation. Represents the entire score map, and is also Z a Decomposition results on each basis image transformation.

[0076] To ensure Z a To correctly decompose the image into various transformations, there must be obvious differences between the basic image transformations in the latent space, and the cosine similarity between the feature libraries must be close to -1. k With Z a are all normalized to [0,1]. Therefore, the constraints on each L k The cosine similarity between them is close to 0. The present invention adopts an orthogonal loss to force all feature entries in each defect feature library to be orthogonal to all entries in other libraries:

[0077]

[0078] Where C represents the number of combinations, P∈R 1×M is an auxiliary row vector whose elements are all 1.

[0079] By constraining the defect feature library to be orthogonal, each score graph Able to calculate independently to ensure Z a The decomposition result can be expressed as a score on each independent orthogonal dimension. The independent orthogonal dimensions represented by the mixed defect image I a Corresponding to the various components of , the present invention adopts an L2 loss as the decomposition loss to constrain the correctness of the decomposition:

[0080]

[0081] in, represents the computational expectation, To decompose the label, it is first obtained by random encoding c and Gaussian defect mask I mask Multiply by pixels:

[0082]

[0083] By Downsampling from W×H×K to W l ×H l ×K, that is, the decomposition label C is obtained t . Transform the abnormal score map of each base image Perform fusion to obtain the fusion anomaly score map S a :

[0084]

[0085] in, S t Each channel represents the composition of I a The abnormal score map of the base image transformation is fused, S a Indicates I a The fusion anomaly score map and defect area. The entire decomposition process is expressed as follows:

[0086] S a =f l (Z a θ l )

[0087] Among them, f l (·) and θ l Respectively represent the functions and parameters of the multi-category feature library module.

[0088] (3) Multi-scale convolutional editing module

[0089] The multi-scale convolution editing module edits abnormal defect features in the latent space into normal texture features, suppresses abnormal information in the input image, prevents reconstruction of defects, and thus improves the accuracy of background reconstruction.

[0090] First, use S a Position Z a The defect characteristics in Z a and the inverted S a Multiply pixel by pixel to get the weighted feature Z w :

[0091] Z w (x l ,y l ,z l )=Z a (x l ,y l ,z l )(1-S a (x l ,y l ))

[0092] in, By S a The located defect area feature is weakened to close to 0, and the weighted feature Z w Some holes are formed in Z, and then the feature editing method is used to w Edit and complete it to make it a normal feature. Specifically, the number of c Multiple convolutional layers with different kernel sizes are used to complete the normal editing feature Z e :

[0093] Z e =f c (Z w θ c )

[0094] in, f c (·) and θ c Respectively represent the function and parameters of the multi-scale convolution layer. In the present invention, N c The kernel size is set to 13×13, 9×9, and 5×5 respectively.

[0095] Through multiple convolutional layers with different kernel sizes, Z w The holes in the normal background feature are filled to obtain the normal feature Z e , thus avoiding the appearance of defective patterns in the final reconstruction results. e Decode and get the reconstructed image

[0096]

[0097] in, f d and θ d They represent the decoder function and its parameters respectively. Finally, the L2 reconstruction loss is used to constrain the entire reconstruction process:

[0098]

[0099] The network model of the texture surface defect detection algorithm based on multi-class decomposition editing is trained through a reconstruction process:

[0100]

[0101] Among them, λ1, λ2, and λ3 are weights, which are set to 1000, 1, and 10 respectively.

[0102] Example 2

[0103] After the model optimization is completed, it can be used for texture defect detection. At this time, input a real defect image I d ∈R W×H , I d The model will be reconstructed into a defect-free background image At the same time, the multi-category feature library module outputs the fusion anomaly score map S d Then S d Upsample to image size and get I s ∈R W×H , input defect image I d and reconstructed image The residual plot of I s Fusion is performed to obtain the detection result I r :

[0104]

[0105] Among them, I r ∈R W×H , 0≤λ f ≤1 is the weight parameter of the residual image, and is set to 0.7 in this patent, and |·| represents the absolute value operation. Then the fusion detection result I r Post-processing mainly includes median filtering, threshold segmentation and morphological closing operation, thereby converting it into a binary image, which is the input defect image I d The final test results. Texture defect detection effect and inkjet printing defect detection effect are as follows Figure 2 and Figure 3 shown.

[0106] Example 3

[0107] A computer-readable storage medium, comprising a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for constructing a texture surface defect detection model based on multi-category decomposition editing as described in Example 1 and / or the method for detecting texture surface defects based on multi-category decomposition editing as described in Example 2.

[0108] The relevant technical means are the same as those in Example 1 and Example 2 and will not be described in detail here.

[0109] In summary, the texture surface defect detection algorithm based on multi-category decomposition and editing proposed in the present invention adopts a random combination generation module to produce mixed defects through random combination of basic image transformations, and adds defect information in the training stage; adopts a multi-category feature library module to decompose the combined defect information into basic defect categories and judge anomalies, so that the model learns a universal decomposition expression method, thereby weakening the difference between manufactured defects and real defects, and outputs the defect segmentation result of the anomaly score map, thereby improving the defect detection rate; through the multi-scale convolution editing module, the abnormal features are converted into normal background features through convolution operations, suppressing defect reconstruction and improving the background reconstruction effect, thereby further improving the defect detection accuracy.

[0110] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for constructing a texture surface defect detection model based on multi-category decomposition editing, characterized in that: include: Build a texture surface defect detection model; wherein, the texture surface defect detection model includes: Random combination generation module, used to generate Gaussian defect masks of different shapes and sizes I mask ; Randomly select a normal image from the training set as the reference image I f ; Construct a random code c, where each element in c represents the weight of an image transformation type, and use each element to generate a corresponding image transformation parameter as a parameter of the image transformation function; use the image transformation function to transform the reference image I f Perform the transformation operation to obtain the transformed image I t ; by I mask Control area, I t and normal image I n Fusion to obtain defect image I a ; Multi-category feature library module, used to extract defect images I a Characteristics of Z a ; Build K defect feature libraries L k ,k=1,...,K, K is the number of image variation types, each defect feature library contains M lengths and features Z a Number of channels C l Identical eigenvector entries And all the feature vector entries in each defect feature library are orthogonal to all the feature vector entries in other libraries; calculate the feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m The maximum similarity is denoted as d k ; Based on the maximum similarity corresponding to the K feature libraries, the anomaly score d = [d1,...,d K ]; by feature Z a All feature vectors in the combination are combined to obtain the anomaly score map W l and H l is feature Z a The width and height of the k-dimensional anomaly score map Perform fusion to obtain the fusion anomaly score map Multi-scale convolutional editing module is used to transform the feature Z a and the inverted S a Perform pixel-by-pixel multiplication to suppress the defect area features and obtain the weighted feature Z w ; Multi-scale feature editing method is used to Z w Edit and complete it to make it a normal feature Z e ; for Z e Decode and get the reconstructed image To minimize I n and The difference between , and minimize S t With decomposition label C t The texture surface defect detection model is trained as the target; wherein the decomposition label C t is the random code c and Gaussian defect mask I mask The result of pixel-wise multiplication and downsampling.

2. The method for constructing a texture surface defect detection model based on multi-category decomposition editing according to claim 1 is characterized in that: The generating of corresponding image transformation parameters by using each element includes: the image transformation parameters include a base value and a degree of change, and the degree of change is controlled by the weight of the image transformation type represented by the corresponding element in the random code c.

3. The method for constructing a texture surface defect detection model based on multi-category decomposition editing according to claim 1, characterized in that: The extracted defect image I a Characteristics of Z a ,include: Extract defect image I through encoder a Characteristics of Z a ; The encoder includes 3 convolutional layers and 2 residual blocks; the convolution kernel of each convolution layer is 3x3, the step size is 1, 2, and 2 respectively, and the number of filter kernels in each layer is 16, 32, and 64 respectively; each residual block contains two convolutional layers with a convolution kernel of 3x3, a step size of 1, and a number of filter kernels of 64, and the residual blocks are connected before and after by residual jump layers.

4. The method for constructing a texture surface defect detection model based on multi-category decomposition editing according to claim 1, characterized in that: The calculated feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m Similarity, including: Feature Z a Each eigenvector z in a With each feature entry l in the kth feature library k,m The distance d k,m The cosine similarity is measured as follows: Among them, l k,m T Indicates l k,m The transpose of , ||·||2 represents the L2 norm.

5. The method for constructing a texture surface defect detection model based on multi-category decomposition editing according to claim 1, characterized in that: The multi-scale feature editing method is used to w Edit and complete it to make it a normal feature Z e ,include: Use multiple convolutional layers with different kernel sizes to Z w Complete and get the normal editing feature Z e : WITH e =f c (WITH w ;θ c ) in, f c (·) and θ c Represent the functions and parameters of the multi-scale convolutional layer respectively.

6. The method for constructing a texture surface defect detection model based on multi-category decomposition editing according to claim 1, characterized in that: The pair Z e Decode and get the reconstructed image include: Through the decoder Z e Decode and get the reconstructed image The decoder includes 2 residual blocks and 3 transposed convolutional layers; each residual block contains two convolutional layers with a convolution kernel of 3x3, a stride of 1, and 64 filter kernels, and the residual blocks are connected by residual skip layers; the convolution kernel of each transposed convolutional layer is 3x3, with strides of 2, 2, and 1 respectively, and the number of filter kernels in each layer is 32, 16, and 1 respectively.

7. A texture surface defect detection method based on multi-category decomposition editing, characterized in that: include: The image to be detected I d Input into the texture surface defect detection model constructed by the method for constructing a texture surface defect detection model based on multi-category decomposition editing according to any one of claims 1 to 6, and obtain the abnormal score map S d and reconstructed images The anomaly score map S d Upsample to get I s , and then the image to be detected I d and reconstructed image The residual image and I s Fusion is performed to obtain the detection result I r .

8. The texture surface defect detection method based on multi-category decomposition editing according to claim 7 is characterized in that: The test result I r for: Where 0≤λ f ≤1 is the weight parameter of the residual image, and |·| represents the absolute value operation.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for constructing a texture surface defect detection model based on multi-category decomposition editing as described in any one of claims 1 to 6 and / or the texture surface defect detection method based on multi-category decomposition editing as described in claim 7 or 8.

Citation Information

Patent Citations

  • Flange surface defect detection method, system and equipment

    CN112508939A

  • Texture surface defect detection method and system based on abnormal synthesis and decomposition

    CN112700432A