Unsupervised OLED defect detection method based on defect generation
Through the unsupervised method based on defect generation in OLED production, defect samples are generated and integrated, which solves the problem of difficulty in collecting defect samples, improves the recognition rate of the defect detection model, and achieves more efficient training data acquisition.
Patent Information
- Application Number
- PCT/CN2023/085938
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-23
- Filing Date
- 2023-04-03
- Publication Date
- 2024-08-29
AI Technical Summary
In the OLED production process, due to the high yield rate, defect samples are difficult to collect, resulting in the deep learning model being unable to obtain sufficient training data, thereby reducing the product defect recognition rate of the defect detection model.
Through an unsupervised method based on defect generation, masks are randomly generated, destructive and structural defects are generated according to the mask, and integrated into positive samples to obtain defect samples to train the defect recognition model. This method includes steps such as randomly generating defect contours, filling and deformation, determining mask morphology, corrosion processing, assigning gray values, constructing a Poisson equation system, clustering pixel values, and style transfer to generate and integrate defect samples.
Quickly obtaining sufficient defect samples improves the recognition rate of the defect detection model, reduces dependence on actual production, and enhances the quality of the model's training data.
Smart Images

Figure CN2023085938_29082024_PF_FP_ABST
Abstract
Description
Unsupervised OLED defect detection method based on defect generation Technical Field
[0001] The present application relates to the field of OLED technology, and in particular to an unsupervised OLED defect detection method based on defect generation. Background Art
[0002] Defect detection is a key part of OLED production. Due to the high labor intensity, subjective judgment, and false detections and missed detections caused by fatigue in manual inspection, deep learning (DL) methods have been widely used in the field of industrial quality inspection.
[0003] However, in the current actual production process, due to the high yield rate on the production line, it is difficult to collect defect samples, which ultimately leads to the inability of the deep learning-based defect detection model to obtain sufficient defect samples as training data, thereby reducing the product defect recognition rate of the defect detection model.
[0004] Summary of the Invention
[0005] Based on this, it is necessary to provide an unsupervised OLED defect detection method based on defect generation that can automatically expand defect samples to address the above technical problems.
[0006] In a first aspect, the present application provides a method for generating an OLED defect sample. The method comprises:
[0007] Get positive samples of OLED and randomly generate masks;
[0008] generating destructive defects and / or structural defects according to the mask;
[0009] The destructive defects and / or structural defects are integrated into the positive samples to obtain corresponding defect samples.
[0010] In one embodiment, the randomly generating a mask includes:
[0011] Randomly generating a defect outline and filling the defect outline;
[0012] The mask is obtained by randomly deforming the filled defect contour within a preset defect size range.
[0013] In one embodiment, generating a destructive defect according to the mask includes:
[0014] Determine the shape of the mask;
[0015] If the mask is in the form of a long strip, determine the width of the mask;
[0016] If the width of the mask is less than the preset width, the mask is corroded and the contour of the mask after the corrosion process is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton;
[0017] If the mask is in a polygonal state, the mask is corroded and the outline of the mask after the corrosion process is used as the skeleton;
[0018] Two contour lines are drawn on the skeleton, and different grayscale values are assigned to the two contour lines to obtain the destructive defect.
[0019] In one embodiment, assigning different grayscale values to the two contour lines includes:
[0020] Get the mean variance of the mask;
[0021] The value ranges of the grayscale values of the two contour lines are determined according to the mean variance and the grayscale value of the first target position, wherein the first target position is the position where the destructive defect is integrated into the positive sample.
[0022] In one embodiment, the step of integrating the destructive defect into the positive sample to obtain a corresponding defect sample includes:
[0023] Constructing a Poisson equation group according to the texture gradient of the destructive defect and the texture gradient of the positive sample;
[0024] The Poisson equations are solved to obtain the defect sample.
[0025] In one embodiment, generating a structural defect according to the mask includes:
[0026] Determining a second target position where the structural defect is integrated into the positive sample, and extracting a pixel value of the second target position;
[0027] Clustering the pixel values of the second target position, and determining connected domains of different materials in the second target position according to the clustering result;
[0028] Pixel values in any of the connected domains are sampled and assigned to the mask to obtain the structural defect.
[0029] In one embodiment, the step of integrating the structural defects into the positive samples to obtain corresponding defective samples includes:
[0030] Style transfer is performed based on the defect sample to obtain a new defect sample.
[0031] In one embodiment, performing style transfer based on the defect sample to obtain a new defect sample includes:
[0032] Traversing the area corresponding to the structural defect with a sliding window of preset specifications to obtain a plurality of image blocks, wherein adjacent image blocks overlap;
[0033] Get the mean square error of each image block and select the image with the smallest mean square error as the target block;
[0034] Find the minimum cost path in the overlapping area between the target block and the adjacent image blocks as the boundary;
[0035] The overlapping area on both sides of the boundary is filled with the target block and image blocks adjacent to the target block to obtain a new defect sample.
[0036] In a second aspect, the present application further provides an unsupervised OLED defect detection method based on defect generation, the method comprising:
[0037] Get positive samples and test images;
[0038] The positive sample and the image to be tested are input into a preset defect recognition model to determine defects in the image to be tested, wherein the preset defect recognition model is obtained by training defect samples and positive samples generated according to the OLED defect sample generation method as described in the first aspect.
[0039] In one embodiment, inputting the positive sample and the image to be tested into a preset defect recognition model to determine defects in the image to be tested includes:
[0040] Acquire the deep-level features and shallow-level features of the positive sample, and the deep-level features and shallow-level features of the image to be tested;
[0041] The deep-level features and shallow-level features of the positive sample and the deep-level features and shallow-level features of the image to be tested are combined to perform predictive segmentation to obtain defects in the image to be tested.
[0042] In one embodiment, before inputting the positive sample and the image to be tested into a preset defect recognition model and determining defects in the image to be tested, the process includes:
[0043] Align the positive sample and the image to be tested.
[0044] In a third aspect, the present application further provides an OLED defect sample generation device. The device comprises:
[0045] A mask generation module is used to obtain positive samples of OLED and randomly generate a mask on the positive samples;
[0046] a defect generation module, configured to generate destructive defects and / or structural defects according to the mask;
[0047] The sample generation module is used to integrate the destructive defects and / or structural defects into the positive samples to obtain corresponding defect samples.
[0048] In a fourth aspect, the present application further provides an unsupervised OLED defect detection device based on defect generation, the device comprising:
[0049] Acquisition module, used to obtain positive samples and images to be tested;
[0050] An identification module is used to input the positive sample and the image to be tested into a preset defect recognition model to determine the defects in the image to be tested, wherein the preset defect recognition model is obtained by training the defect samples and positive samples generated according to the OLED defect sample generation method as described in the first aspect.
[0051] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the OLED defect sample generation method according to the first aspect or the steps of the unsupervised OLED defect detection method based on defect generation according to the second aspect.
[0052] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the OLED defect sample generation method according to the first aspect or the steps of the unsupervised OLED defect detection method based on defect generation according to the second aspect.
[0053] In a seventh aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the OLED defect sample generation method according to the first aspect or the steps of the unsupervised OLED defect detection method based on defect generation according to the second aspect.
[0054] The above-mentioned OLED defect sample generation method, the unsupervised OLED defect detection method based on defect generation and related equipment obtain positive samples of OLED and randomly generate a mask; generate destructive defects and / or structural defects based on the mask; integrate the destructive defects and / or structural defects into the positive sample to obtain corresponding defect samples. In the above manner, the present application randomly generates a mask, then generates destructive defects and / or structural defects based on the mask, and finally integrates the positive sample to obtain a defect sample. The defects in the present application do not depend on actual production, and sufficient defect samples can be quickly obtained as training data for training the defect recognition model, thereby improving the recognition rate of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] FIG1 is a schematic flow chart of a method for generating an OLED defect sample according to an embodiment;
[0056] FIG2 is a front view schematic diagram of a destructive defect image in one embodiment;
[0057] FIG3 is a front view schematic diagram of a destructive defect image according to another embodiment;
[0058] FIG4 is a schematic cross-sectional view of a destructive defect image in one embodiment;
[0059] FIG5 is a schematic diagram of front-view comparison of structural defect images in one embodiment;
[0060] FIG6 is a schematic diagram of a detailed flow chart of steps for generating destructive defects according to the mask in one embodiment;
[0061] FIG7 is a schematic diagram of a detailed flow chart of steps for generating structural defects according to the mask in one embodiment;
[0062] FIG8 is a schematic flow chart of an unsupervised OLED defect detection method based on defect generation in one embodiment;
[0063] FIG9 is a structural block diagram of an OLED defect sample generating device according to an embodiment;
[0064] FIG10 is a block diagram of an unsupervised OLED defect detection apparatus based on defect generation according to one embodiment;
[0065] FIG11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0067] In one embodiment, as shown in FIG1 , a method for generating an OLED defect sample is provided, comprising the following steps:
[0068] Step 110: obtain a positive sample of OLED and randomly generate a mask.
[0069] The present application is applied to a device such as a computer device for generating or identifying OLED film defects. The device can receive OLED positive samples transmitted from the outside, or obtain OLED positive samples through a camera module.
[0070] As an example, randomly generate a mask including:
[0071] Randomly generating a defect outline and filling the defect outline;
[0072] The mask is obtained by randomly deforming the filled defect contour within a preset defect size range.
[0073] Specifically, a random defect outline is generated, then filled. Within a preset defect size range, the original defect outline is randomly bent, scaled, rotated, and repositioned to obtain a randomly generated mask. The preset defect size range is set based on actual conditions. The original defect outline can be generated by controlling the number and curvature of Bezier curve control points, or by other random methods.
[0074] In the specific implementation, the generation of the mask can also refer to the existing technology and is not limited here.
[0075] Step 120: Generate destructive defects and / or structural defects according to the mask.
[0076] Specifically, in this application, OLED defects are divided into two types: destructive defects and structural defects.
[0077] Among them, destructive defects refer to defects caused by external forces, vibrations, noise and other problems. For example, the surface of the OLED dry film is damaged, resulting in abnormal light reflection in the defective part; or there are depressions or protrusions on the surface of the OLED dry film, resulting in the formation of Gaussian valleys or peaks in the image. In other words, destructive defects include cracks, scratches, bruises, etc., as shown in Figures 2 and 3, and a three-dimensional cross-sectional view of a destructive defect is shown in Figure 4. This type of defect is observable to the human eye in a local area of the image. In fact, the reason why destructive defects can be recognized by the human eye is that regardless of the type of defect, whether it is a crack, scratch or bruise, as long as it can be detected, the grayscale will be different from the surrounding original pixels, that is, the transition part between the original workpiece and the defect will produce a gradient, thereby producing a visually significant effect, allowing people to recognize it.
[0078] Structural defects refer to ink shortage or excess caused by vibration or other factors during inkjet printing. As shown in Figure 5, Figure 5 shows the normal pixel morphology and structural defects caused by excess inkjet printing. It is difficult to make a defect judgment without comparison of structural defects.
[0079] In this embodiment, the above-mentioned destructive defects and / or structural defects are generated according to the mask randomly generated in step 110 .
[0080] As an example, if the mask is a strip, the border of the strip is filled with the pixel values on the positive sample, and the inside of the border is filled with pixel values different from those on the positive sample. If the filled mask is placed inside the OLED pixel, it will be a destructive defect, and if it is placed on the edge of the OLED pixel, it will be a structural defect.
[0081] Step 130 : Incorporate the destructive defects and / or structural defects into the positive samples to obtain corresponding defect samples.
[0082] The obtained destructive defects and / or structural defects are integrated into the positive sample to obtain a corresponding defect sample. It should be noted that in order to achieve a smooth transition between the destructive defects and / or structural defects and other parts in the defect sample, the destructive defects and / or structural defects and other parts can be processed by edge feathering.
[0083] The above-mentioned OLED defect sample generation method obtains a positive sample of OLED and randomly generates a mask; generates destructive defects and / or structural defects based on the mask; and integrates the destructive defects and / or structural defects into the positive sample to obtain a corresponding defect sample. In the above manner, the present application randomly generates a mask, then generates destructive defects and / or structural defects based on the mask, and finally integrates the positive sample to obtain a defect sample. The defects in the present application do not depend on actual production, and sufficient defect samples can be quickly obtained as training data for training the defect recognition model, thereby improving the recognition rate of the model.
[0084] In one embodiment, as shown in FIG6 , generating a destructive defect according to the mask includes:
[0085] Step 121, determining the shape of the mask;
[0086] Step 122: If the mask is in a strip shape, determine the width of the mask;
[0087] Step 123: If the width of the mask is less than the preset width, the mask is corroded and the contour of the mask after the corrosion process is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton;
[0088] Step 124: If the mask is in a polygonal state, the mask is corroded and the contour of the mask after the corrosion process is used as the skeleton;
[0089] Step 125 , draw two contour lines for the skeleton, and assign different grayscale values to the two contour lines to obtain the destructive defect.
[0090] Specifically, in this embodiment, generating destructive defects based on the mask can include: first determining the shape of the randomly generated mask; if the mask is in the shape of a long strip, then determining the width of the mask; if the width of the mask is less than a preset width (for example, a preset width of 5 pixels), the width is too small and it is not suitable to use other algorithms to extract the contour; the mask is corroded and the contour of the corroded mask is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton.
[0091] If the mask is polygonal, the mask is corroded and the outline of the mask after the corrosion process is used as the skeleton.
[0092] After obtaining the skeleton, two contour lines are drawn based on it and assigned different grayscale values. Together, these two contour lines, plus the skeleton, yield three lines with the same shape but different grayscale values. As mentioned above, destructive defects manifest on a plane as cracks, scratches, or bruises, with grayscale values that differ from those of the surrounding original pixels. Therefore, this method creates destructive defects.
[0093] Furthermore, different grayscale values are assigned to the two contour lines, including:
[0094] Get the mean variance of the mask;
[0095] The value ranges of the grayscale values of the two contour lines are determined according to the mean variance and the grayscale value of the first target position, wherein the first target position is the position where the destructive defect is integrated into the positive sample.
[0096] Specifically, in order to ensure that the pixels around the destructive defect can smoothly transition with the positive sample when the destructive defect is integrated into the positive sample, the mean variance of the mask is first calculated in this implementation. The calculation method of the mean variance can refer to the existing technology. Then, the position where the destructive defect is integrated into the positive sample is determined, and the value range of the grayscale values of the two contour lines is determined using the mean variance and the grayscale value of the first target position. Specifically, the minimum value of the value range is the difference between the grayscale value of the first target position and the mean variance, and the maximum value is the sum of the grayscale value of the first target position and the mean variance.
[0097] Correspondingly, the destructive defect is integrated into the positive sample to obtain a corresponding defect sample, including:
[0098] Constructing a Poisson equation group according to the texture gradient of the destructive defect and the texture gradient of the positive sample;
[0099] The Poisson equations are solved to obtain the defect sample.
[0100] Specifically, the process of integrating destructive defects can include constructing a Poisson equation group based on the texture gradient of the destructive defect and the texture gradient of the positive sample, and then solving the Poisson equation group. The solved image satisfies the gradient fusion image, that is, a defect sample is generated.
[0101] In one embodiment, as shown in FIG7 , generating a structural defect according to the mask includes:
[0102] Step 126, determining a second target position where the structural defect is integrated into the positive sample, and extracting a pixel value of the second target position;
[0103] Step 127: clustering the pixel values of the second target position, and determining connected domains of different materials in the second target position based on the clustering result;
[0104] Step 128: sampling pixel values in any of the connected domains and assigning them to the mask to obtain the structural defects.
[0105] Specifically, as an example, the process of generating a structural defect in this embodiment may include: first determining the location where the positive sample is to be incorporated, defined for ease of description as a second target location; extracting pixels at this second target location; clustering the pixel values at the second target location to distinguish connected domains of different materials; randomly sampling pixel values from one connected domain; and assigning these values to a mask. This process is equivalent to filling one material with another, resulting in a structural defect on the OLED similar to underfilling or exceeding a normal pixel.
[0106] Furthermore, as an example, the structural defects are integrated into the positive samples to obtain corresponding defect samples, including:
[0107] Style transfer is performed based on the defect sample to obtain a new defect sample.
[0108] Specifically, in order to generate more structural defect samples, this implementation performs style transfer based on the already generated defect samples to obtain new defect samples.
[0109] It should be noted that the methods for generating structural defect samples in this application include: randomly generating a mask, generating structural defect samples using the mask, or performing style transfer based on the generated defect samples to generate structural defect samples. The specific process of style transfer can refer to the existing technology.
[0110] As another embodiment, performing style transfer according to the defect sample to obtain a new defect sample includes:
[0111] Traversing the area corresponding to the structural defect with a sliding window of preset specifications to obtain a plurality of image blocks, wherein adjacent image blocks overlap;
[0112] Get the mean square error of each image block and select the image with the smallest mean square error as the target block;
[0113] Find the minimum cost path in the overlapping area between the target block and the adjacent image blocks as the boundary;
[0114] The overlapping area on both sides of the boundary is filled with the target block and image blocks adjacent to the target block to obtain a new defect sample.
[0115] Specifically, this embodiment provides a style transfer method, including traversing a corresponding region in a generated structural defect image using a sliding window, where the region is the region where the defect is located in the defect sample, to obtain multiple image blocks (i.e., defect image blocks within the window). During the sliding process, adjacent windows overlap. Exemplarily, the overlapping portion is 1 / 3 of each image block. For example, if the sliding window is 9*9, the overlapping portion is 9*3. For each obtained image block, the mean square error (MSE) of each image block is calculated, and the image block with the minimum MSE is selected. The image block with the minimum MSE is defined as the target block. A minimum cost path is then searched for in the overlapping region between the target block and adjacent image blocks, and the search result is used as a boundary. As an example, the method for finding the minimum cost path includes: selecting a pixel in each row of each pixel in the 9*3 overlapping region, for a total of 27 selections, forming 27 paths; summing the grayscale values corresponding to each path; comparing the sum of the grayscale values of each path; and selecting the path with the minimum grayscale value as the boundary.
[0116] Finally, the overlapping area on both sides of the boundary is filled with the target block and the image blocks adjacent to the target block to obtain a new defect sample.
[0117] Based on the same inventive concept, referring to FIG8 , an embodiment of the present application further provides an unsupervised OLED defect detection method based on defect generation based on the above-mentioned OLED defect sample generation method, the unsupervised OLED defect detection method based on defect generation comprising:
[0118] Step 810, obtaining a positive sample and an image to be tested;
[0119] Step 820: Input the positive sample and the image to be tested into a preset defect recognition model to determine defects in the image to be tested.
[0120] Specifically, it is first necessary to use defect samples to train the defect recognition model to obtain a trained defect recognition model. As an example, the defect recognition model can be a U-net model, and the training process of the U-net model can be the same as that of the prior art. As another embodiment, the present application adds an input channel to the U-net model, that is, the U-net model in the present application has two input channels, one of the two input channels is used to input positive samples, and the other is used to input training samples (that is, defect samples as described in any of the above embodiments). Then the U-net model is trained according to the input positive samples and training samples to obtain trained samples. In this way, the defect recognition model in this implementation includes the normal features of the positive samples and the defect features of the defective samples, and can be identified by comparison during the recognition process.
[0121] During use, a positive sample and an image to be tested are acquired and fed into the two channels of a pre-set defect recognition model. The pre-set defect recognition model extracts features from both images and compares them for defect recognition. Compared to a single-channel defect recognition model, a two-channel defect recognition model can better adapt to the diversity of defects in OLED films.
[0122] In one embodiment, the positive sample and the image to be tested are input into a preset defect recognition model to determine defects in the image to be tested, including:
[0123] Acquire the deep-level features and shallow-level features of the positive sample, and the deep-level features and shallow-level features of the image to be tested;
[0124] The deep-level features and shallow-level features of the positive sample and the deep-level features and shallow-level features of the image to be tested are combined to perform predictive segmentation to obtain defects in the image to be tested.
[0125] Specifically, during the recognition process, the deep and shallow features of the positive sample, as well as the deep and shallow features of the image to be tested, are obtained through a preset defect recognition model. Exemplarily, when the defect recognition model is a U-net model, the shallow features of the positive sample and the shallow features of the image to be tested can be obtained through four downsamplings, and the deep features of the positive sample and the deep features of the image to be tested can be obtained through four upsamplings. The obtained deep and shallow features are combined to perform predictive segmentation to obtain the defects in the image to be tested. In the specific implementation, the number of downsampling and upsampling can be selected according to the actual situation. Of course, other defect recognition models can also be selected, as long as they can extract the deep and shallow features of each image.
[0126] In one embodiment, before inputting the positive sample and the image to be tested into a preset defect recognition model and determining defects in the image to be tested, the process includes:
[0127] Align the positive sample and the image to be tested.
[0128] Specifically, to reduce the difficulty of model training and recognition, during the training process, the positive sample and the image to be tested are first aligned before being input into the preset defect recognition model. During the defect recognition process, the positive sample and the image to be tested can also be aligned first.
[0129] As an example, the process of aligning the positive sample and the image to be tested may include:
[0130] Extract feature vectors from the positive sample and the image to be tested that are independent of scale, rotation, and brightness changes, i.e., extract SIFT features. Then, use Euclidean distance to calculate the closest feature points in the positive sample and the image to be tested. Find robust feature point pairs when the feature points on the positive sample and the feature points on the image to be tested are compared. Then, through similarity changes, a linear equation is established for each pair of feature points. A robust set of matching feature points can be used to establish a system of linear equations, and the specific coefficients of the similarity transformation matrix are solved using the least squares method. Finally, the image coordinates of the positive sample and the image to be tested are transformed to a preset coordinate system through image space transformation, thus obtaining an aligned positive sample and the image to be tested.
[0131] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0132] Based on the same inventive concept, embodiments of the present application further provide an OLED defect sample generation device for implementing the aforementioned OLED defect sample generation method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more OLED defect sample generation device embodiments provided below can be found in the aforementioned limitations of the OLED defect sample generation method and will not be further elaborated here.
[0133] In one embodiment, as shown in FIG9 , a device for generating an OLED defect sample is provided, comprising:
[0134] Mask generation module 910, used to obtain positive samples of OLED and randomly generate masks on the positive samples;
[0135] a defect generation module 920, configured to generate destructive defects and / or structural defects according to the mask;
[0136] The sample generation module 930 is configured to integrate the destructive defects and / or structural defects into the positive samples to obtain corresponding defect samples.
[0137] In one embodiment, the Mask generation module 910 is further configured to:
[0138] Randomly generating a defect outline and filling the defect outline;
[0139] The mask is obtained by randomly deforming the filled defect contour within a preset defect size range.
[0140] In one embodiment, the defect generation module 920 is further configured to:
[0141] Determine the shape of the mask;
[0142] If the mask is in the form of a long strip, determine the width of the mask;
[0143] If the width of the mask is less than the preset width, the mask is corroded and the contour of the mask after the corrosion process is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton;
[0144] If the mask is in a polygonal state, the mask is corroded and the outline of the mask after the corrosion process is used as the skeleton;
[0145] Two contour lines are drawn on the skeleton, and different grayscale values are assigned to the two contour lines to obtain the destructive defect.
[0146] In one embodiment, the defect generation module 920 is further configured to:
[0147] Get the mean variance of the mask;
[0148] The value ranges of the grayscale values of the two contour lines are determined according to the mean variance and the grayscale value of the first target position, wherein the first target position is the position where the destructive defect is integrated into the positive sample.
[0149] In one embodiment, the sample generation module 930 is configured to:
[0150] Constructing a Poisson equation group according to the texture gradient of the destructive defect and the texture gradient of the positive sample;
[0151] The Poisson equations are solved to obtain the defect sample.
[0152] In one embodiment, the defect generation module 920 is further configured to:
[0153] Determining a second target position where the structural defect is integrated into the positive sample, and extracting a pixel value of the second target position;
[0154] Clustering the pixel values of the second target position, and determining connected domains of different materials in the second target position according to the clustering result;
[0155] Pixel values in any of the connected domains are sampled and assigned to the mask to obtain the structural defect.
[0156] In one embodiment, the sample generation module 930 is configured to:
[0157] Style transfer is performed based on the defect sample to obtain a new defect sample.
[0158] In one embodiment, the sample generation module 930 is configured to:
[0159] Traversing the area corresponding to the structural defect with a sliding window of preset specifications to obtain a plurality of image blocks, wherein adjacent image blocks overlap;
[0160] Get the mean square error of each image block and select the image with the smallest mean square error as the target block;
[0161] Find the minimum cost path in the overlapping area between the target block and the adjacent image blocks as the boundary;
[0162] The overlapping area on both sides of the boundary is filled with the target block and image blocks adjacent to the target block to obtain a new defect sample.
[0163] Each module in the aforementioned OLED defect sample generation device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0164] Based on the same inventive concept, the embodiments of the present application further provide an unsupervised OLED defect detection device based on defect generation for implementing the above-mentioned unsupervised OLED defect detection method based on defect generation. The implementation solution provided by the device is similar to the implementation solution described in the above-mentioned method. Therefore, the specific limitations of one or more embodiments of the unsupervised OLED defect detection device based on defect generation provided below can be referred to the limitations of the unsupervised OLED defect detection method based on defect generation above, and will not be repeated here.
[0165] In one embodiment, as shown in FIG10 , an unsupervised OLED defect detection apparatus based on defect generation is provided, comprising:
[0166] An acquisition module 1010 is used to acquire positive samples and images to be tested;
[0167] The recognition module 1020 is used to input the positive sample and the image to be tested into a preset defect recognition model to determine the defects in the image to be tested, wherein the preset defect recognition model is obtained by training the defect samples and positive samples generated according to the OLED defect sample generation method described in any of the above embodiments.
[0168] In one embodiment, the identification module 1020 is configured to:
[0169] Acquire the deep-level features and shallow-level features of the positive sample, and the deep-level features and shallow-level features of the image to be tested;
[0170] The deep-level features and shallow-level features of the positive sample and the deep-level features and shallow-level features of the image to be tested are combined to perform predictive segmentation to obtain defects in the image to be tested.
[0171] In one embodiment, the apparatus further comprises:
[0172] An image alignment module (not shown) is used to align the positive sample and the image to be tested.
[0173] Each module in the above-mentioned unsupervised OLED defect detection device based on defect generation can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0174] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in FIG11 . The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as positive samples and defect samples. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for generating OLED defect samples or an unsupervised OLED defect detection method based on defect generation is implemented.
[0175] Those skilled in the art will understand that the structure shown in FIG11 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0176] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0177] Get positive samples of OLED and randomly generate masks;
[0178] generating destructive defects and / or structural defects according to the mask;
[0179] The destructive defects and / or structural defects are integrated into the positive samples to obtain corresponding defect samples.
[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0181] Randomly generating a defect outline and filling the defect outline;
[0182] The mask is obtained by randomly deforming the filled defect contour within a preset defect size range.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] Determine the shape of the mask;
[0185] If the mask is in the form of a long strip, determine the width of the mask;
[0186] If the width of the mask is less than the preset width, the mask is corroded and the contour of the mask after the corrosion process is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton;
[0187] If the mask is in a polygonal state, the mask is corroded and the outline of the mask after the corrosion process is used as the skeleton;
[0188] Two contour lines are drawn on the skeleton, and different grayscale values are assigned to the two contour lines to obtain the destructive defect.
[0189] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0190] Get the mean variance of the mask;
[0191] The value ranges of the grayscale values of the two contour lines are determined according to the mean variance and the grayscale value of the first target position, wherein the first target position is the position where the destructive defect is integrated into the positive sample.
[0192] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0193] Constructing a Poisson equation group according to the texture gradient of the destructive defect and the texture gradient of the positive sample;
[0194] The Poisson equations are solved to obtain the defect sample.
[0195] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0196] Determining a second target position where the structural defect is integrated into the positive sample, and extracting a pixel value of the second target position;
[0197] Clustering the pixel values of the second target position, and determining connected domains of different materials in the second target position according to the clustering result;
[0198] Pixel values in any of the connected domains are sampled and assigned to the mask to obtain the structural defect.
[0199] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0200] Style transfer is performed based on the defect sample to obtain a new defect sample.
[0201] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0202] Traversing the area corresponding to the structural defect with a sliding window of preset specifications to obtain a plurality of image blocks, wherein adjacent image blocks overlap;
[0203] Get the mean square error of each image block and select the image with the smallest mean square error as the target block;
[0204] Find the minimum cost path in the overlapping area between the target block and the adjacent image blocks as the boundary;
[0205] The overlapping area on both sides of the boundary is filled with the target block and image blocks adjacent to the target block to obtain a new defect sample.
[0206] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0207] Get positive samples and test images;
[0208] The positive sample and the image to be tested are input into a preset defect recognition model to determine defects in the image to be tested, wherein the preset defect recognition model is obtained by training defect samples and positive samples generated according to the OLED defect sample generation method as described in any of the above embodiments.
[0209] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0210] Acquire the deep-level features and shallow-level features of the positive sample, and the deep-level features and shallow-level features of the image to be tested;
[0211] The deep-level features and shallow-level features of the positive sample and the deep-level features and shallow-level features of the image to be tested are combined to perform predictive segmentation to obtain defects in the image to be tested.
[0212] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0213] Align the positive sample and the image to be tested.
[0214] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the OLED defect sample generation method described in any of the above embodiments, or the steps of the unsupervised OLED defect detection method based on defect generation are implemented.
[0215] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0216] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0217] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for generating an OLED defect sample, characterized in that: The method comprises: Get positive samples of OLED and randomly generate masks; generating destructive defects and / or structural defects according to the mask; The destructive defects and / or structural defects are integrated into the positive samples to obtain corresponding defect samples.
2. The method according to claim 1, characterized in that The randomly generated mask includes: Randomly generate a defect contour and fill the defect contour; The mask is obtained by randomly deforming the filled defect contour within a preset defect size range.
3. The method according to claim 1, characterized in that: Generating a destructive defect according to the mask includes: Determine the shape of the mask; If the mask is in the form of a long strip, determine the width of the mask; If the width of the mask is less than the preset width, the mask is corroded and the contour of the mask after the corrosion is used as the skeleton; if the width of the mask is greater than or equal to the preset width, the contour of the mask is extracted to obtain the skeleton; If the mask is in a polygonal state, the mask is corroded, and the outline of the mask after the corrosion process is used as the skeleton; Two contour lines are drawn for the skeleton, and different grayscale values are assigned to the two contour lines to obtain the destructive defect.
4. The method according to claim 3, characterized in that The step of assigning different grayscale values to the two contour lines includes: Obtain the mean variance of the mask; The value ranges of the grayscale values of the two contour lines are determined according to the mean variance and the grayscale value of the first target position, wherein the first target position is the position where the destructive defect is integrated into the positive sample.
5. The method according to claim 3, characterized in that: The step of integrating the destructive defect into the positive sample to obtain a corresponding defect sample includes: Construct a Poisson equation based on the texture gradient of the destructive defect and the texture gradient of the positive sample Group; The Poisson equations are solved to obtain the defect sample.
6. The method according to claim 1, characterized in that Generating a structural defect according to the mask includes: Determine a second target position where the structural defect is integrated into the positive sample, and extract a pixel value of the second target position; Clustering the pixel values of the second target position, and determining connected domains of different materials in the second target position according to the clustering result; The pixel values in any of the connected domains are sampled and assigned to the mask to obtain the structural defect.
7. The method according to claim 6, characterized in that The step of integrating the positive sample according to the structural defect to obtain a corresponding defect sample includes: Style transfer is performed according to the defect sample to obtain a new defect sample.
8. The method according to claim 6, characterized in that The performing style transfer according to the defect sample to obtain a new defect sample includes: Traversing the area corresponding to the structural defect with a sliding window of preset specifications to obtain a plurality of image blocks, wherein adjacent image blocks overlap; Get the mean square error of each image block and select the image with the smallest mean square error as the target block; Find the minimum cost path in the overlapping area between the target block and the adjacent image blocks as the boundary; The overlapping area on both sides of the boundary is filled with the target block and image blocks adjacent to the target block to obtain a new defect sample.
9. An unsupervised OLED defect detection method based on defect generation, characterized in that: The method comprises: Get positive samples and test images; The positive sample and the image to be tested are input into a preset defect recognition model to determine defects in the image to be tested, wherein the preset defect recognition model is obtained by training defect samples and positive samples generated according to the OLED defect sample generation method according to any one of claims 1 to 7.
10. The method according to claim 9, characterized in that The step of inputting the positive sample and the image to be tested into a preset defect recognition model to determine defects in the image to be tested includes: Acquire the deep-level features and shallow-level features of the positive sample, and the deep-level features and shallow-level features of the image to be tested; The deep-level features and shallow-level features of the positive sample and the deep-level features and shallow-level features of the image to be tested are combined to perform predictive segmentation to obtain defects in the image to be tested.
11. The method according to claim 9, characterized in that Before inputting the positive sample and the image to be tested into a preset defect recognition model to determine the defects in the image to be tested, the method includes: The positive sample and the image to be tested are aligned.
12. An OLED defect sample generating device, characterized in that: The device comprises: A mask generation module is used to obtain a positive sample of OLED and randomly generate a mask on the positive sample; A defect generation module, used for generating destructive defects and / or structural defects according to the mask; The sample generation module is used to integrate the destructive defects and / or structural defects into the positive samples to obtain corresponding defect samples.
13. An unsupervised OLED defect detection device based on defect generation, characterized in that: The device comprises: An acquisition module is used to acquire positive samples and images to be tested; An identification module is used to input the positive sample and the image to be tested into a preset defect recognition model to determine the defects in the image to be tested, wherein the preset defect recognition model is obtained by training the defect sample and positive sample generated by the OLED defect sample generation method according to any one of claims 1 to 8.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Defect sample generation method and device, electronic equipment and storage medium
CN111681162A
Industrial defect detection method based on few defect samples
CN114897865A
Industrial defect image generation method
CN115661578A
Product defect detection method and apparatus
WO2022121531A1
Cited By
Gearbox component surface defect detection method and system
CN119417801A
LCD display screen production risk early warning method based on data analysis
CN121279816A
Generative data enhancement method and device for petrochemical equipment defect detection and medium
CN122244022A
A generative data augmentation method for petrochemical equipment defect detection, device and medium
CN122244022B
