Construction Method and Application of Surface Defect Detection Model for Novel OLED Display Devices

By constructing an unsupervised surface defect detection model for novel OLED display devices, combining a pre-trained network and Gaussian random sampling to generate abnormal samples, and employing latent space feature contrast separation and multi-scale feature fusion, the problems of insufficient efficiency and robustness in surface defect detection of novel OLED display devices are solved, and high-precision defect detection is achieved.

CN115619743BActive Publication Date: 2025-10-31HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211287562.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-10-31
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

Existing technologies for surface defect detection in novel OLED display devices suffer from insufficient efficiency and robustness, especially when sample data is unbalanced, making it difficult to achieve high-precision defect detection.

Method used

An unsupervised surface defect detection model for novel OLED display devices is adopted. By combining a contrast separation module and a fusion segmentation module, abnormal samples are generated using prior weight information provided by a pre-trained network and Gaussian random sampling. Feature extraction and difference calculation are performed to construct a latent space feature contrast separation mechanism. An improved self-attention module is introduced to perform multi-scale feature fusion and generate an adversarial mechanism to improve detection accuracy and robustness.

Benefits of technology

It improves the accuracy and robustness of surface defect detection in novel OLED display devices, reduces the over-detection rate, enhances the network's ability to separate textured and defective regions, and improves detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115619743B_ABST
    Figure CN115619743B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of image processing, specifically relating to the construction method and application of a surface defect detection model for novel OLED display devices. The model includes a contrast separation module and a fusion segmentation module. During the training phase, abnormal samples are first generated. Then, the contrast separation module learns to separate textured background images and defect foreground images from the abnormal samples through latent space feature comparison. Finally, the fusion segmentation module takes paired textured background images and artificial abnormal samples as input, and performs multi-scale feature fusion during the encoding phase to aggregate low-dimensional structural information and high-dimensional semantic information. Its overall structure, together with the contrast separation module, forms a generative adversarial mode, outputting pixel-level segmentation results while improving the detection performance of both the contrast separation module and itself. During the testing phase, the defect foreground image generated by the contrast separation module is fused with the defect segmentation image generated by the fusion segmentation module to obtain the detection result. The detection model of this invention exhibits good robustness and high-precision detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, and more specifically, relates to a method for constructing a surface defect detection model for novel OLED display devices and its application. Background Technology

[0002] In the industrial manufacturing sector, many production lines inevitably produce defective products that have serious flaws or fail to meet factory standards during the production process. Examples include scratches on wood surfaces, stains on textiles, bumps on leather, cracks on ceramic products, and defects on the surfaces of various widely used new display devices (such as OLED and TFT-LCD). The causes of these defects include, but are not limited to, differences in the quality and type of raw materials used in the production line, the stability of the production equipment, and complex production processes. These defects typically manifest as irregular brightness variations or damage to the texture structure in localized areas, collectively referred to as surface texture defects. These defects not only severely impact production efficiency but also reduce the visual experience for consumers. To promote improvements in production processes and increase yield rates, surface texture defect detection has become an indispensable part of industrial production.

[0003] Currently, the traditional method of identifying defects by human observation is gradually being replaced by modern automated optical inspection (AOI) equipment, which boasts advantages such as non-contact operation, high speed, and high precision. The core of AOI inspection equipment is typically a built-in defect detection algorithm, and the quality of the algorithm directly determines the equipment's inspection performance. Due to the complex manufacturing processes of new display devices such as OLEDs, surface defects often exhibit characteristics such as irregular shape, varying size, irregular brightness variations, low contrast, and unknown types. Furthermore, the number of defective products generated during production is usually very small compared to good products. This imbalance in sample data undoubtedly poses a significant challenge to collecting a large number of abnormal samples for training the detection algorithm network in a short period. These difficulties mean that the problem of achieving efficient and high-precision surface defect detection for new OLED display devices in the industrial field remains to be solved.

[0004] In recent years, with the rapid development of computer technology, the scale of data has grown rapidly, the amount of computation and computational efficiency have increased, and algorithms are constantly being innovated. Deep learning, due to its outstanding performance advantages in the field of computer vision, has gradually been applied to the detection of surface defects in display devices in industrial scenarios. Currently, the mainstream algorithms are divided into two categories: supervised algorithms and unsupervised algorithms. Supervised algorithms are suitable for situations where the defect type is known and the type is singular. However, these methods not only require the collection of a large number of abnormal samples, but also require a long time and expensive manual annotation costs, resulting in significant shortcomings in generalization and applicability. Unsupervised algorithms do not require the collection of abnormal samples. The current mainstream approach is to train the reconstruction network by artificially creating defect samples and using the reconstruction residual based on texture background reconstruction for defect detection. This method can save annotation costs and has achieved good results in industrial scenarios with extremely imbalanced samples. However, this method is highly dependent on reconstruction accuracy, which can easily lead to missed detections and overdetections, resulting in poor robustness.

[0005] Therefore, it is necessary to propose an unsupervised surface defect detection algorithm for novel OLED display devices that is applicable to various scenarios and has good robustness, efficiency and excellent detection performance. Summary of the Invention

[0006] In view of the shortcomings of existing technologies and the need for improvement, this invention provides an unsupervised surface defect detection algorithm for novel OLED display devices with good robustness and high-precision detection performance.

[0007] To achieve the above objectives, according to one aspect of the present invention, a method for constructing a surface defect detection model for a novel OLED display device is provided. The detection model is divided into two parts: a contrast separation module and a fusion segmentation module. The contrast separation module includes a first encoder, a texture decoding module, and a defect decoding module. The following steps are performed to achieve training:

[0008] Gaussian random sampling is used to generate a mask image, and abnormal samples are generated by combining the mask image and normal samples. A pre-trained network is used to extract features from each normal sample and its corresponding abnormal sample to calculate the difference between the feature vectors of the two in each channel dimension. Based on the mask image, the difference set corresponding to the defect foreground region and texture background region in each abnormal sample is obtained as the prior weight information for feature comparison.

[0009] Each anomalous sample is encoded using a first encoder to obtain encoded features. These features are then input into a texture decoding module and a defect decoding module, resulting in a texture background image and a defect foreground image. A fusion segmentation module encodes, fuses, and decodes the texture background image and its corresponding anomalous sample, outputting the corresponding defect segmentation result. Combining the prior weight information of each anomalous sample, the feature contrast loss between the defect foreground and texture background in the corresponding encoded features is calculated to guide parameter updates for the first encoder, enhancing the difference in representation between the texture background and defect foreground in the anomalous sample. Based on the decoded defect foreground image, texture background image, and the defect segmentation result of the fusion segmentation module on the texture background image, defect separation loss, texture separation reconstruction loss, and adversarial generation loss are calculated to guide parameter updates for the contrast separation module. Based on the defect segmentation results of the fusion segmentation module on the anomalous sample and texture background image, segmentation loss is calculated to guide parameter updates for the fusion segmentation module. This process is repeated until the iteration termination condition is met, resulting in a surface defect detection model for a novel OLED display device.

[0010] Furthermore, the specific method for generating the abnormal samples is as follows:

[0011] A probability distribution map is obtained by using two-dimensional Gaussian random sampling, and a corresponding mask image is obtained by thresholding. Normal samples are randomly transformed and combined with the probability distribution map and the corresponding mask image to obtain an abnormal mask. Artificial abnormal samples are obtained by using the randomly transformed normal samples, the abnormal mask, and the mask image.

[0012] The random transformation is a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise.

[0013] Furthermore, the anomaly mask is obtained in the following manner:

[0014]

[0015] In the formula, Indicates anomaly mask, I n For normal samples after random transformation, f1(·) represents a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise. I represents the probability distribution graph. m The mask image is represented by δ∈[-1,1], which controls the gray intensity of the generated defect region.

[0016] The abnormal samples were obtained in the following manner:

[0017]

[0018] In the formula, I a This is indicated as an abnormal sample.

[0019] Furthermore, the specific method for constructing the prior weight information is as follows:

[0020] Using a pre-trained network, features are extracted from both the normal samples and the abnormal samples after the random transformation, resulting in feature Z. n and feature Z a ;

[0021] Calculate Z n and Z a The cosine similarity between the channel dimension feature vectors corresponding to the same height and width coordinates in the image is used to obtain the anomaly score map M. a ;

[0022] For the anomaly score map M a Normalization is performed to obtain prior weight distribution information;

[0023] The mask image is downsampled to match the anomaly score map M. a Using the same resolution and based on the downsampled mask image, the weight sets corresponding to the feature vectors of the textured background region and the feature vectors of the defective foreground region are divided from the prior weight distribution information and used as prior weight information.

[0024] Furthermore, the feature contrast loss is calculated as follows:

[0025] The mask image is downsampled to the same resolution as the encoded features, and based on the downsampled mask image, a texture feature vector set P is partitioned from the encoded features. i Defect feature vector set N i The encoded features are considered as a series of dimensions. The combination of eigenvectors in the feature space, where C C The number of channels represents the encoded feature;

[0026] Calculate the arithmetic mean center of the texture feature vector set, and use it as the anchor point feature vector i;

[0027] Based on the anchor point feature vector i and the texture feature vector set P i Defect feature vector set N i And the prior weight information, calculate the feature contrast loss L. ctr The expression is:

[0028]

[0029] In the formula, b represents the number of samples selected in one training iteration, and W p W represents the set of weights corresponding to the feature vectors of the texture background region, that is, the prior weight information corresponding to the feature vectors of the texture background region. n The set of weights corresponding to the feature vectors of the defect foreground region represents the prior weight information corresponding to the feature vectors of the defect foreground region. τ is a temperature parameter used to control the smoothness of the calculated correlation matrix. ||·||2 represents the L2 norm.

[0030] Furthermore, the fusion segmentation module includes a second encoder, a feature fusion module, and a decoder, used for encoding, feature fusion, and decoding, respectively. The feature fusion module includes n convolutional units consisting of a 1×1 convolution and a 3×3 convolution, and a self-attention module, where the value of n is the same as the number of convolutional levels in the second encoder. The first-level convolutional output of the second encoder serves as the input to a corresponding convolutional unit. Subsequently, each level of convolutional output from the second encoder is connected channel-wise to the output of the previous convolutional unit and input to the corresponding convolutional unit. The output of the last convolutional unit is connected to the self-attention module.

[0031] Furthermore, the self-attention module is an improved self-attention module, specifically:

[0032] The output features Z∈R of the last convolutional unit H'×W'×C' After two independent 2D 1×1 convolutions and changing their dimensions respectively, feature matrices Q and K∈R are obtained. H'W'×C' Then, by multiplying the transpose of Q with K, we obtain the correlation strength matrix M between any two features in the spatial dimension: M = Q. T K, the stronger the correlation between two feature points, the larger their response value in matrix M;

[0033] For feature Z∈R H'×W'×C' Perform average pooling to obtain the feature vector a∈R 1×1×C' Then, after a one-dimensional 3×3 convolution, the feature Z∈R is obtained. H'×W'×C' The weight vector a'∈R along the channel dimension 1×1×C' After applying Sigmoid activation to the weight vector a', it is then compared with the feature Z∈R. H'×W'×C' Channel-by-channel multiplication: Z' = Sigmoid(a')·Z, where Z'∈R H'×W'×C' Applying a 2D 1×1 convolution to Z' and changing its dimensions yields the feature matrix V∈R. H'W'×C' ;

[0034] After V and Softmax The final result is obtained by performing matrix multiplication and then weighting and fusing the results with the original features.

[0035]

[0036] in, This represents the correlation strength matrix after Softmax, where γ is the learnable weighting coefficient. This represents the feature result after processing by the improved self-attention module.

[0037] Furthermore, the fusion segmentation loss consists of three losses. The first term is the cross-entropy loss of the fusion segmentation module for segmenting abnormal samples. The second and third terms are the hard label loss and soft label loss of the fusion segmentation module for judging the texture background image, respectively. The mask image is used as the hard label, and the defect foreground image output by the defect decoding module is used as the soft label, as shown below:

[0038]

[0039] In the formula, L fsm Let θ represent the fusion segmentation loss. s_e θ ffm θ s_d α1, α2, and α3 represent the network parameters of the second encoder, feature fusion module, and decoder of the fusion segmentation module, respectively, and represent the loss weights. I represents the mathematical expectation. a Indicates an abnormal sample, I c_t I represents the texture background image output by the texture decoding module. l The label image representing the segmentation result, and I m Same, I c_a I represents the foreground image of the defect output by the defect decoding module. s_a I represents the defect segmentation result of the fusion segmentation module on the abnormal sample. s_t This represents the defect segmentation result of the fusion segmentation module on the textured background image, where ||·||1 represents the L1 norm.

[0040] This invention also provides a method for detecting surface defects in a novel OLED display device, comprising:

[0041] The samples to be tested from the OLED novel display device are input into the contrast separation module and the fusion segmentation module in the OLED novel display device surface defect detection model, respectively, to obtain corresponding defect detection images. The two defect detection images are then fused with a certain weight to obtain the final defect foreground region detection result. Based on the final defect foreground region detection result, the defect status of the OLED novel display device surface is determined. The OLED novel display device surface defect detection model is constructed according to the above-described method for constructing an OLED novel display device surface defect detection model.

[0042] The present invention also provides a computer-readable storage medium comprising a stored computer program, wherein the computer program, when executed by a processor, controls the device where the storage medium is located to execute the method for constructing a surface defect detection model for a novel OLED display device as described above, and / or the method for detecting surface defects in a novel OLED display device as described above.

[0043] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects:

[0044] (1) This invention is a method for constructing a surface defect detection model for OLED display devices based on prior information-guided feature comparison. By employing latent space feature comparison and separation, combined with prior information on the weight distribution of positive and negative example feature vectors provided by the pre-trained network, the method constrains texture feature clustering in the feature space and keeps it away from abnormal features, effectively promoting the network's separation effect between texture and defect regions, improving defect detection accuracy in real-world scenarios, and enhancing the network's robustness. Secondly, by adopting a multi-scale feature fusion encoding method, the method integrates local description information and global structural information, improving detection performance. In addition, a generative adversarial mechanism is constructed between the comparison separation module and the fusion segmentation module. Through a zero-sum game between the two, the comparison separation effect and fusion segmentation accuracy are improved. Furthermore, the defect foreground image can be used as a soft label for fusion segmentation, thereby more reasonably guiding the fusion segmentation network's output of the texture background image, enhancing the network's robustness, and reducing the over-detection rate.

[0045] (2) In the fusion segmentation module proposed in this invention, the feature fusion module is used to fuse and further compress the multi-scale features output by each basic coding convolutional block during encoding, thereby comprehensively aggregating low-dimensional structural information and high-dimensional semantic information. Finally, more information-rich and compact features are generated.

[0046] (3) The improved spatial-channel attention module (SCAM) proposed in this invention improves the shortcomings of channel position information sharing based on the original position attention module (PAM). Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the overall network model provided in an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of latent space feature comparison and separation provided in an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of an improved self-attention module provided in an embodiment of the present invention;

[0050] Figure 4 This is a schematic diagram of the network testing phase provided in an embodiment of the present invention;

[0051] Figure 5 This is a schematic diagram illustrating the defect detection effect provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be 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 illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0053] Example 1

[0054] A method for constructing a surface defect detection model for a novel OLED display device. The detection model consists of two parts: a contrast separation module and a fusion segmentation module. The contrast separation module includes a first encoder, a texture decoding module, and a defect decoding module. The training is achieved by performing the following steps:

[0055] Gaussian random sampling is used to generate a mask image, and abnormal samples are generated by combining the mask image and normal samples. A pre-trained network is used to extract features from each normal sample and its corresponding abnormal sample to calculate the difference between the feature vectors of the two in each channel dimension. Based on the mask image, the difference set corresponding to the defect foreground region and texture background region in each abnormal sample is obtained as the prior weight information for feature comparison.

[0056] Each anomalous sample is encoded using a first encoder to obtain encoded features. These features are then input into a texture decoding module and a defect decoding module, resulting in a texture background image and a defect foreground image. A fusion segmentation module encodes, fuses features, and decodes the texture background image and its corresponding anomalous sample, outputting the corresponding defect segmentation result. Combining the prior weight information of each anomalous sample, the feature contrast loss between the defect foreground and texture background in the corresponding encoded features is calculated to guide the parameter update of the first encoder. This enhances the difference in the representation of texture background and defect foreground in the anomalous sample, resulting in texture feature clustering in the feature space obtained at the last stage of encoding. The model is designed to detect defects by separating the foreground image from the defects and the background image from the texture. Based on the decoded foreground and background images, the model calculates the defect separation loss and texture separation reconstruction loss using the mask image as the label. Based on the defect segmentation result of the fusion segmentation module on the background image, the model calculates the adversarial generation loss. Based on the defect separation loss, texture separation reconstruction loss, and adversarial generation loss, the model guides the parameter update of the contrast separation module. Based on the defect segmentation result of the fusion segmentation module on the abnormal samples and the background image, the model calculates the segmentation loss and guides the parameter update of the fusion segmentation module. The above process is repeated until the iteration termination condition is met to obtain the surface defect detection model for the OLED novel display device.

[0057] In other words, the detection model in this embodiment includes a conventional data augmentation module and two proposed new modules: a contrast separation module and a fusion segmentation module.

[0058] The contrast separation module implicitly learns the mapping relationship between textured background images and defective foreground images from anomalous samples. The pre-trained network can be categorized as the contrast separation module, which comprises five parts: a pre-trained network, a first encoding module (serving as the common encoding module for the subsequent two decoding modules), a latent space feature contrast separation module (used for contrast loss calculation and guiding parameter updates), a texture decoding module, and a defect decoding module. The pre-trained network takes pairs of normal samples and corresponding artificially created anomalous samples as input, generating an anomalous score map to provide prior information on the weight distribution for subsequent contrast feature vectors. The common encoding module encodes the input samples into latent space features. As a preferred approach, this module consists of four basic encoding convolutional blocks, each containing two convolutional layers with a kernel size of 3x3 and strides of 2 and 1 respectively. The initial number of kernels is 16, and the number doubles with each subsequent block. The latent space feature contrast separation module reduces the distance between texture features with the same semantic information in the feature space and constrains them away from anomalous features, thereby enhancing the network's response to anomalous textured backgrounds and defective regions. Alternatively, as a preferred embodiment, the texture decoding module and the defect decoding module have the same structure, both consisting of three basic decoding convolutional blocks and one convolutional layer connected to the output. Each basic decoding convolutional block contains a transposed convolutional layer and a convolutional layer, both with a kernel size of 3x3 and strides of 2 and 1 respectively. The initial number of convolutional kernels is 64, and the number of kernels is halved for each subsequent block. The convolutional layers connected to the output of both decoding modules have a kernel size of 3x3, a number of kernels of 1, and a stride of 1, followed by a sigmoid activation layer. Each basic decoding convolutional block is skipped to a basic encoding convolutional block with the same output feature size. The contrast separation module takes abnormal samples as input. The texture decoding module can separate and reconstruct the texture background, while the defect decoding module can accurately separate the defect foreground image from the original image.

[0059] The fusion segmentation module combines a self-attention mechanism to perform multi-scale feature fusion encoding and constructs a generative adversarial mode with the aforementioned contrast separation module, improving network performance. Specifically, the fusion segmentation module comprises three parts: an encoding module (second encoder), a feature fusion module, and a decoding module (decoder). The encoding module initially extracts convolutional features from the input image, which can be considered a preferred approach. The structural configuration of this module is the same as the first three basic encoding convolutional blocks of the aforementioned common encoding module. The feature fusion module is used to fuse the multi-scale feature semantic and structural information from the encoding stage, generating richer and more compact features as subsequent decoding input, which can also be considered a preferred approach. This module mainly includes three layers of 3x3 convolutions with a stride of 2, three layers of 1x1 convolutions with a stride of 1, and an improved spatial-channel self-attention module. The number of 3x3 convolution kernels is 32, 64, and 128, respectively, and the number of 1x1 convolution kernels is the same. The decoding module decodes the fused features and outputs the segmentation result of the defective region, which can also be considered a preferred approach. Its structural configuration is the same as the decoding module in the aforementioned contrast separation module. During the training phase, the fusion segmentation module takes paired textured background images and artificial anomaly samples as input and performs multi-scale feature fusion encoding to capture global contextual relevance. It can compare and separate defective foreground images as soft labels, enabling accurate segmentation of defective regions in anomaly images.

[0060] Therefore, this embodiment presents a method for constructing a surface defect detection model for novel OLED display devices based on prior information-guided feature comparison. Firstly, by employing latent space feature comparison separation and combining prior information on the weight distribution of positive and negative example feature vectors provided by a pre-trained network, this method constrains texture feature clustering in the feature space and keeps it away from anomalous features. This effectively improves the network's separation of texture and defect regions, enhances defect detection accuracy in real-world scenarios, and strengthens the network's robustness. Secondly, this embodiment utilizes multi-scale feature fusion encoding to integrate local descriptive information and global structural information, thereby improving detection performance. Furthermore, this embodiment constructs a generative adversarial mechanism between the comparison separation module and the fusion segmentation module. Through a zero-sum game between the two, it improves the comparison separation effect and fusion segmentation accuracy. The defect foreground image is used as a soft label for fusion segmentation, thus more reasonably guiding the fusion segmentation network's output on the texture background image, enhancing the network's robustness and reducing the overdetection rate.

[0061] It should be noted that the detection model constructed in this embodiment has two outputs: a contrast separation module and a fusion segmentation module. Therefore, during detection, the image to be detected is input into both the contrast separation module and the fusion segmentation module. Then, the defect foreground image generated by the contrast separation module and the defect segmentation image generated by the fusion segmentation module are fused with certain weights to obtain the defect detection result. That is, the defect detection result of the fusion segmentation can be used as a compensation term to improve the network's detection performance. In addition, the model constructed in this embodiment belongs to an end-to-end network structure, which is simple and effective, and adopts a single-stage training mode, thus exhibiting high efficiency.

[0062] The data augmentation module is used to generate artificially created anomalous samples for training. This can be considered a preferred approach, such as... Figure 1 In step (a), firstly, a probability distribution map is obtained using two-dimensional Gaussian random sampling, and the corresponding mask image is obtained through thresholding. Normal samples undergo random transformation processing, and combined with the probability distribution map and its corresponding mask image, an abnormal mask is obtained. Using the randomly transformed normal samples, the abnormal mask, and the mask image, artificial abnormal samples are obtained to simulate defect samples in real industrial scenarios. The random transformation is a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise.

[0063] Specifically, mask image I m for: in, I m ∈R W×H×1 , x=1,...,W, y=1,...,H, This is an image generated by two-dimensional Gaussian random sampling, where W and H represent the width and height of the image, respectively, and x and y are the coordinates of the pixel values ​​in the image. T represents the truncation threshold, and i represents the number of anomaly masks. Further, as a preferred scheme, W and H are both set to 256, T is set to 0.04, and i is set to 1. Then, randomly selected samples from the normal sample library are processed using random transformation. Obtain normal image I n and combined with I m and Obtain an anomaly mask

[0064]

[0065] in, I n , δ∈[-1,1] represents the grayscale intensity controlling the generation of defective regions. f1(·) represents a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise. Finally, using I... n and and mask image I m This allows for the fusion and generation of artificially generated abnormal samples I. a ∈R W×H×1 To simulate defect samples in real industrial scenarios:

[0066]

[0067] By following the steps above, a large number of artificially generated abnormal samples can be generated for network training using only normal samples. Furthermore, since various basic transformations and random sampling grayscale intensity combinations are used in the process of creating artificially generated abnormal samples, the generated simulated defect regions are closer to the defect characteristics that are likely to occur in the industrial production scenarios of real OLED new display devices. This can enrich the defect features in the dataset to a certain extent, enhance the generalization potential of the algorithm in the inference process, and overcome the difficulty of imbalanced sample data in actual industrial scenarios.

[0068] As a preferred embodiment, the above-mentioned method for constructing prior weight information is as follows:

[0069] Using a pre-trained network, features are extracted from both the normal samples and the abnormal samples after the random transformation, resulting in feature Z. n and feature Z a ;

[0070] Calculate Z n and Z a The cosine similarity between the channel dimension feature vectors corresponding to the same height and width coordinates in the image is used to obtain the anomaly score map M. a ;

[0071] For the anomaly score map M a Normalization is performed to obtain prior weight distribution information;

[0072] The mask image is downsampled to match the anomaly score map M. a With the same resolution, and based on the downsampled mask image, the weight sets corresponding to the feature vectors of the texture background region and the feature vectors of the defect foreground region are divided from the prior weight distribution information, and used as the prior weight information.

[0073] like Figure 1As shown in module (b), the contrast separation module is based on the assumption that textured background images and defective foreground images can be separated from anomalous samples. First, it obtains the prior weight distribution of the feature vector set through a pre-trained network. Then, it encodes the anomalous samples into the feature space, uses feature contrastive learning loss to constrain the distance between features, and finally outputs the textured background image and defective foreground image through two decoding branches. This module consists of five parts: a pre-trained network, a common encoding module, a latent space feature contrast separation module, a texture decoding module, and a defect decoding module. The pre-trained network takes pairs of normal samples and corresponding artificially synthesized anomalous samples as input, encoding them into features Z. n and Z a :

[0074]

[0075] Among them, Z n , W p H p C p The width, height, and number of channels of the feature are represented by 32, 32, and 128, respectively, which can be considered as preferred solutions. p_e (·) and θ p _ e These represent the neural network mapping function and corresponding network parameters of the pre-trained network, respectively. In this embodiment, ResNet18, pre-trained on the ImageNet dataset, is selected as the pre-trained network, and its parameters are fixed and not updated during training. Then, in Z... n and Z a The anomaly score map is obtained by calculating the cosine similarity between the two along the channel dimension.

[0076]

[0077] in, Representing features Z respectively n and Z a In the spatial dimension, the feature vector ||·||² represents the L2 norm. For the anomaly score map M... a Normalization will provide the prior weight distribution information needed for subsequent comparison of feature vectors.

[0078] W(h,w)=(M a (h,w)-min(M a (h,w)))÷(maxM a (h,w)-min(M a (h,w)));

[0079] Finally, based on the mask image Im Further divide the feature vectors of positive and negative examples into weight sets W. p and W n :

[0080]

[0081] Among them, f down (·) indicates that I will m Bilinear interpolation is used to downsample to the same resolution as W, W p and W n That is, the set of weights corresponding to the feature vectors of the textured background region and the feature vectors of the defective foreground region.

[0082] Preferably, the feature contrast loss is calculated as follows:

[0083] The mask image is downsampled to the same resolution as the encoded features, and based on the downsampled mask image, a texture feature vector set P is partitioned from the encoded features. i Defect feature vector set N i The encoded features are considered as a series of dimensions. The combination of eigenvectors in the feature space, where C C The number of channels represents the encoded feature;

[0084] Calculate the arithmetic mean center of the texture feature vector set, and use it as the anchor point feature vector i;

[0085] Based on the anchor point feature vector i and the texture feature vector set P i Defect feature vector set N i And the prior weight information, calculate the feature contrast loss L. ctr The expression is:

[0086]

[0087] In the formula, b represents the number of samples selected in one training iteration, and W p W represents the set of weights corresponding to the feature vectors of the texture background region, that is, the prior weight information corresponding to the feature vectors of the texture background region. n The set of weights corresponding to the feature vectors of the defect foreground region represents the prior weight information corresponding to the feature vectors of the defect foreground region. τ is a temperature parameter used to control the smoothness of the calculated correlation matrix. ||·||2 represents the L2 norm.

[0088] The calculation method for the feature contrast loss is explained below:

[0089] The common coding module receives the abnormal sample data I generated by the data augmentation module.a As input, feature Z is obtained through convolutional encoding. c Z c Specifically, this can also be referred to as latent space feature embedding:

[0090] Z c =f c_e (I a ;θ c_e );

[0091] in, W c H c C c These represent feature embeddings Z and Z, respectively. c The width, height, and number of channels can be considered as a preferred scheme. Except for the basic coding convolutional block connected to the input, the width and height of subsequent features are halved after each basic coding convolutional block, while the number of channels is doubled based on the initial number of channels C. This can be considered a preferred scheme, with C set to 16. Therefore, W here... c H c C c The values ​​are 32, 32, and 128, respectively. c_e (·) and θ c_e These represent the neural network mapping function and the corresponding network parameters of the common encoding module, respectively.

[0092] like Figure 2 As shown, the Latent Space Feature Contrast Module (LFCM) converts the features Z generated by the Common Coding Module into... c Viewed as a series of dimensions The combination of feature vectors in the feature space is chaotic when these feature vectors are mapped to a two-dimensional plane during the initial training phase of the network. Due to the unique characteristics of textured surface defect samples in OLED displays—texture regions are periodic and regular, while defect regions are irregular and of unknown type—based on the assumption that texture-encoded feature classes should have strong correlation and similarity within each class and weak correlation with defect-encoded feature classes, these feature points can be divided into two main categories: positive feature p∈P. i (Set of texture feature vectors), negative example features n∈N i (Set of defect feature vectors), where i = 1, ..., b, b represents the number of samples selected in one training iteration, P i Set and N i The set also consists of the downsampled mask image corresponding to each training sample. Sure:

[0093]

[0094] Before constructing the latent space feature contrastive learning loss, it is necessary to obtain the anchor feature i. Since the texture encoding features in each training sample should have strong correlation and similarity, the anchor feature vector i can be obtained by calculating the texture feature vector set P. i The arithmetic mean center is obtained as follows:

[0095]

[0096] Among them, |P i | indicates the number of positive example eigenvectors. This means summing the feature vectors of each positive example along the channel dimension. Therefore, the latent space feature contrast loss L... ctr It can be calculated using the following set of formulas:

[0097]

[0098] Among them, L i The latent space feature contrast loss for a single sample is represented by τ, which is a temperature parameter used to control the smoothness of the calculated correlation matrix; in this embodiment, it is set to 0.1. By constraining texture feature clustering and moving away from anomalous features in the feature space through the latent space feature contrast separation module, the difference in the representation of texture and defect regions in anomalous samples by the common encoding module can be effectively enhanced, thus promoting the separation of the corresponding target image by the subsequent two decoding branch modules.

[0099] Furthermore, regarding the loss of the comparison separation module, the defect separation loss term L is also involved. ano Loss term L for texture separation and reconstruction rec .

[0100] In this embodiment, the defect decoding module and the texture decoding module have essentially the same function, both decoding from feature Z. c Decode the corresponding target image:

[0101]

[0102] Where I c_a I c_t ∈R W×H×1 These represent the defect foreground image and texture background image separated by decoding, respectively, f c_da (·) and θ c_da Let f represent the neural network mapping function and the corresponding network parameters of the defect decoding module, respectively. c_dt (·) and θ c_dt These represent the neural network mapping function and the corresponding network parameters of the texture decoding module, respectively. These represent the features output by each basic coding convolutional block of the common coding module, starting from the input end. Based on the outputs of the two decoding modules, the following defect separation loss term L can be constructed.ano Loss term L for texture separation and reconstruction rec :

[0103]

[0104] Among them, I l ∈R W×H×1 with I m Similarly, as labels for the training defect decoding output, Let L represent the expected value, * represent the matrix dot product, and ||·||1 and ||·||2 represent the L1 norm and L2 norm, respectively. The defect separation loss term L... ano Pixel-level classification is performed using pixel-wise cross-entropy loss, and the texture separation and reconstruction loss term L... rec Mean squared error loss is used to constrain the textured background image I c_t As close as possible to the corresponding normal image I n .

[0105] Preferably, the fusion segmentation module includes a second encoder, a feature fusion module, and a decoder, used for encoding, feature fusion, and decoding, respectively. It receives the texture image output from the contrast separation module and the corresponding anomalous sample as paired inputs to construct a generative adversarial mode, improving detection accuracy. The encoding module shares parameters between the input texture image and the corresponding anomalous sample; as a preferred approach, it encodes both into features using three basic encoding convolutional blocks. and

[0106]

[0107] in, f s_e (·) and θ s_e These represent the neural network mapping function and the corresponding network parameters of the encoding module, respectively.

[0108] The feature fusion module is used to fuse and further compress the multi-scale features output by each basic coding convolutional block during encoding, thereby comprehensively aggregating low-dimensional structural information and high-dimensional semantic information. Specifically, such as... Figure 1 As shown in (c), this module mainly consists of three 3×3 convolutional layers with a stride of 2, three 1×1 convolutional layers with a stride of 1, and an improved spatial-channel self-attention module. The number of 3×3 convolutional kernels is 32, 64, and 128, respectively, and the number of 1×1 convolutional kernels is the same. Starting from near the input, each feature layer sequentially passes through a pair of 1×1 convolutions and 3×3 convolutions, and is then connected to the next adjacent feature along the channel dimension. This process is repeated three times. Finally, the fused output features are processed by the improved self-attention module SCAM to generate a more information-rich and compact feature Z. st and Zsa :

[0109]

[0110] Among them, Z st , W s H s C s These represent the width, height, and number of channels of the feature, respectively, and are set to 32, 32, and 128 in the embodiment. ffm (·) and θ ffm These represent the network mapping function and the corresponding network parameters of the feature fusion module, respectively. These represent the features output by each basic coded convolutional block of the encoding module, starting from the input end.

[0111] As the number of convolutions in the second encoder increases, the semantic information it extracts gradually becomes richer and more abstract. However, the texture regions or defect regions that the feature information at each level emphasizes differ in nature. Deeper features lose a lot of positional information but carry more semantic information. In contrast, shallower features lose less positional information but have more information describing local structures. Therefore, fusing multi-level features and combining them with the self-attention module can effectively utilize local descriptive information and global structural information, thereby enhancing the network's comprehensive expressive ability.

[0112] Preferably, this embodiment introduces a self-attention mechanism in the feature fusion module to promote the network's effective comprehensive utilization of local descriptive information and global structural information. The improved Spatial-Channel Attention Module (SCAM) proposed in this embodiment is as follows: Figure 3 As shown, this paper improves upon the shortcomings of the original Position Attention Module (PAM) in terms of channel position information sharing. Specifically, it first processes the original input features Z∈R... H'×W'×C' After two independent 2D 1×1 convolutions and changing their dimensions respectively, feature matrices Q and K∈R are obtained. H'W'×C' Then, by multiplying the transpose of Q with K, we obtain the correlation strength matrix M between any two features in the spatial dimension:

[0113] M = Q T K;

[0114] The stronger the correlation between two feature points, the larger their response value in matrix M. Then, average pooling is performed on the original input features to obtain the feature vector a∈R. 1×1×C' Then, a one-dimensional 3×3 convolution is performed to obtain the weight vector a'∈R of the original feature in the channel dimension. 1×1×C'The weight vector is activated by Sigmoid and then multiplied channel by channel with the original features:

[0115] Z' = Sigmoid(a')·Z;

[0116] Where Z'∈R H'×W'×C' Applying a 2D 1×1 convolution to Z' and changing its dimensions yields the feature matrix V∈R. H'W'×C' Finally, V is compared with the result of Softmax. The final result is obtained by performing matrix multiplication and then weighting and fusing the results with the original features.

[0117]

[0118] in This represents the correlation strength matrix after Softmax, where γ is the learnable weighting coefficient. This represents the feature result after processing by the improved attention module.

[0119] Preferably, the decoding module in the fusion segmentation module combines the fused and compressed features with the encoded features multiplexed through a skip-connection structure, and completes high-fine-grained segmentation through multiple deconvolution upsampling learning:

[0120]

[0121] Among them, I s_t I s_a ∈R W×H f represents the segmentation results of the textured background image and the corresponding outlier sample, respectively. s_d (·) and θ s _ d These represent the neural network mapping function and corresponding network parameters of the decoding module, respectively. On one hand, for the fusion segmentation network itself, it needs to identify the textured background image as an anomaly label, and simultaneously segment the defect region from the anomaly samples. In this process, due to the textured background image I... c_t and defect foreground image I c_a Since they are separated from the same anomalous sample and there is a certain coupling relationship between them, this embodiment preferably incorporates the defective foreground image I when designing the segmentation loss. c_a The loss due to the guided soft labeling means that the overall loss of the fusion segmentation module consists of the following three components:

[0122]

[0123] Where, θ s_e θ ffm θ s_dI represents the network parameters of the encoder, feature fusion module, and decoder of the fusion segmentation module, respectively. l The label image representing the segmentation result, and I m same, Let represent the expected value, * represent the matrix dot product, and ||·||1 represent the L1 norm. The first term is the cross-entropy loss for segmenting outlier samples, and the second and third terms are the hard label loss and soft label loss for distinguishing textured background images, respectively. α1, α2, and α3 represent the loss weights, which are set to 1, 0.5, and 0.5 in this embodiment, respectively. On the other hand, for the contrast separation network, the fusion segmentation network needs to combine the textured background image I... c_t The label is identified as normal, and an adversarial loss L is generated accordingly. adg :

[0124]

[0125] Therefore, the overall loss of the comparison separation module can be expressed as:

[0126] L csm (θ c_e ,θ c_dt ,θ c_da )=β1L ctr +β2L ano +β3L rec +β4L adg ;

[0127] Where, θ c_e θ c_dt θ c_da L represents the network parameters of the common encoder, texture decoding module, and defect decoding module of the contrast separation module, respectively. β1, β2, β3, and β4 represent the weights of each loss term, which are set to 1, 10, 100, and 1 respectively in this embodiment. L is updated alternately during the training phase. fsm and L csm Then online training can be conducted.

[0128] The surface defect detection algorithm for novel OLED display devices based on prior information-guided feature comparison proposed in this embodiment can achieve high detection accuracy for defects of different sizes, shapes, and contrasts on the surface of novel OLED display devices even without real abnormal samples for training.

[0129] Example 2

[0130] A novel surface defect detection method for OLED display devices includes:

[0131] The samples to be tested from the OLED novel display device are respectively input into the contrast separation module and the fusion segmentation module in the OLED novel display device surface defect detection model to obtain corresponding defect detection images. The two defect detection images are fused with a certain weight to obtain the final defect region detection result. Based on the final defect region detection result, the defect status of the OLED novel display device surface is determined. The OLED novel display device surface defect detection model is constructed according to the above-described method for constructing an OLED novel display device surface defect detection model.

[0132] Once the network model is trained, it can be used for defect detection. For example... Figure 4 As shown, during the network testing phase, it is only necessary to I... a Input the contrast separation module and the fusion segmentation module to generate the defect foreground image I. c_a and defect segmentation image I c_a Then, by fusing the two according to the following formula, the final detection result I can be obtained. res :

[0133] I res =λI c_a +(1-λ)I s_a ;

[0134] Among them, I res ∈R W×H×1 For the fusion result, 0 < λ < 1, and in this embodiment, it is set to 0.5, indicating that the defect separation result and the fusion segmentation result are assigned the same trust weight. The method proposed in this embodiment achieves the following effect in surface defect detection of novel OLED display devices: Figure 5 As shown, the first column is the original image, the second column is the ground truth image, and the third column is the final fusion detection result.

[0135] It is worth noting that although this embodiment separates and reconstructs the textured background image during the training phase, it does not use the reconstruction residual between the textured background image and the image under test for defect detection in actual OLED novel display device surface defect detection applications. The reason is that experiments have verified that the present invention can achieve the best detection effect without using the residual. This is also one of the important differences between the method proposed in this invention and most current methods that heavily rely on reconstruction residuals.

[0136] The relevant technical solutions are the same as in Embodiment 1, and will not be repeated here.

[0137] This invention proposes a surface defect detection algorithm for novel OLED display devices based on prior information-guided feature comparison. It utilizes a proposed data augmentation module to generate a large number of artificially generated anomalous samples using only normal samples, overcoming the challenge of imbalanced sample data in real industrial scenarios. A proposed contrast separation module implicitly learns the mapping relationship between textured background images and defect foreground images from anomalous samples. A proposed fusion segmentation module integrates multi-scale feature fusion encoding and constructs a generative adversarial model, improving the contrast separation effect of the contrast separation module and the segmentation accuracy of the fusion segmentation module itself. During defect detection, the sample to be detected is input into both the contrast separation module and the fusion segmentation module. The defect foreground image separated by the contrast separation module and the defect region segmented by the fusion segmentation module are fused according to certain weights, allowing for accurate defect detection without the need for residual reconstruction. This invention overcomes the difficulties in detecting surface defects in novel OLED display devices, such as irregular shapes, varying sizes, irregular brightness changes, low contrast, and unknown types, as well as the challenges posed by imbalanced sample data, effectively improving detection accuracy and production quality.

[0138] Example 3

[0139] A computer-readable storage medium 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 surface defect detection model for a novel OLED display device as described in Embodiment 1 above, and / or the method for detecting surface defects in a novel OLED display device as described in Embodiment 2 above.

[0140] The relevant technical solutions are the same as those in Embodiment 1 and Embodiment 2, and will not be repeated here.

[0141] Those skilled in the art will readily understand 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 within the scope of protection of the present invention.

Claims

1. A method for constructing a surface defect detection model for a novel OLED display device, characterized in that, The detection model is divided into two parts: a contrast separation module and a fusion segmentation module. The contrast separation module includes a first encoder, a texture decoding module, and a defect decoding module. Perform the following steps to achieve training: Gaussian random sampling is used to generate a mask image, and abnormal samples are generated by combining the mask image and normal samples. A pre-trained network is used to extract features from each normal sample and its corresponding abnormal sample to calculate the difference between the feature vectors of the two in each channel dimension. Based on the mask image, the difference set corresponding to the defect foreground region and texture background region in each abnormal sample is obtained as the prior weight information for feature comparison. Each anomalous sample is encoded using a first encoder to obtain encoded features. These features are then input into a texture decoding module and a defect decoding module, resulting in a texture background image and a defect foreground image. A fusion segmentation module encodes, fuses, and decodes the texture background image and its corresponding anomalous sample, outputting the corresponding defect segmentation result. Combining the prior weight information of each anomalous sample, the feature contrast loss between the defect foreground and texture background in the corresponding encoded features is calculated to guide parameter updates for the first encoder, enhancing the difference in representation between the texture background and defect foreground in the anomalous sample. Based on the decoded defect foreground image, texture background image, and the defect segmentation result of the fusion segmentation module on the texture background image, defect separation loss, texture separation reconstruction loss, and adversarial generation loss are calculated to guide parameter updates for the contrast separation module. Based on the defect segmentation results of the fusion segmentation module on the anomalous sample and texture background image, segmentation loss is calculated to guide parameter updates for the fusion segmentation module. These steps are repeated until the iteration termination condition is met, resulting in a surface defect detection model for a novel OLED display device.

2. The method for detecting surface defects in a novel OLED display device according to claim 1, characterized in that, The specific method for generating the abnormal samples is as follows: A probability distribution map is obtained by using two-dimensional Gaussian random sampling, and a corresponding mask image is obtained by thresholding. Normal samples are randomly transformed and combined with the probability distribution map and the corresponding mask image to obtain an abnormal mask. Artificial abnormal samples are obtained by using the randomly transformed normal samples, the abnormal mask, and the mask image. The random transformation is a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise.

3. The method for detecting surface defects in a novel OLED display device according to claim 2, characterized in that, The anomaly mask is obtained in the following manner: In the formula, Indicates anomaly mask, I n For normal samples after random transformation, f1(·) represents a transformation mapping function randomly selected from four basic transformations, including copying, flipping vertically, flipping horizontally, and rotating 180° clockwise. I represents the probability distribution graph. m The mask image is represented by δ∈[-1,1], which controls the gray intensity of the generated defect region. The abnormal samples were obtained in the following manner: In the formula, I a This is indicated as an abnormal sample.

4. The method for detecting surface defects in a novel OLED display device according to claim 2, characterized in that, The specific method for constructing the prior weight information is as follows: Using a pre-trained network, features are extracted from both the normal samples and the abnormal samples after the random transformation, resulting in feature Z. n and feature Z a ; Calculate Z n and Z a The cosine similarity between the channel dimension feature vectors corresponding to the same height and width coordinates in the image is used to obtain the anomaly score map M. a ; For the anomaly score map M a Normalization is performed to obtain prior weight distribution information; The mask image is downsampled to match the anomaly score map M. a Using the same resolution and based on the downsampled mask image, the weight sets corresponding to the feature vectors of the textured background region and the feature vectors of the defective foreground region are divided from the prior weight distribution information and used as prior weight information.

5. The method for detecting surface defects in a novel OLED display device according to claim 1, characterized in that, The feature contrast loss is calculated as follows: The mask image is downsampled to the same resolution as the encoded features, and based on the downsampled mask image, a texture feature vector set P is partitioned from the encoded features. i Defect feature vector set N i The encoded features are considered as a series of dimensions. The combination of eigenvectors in the feature space, where C C The number of channels represents the encoded feature; Calculate the arithmetic mean center of the texture feature vector set, and use it as the anchor point feature vector i; Based on the anchor point feature vector i and the texture feature vector set P i Defect feature vector set N i And the prior weight information, calculate the feature contrast loss L. ctr The expression is: In the formula, b represents the number of samples selected in one training iteration, and W p W represents the set of weights corresponding to the feature vectors of the texture background region, that is, the prior weight information corresponding to the feature vectors of the texture background region. n This represents the set of weights corresponding to the feature vectors of the defect foreground region, i.e., the prior weight information corresponding to the feature vectors of the defect foreground region. τ is a temperature parameter used to control the smoothness of the calculated correlation matrix. ||·||2 represents the L2 norm.

6. The method for detecting surface defects in a novel OLED display device according to claim 1, characterized in that, The fusion segmentation module includes a second encoder, a feature fusion module, and a decoder, used for encoding, feature fusion, and decoding, respectively. The feature fusion module includes n convolutional units consisting of a 1×1 convolution and a 3×3 convolution, and a self-attention module, where the value of n is the same as the number of convolutional levels in the second encoder. The first-level convolutional output of the second encoder serves as the input to a corresponding convolutional unit. Subsequently, each level of convolutional output from the second encoder is connected channel-wise to the output of the previous convolutional unit and input to the corresponding convolutional unit. The output of the last convolutional unit is connected to the self-attention module to comprehensively utilize local descriptive information and global structural information.

7. The method for detecting surface defects in a novel OLED display device according to claim 6, characterized in that, The self-attention module is an improved self-attention module, specifically: The output features Z∈R of the last convolutional unit H'×W'×C' After two independent 2D 1×1 convolutions and changing their dimensions respectively, feature matrices Q and K∈R are obtained. H'W'×C' Then, by multiplying the transpose of Q with K, we obtain the correlation strength matrix M between any two features in the spatial dimension: M = Q. T K, the stronger the correlation between two feature points, the larger their response value in matrix M; For feature Z∈R H'×W'×C' Perform average pooling to obtain the feature vector a∈R 1×1×C' Then, after a one-dimensional 3×3 convolution, the feature Z∈R is obtained. H'×W'×C' The weight vector a'∈R along the channel dimension 1×1×C' After applying Sigmoid activation to the weight vector a', it is then compared with the feature Z∈R. H'×W'×C Channel-by-channel multiplication: Z' = Sigmoid(a')·Z, where Z'∈R H'×W'×C' Applying a 2D 1×1 convolution to Z' and changing its dimensions yields the feature matrix V∈R. H'W'×C' ; After V and Softmax The final result is obtained by performing matrix multiplication and then weighting and fusing the results with the original features. in, This represents the correlation strength matrix after Softmax, where γ is the learnable weighting coefficient. This represents the feature result after processing by the improved self-attention module.

8. The method for detecting surface defects in a novel OLED display device according to claim 1, characterized in that, The segmentation loss of the fusion segmentation module consists of three loss terms. The first term is the cross-entropy loss of the fusion segmentation module for segmenting abnormal samples. The second and third terms are the hard label loss and soft label loss of the fusion segmentation module for judging the texture background image, respectively. The mask image is used as the hard label, and the defect foreground image output by the defect decoding module is used as the soft label, as shown below: In the formula, L fsm Let θ represent the fusion segmentation loss. s_e θ ffm θ s_d α1, α2, and α3 represent the network parameters of the second encoder, feature fusion module, and decoder of the fusion segmentation module, respectively, and represent the loss weights. I represents the mathematical expectation. a Indicates an abnormal sample, I c_t I represents the texture background image output by the texture decoding module. l The label image representing the segmentation result, and I m Same, I c_a I represents the foreground image of the defect output by the defect decoding module. s_a I represents the defect segmentation result of the fusion segmentation module on the abnormal sample. s_t This represents the defect segmentation result of the fusion segmentation module on the textured background image, where ||·||1 represents the L1 norm.

9. A method for detecting surface defects in a novel OLED display device, characterized in that, include: The samples to be tested from the OLED novel display device are respectively input into the contrast separation module and the fusion segmentation module in the OLED novel display device surface defect detection model to obtain corresponding defect detection images. The two defect detection images are fused with a certain weight to obtain the final defect region detection result. Based on the final defect region detection result, the defect status of the OLED novel display device surface is determined. The OLED novel display device surface defect detection model is constructed according to the construction method of the OLED novel display device surface defect detection model as described in any one of claims 1 to 8.

10. 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, it controls the device where the storage medium is located to perform a method for constructing a surface defect detection model for a novel OLED display device as described in any one of claims 1 to 8 and / or a method for detecting surface defects in a novel OLED display device as described in claim 9.