Texture surface defect detection method and system based on memory assisted distillation network

By adopting memory -assisted distillation networks in the surface defect detection of texture, combined with teacher encoders and student decoders, using multi -scale characteristics and memory templates for assistance knowledge distillation, solving the problem of complex texture surface defect detection, realized efficient, robust snacks The detection effect.

CN119359637AActive Publication Date: 2025-01-24HUAZHONG UNIV OF SCI & TECH
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411366758.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-24
Estimated Expiration
2044-09-29

Smart Images

  • Figure CN119359637A_ABST
    Figure CN119359637A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field related to image processing, and discloses a texture surface defect detection method and system based on a memory assisted distillation network. The method comprises the following steps: acquiring a plurality of to-be-processed sample defect-free images, and acquiring multi-scale features and a global memory template of each image; performing feature fusion on the global memory template and the multi-scale features of each image to form fused features; decoding the fusion features by using the student decoders to obtain multi-scale decoding features, and training to obtain an optimal student decoder; and respectively inputting the to-be-processed image into a teacher encoder and an optimal student decoder to obtain a multi-scale feature and a multi-scale decoding feature, calculating an abnormal score graph and carrying out image processing to realize defect detection. According to the invention, various texture defects in a complex industrial environment can be accurately detected under the condition that only normal samples are used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field related to image processing, and more specifically, to a texture surface defect detection method and system based on a memory-assisted distillation network. Background Art

[0002] Industrialized production requires the establishment of an effective quality monitoring and early warning system to promptly detect potential risks through real-time monitoring of data during the production process. The current complex and cumbersome industrial production process easily leads to defects on the product surface. These defective products need to be detected in a timely manner to avoid entering the market and ensure the yield rate of the production line. Surface defects of textured products such as fabrics, leather, and OLEDs have always been a difficult detection problem in the industry. Textured surface defects usually have the characteristics of low contrast, complex types, variable shapes and scales, and background interference. How to use the limited conditions of the production line to achieve high-precision detection of textured surface defects is a problem that needs to be solved.

[0003] Automatic Optical Inspection (AOI) technology is widely used in quality inspection on industrial production lines due to its advantages of non-contact, high speed and high precision. The theoretical basis of AOI technology comes from machine vision. The inspection process mainly includes four steps: visual imaging, positioning of the region of interest (ROI), algorithm processing, and post-processing. The most critical of these is the algorithm processing stage, which involves three modules: computing platform, detection algorithm, and control interface. Among them, the texture surface defect detection algorithm can detect defective products and assist production line staff in in-depth analysis of defective samples to find out potential causes, thereby optimizing production processes and material selection, improving the stability of the production line and product quality, and reducing production costs.

[0004] In the early stage of the production line, when only normal samples can be collected for training, many existing algorithms use the previous tasks to mine or simulate the internal connections of real data based on self-supervision. When these methods face new or unseen data, they may experience performance degradation or unstable prediction results, and lack good robustness and generalization. In order to alleviate the above problems, some unsupervised methods introduce pre-trained networks on natural data sets to extract and store the features of normal samples, and then calculate the distance between the features of the tested samples and the features of normal samples as the anomaly score during detection. The larger the anomaly score, the more likely it is to be judged as a defect. Although the detection effect of this type of method has been improved to a certain extent, due to the need to store a large number of features in the training stage, the space occupied grows linearly with the size of the training set, and the more features are stored, the greater the amount of calculation during testing, which greatly limits the detection speed of this type of method. Although the existing unsupervised methods have good detection effects on some common defects with obvious structural damage on the surface of the texture, they are helpless against some logical texture defects. The complex and unpredictable textures and defects make the robust detection of texture surface defects extremely challenging. Therefore, in order to promote the improvement of production processes and increase the yield rate, it is necessary to propose a robust texture surface defect detection algorithm that can achieve excellent detection results in the face of complex and changeable production environments and texture surface defects. Summary of the invention

[0005] In response to the above defects or improvement needs of the prior art, the present invention provides a texture surface defect detection method and system based on a memory-assisted distillation network to solve the problem that complex textures and defects are difficult to detect.

[0006] To achieve the above object, according to one aspect of the present invention, a texture surface defect detection method based on a memory-assisted distillation network is provided, the method comprising the following steps:

[0007] Offline training:

[0008] Offline training:

[0009] Acquire multiple defect-free texture surface images, divide the multiple images into multiple batches, use a teacher encoder to extract multi-scale features of each image in each batch, select multiple multi-scale features from the multi-scale features of each batch as feature templates, so as to obtain feature templates of all batches; use a sliding average method to calculate the feature templates of all batches, and use the calculation results as global memory templates;

[0010] The global memory template is subjected to feature fusion with the multi-scale features of each image to obtain the fusion features of each image;

[0011] Construct a student decoder with a global memory template and fusion features as input and multi-scale decoding features of the fusion features as output, train the student decoder using the fusion features and the global memory template of each image, set the total number of training times and the learning rate, calculate the distillation loss function between the multi-scale features and the multi-scale decoding features of each image, reduce the distillation loss function by adjusting the parameters in the student decoder, and when the preset total number of training times is reached, the corresponding student decoder is the optimal student decoder;

[0012] Online detection:

[0013] The texture surface image to be processed is input into the teacher encoder and the optimal student decoder respectively, and the multi-scale features and multi-scale decoding features corresponding to the texture surface image to be processed are obtained. The anomaly score map is calculated using the difference between the multi-scale features and the multi-scale decoding features. The anomaly score map is processed to obtain a defect image corresponding to the texture surface image to be processed, so as to realize defect detection of the texture surface.

[0014] Further preferably, the feature template is selected by a core set sampling method, and the formula of the core set sampling is as follows:

[0015]

[0016]

[0017] in, are the feature sets of the kth scale before and after core set sampling, is in the spatial dimension of the kth scale, and the coordinates after core set sampling are (x 1 ,y 1 ), a collection of multi-scale features, W k and H k They are respectively The width and length of the spatial resolution, v i and v j They are already in the collection The multi-scale features in the set and the multi-scale features that need to be judged whether to be used to update the set, ||·|| 2 is the second-order norm, is the multi-scale feature representation after taking the mean of the core set, which is composed of all multi-scale feature space positions (x 1 ,y 1 )of Features of the composition As the feature template of the current batch.

[0018] Further preferably, the calculation formula of the global memory template is as follows:

[0019]

[0020]

[0021] in, and are the global memory templates at the kth scale of two adjacent batches, β is the decay rate, count is the current batch count, is a feature template.

[0022] Further preferably, the feature fusion is performed using a convolutional neural network, which includes N*N convolutional layers, where N is the number of encoders in the teacher encoder.

[0023] Further preferably, the structure of the student decoder is symmetrical to that of the teacher encoder, and the number of decoding blocks included in the student decoder is the same as the number of encoding blocks included in the teacher encoder.

[0024] Further preferably, the distillation loss function is as follows:

[0025]

[0026] Among them, M k (x 2 ,y 2 ) is the eigenvector space coordinate (x 2 ,y 2 ), L is the distillation loss function, K is the total number of feature scales distilled, and W k and H k They are M at the kth scale. k (x 2 ,y 2 )The width and length of the spatial resolution are the horizontal and vertical axes in the anomaly score map.

[0027] Further preferably, the anomaly score map M k (x 2 ,y 2 ) is as follows:

[0028]

[0029] Among them, x 2 and 2 They are the anomaly score maps M k (x 2 ,y 2 ) on the horizontal and vertical axes, is the feature of the teacher encoder at the kth scale, is the decoding feature of the student decoder at the kth scale, x 1 and 1 are the horizontal and vertical coordinates of the features of the teacher encoder and student decoder at the kth scale, respectively. T is the transposition operation. The coordinates (x 1 ,y 1 ) and coordinates (x 2 ,y 2 ) have one-to-one correspondence in geometric space positions.

[0030] Further preferably, the image processing of the abnormal score map is performed according to the following steps:

[0031] Interpolating the anomaly score map to form a new anomaly score map of the same size as the image to be processed;

[0032] Add the new anomaly score maps at each scale to obtain the fused anomaly score map;

[0033] The fused anomaly score map is normalized and then threshold segmented. Pixel values ​​greater than or equal to the preset threshold are set to white, otherwise the pixel values ​​are set to black. The white area corresponds to the defect area.

[0034] Further preferably, after obtaining the fused anomaly score map, Gaussian filtering is performed on the fused anomaly score map to denoise.

[0035] According to another aspect of the present invention, a texture surface defect detection system based on a memory-assisted distillation network is provided, characterized in that the system includes an actuator for executing the above-mentioned texture surface defect detection method based on a memory-assisted distillation network.

[0036] In general, the above technical solutions conceived by the present invention have the following beneficial effects compared with the prior art:

[0037] 1. The present invention combines a teacher encoder and a student decoder, and uses multi-scale features and memory templates to assist knowledge distillation, thereby improving the difference in the detection capabilities of the teacher encoder and the student decoder for abnormal areas at the same scale, and can quickly and accurately locate the defective areas in the image to be detected, and accurately detect various texture defects in complex industrial environments using only normal samples;

[0038] 2. The present invention can selectively retain the most representative normal sample spatial structure and feature information by first using the teacher encoder to extract the memory template features of the normal sample data set. The student decoder decodes the fused features, provides an explicit hierarchical global dependency relationship for subsequent distillation tasks, and assists the student decoder in understanding higher-level feature representations, thereby effectively improving the network's ability to discriminate defects.

[0039] 3. When establishing the memory template library, the present invention adopts a sliding average method to update the global memory template until all batches of training samples are traversed to obtain the latest global memory template of the entire training set. Therefore, only the most representative memory template at each scale needs to be stored, which is equal to the single sample feature in parameter size, reducing the amount of calculation and storage space requirements.

[0040] 4. The present invention proposes a novel feature fusion method to integrate the features output by the teacher network with the template features of the memory library at multiple scales, which helps the network to simultaneously capture the rich semantic information of high-level features and the specific structure and detail information of low-level features. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a schematic diagram of an overall network model constructed according to a preferred embodiment of the present invention;

[0042] Figure 2 It is a schematic diagram of a detection process constructed according to a preferred embodiment of the present invention;

[0043] Figure 3 is a schematic diagram of a feature fusion method constructed according to a preferred embodiment of the present invention;

[0044] Figure 4 It is a schematic diagram of the defect detection effect of an OLED screen constructed according to a preferred embodiment of the present invention;

[0045] Figure 5 It is a schematic diagram of the defect detection effect of the texture data set constructed according to the preferred embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain 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 can be combined with each other as long as they do not conflict with each other.

[0047] like Figure 1 As shown, a texture surface defect detection method based on a memory-assisted distillation network uses a pre-trained teacher encoder to extract features of a training set to construct a memory template library, and then implements it through memory template-assisted distillation, including:

[0048] Training phase:

[0049] A. Phase I

[0050] (1) Constructing a memory template

[0051] Taking any batch of normal samples in the training set as an example, the pre-trained teacher encoder is first used to extract the multi-scale features of these normal samples. The features of each scale are sampled by core set, and the mean of the feature vectors corresponding to each coordinate point in the spatial dimension that are far away in the feature space and represent different decision boundary points are selected as the multi-scale feature representative of the point, thereby reducing the number of features while maintaining the performance of the algorithm near the decision boundary. After core set sampling is used for each batch of samples, only one multi-scale feature will be retained at each scale for the batch, and the feature is composed of all representative vectors as the memory template of the current batch, and a variable is used to record the global memory template of the entire training set. After the first batch is processed, the global memory template is equal to the memory template of the first batch.

[0052] In the first stage, take any normal sample I in the training set n Taking as an example, we first use the pre-trained teacher encoder to extract multi-scale normal features:

[0053]

[0054] Among them, I n ∈R W×H×3 , W and H represent the width and height of the input image respectively, the number of image channels is 3, and in this study W=H=256; represents the k-th scale feature extracted, k = 1, 2, 3, indicating the number of scales of extracted features. For example, Wide-ResNet-50 can be selected as the teacher encoder. In this case, W 1 =H 1 =64, C 1 =64,W 2 =H 2 =32, C 2 =128,W 3 =H 3 =16, C 3 =256; f t (·) and θ t They represent the mapping function and network parameters of the teacher network encoder respectively.

[0055] The batch size in the training phase is represented by symbol B. After processing all images in a batch, B multi-scale feature vectors will be obtained at three scales. For the convenience of representation, the present invention exemplarily sets the number of training set samples to be divisible by the batch size. If it is not divisible, it is rounded up. To represent the multi-scale feature set of the k-th scale, W k and Hk Respectively represent the multi-scale feature resolution width and height, C k The number of channels representing the resolution of multi-scale features.

[0056] In order to reduce the number of features while maintaining the performance of the algorithm near the decision boundary, so that the memory template constructed later has the best feature representation ability, core set sampling is used within each feature set at each scale to calculate the multi-scale feature representation of the decision boundary point:

[0057]

[0058]

[0059] in, are the feature sets of the kth scale before and after core set sampling, It represents the set of multi-scale features with coordinates (x, y) after core set sampling in the spatial dimension of the kth scale. x=1,...,W k ,y=1,...,H k , and W k , H k and C k They are respectively The width, length and number of channels of the spatial resolution. In the embodiment, the core set sampling rate is set to 0.1, so the core set downsampling number Respectively indicate that they are already in the collection The multi-scale features in the set and the multi-scale features that need to be judged whether to be used to update the set, C k represents the number of multi-scale feature channels; ||·|| 2 Indicates L 2 norm; It represents the multi-scale feature vector after taking the mean of the core set, which is represented by all the multi-scale feature space positions (x 1 ,y 1 ) coordinates Features of the composition As the feature template of the current batch. In particular, when the processing of the first batch is completed, the global memory template is equal to the feature template of the first batch.

[0060] The same operation is performed on all batches of samples to obtain the feature templates of each batch.

[0061] (2) Constructing a global memory template

[0062] The global memory template is updated by sliding average until all batches of training samples are traversed to obtain the latest global memory template of the entire training set. The parameter size of the global memory template is equal to that of a single sample feature, which reduces the amount of calculation and storage space required. After completing the construction of the first stage memory template, the second stage is entered for memory-assisted distillation.

[0063] Perform the same process on all batches of samples in turn, and simultaneously use the sliding average method to update the global memory template of the entire dataset:

[0064]

[0065]

[0066] in, They represent the global memory templates of two adjacent batches at the kth scale, W k , H k and C k They represent the resolution width, height and number of channels of the global memory template respectively; 0≤β<1 represents the attenuation rate, which is used to control the smoothness when updating the global memory template. The value of β determines the importance of the sliding average to the historical data. When the value of β is large, it will pay more attention to the historical data and react slowly to the changes of the current data. On the contrary, when the value of β is small, it will be more sensitive to the changes of the current data. In the embodiment, the value of β is set to 0.9; count represents the current batch count. If the number of samples contained in the training set is N, then After traversing all the training set data using the teacher network, the latest global memory template can be obtained

[0067] B. Phase II

[0068] (1) Feature Fusion

[0069] The teacher encoder first encodes multi-scale features for each training sample, and then fuses these multi-scale features with the memory template features obtained in the previous stage, which is called feature fusion.

[0070] In the memory-assisted distillation stage, any image in the training set is encoded to obtain multi-scale features. like Figure 3 As shown, the present invention integrates the features output by the teacher encoder with the template features of the memory library at multiple scales:

[0071]

[0072] in, represents the fusion feature. In this study, Wf , H f and C f Respectively represent the fusion feature resolution width, height and number of channels, W f =H f =8, C f =512; f f (·) and θ f They represent the mapping function and network parameters of the feature fusion module respectively.

[0073] like Figure 3 As shown in Figure 2, the convolution kernel stride of the 3×3 convolutional layer used in the feature fusion process is 2, and each convolutional layer is followed by a pair of BatchNorm layers and ReLU activation layers. First, the memory template MT of the first scale 1 The feature vector of the teacher encoder After adding the elements, two convolution operations are performed. The result is the same as the memory template MT of the second scale. 2 The feature vector of the teacher encoder Perform element addition and convolution operations, and then compare the results with the memory template MT of the third scale 3 The feature vector of the teacher encoder Perform element addition and convolution operations to obtain the initial fusion feature vector F c Finally, a convolution operation is performed to obtain the final fusion feature F f The multi-scale feature fusion method helps the network capture the rich semantic information of high-level features and the specific structure and detail information of low-level features at the same time.

[0074] (2) Constructing a student encoder

[0075] The result of feature fusion is used as the input of the student decoder, and the student decoder decodes the fused features. During this process, the template features of the corresponding scale in the memory library are concatenated with the intermediate features of the student decoder according to the channel dimension as the input before decoding. The student decoder finally outputs features of the same scale as the teacher encoder and calculates the cosine similarity between the output features of the two at each scale as the distillation loss.

[0076] In one embodiment of the present invention, the student decoder includes three decoding blocks, the first convolution layer of each decoding block adopts an inverse residual structure, and the features output by each inverse residual structure are concatenated with the template features of the corresponding scale of the memory library in the channel dimension, and then restored to the original number of channels using a 1×1 convolution. Feature fusion helps the network capture the rich semantic information of high-level features and the specific structure and detail information of low-level features at the same time.

[0077] The fused feature F fAs the input of the student decoder, the student decoder uses the opposite data flow and structure as the teacher encoder for decoding. The structure of the student decoder is symmetrical with that of the teacher encoder, and the number of decoding blocks contained in the student decoder is the same as the number of encoding blocks contained in the teacher encoder. In one embodiment of the present invention, the student decoder includes three decoding blocks, and its structure is symmetrical with the encoding structure of Wide-ResNet-50, except that the first convolution layer of each decoding block adopts an inverse residual structure. In addition, the features output by each inverse residual structure will be spliced ​​with the template features of the corresponding scale in the memory library in the channel dimension, and then restored to the original number of channels using a 1×1 convolution. With the assistance of the memory feature template, the student decoder decodes the fused feature output with the corresponding multi-scale features:

[0078]

[0079] in, represents the multi-scale features output by the student decoder, W f , H f and C f They represent the multi-scale feature resolution width, height and number of channels output by the student decoder respectively; f s (·) and θ s Represent the mapping function and network parameters of the student decoder respectively. Then, the cosine similarity is used to calculate the similarity distance between the output features of the teacher encoder and the student decoder at each scale:

[0080]

[0081] in, Represents the anomaly score map of the kth scale. The larger the pixel value, the greater the difference between the output of the teacher encoder and the student decoder at that pixel position; x=1,...,W k ,y=1,...,H k , represents the coordinates of the feature in the spatial dimension, W k and H k denote the resolution width and height of the anomaly score map, respectively; ||·|| 2 Indicates L 2 Finally, the anomaly score maps at all scales are combined to calculate the distillation loss:

[0082]

[0083] Among them, L and L k They represent the overall distillation loss and the distillation loss of each scale respectively; K represents the number of feature scales to be distilled, which is set to 3 in this example, and W k and H kdenote the resolution width and height of the anomaly score map, M k (x 2 ,y 2 ) is the eigenvector space coordinate (x 2 ,y 2 )’s k-th scale anomaly score map.

[0084] The memory-assisted distillation stage introduces the memory template features of normal samples, which can not only consolidate the student decoder's ability to learn the normal patterns output by the teacher encoder during the training stage, but also in the testing stage, if the sample to be tested is a defective sample, the memory template features have representative normal information that can further enhance the network's sensitivity to defects; if the sample to be tested is a normal sample, since the memory template features are homologous to the output features of the teacher encoder, they will alleviate the difference between the outputs of the teacher encoder and the student decoder, thereby reducing over-detection.

[0085] In one embodiment of the present invention, the Adam optimizer is used to update parameters in the training phase. Exemplarily, the learning rate is set to 0.005, the batch size is set to 8, and the total number of training epochs is set to 300.

[0086] Testing phase:

[0087] like Figure 2 As shown in the figure, in the test phase, a test image is input, and the teacher encoder and student decoder will output features of the same multi-scale. At this time, the feature difference between the two at each scale is calculated and converted into an anomaly score map. All anomaly score maps are sampled to the same size as the input image, and then element-by-element addition or multiplication is performed to obtain the detection result.

[0088] like Figure 2 As shown, in the test phase, in order to make the visualization effect more intuitive, the figure shows the heat map or binary map after normalization and multiplication of all pixels by 255. Figure 1 The memory template obtained in the first stage and the network structure in the second stage. Input a test image I d , first calculate the anomaly score maps of the output of the teacher encoder and the student decoder at each scale. Then, these anomaly score maps are upsampled to the same size as the input image using bilinear interpolation. Next, all anomaly score maps are fused by element-by-element addition, and Gaussian filtering is used to remove noise to obtain the fused anomaly score map:

[0089]

[0090] Among them, I a ∈R W×H×1 , represents the fused anomaly score map of three scales; represents Gaussian filtering operation; Represents a bilinear interpolation upsampling operation; represents the anomaly score map of the kth scale, W and H represent the width and height of the image to be tested. Finally, a threshold is used to fused the anomaly score map I a Segmentation is performed to obtain the defect detection result image I s ∈R W×H×1 In the embodiment, the segmentation threshold is set to 0.5, and each pixel of the normalized detection result image is compared with 0.5. Pixels greater than 0.5 are set to 255 (defects), and pixels less than 0.5 are set to 0.

[0091] The detection method provided in this embodiment is used to detect the mobile phone screen on the OLED production line. Figure 4 As shown in Figure 2, the detection effect of various texture surface defects is as follows: Figure 5 As shown, Figure 4 and Figure 5 The first row is the test image, the second row is the label image, and the third row is the detection result image. It can be seen from the two figures that the texture surface defect detection method proposed in this embodiment can effectively solve various texture surface defect detection problems when only normal samples are used for training, thereby ensuring the yield rate of the production line and improving production efficiency and stability.

[0092] It will be easily understood by those skilled in the art that the above description is only 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 protection scope of the present invention.

Claims

1. A texture surface defect detection method based on memory-assisted distillation network, characterized in that: The method comprises the following steps: Offline training: A plurality of defect-free texture surface images are obtained, and the plurality of images are divided into a plurality of batches. A teacher encoder is used to extract multi-scale features of each image in each batch, and a plurality of multi-scale features are selected as feature templates from the multi-scale features of each batch. In this way, the feature templates of all batches are obtained; the feature templates of all batches are calculated using the sliding average method, and the calculation results are used as the global memory template; The global memory template is subjected to feature fusion with the multi-scale features of each image to obtain the fusion features of each image; Construct a student decoder with a global memory template and fusion features as input and multi-scale decoding features of the fusion features as output, train the student decoder using the fusion features and the global memory template of each image, set the total number of training times and the learning rate, calculate the distillation loss function between the multi-scale features and the multi-scale decoding features of each image, reduce the distillation loss function by adjusting the parameters in the student decoder, and when the preset total number of training times is reached, the corresponding student decoder is the optimal student decoder; Online detection: The texture surface image to be processed is input into the teacher encoder and the optimal student decoder respectively, and the multi-scale features and multi-scale decoding features corresponding to the texture surface image to be processed are obtained. The anomaly score map is calculated using the difference between the multi-scale features and the multi-scale decoding features. The anomaly score map is processed to obtain a defect image corresponding to the texture surface image to be processed, so as to realize defect detection of the texture surface.

2. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The feature template is selected by core set sampling method, and the formula of core set sampling is as follows: Among them, F b k , F c k are the feature sets of the kth scale before and after core set sampling, It is a set of multi-scale features with coordinates (x1, y1) after core set sampling in the spatial dimension of the k-th scale. Wk and Hk are the F c k (x1,y1) The width and length of the spatial resolution, v i and v j They are already in the set {F c k (x1,y1)} and the multi-scale features that need to be used to determine whether to update the set, ||·||2 is the second-order norm, F k * (x1, y1) is the multi-scale feature representation after taking the mean of the core set, which is composed of the F of all multi-scale feature space positions (x1, y1) k * The feature F formed by (x1,y1) k * As the feature template of the current batch.

3. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The calculation formula of the global memory template is as follows: in, and are the global memory templates at the kth scale of two adjacent batches, β is the decay rate, count is the current batch count, and F k * is a feature template.

4. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The feature fusion is performed using a convolutional neural network, which includes N*N convolutional layers, where N is the number of encoders in the teacher encoder.

5. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The structure of the student decoder is symmetrical to that of the teacher encoder, and the number of decoding blocks included in the student decoder is the same as the number of encoding blocks included in the teacher encoder.

6. The texture surface defect detection method based on memory-assisted distillation network according to claim 5, characterized in that: The distillation loss function is as follows: Among them, M k (x2, y2) is the anomaly score map of the kth scale with coordinates in the feature vector space (x2, y2), L is the distillation loss function, K is the total number of feature scales distilled, and W k and H k They are M at the kth scale. k (x2, y2) The width and length of the spatial resolution are the horizontal and vertical coordinates in the anomaly score map.

7. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The anomaly score map M k The formula for (x2,y2) is as follows: Among them, x2 and y2 are the anomaly score map M k The horizontal and vertical coordinates on (x2, y2), F t k (x1,y1) is the feature of the teacher encoder at the kth scale, F s k (x1, y1) is the decoding feature of the student decoder at the kth scale. x1 and y1 are the horizontal and vertical coordinates of the features of the teacher encoder and the student decoder at the kth scale, respectively. T is the transpose operation. The coordinates (x1, y1) and (x2, y2) correspond one to one in the geometric space position.

8. The texture surface defect detection method based on memory-assisted distillation network according to claim 1, characterized in that: The image processing of the anomaly score map is carried out according to the following steps: Interpolating the anomaly score map to form a new anomaly score map of the same size as the image to be processed; Add the new anomaly score maps at each scale to obtain the fused anomaly score map; The fused anomaly score map is normalized and then threshold segmented. Pixel values ​​greater than or equal to the preset threshold are set to white, otherwise the pixel values ​​are set to black. The white area corresponds to the defect area.

9. The texture surface defect detection method based on memory-assisted distillation network according to claim 8, characterized in that: After obtaining the fused anomaly score map, Gaussian filtering is performed on the fused anomaly score map to denoise it.

10. The texture surface defect detection system based on memory-assisted distillation network according to claim 1, characterized in that: The system includes an actuator, which is used to execute the texture surface defect detection method based on a memory-assisted distillation network as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Expressway foreign matter recognition method and system based on deep learning target detection

    CN112560693A

  • Defect detection method and device based on multi-scale characteristic distillation and medium

    CN113962928A

  • Knowledge distillation anomaly detection method based on U-shaped student network

    CN115471645A

  • Abnormity detection method and system for esophageal endoscope image, medium and equipment

    CN116091446A

  • Real-time depth estimation method based on semantics and multi-scale information

    CN116596983A