A texture surface defect detection method and system based on memory-assisted distillation network
Through the memory-assisted distillation network, a combination of teacher encoder and student decoder is used to construct memory templates and perform feature fusion, which solves the robustness and computational storage problems in complex texture surface defect detection and achieves efficient and accurate texture surface defect detection.
Patent Information
- Application Number
- CN202411366758.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Existing technologies lack robustness in detecting defects on complex textured surfaces, especially logical texture defects. They also have large computational complexity and high storage requirements, making it difficult to achieve efficient detection with limited resources.
A method based on memory-assisted distillation network is adopted. The teacher encoder is used to extract multi-scale features to construct a memory template library, and the global memory template is updated by sliding average. The student decoder is combined to perform feature fusion and distillation loss calculation to realize texture surface defect detection.
It improves the robustness and speed of texture surface defect detection, reduces the amount of calculation and storage requirements, can quickly and accurately locate defect areas in complex environments, and improves detection accuracy and efficiency.
Smart Images

Figure CN119359637B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to image processing, and more specifically, relates 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. This system monitors data from the production process in real time to promptly identify potential risks. The current complex and cumbersome industrial production process easily leads to surface defects on products. These defective products need to be detected promptly to prevent them from entering the market and ensure production line yields. Surface defects in textured products such as fabrics, leather, and OLEDs have always been a difficult detection challenge in the industry. Textured surface defects typically exhibit low contrast, complex types, variable shapes and scales, and background interference. High-precision detection of textured surface defects within the limited constraints of production lines is a challenge that needs to be addressed.
[0003] Automatic Optical Inspection (AOI) technology is widely used for 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 identify potential causes, thereby optimizing production processes and material selection, improving production line stability and product quality, and reducing production costs.
[0004] When only normal samples are available for training in the early stages of a production line, many existing algorithms rely on self-supervision to exploit or simulate the inherent connections in real data using pre-trained tasks. However, these methods can experience performance degradation or unstable predictions when faced with new or unseen data, lacking robustness and generalization. To alleviate these issues, some unsupervised methods use pre-trained networks on natural datasets to extract and store features of normal samples. During detection, the distance between the features of the test sample and those of the normal samples is calculated as an anomaly score. A higher anomaly score indicates a higher probability of defect detection. While these methods have shown some improvement in detection performance, the large number of features required during training increases the space consumed by these methods linearly with the size of the training set. Furthermore, the more features stored, the greater the computational effort required during testing, significantly limiting their detection speed. While existing unsupervised methods achieve good detection results for some common texture defects that clearly disrupt the surface structure, they struggle with some logical texture defects. The complex and unpredictable characteristics of textures and defects make robust detection of texture 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 objectives, 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 images of defect-free textured surfaces, divide the 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, and thus obtain feature templates for all batches; use a sliding average method to calculate the feature templates of all batches, and use the calculated results as the global memory template;
[0010] The global memory template is combined with the multi-scale features of each image to obtain the fused features of each image;
[0011] Construct a student decoder that takes a global memory template and fused features as input and outputs multi-scale decoding features of the fused features. Train the student decoder using the fused features and 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. 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 image processed to obtain a defect image corresponding to the texture surface image to be processed, thereby realizing defect detection of the texture surface.
[0014] Further preferably, the feature template is selected using a core set sampling method, and the formula for 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, 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, W k and H k They are respectively at the kth scale The width and length of the spatial resolution, v i and v j Already in the collection The multi-scale features in the set and the multi-scale features that need to be used to determine whether to update the set, ||·||2 is the second-order norm, It is the multi-scale feature representation after taking the mean of the core set, which is composed of all multi-scale feature space positions (x1, y1) Characteristics 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 (x2, y2) is the anomaly score map of the k-th scale with the feature vector space coordinates (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 The width and length of the (x2, y2) spatial resolution are the horizontal and vertical coordinates in the anomaly score map.
[0027] Further preferably, the anomaly score map M k The formula for (x²,y²) is as follows:
[0028]
[0029] Among them, x2 and y2 are the anomaly score map M k The horizontal and vertical coordinates on (x2,y2), is the feature of the teacher encoder at the kth scale, is the decoding feature of the student decoder at the kth scale, x1 and y1 are the horizontal and vertical coordinates of the teacher encoder and student decoder features at the kth scale, respectively, T is the transpose operation, and the coordinates (x1, y1) and the coordinates (x2, y2) correspond one to one in the geometric space position.
[0030] Further preferably, the image processing of the anomaly 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 and denoising are performed on the fused anomaly score map.
[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 executor 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. This method combines a teacher encoder and a student decoder, and utilizes multi-scale features and memory templates for auxiliary knowledge distillation. This improves the difference in the teacher encoder and student decoder's ability to detect abnormal areas at the same scale. It can quickly and accurately locate defective areas in images to be inspected, and accurately detect various texture defects in complex industrial environments using only normal samples.
[0038] 2. By first using a teacher encoder to extract memory template features from a normal sample dataset, this method selectively retains the most representative spatial structure and feature information of normal samples. The student decoder then decodes the fused features, providing explicit hierarchical global dependencies for subsequent distillation tasks. This helps the student decoder understand higher-level feature representations, effectively improving the network's ability to discriminate defects.
[0039] 3. When establishing the memory template library, the present invention uses 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, and the parameter size is equal to the single sample feature, which reduces 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 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 Schematic diagram of OLED screen defect detection effect 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 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 merely for the purpose of explaining 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.
[0047] like Figure 1 As shown in the figure, a texture surface defect detection method based on a memory-assisted distillation network is proposed. A pre-trained teacher encoder is used to extract features of the training set to construct a memory template library, and then the memory template is used to assist distillation. The method includes:
[0048] Training phase:
[0049] A. Phase I
[0050] (1) Constructing a memory template
[0051] Taking any batch of normal samples from the training set as an example, the pre-trained teacher encoder is first used to extract multi-scale features from these normal samples. Core set sampling is performed on the features at each scale. The mean of the feature vectors corresponding to each coordinate point in the spatial dimension that are far apart in the feature space and represent different decision boundary points is selected as the multi-scale feature representative of that point. This reduces the number of features while maintaining the algorithm's performance near the decision boundary. After core set sampling of each batch of samples, only one multi-scale feature is retained at each scale for that batch. This feature, composed of all representative vectors, serves as the memory template for the current batch. A global memory template for the entire training set is also recorded in a variable. After processing the first batch, the global memory template is equal to the memory template of the first batch.
[0052] In the first stage, any normal sample I in the training set n 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. In this study, W = H = 256; represents the k-th scale feature extracted, k = 1, 2, 3, and represents the number of scales of the extracted features. For example, Wide-ResNet-50 can be selected as the teacher encoder. In this case, W1 = H1 = 64, C1 = 64, W2 = H2 = 32, C2 = 128, W3 = H3 = 16, C3 = 256; f t (·) and θ t 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 all 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. In addition, the symbol To represent the multi-scale feature set of the k-th scale, W k and H k 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 and to ensure that the subsequently constructed memory template has the best feature representation capability, 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, Represents a 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 at the kth scale 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 number of core set downsampling 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 used to determine whether to update the set, C k represents the number of multi-scale feature channels; ||·||2 represents the L2 norm; Represents the multi-scale feature vector after taking the mean of the core set, which is represented by the coordinates of all multi-scale feature space positions (x1, y1) Characteristics 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 using a sliding average method until all batches of training samples are traversed, resulting in the latest global memory template for the entire training set. The global memory template has parameters equivalent to the features of individual samples, reducing computational complexity and storage space requirements. After completing the first phase of memory template construction, the second phase of memory-assisted distillation begins.
[0063] The same process is performed on all batches of samples in turn, and the global memory template of the entire dataset is updated synchronously using a sliding average method:
[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 Respectively represent the global memory template resolution width, height and number of channels; 0≤β<1 represents the decay rate, which is used to control the smoothness when updating the global memory template. The size of the β value determines the importance of the sliding average to historical data. When the β value is large, it will pay more attention to historical data and react slowly to changes in current data. Conversely, when the β value is small, it will be more sensitive to changes in current data. In this embodiment, the β value is set to 0.9; count represents the current batch count. If the number of samples 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, W f , 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 θ fRepresent the mapping function and network parameters of the feature fusion module respectively.
[0073] like Figure 3 As shown in the figure, the convolution kernel stride of the 3×3 convolution layer used in the feature fusion process is 2, and each convolution layer is followed by a pair of BatchNorm layers and ReLU activation layers. First, the first scale memory template MT1 is combined with the feature vector of the teacher encoder After performing two convolution operations after element addition, the result is the same as the feature vector of the second-scale memory template MT2 and the teacher encoder Perform element addition and convolution operations, and then add the results to the third-scale memory template MT3 and the feature vector of the teacher encoder. Perform element addition and convolution operations to obtain the initial fusion feature vector F c , and finally perform a convolution operation 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) Build a student encoder
[0075] The result of feature fusion is used as the input of the student decoder, which 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 convolutional layer of each decoding block uses an inverse residual structure. The features output by each inverse residual structure are concatenated with the template features of the corresponding scale in the memory library along the channel dimension, and then restored to the original number of channels using a 1×1 convolution. Feature fusion helps the network capture both the rich semantic information of high-level features and the specific structural and detailed information of low-level features.
[0077] The fused feature F fAs the input of the student decoder, the student decoder uses the opposite data flow and structure of 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 represents the multi-scale feature resolution width, height and number of channels output by the student decoder; f s (·) and θ s Denote 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 at 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 denotes the L2 norm. Finally, the distillation loss is calculated by integrating the anomaly score maps at all scales:
[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 k denote the resolution width and height of the anomaly score map, M k(x2,y2) is the anomaly score map at the kth scale with coordinates (x2,y2) in the feature vector space.
[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 during the training phase. For example, 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, during the test phase, a test image is input, and the teacher encoder and student decoder will output features of the same multiple scales. 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, we calculate the anomaly score maps of the outputs of the teacher encoder and the student decoder at each scale. Then, we upsample these anomaly score maps to the same size as the input image using bilinear interpolation. Next, we fuse all the anomaly score maps element-wise and use Gaussian filtering to remove noise, resulting in 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 fusion the anomaly score map I a Perform segmentation to obtain the defect detection result image I s ∈R W×H×1 In an 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 in the figure shows the test images, the second row shows the label images, and the third row shows the detection result images. As can be seen from these two figures, the texture surface defect detection method proposed in this embodiment, when trained only with normal samples, can effectively solve various texture surface defect detection challenges, 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 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 texture surface defect detection method based on memory-assisted distillation network, characterized in that: The method comprises the following steps: Offline training: Obtain multiple defect-free texture surface images, divide the multiple images into multiple batches, use the teacher encoder to extract the multi-scale features of each image in each batch, and select multiple multi-scale features from the multi-scale features of each batch as feature templates. 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 combined with the multi-scale features of each image to obtain the fused features of each image; Construct a student decoder that takes a global memory template and fused features as input and outputs multi-scale decoding features of the fused features. Train the student decoder using the fused features and 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. When the preset total number of training times is reached, the corresponding student decoder is the optimal student decoder. Online detection: Inputting the texture surface image to be processed into the teacher encoder and the optimal student decoder respectively, obtaining multi-scale features and multi-scale decoding features corresponding to the texture surface image to be processed, calculating an anomaly score map using the difference between the multi-scale features and the multi-scale decoding features, and performing image processing on the anomaly score map to obtain a defect image corresponding to the texture surface image to be processed, thereby realizing defect detection on the texture surface; The feature template is selected using a core set sampling method, and the formula for the core set sampling is as follows: in, , They are the first and second samples before and after core set sampling. The feature set of the scale, It is in In the spatial dimension of the scale, the coordinates after core set sampling are A collection of multi-scale features, and Already in the collection The multi-scale features in and the multi-scale features that need to be used to determine whether to update the set, is the second-order norm, It is the multi-scale feature representation after taking the mean of the core set, which is composed of all the multi-scale feature space positions. of Characteristics of the composition As the feature template of the current batch; The calculation formula of the global memory template is as follows: in, and They are two adjacent batches Global memory template at scale, is the decay rate, is the current batch count, is a feature template; The anomaly score map The formula is as follows: in, and Anomaly score maps The horizontal and vertical coordinates on Is the teacher coder in the Features at scale, The student decoder is Decoding features at different scales, and In the The horizontal and vertical coordinates of the teacher encoder and student decoder features under different scales, is the transpose operation, the coordinates and coordinates There is a one-to-one correspondence in geometric space positions.
2. 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.
3. 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.
4. The texture surface defect detection method based on memory-assisted distillation network according to claim 3, characterized in that: The distillation loss function is as follows: in, The coordinates of the eigenvector space are No. The anomaly score map of the scale, L is the distillation loss function, is the total number of feature scales distilled, and They are Downscale The width and length of the spatial resolution are the horizontal and vertical coordinates in the anomaly score map.
5. 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 performed 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.
6. The texture surface defect detection method based on memory-assisted distillation network according to claim 5, characterized in that: After obtaining the fused anomaly score map, the fused anomaly score map is subjected to Gaussian filtering and denoising.
7. The texture surface defect detection system based on memory-assisted distillation network according to claim 1, characterized in that: The system includes an actuator for executing the texture surface defect detection method based on a memory-assisted distillation network as described in any one of claims 1-6.
Citation Information
Patent Citations
Expressway foreign matter recognition method and system based on deep learning target detection
CN112560693A
Self-supervised industrial defect detection method based on prototype memory guidance
CN118196051A