Polaroid defect detection method and system based on deep learning

By acquiring polarizer surface image data at different angles, pre-processing and feature extraction, and combining with deep learning models for defect recognition, the multi-dimensional characteristic capture and positioning problems in polarizer defect detection are solved, and the accuracy of detection and production guidance value are improved.

CN120471930AActive Publication Date: 2025-08-12GUIZHOU IND VOCATIONAL & TECH COLLEGE +1

Patent Information

Application Number
CN202510980636.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-08-12
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

In the prior art, polarizer defect detection is difficult to fully capture the multi-dimensional characteristics of complex defects, and the location information and distribution rules of defects are not fully explored, resulting in limited guiding value of the detection results for production process optimization.

Method used

By obtaining polarizer surface image data at different acquisition angles, image preprocessing and feature extraction are performed, defect candidate area features and texture distribution features are extracted, and input them into the pre-trained defect recognition deep learning model for joint defect recognition, and generating preliminary defect recognition results.

Benefits of technology

It realizes high-precision identification of polarizer defects, captures the optical performance of defects under different lighting conditions, fully reflects the multi-dimensional characteristics of defects, provides data support for defect location and relative relationships, and improves the practicality of the detection results and the guiding value for the production process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471930A_ABST
    Figure CN120471930A_ABST
Patent Text Reader

Abstract

The invention provides a polaroid defect detection method and system based on deep learning, and the method comprises the steps: obtaining an initial image data set corresponding to a to-be-detected polaroid; extracting defect candidate region features in the polaroid surface image and texture distribution features of the polaroid surface from the initial image data set through image preprocessing and feature extraction operation; inputting the defect candidate region features and the texture distribution features into a pre-trained defect identification deep learning model to carry out joint defect identification operation, and generating a defect preliminary identification result of the polarizer surface image; and determining the defect type of the defect existing in the polaroid to be detected and the spatial distribution characteristic information of the defect on the surface of the polaroid based on the preliminary defect identification result. According to the invention, effective connection between the defect detection result and the production quality control process can be realized, and the practicability of polaroid defect detection and the guiding value for the production process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning, and in particular to a method and system for detecting polarizer defects based on deep learning. Background Art

[0002] With the development of display panel manufacturing technology, polarizers are key components, and their surface quality directly affects the display effect. Polarizer defect detection technology has emerged as the times require. It is an important step in the display panel production process to ensure product quality by identifying various defects on the surface of polarizers. In the existing technology, the surface image of the polarizer is collected, the image is pre-processed, and the geometric features or grayscale features of the defects are extracted. Then, the defects are identified and judged using traditional machine learning classifiers. However, the existing technology often fails to effectively capture some directional defects due to problems with light reflection angles, making it difficult to fully characterize the multi-dimensional characteristics of complex defects. In addition, the location information and distribution patterns of the defects are not fully explored, resulting in the limited guiding value of the detection results for subsequent production process optimization. Summary of the Invention

[0003] The present invention provides a method and system for detecting polarizer defects based on deep learning.

[0004] In a first aspect, an embodiment of the present invention provides a method for detecting polarizer defects based on deep learning, the method comprising: Acquire an initial image data set corresponding to the polarizer to be detected, wherein the initial image data set includes multiple polarizer surface images at different acquisition angles; Extracting defect candidate region features in the polarizer surface image and texture distribution features on the polarizer surface from the initial image data set through image preprocessing and feature extraction operations; Inputting the defect candidate region features and the texture distribution features into a pre-trained defect recognition deep learning model to perform a joint defect recognition operation to generate a preliminary defect recognition result of the polarizer surface image; Based on the preliminary defect identification result, the defect type of the defect existing in the polarizer to be detected and the spatial distribution characteristic information of the defect on the surface of the polarizer are determined.

[0005] In a second aspect, an embodiment of the present invention provides a defect detection system, including: a memory storing a computer program; A processor is used to load the computer program to implement the polarizer defect detection method based on deep learning as described above.

[0006] The deep learning-based polarizer defect detection method provided by the present invention obtains an initial image data set corresponding to the polarizer to be detected, which includes multiple polarizer surface images at different acquisition angles. The defect candidate area features and texture distribution features in the polarizer surface image are extracted from the image preprocessing and feature extraction operations. The two features are input into a pre-trained defect recognition deep learning model for a joint defect recognition operation to generate a preliminary defect recognition result. Based on the result, the defect type in the polarizer to be detected and the spatial distribution feature information of the defects on the polarizer surface are determined. According to the defect type and spatial distribution feature information, a polarizer quality inspection report including the defect location coordinates is generated and sent to the target quality control system. By acquiring polarizer surface images at different acquisition angles, the optical manifestations of defects under different lighting conditions can be captured, avoiding the problem of missing directional defects. By simultaneously extracting defect candidate area features and texture distribution features, the local morphological features of defects and the overall texture change features of the polarizer surface can be collaboratively captured to comprehensively reflect the multi-dimensional manifestations of defects. By inputting the two features into a deep learning model for joint defect recognition, the deep learning model's nonlinear transformation and association modeling capabilities for high-dimensional features can be utilized to explore the intrinsic correlation between defect candidate area features and texture distribution features, thereby improving the accuracy of identifying complex defects in polarizers. By determining the spatial distribution feature information of defects, data support for defect location and relative relationships can be provided for polarizer production quality control. By generating a quality inspection report containing defect location coordinates and sending it to the quality control system, the defect detection results can be effectively connected with the production quality control process, thereby improving the practicality of polarizer defect detection and its guiding value to the production process. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 This is a flowchart of a polarizer defect detection method based on deep learning provided by an embodiment of the present invention.

[0008] Figure 2 This is a schematic diagram of the composition of a defect detection system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0009] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0010] See also Figure 1 , Figure 1A flowchart of a method for detecting polarizer defects based on deep learning is provided in an embodiment of the present invention. The method for detecting polarizer defects based on deep learning can be performed by a defect detection system. The method for detecting polarizer defects based on deep learning may include the following steps: Step S100: obtaining an initial image data set corresponding to the polarizer to be inspected, wherein the initial image data set includes a plurality of polarizer surface images at different acquisition angles.

[0011] The initial image dataset serves as the foundation for subsequent polarizer defect detection. It consists of multiple polarizer surface images captured at different acquisition angles. Setting different acquisition angles allows for comprehensive capture of polarizer surface information. For example, multiple cameras can be used to capture the polarizer from different directions and angles. These cameras can be evenly distributed around the polarizer, with each camera's angle varying by a set number of degrees, such as 30 or 45 degrees, from those of adjacent cameras.

[0012] Step S200: extracting defect candidate region features and texture distribution features of the polarizer surface in the polarizer surface image from the initial image data set through image preprocessing and feature extraction operations.

[0013] Image preprocessing processes the original image to improve its quality and facilitate subsequent feature extraction. Feature extraction extracts features from the preprocessed image that represent candidate defect regions and texture distribution. Defect candidate region features are characteristics of areas that may contain defects, such as area, perimeter, and shape. Texture distribution features describe the surface texture of the polarizer, such as energy, entropy, and contrast. Extracting these features provides a more accurate basis for subsequent defect identification.

[0014] As an embodiment, step S200 extracts defect candidate region features and texture distribution features of the polarizer surface from the initial image data set through image preprocessing and feature extraction operations, which may specifically include the following steps S210 to S270: Step S210: adjusting the grayscale distribution range of each polarizer surface image in the initial image data set by an adaptive histogram equalization algorithm to generate illumination-balanced image data.

[0015] The adaptive histogram equalization algorithm can adjust the grayscale distribution of an image based on the local area information of the image. In polarizer surface images, different lighting conditions may cause some areas of the image to be too bright and others to be too dark, affecting the identification of defects. The adaptive histogram equalization algorithm can adjust the grayscale distribution range of the image to make the overall brightness of the image more uniform. In specific implementation, each polarizer surface image in the initial image data set is divided into multiple small local areas, and histogram equalization processing is performed on each local area. The processed local areas are then merged to obtain the illumination-balanced image data. This can enhance the local contrast of the image without changing the overall image information, making defects more clearly visible.

[0016] Step S220: eliminating random noise and salt-and-pepper noise in the illumination-equalized image data based on the collaboration of Gaussian filtering and median filtering to generate denoised image data.

[0017] Gaussian filtering achieves filtering by taking a weighted average of each pixel in an image and its neighboring pixels, with the weights determined by a Gaussian function. Gaussian filtering can effectively eliminate Gaussian noise, i.e., random noise, in an image. Median filtering replaces the grayscale value of each pixel in an image with the median of the grayscale values of its neighboring pixels. For salt and pepper noise, i.e., isolated bright or dark spots that appear in an image, median filtering is used in synergy with Gaussian filtering in an embodiment of the present invention. Gaussian filtering is first performed on the illumination-equalized image data to remove random noise, and then median filtering is performed to remove salt and pepper noise, ultimately generating denoised image data. This collaborative filtering approach can more effectively improve image quality and reduce the impact of noise on subsequent feature extraction and defect recognition.

[0018] Step S230: enhancing the grayscale change area in the denoised image data by using the Laplacian operator, highlighting the edge contour information of the defect area, and generating edge-enhanced image data.

[0019] The Laplace operator is a second-order differential operator that is highly sensitive to grayscale variations in images and can be used to detect edge information in images. In denoised image data, defect regions often exhibit significant grayscale variations. The Laplace operator can be used to enhance these grayscale variations, thereby highlighting the edge contours of the defect region. In practice, the Laplace operator is applied to the denoised image data, calculating the second-order derivative of each pixel in the image to produce a new image in which regions with large grayscale variations are enhanced, while regions with small grayscale variations are suppressed. This generates edge-enhanced image data, making the edges of defect regions clearer and facilitating subsequent extraction of candidate defect regions.

[0020] As an embodiment, step S230, using a Laplacian operator to enhance the grayscale change area in the denoised image data, highlighting the edge contour information of the defect area, and generating edge-enhanced image data, may specifically include the following steps S231 to S237: Step S231: converting the denoised image data into a single-channel grayscale image, retaining the brightness information in the image, and generating grayscale image data.

[0021] The denoised image data may be a multi-channel color image. When performing edge detection, a single-channel grayscale image is easier to process. Converting the denoised image data into a single-channel grayscale image is done by taking a weighted average of the color information of each pixel in the multi-channel image to obtain a grayscale value, thereby converting the image into a grayscale image containing only brightness information. In this process, the brightness information in the image is retained and the color information is removed, making the image more concise and convenient for subsequent edge detection operations. For example, if the denoised image data is a RGB three-channel color image, the formula: Grayscale value = 0.299×R+0.587×G+0.114×B can be used to convert the RGB value of each pixel into a grayscale value to generate grayscale image data.

[0022] Step S232: Calculate the gradient values of the pixels in the grayscale image data in the horizontal and vertical directions based on the Sobel operator to obtain a horizontal gradient image and a vertical gradient image.

[0023] The Sobel operator is an edge detection operator that calculates the gradient value of a pixel in an image by performing a convolution operation on the image. The gradient value reflects the degree of grayscale change in the image. The larger the gradient value, the more obvious the grayscale change in the area where the pixel is located, which may be the edge of the image. In an embodiment of the present invention, a horizontal Sobel operator and a vertical Sobel operator are used to perform convolution operations on grayscale image data. The horizontal Sobel operator can detect horizontal edges in an image, and the vertical Sobel operator can detect vertical edges in an image. Through the convolution operation of these two operators, a horizontal gradient image and a vertical gradient image are obtained, respectively. These two images reflect the grayscale changes of the grayscale image data in the horizontal and vertical directions, respectively.

[0024] Step S233: performing square root operations on the horizontal gradient image and the vertical gradient image, and merging them to obtain a gradient magnitude image representing edge strength.

[0025] After obtaining the horizontal gradient image and the vertical gradient image, the two images are merged to comprehensively consider the grayscale changes in the horizontal and vertical directions. For example, the gradient values of each pixel in the horizontal gradient image and the vertical gradient image are squared and squared. That is, for pixels at the same position in the horizontal gradient image and the vertical gradient image, their gradient values are first squared, then the squared results are added together, and finally the square root of the sum is taken to obtain the gradient amplitude of the pixel. By performing this operation on all pixels, a gradient amplitude image representing edge strength is obtained. The grayscale value of each pixel in the gradient amplitude image represents the edge strength at the pixel's location. The larger the grayscale value, the more pronounced the edge at that location.

[0026] Step S234: traverse each pixel in the gradient magnitude image, compare the gradient magnitude of the pixel with the gradient magnitude of the adjacent pixels in the gradient direction, retain the local maximum pixel, and obtain a refined edge image.

[0027] In a gradient magnitude image, edges may be relatively wide. To obtain more accurate edge information, the edges need to be refined. For example, each pixel in the gradient magnitude image is traversed and, for each pixel, its gradient magnitude is compared with that of its adjacent pixels in the gradient direction. If the gradient magnitude of the pixel is the largest among its adjacent pixels in the gradient direction, the pixel is retained; otherwise, the grayscale value of the pixel is set to 0. This operation retains only the local maximum pixels on the edge, removing redundant pixels around the edge and obtaining a refined edge image. The edges in the refined edge image are finer and more precise, facilitating edge connection and defect area extraction.

[0028] Step S235: Set a high threshold and a low threshold to perform double threshold processing on the refined edge image, mark the pixel points with a gradient amplitude greater than the high threshold as strong edges, mark the pixel points with a gradient amplitude between the low threshold and the high threshold and connected to the strong edge as weak edges, and mark the pixel points with a gradient amplitude less than the low threshold as non-edges.

[0029] Double threshold processing is a method for further screening edge pixels. By setting a high threshold and a low threshold, the settings of the high threshold and the low threshold can be set according to actual conditions, and the present invention does not limit this. The pixels in the refined edge image can be divided into three categories: strong edge, weak edge, and non-edge. Pixels with a gradient amplitude greater than the high threshold are regarded as true edge pixels and are marked as strong edges. Pixels with a gradient amplitude between the low threshold and the high threshold are regarded as edge pixels, but may also be noise points and require further judgment. If these pixels are connected to a strong edge, they are marked as weak edges because they may be an extension of the strong edge. Pixels with a gradient amplitude less than the low threshold are marked as non-edges because they may be noise points or areas that are not edges. Through double threshold processing, noise points can be effectively removed while retaining true edge information.

[0030] Step S236: Determine whether the pixel points marked as weak edges have a connected path with the strong edge, retain the weak edge pixels connected to the strong edge, delete the isolated weak edge pixels, and obtain a complete edge image.

[0031] After double thresholding, pixels marked as weak edges are further evaluated to determine if they are actually edges. For example, these weak edge pixels are checked to see if there is a connected path with the strong edge. If so, these weak edge pixels are part of the strong edge and are retained. If not, these weak edge pixels are likely isolated noise points and are deleted. This process removes isolated weak edge pixels and produces a complete edge image. The edges in a complete edge image are more continuous and accurate.

[0032] Step S237: superimposing the complete edge image and the grayscale image data, adjusting the grayscale value of the edge pixel to a preset highlight value, and generating edge enhanced image data that highlights the edge contour of the defect area.

[0033] To more clearly highlight the edge contours of the defect area, the complete edge image is overlaid with the grayscale image data. During the overlay process, the grayscale values of the edge pixels in the complete edge image are adjusted to a preset highlight value, such as 255 (assuming the image's grayscale value range is 0-255). This makes the edge pixels appear brighter in the overlaid image, while other non-edge pixels retain the original grayscale values of the grayscale image data. This generates edge-enhanced image data that highlights the edge contours of the defect area, making the edges of the defect area more distinct.

[0034] Step S240: starting from a preset seed point, adjacent pixel points in the edge-enhanced image data whose grayscale value differences are within a preset range are merged into the same region to obtain a plurality of defect candidate region units.

[0035] The preset seed points are pre-determined starting points for region growing, and these seed points are usually located in areas that may contain defects. Region growing is an image segmentation method based on the similarity of pixel grayscale values, which merges adjacent pixels with similar grayscale values into the same region. In an embodiment of the present invention, starting from the preset seed point, the pixel points adjacent to it are searched in the edge-enhanced image data, and the grayscale value difference between these adjacent pixel points and the seed point is calculated. If the grayscale value difference is within the preset range, these adjacent pixel points are included in the current growing region, and the adjacent pixel points are searched starting from these newly included pixel points, and the above process is repeated until no new pixel points meet the grayscale value difference condition. Through such a region growing process, the edge-enhanced image data is divided into multiple regions, which are defect candidate region units. Each defect candidate region unit may contain one or more defects, or may be some normal areas, but they all have similar grayscale features.

[0036] As an embodiment, step S240, starting from a preset seed point, merges adjacent pixels in the edge-enhanced image data whose grayscale value differences are within a preset range into the same region to obtain multiple defect candidate region units. Specifically, the steps S241 to S247 may be included: Step S241: Setting a grayscale threshold to convert the edge enhanced image data into a black and white binary image, wherein the pixel value of the edge contour area is 1 and the pixel value of the background area is 0, thereby generating a binary edge image.

[0037] Binarization is the process of dividing the pixel values in an image into two values. For example, pixels with values greater than a threshold are set to one value, and pixels with values less than the threshold are set to another value. In an embodiment of the present invention, a grayscale threshold is set to classify the pixels in the edge-enhanced image data. The pixel values of the pixels in the edge contour area are set to 1, and the pixel values of the pixels in the background area are set to 0, thereby converting the edge-enhanced image data into a black and white binary image, i.e., a binarized edge image. Binarization can simplify image representation, facilitating morphological operations and contour extraction.

[0038] Step S242: performing a morphological closing operation of dilation followed by erosion on the binary edge image based on a structure element of a preset size, filling small holes in the edge contour, connecting broken edge segments, and generating a closed edge image.

[0039] The morphological closing operation consists of two operations: dilation and erosion. The dilation operation is to expand the boundaries of objects in the image outward, and the erosion operation is to shrink the boundaries of objects in the image inward. In an embodiment of the present invention, a dilation operation is performed on the binary edge image using a structure element of a preset size to expand the edge contour area outward and fill small holes in the edge contour. The dilated image is then eroded to shrink the object boundaries inward and remove the excess parts generated during the dilation process. Through such dilation and erosion operations, small holes in the edge contour are filled, broken edge segments are connected, and a closed edge image is generated. The edges in the closed edge image are more continuous and complete, which facilitates contour tracing and region growing.

[0040] Step S243: extracting the pixel coordinate set of each closed contour in the closed edge image through a contour tracing algorithm, determining the minimum bounding rectangle of each closed contour, and using the central pixel point of the minimum bounding rectangle as the seed point for region growth.

[0041] The contour tracing algorithm is used to extract closed contours from an image. It tracks pixels along the edges of closed contours to obtain a set of pixel coordinates for each closed contour. After obtaining a closed edge image, the contour tracing algorithm is used to extract the pixel coordinates for each closed contour. Next, for each closed contour, its minimum bounding rectangle (MBR) is calculated—the smallest rectangle that can completely contain the closed contour. The center pixel of the MBR is located at the center of the closed contour, and this center pixel is used as the seed point for region growing. This ensures that region growing begins at the center of the closed contour, facilitating the merging of pixels within the entire closed contour into a single region.

[0042] Step S244: sampling the grayscale value of the pixel corresponding to each seed point in the denoised image data as an initial grayscale reference value for region growing.

[0043] After determining the seed points for region growing, an initial grayscale reference value is assigned to each seed point for use in region growing. For example, the pixel corresponding to each seed point is found in the denoised image data, and the grayscale value of that pixel is sampled and used as the initial grayscale reference value for region growing. This initial grayscale reference value can then be used to determine whether adjacent pixels should be included in the current growing region during the region growing process.

[0044] Step S245: With the seed point as the center, traverse the adjacent pixel points based on the eight-neighborhood search method, calculate the absolute difference between the grayscale value of the adjacent pixel point and the initial grayscale reference value. When the absolute difference is less than the preset grayscale difference threshold, the adjacent pixel point is included in the current growth area, and the grayscale reference value of the area is updated to the average grayscale value of all pixels in the area.

[0045] The eight-neighborhood search method refers to searching for eight adjacent pixels around a certain pixel point in the image. In an embodiment of the present invention, the eight-neighborhood search method is used to traverse its adjacent pixels with the seed point as the center. For each adjacent pixel point, the absolute difference between its grayscale value and the initial grayscale reference value is calculated. If this absolute difference is less than the preset grayscale difference threshold, it means that the grayscale value of the adjacent pixel point is similar to that of the current growing area, and it is included in the current growing area. After the new pixel point is included, the grayscale reference value of the updated area is the average grayscale value of all pixels in the area. In this way, as the area grows, the grayscale reference value will be continuously updated to reflect the overall grayscale characteristics of the pixels in the area.

[0046] Step S246: Repeat the neighborhood search and region growing steps until no new pixel points meet the grayscale difference condition, stop the growing process of the current region, and obtain a complete region unit.

[0047] After completing the neighborhood search and region growing for a pixel, the neighborhood search and region growing steps are repeated, centering on the newly added pixel. Adjacent pixels are continuously searched to determine whether they meet the grayscale difference condition. Pixels that meet the condition are added to the current growing region, and the grayscale reference value is updated. This process continues until no new pixels meet the grayscale difference condition. At this point, the current region growth process stops, resulting in a complete region unit. Each region unit may contain one or more defects or some normal areas, but they all have similar grayscale characteristics.

[0048] Step S247: deleting the region units whose areas are smaller than the preset minimum area threshold, and retaining the region units whose areas are greater than or equal to the preset minimum area threshold as defect candidate region units.

[0049] After obtaining multiple area units, these are screened to remove those with too small an area. These may be noise points or unimportant areas, making them meaningless for defect detection. For example, a preset minimum area threshold is set, and the area of each area unit is calculated. If the area is less than the preset minimum area threshold, the area unit is deleted; if the area is greater than or equal to the preset minimum area threshold, the area unit is retained and considered a defect candidate. This screening process reduces unnecessary computation and improves defect detection efficiency.

[0050] Step S250: extracting the area ratio, the ratio of the contour perimeter to the area, and the aspect ratio of the circumscribed rectangle of each defect candidate region unit, and combining them to obtain defect candidate region features.

[0051] The area ratio is the proportion of the defect candidate region unit's area to the entire image area, reflecting the relative size of the defect candidate region to the overall image size. The perimeter-to-area ratio is the ratio of the perimeter of the defect candidate region unit to its area, reflecting the shape complexity of the defect candidate region. The bounding rectangle aspect ratio is the ratio of the length to the width of the minimum bounding rectangle of the defect candidate region unit, reflecting the shape characteristics of the defect candidate region. By extracting these features from each defect candidate region unit and combining them, the defect candidate region features can be obtained.

[0052] Step S260: Calculate the texture energy, entropy value and contrast parameter of the denoised image data at different directions and distances through the gray level co-occurrence matrix, and combine them to obtain texture distribution features.

[0053] The gray level co-occurrence matrix is a matrix used to describe the texture characteristics of an image, which reflects the spatial distribution relationship of the gray values in the image. In an embodiment of the present invention, the texture energy, entropy value and contrast parameter of the denoised image data in different directions and distances are calculated using the gray level co-occurrence matrix. The texture energy reflects the uniformity of the texture in the image. The larger the energy value, the more uniform the texture. The entropy value reflects the complexity of the texture in the image. The larger the entropy value, the more complex the texture. The contrast parameter reflects the contrast of the texture in the image. The greater the contrast, the clearer the texture. By calculating these parameters and combining them, the texture distribution characteristics can be obtained.

[0054] Step S270: adjusting the dimensions of the defect candidate region features and the texture distribution features to the same dimension through linear mapping, and generating a joint feature set with a unified dimensional representation.

[0055] After obtaining the defect candidate region features and texture distribution features, since their dimensions may differ, they need to be aligned to facilitate subsequent processing and analysis. For example, linear mapping can be used to align the dimensions of the defect candidate region features and texture distribution features. Linear mapping maps vectors from one vector space to another. By aligning the dimensions of the defect candidate region features and texture distribution features to the same dimension, a joint feature set with a unified dimensional representation is generated. The joint feature set contains information about both the defect candidate region features and the texture distribution features.

[0056] Step S300: Input the defect candidate area features and texture distribution features into the pre-trained defect recognition deep learning model to perform a joint defect recognition operation to generate a preliminary defect recognition result of the polarizer surface image.

[0057] A pretrained deep learning model for defect recognition is a trained neural network model that can identify defects based on input feature information. In an embodiment of the present invention, the features of candidate defect regions and texture distribution are input into the pretrained deep learning model. The model analyzes and processes these features and, through a combined defect recognition operation, generates a preliminary defect recognition result for the polarizer surface image. This preliminary defect recognition result includes information such as the type and location of possible defects in the polarizer surface image. By using a pretrained deep learning model, the accuracy and efficiency of defect recognition can be improved.

[0058] As an embodiment, step S300 inputs the defect candidate region features and texture distribution features into a pre-trained defect recognition deep learning model to perform a joint defect recognition operation to generate a preliminary defect recognition result of the polarizer surface image. Specifically, the following steps S310 to S370 may be included: Step S310: Concatenate the defect candidate region features and texture distribution features along the channel dimension to generate an initial fusion feature vector.

[0059] The channel dimension refers to the different channels in a feature vector, each of which can represent different feature information. In this embodiment of the present invention, the defect candidate region features and texture distribution features are spliced along the channel dimension. This means that the two feature vectors are connected in the channel direction to generate a new feature vector, the initial fused feature vector. The initial fused feature vector contains information about the defect candidate region features and texture distribution features. Through the splicing operation, these two features can be integrated.

[0060] Step S320: adjusting the mean and variance of each channel in the initial fused feature vector to a preset range, eliminating the dimensional differences between different feature channels, and generating a normalized fused feature vector.

[0061] There may be dimensional differences between different feature channels, that is, the range and scale of the eigenvalues of different channels may be different. This dimensional difference will affect the training and performance of the deep learning model. In an embodiment of the present invention, the mean and variance of each channel in the initial fused feature vector are adjusted to a preset range, and the dimensional difference between different feature channels is eliminated by a normalization operation. For example, for each channel in the initial fused feature vector, its mean and variance are calculated, and then each eigenvalue of the channel is subtracted from the mean, and then divided by the standard deviation to convert it into a standard normal distribution with a mean of 0 and a variance of 1. Through such a normalization operation, a normalized fused feature vector is generated so that different feature channels have the same scale and range.

[0062] Step S330: Input the normalized fused feature vector into the residual network module of the defect recognition deep learning model, and perform nonlinear transformation and dimensionality enhancement on the feature vector through multiple residual blocks. Each residual block contains two convolutional layers and a skip connection. The input features are directly superimposed on the convolutional layer output features through the skip connection to generate a deep feature representation vector.

[0063] The residual network module is a network structure in a deep learning model, which consists of multiple residual blocks. The residual block is the basic component unit of the residual network, and each residual block contains two convolutional layers and a skip connection. The convolutional layer is a neural network layer used to extract features, which can perform convolution operations on the input feature vector to extract the feature information therein. The skip connection is a connection method that directly superimposes the input features on the output features of the convolution layer, which can solve the gradient disappearance problem in the deep learning model and enable the model to train a deeper network. In an embodiment of the present invention, the normalized fusion feature vector is input into the residual network module of the defect recognition deep learning model, and the feature vector is nonlinearly transformed and dimensionally enhanced through multiple residual blocks. Each residual block performs a convolution operation on the input feature vector to extract the feature information therein, and directly superimposes the input features on the output features of the convolution layer through a skip connection to generate a deep feature representation vector. The deep feature representation vector contains more advanced and abstract feature information.

[0064] As an implementation method, step S330 inputs the normalized fused feature vector into the residual network module of the defect recognition deep learning model, performs nonlinear transformation and dimensionality enhancement on the feature vector through multiple residual blocks, each residual block includes two convolutional layers and a skip connection, and the input features are directly superimposed on the convolutional layer output features through the skip connection to generate a deep feature representation vector. Specifically, the following steps may be included: S331 to S337: Step S331: input the normalized fused feature vector into the first convolution layer of the first residual block, perform a convolution operation on the feature vector based on a preset number of convolution kernels, extract local feature information, and generate a first convolution feature.

[0065] The convolution layer performs a convolution operation with the input feature vector through a convolution kernel to extract local feature information. In an embodiment of the present invention, the normalized fused feature vector is input into the first convolution layer of the first residual block, and a convolution operation is performed on the feature vector using a preset number of convolution kernels. Each convolution kernel can extract different feature information from the input feature vector. Through the convolution operation of multiple convolution kernels, multiple local feature information can be extracted. Through such a convolution operation, a first convolution feature is generated, which contains the local feature information in the normalized fused feature vector.

[0066] Step S332: Perform ReLU activation function processing on the first convolution feature to generate a first activation feature.

[0067] The ReLU activation function is a nonlinear activation function expressed as f(x) = max(0, x). In this embodiment of the present invention, the ReLU activation function is applied to each element in the first convolutional feature, setting elements less than 0 to 0 and elements greater than 0 unchanged. This process introduces nonlinear factors, allowing the model to learn more complex feature representations. The generated first activated feature contains local feature information after nonlinear transformation, providing a richer feature representation for the convolution operation.

[0068] Step S333: Input the first activated feature into the second convolutional layer of the first residual block, perform a convolution operation on the feature based on the same number of convolution kernels as the first convolutional layer, further extract deep local features, and generate a second convolutional feature.

[0069] After obtaining the first activation feature, it is fed into the second convolutional layer of the first residual block. The first activation feature is convolved with the same number of convolutional kernels as in the first convolutional layer to further extract deep local features. The second convolutional layer further extracts and abstracts the local feature information in the first activation feature, generating the second convolutional feature. This second convolutional feature contains higher-level, more abstract local feature information.

[0070] Step S334: Adjust the mean and variance of the second convolution feature to generate a second normalized feature.

[0071] To eliminate the dimensionality differences between different channels in the second convolutional feature and improve model training efficiency and performance, the second convolutional feature needs to be normalized. For example, the mean and variance of each channel in the second convolutional feature are adjusted to convert it to a standard normal distribution with a mean of 0 and a variance of 1. This normalization operation generates the second normalized feature, ensuring that different channels have the same scale and range.

[0072] Step S335: superimpose the normalized fusion feature vector onto the second normalized feature through a jump connection to achieve residual learning of the input feature and the convolution processing feature to generate a first residual feature.

[0073] The jump connection can directly superimpose the input features on the output features of the convolution layer. In an embodiment of the present invention, the normalized fusion feature vector is superimposed on the second normalized feature through a jump connection, that is, the normalized fusion feature vector and the elements at the corresponding positions of the second normalized feature are added to obtain the first residual feature. Through such a superposition operation, the residual learning of the input features and the convolution processing features is realized, so that the model can learn the difference information between the input features and the convolution processing features, solve the gradient disappearance problem in the deep learning model, and improve the training efficiency and performance of the model.

[0074] Step S336: Input the first residual feature into the second residual block, and repeat the convolution, activation, batch normalization and jump connection operations in the first residual block to generate a second residual feature, where the number of convolution kernels in the second residual block is twice that of the first residual block, thereby achieving an increase in feature dimension.

[0075] After obtaining the first residual feature, it is input into the second residual block. In the second residual block, the convolution, activation, batch normalization, and skip connection operations of the first residual block are repeated. Specifically, the first residual feature is convolved to extract local feature information. It is then activated with the ReLU activation function to introduce nonlinear factors. Normalization is then performed to eliminate dimensional differences between channels. Finally, the input features are superimposed on the output features of the convolution layer through skip connections. Unlike the first residual block, the second residual block has twice the number of convolution kernels as the first. By increasing the number of convolution kernels, the feature dimensionality is increased, allowing the second residual feature to contain richer feature information.

[0076] Step S337: The output features of each residual block are input into the next residual block in turn. The number of convolution kernels in each subsequent residual block is twice that of the previous residual block. Through the cascade processing of multiple residual blocks, the dimension and abstraction level of the features are gradually improved to generate a deep feature representation vector with multi-scale feature information.

[0077] After obtaining the second residual feature, it is input into the third residual block, and the convolution, activation, batch normalization and jump connection operations are repeated. The output features of each residual block are input into the next residual block in turn, and the number of convolution kernels in each subsequent residual block is twice that of the previous residual block. Through the cascade processing of multiple residual blocks, the dimension and abstraction level of the features are gradually improved. With the increase of residual blocks, the dimension of the feature vector continues to increase, and the feature representation becomes more and more abstract. Ultimately, a deep feature representation vector with multi-scale feature information is generated. The deep feature representation vector contains feature information of different scales from low level to high level, providing a more comprehensive feature representation for global feature extraction and defect recognition.

[0078] Step S340: Calculate the average value of the deep feature representation vector in the spatial dimension to obtain a global feature vector with a global receptive field.

[0079] The global receptive field refers to the range of the input image that a neuron in a neural network can perceive. In an embodiment of the present invention, the average value of the deep feature representation vector in the spatial dimension is calculated, that is, the eigenvalues of the deep feature representation vector at each position in the spatial direction are averaged to obtain a new feature vector, that is, a global feature vector with a global receptive field. The global feature vector contains the global information in the deep feature representation vector. By calculating the average value, the local information in the spatial dimension is integrated to obtain a globally representative feature vector.

[0080] As an implementation method, step S340, calculating the average value of the deep feature representation vector in the spatial dimension to obtain a global feature vector with a global receptive field, may specifically include the following steps S341 to S346: Step S341: Divide the deep feature representation vector into shallow feature sub-vectors, middle feature sub-vectors and deep feature sub-vectors according to the level of the residual network module.

[0081] Among them, the shallow feature sub-vector corresponds to the output of the residual block of the front part proportion, the middle feature sub-vector corresponds to the output of the residual block of the middle part proportion, and the deep feature sub-vector corresponds to the output of the residual block of the back part proportion. The sum of the front part proportion, the middle part proportion and the back part proportion is equal to the total proportion of the residual blocks in the residual network module.

[0082] After obtaining the deep feature representation vector, to more comprehensively extract the feature information contained therein, it is divided according to the hierarchy of the residual network module. For example, the deep feature representation vector is divided into shallow feature sub-vectors, mid-level feature sub-vectors, and deep feature sub-vectors. The shallow feature sub-vectors correspond to the outputs of the residual blocks in the front portion of the network. These residual blocks extract relatively low-level feature information, such as edges and textures. The mid-level feature sub-vectors correspond to the outputs of the residual blocks in the middle portion of the network. These residual blocks extract medium-level feature information, such as the local shape of an object. The deep feature sub-vectors correspond to the outputs of the residual blocks in the back portion of the network. These residual blocks extract high-level feature information, such as the overall shape and category of an object. The sum of the front, middle, and back portions of the network is equal to the total proportion of residual blocks in the residual network module. This division allows for the processing and analysis of feature information at different levels.

[0083] Step S342: Perform maximum pooling processing on the shallow feature sub-vector in the spatial dimension, retain the local detail information with the strongest response in the feature map, and generate a shallow key feature vector.

[0084] Max pooling can reduce the spatial size of a feature map without changing the number of channels in the feature map. In an embodiment of the present invention, a maximum pooling process is performed on the shallow feature sub-vector in the spatial dimension. That is, for each channel in the shallow feature sub-vector, the maximum value in the local region in the spatial direction is taken as the output of the region. Through the maximum pooling process, the local detail information with the strongest response in the feature map is retained, redundant information is removed, and a shallow key feature vector is generated. The shallow key feature vector contains the important local detail information in the shallow feature sub-vector.

[0085] Step S343: Perform average pooling processing on the spatial dimension of the middle-level feature sub-vector, extract regional statistical information in the feature map, and generate a middle-level regional feature vector.

[0086] Average pooling can reduce the spatial size of a feature map without changing the number of channels in the feature map. In an embodiment of the present invention, average pooling of the spatial dimension is performed on the mid-level feature sub-vector. That is, for each channel in the mid-level feature sub-vector, the average value within the local region in the spatial direction is taken as the output of the region. Through such average pooling, regional statistical information in the feature map, such as the average grayscale value of the region, is extracted, and a mid-level regional feature vector is generated. The mid-level regional feature vector contains the regional statistical information in the mid-level feature sub-vector.

[0087] Step S344: Perform global average pooling processing on the deep feature sub-vector in the spatial dimension to obtain the overall distribution characteristics of the feature map and generate a deep global feature vector.

[0088] Global average pooling performs average pooling on the entire feature map in the spatial dimension to obtain a scalar value as the output of each channel. In an embodiment of the present invention, global average pooling is performed on the deep feature sub-vector in the spatial dimension, that is, for each channel in the deep feature sub-vector, the feature values of all pixels in the entire feature map in the spatial direction are averaged to obtain a scalar value. Through such global average pooling, the overall distribution characteristics of the feature map are obtained, and a deep global feature vector is generated. The deep global feature vector contains the global information in the deep feature sub-vector.

[0089] Step S345: concatenate the shallow key feature vector, the middle regional feature vector, and the deep global feature vector along the channel dimension to generate a multi-scale fusion feature vector.

[0090] After obtaining the shallow key feature vector, the mid-level regional feature vector, and the deep global feature vector, these three feature vectors are concatenated along the channel dimension, connecting them in the channel direction to generate a new feature vector, the multi-scale fused feature vector. The multi-scale fused feature vector contains feature information at different scales, from shallow to deep layers. Through the concatenation operation, this information is integrated to provide a more comprehensive input for dimensionality reduction.

[0091] Step S346: Perform dimensionality reduction processing on the multi-scale fusion feature vector through a fully connected layer, compress the feature dimension to a preset target dimension, and generate a global feature vector with a global receptive field. The target dimension matches the dimension of the defect category space.

[0092] The fully connected layer connects each input neuron to each output neuron. In an embodiment of the present invention, the multi-scale fusion feature vector is subjected to dimensionality reduction processing through the fully connected layer. The weight matrix of the fully connected layer can compress the feature dimensions in the multi-scale fusion feature vector, compressing it from a high dimension to a preset target dimension. The target dimension matches the dimension of the defect category space, so that the global feature vector can be better used for defect category identification. Through such dimensionality reduction processing, a global feature vector with a global receptive field is generated. The global feature vector contains the global information in the multi-scale fusion feature vector, and its dimension matches the dimension of the defect category space.

[0093] Step S350: Mapping the global feature vector to a preset defect category space through linear transformation to generate a defect probability distribution vector containing probability values for each category.

[0094] The preset defect category space is a predefined space that contains all possible defect categories. In an embodiment of the present invention, the global feature vector is mapped to the preset defect category space through a linear transformation. The linear transformation is achieved through a weight matrix and a bias vector. The global feature vector is multiplied by the weight matrix and then added with the bias vector to obtain a new vector. Each element in this new vector represents the score of the global feature vector belonging to a certain defect category. Then, these scores are converted into probability values through a softmax function to generate a defect probability distribution vector containing the probability values of each category. Each element in the defect probability distribution vector represents the probability that the global feature vector belongs to a certain defect category, and the sum of the probability values of all elements is 1.

[0095] Step S360: Perform softmax normalization on the defect probability distribution vector to convert the probability value into a probability distribution with a sum of 1, extract the category with the largest probability value as the main defect category, and record other categories with probability values greater than the preset secondary threshold as secondary defect categories.

[0096] The softmax normalization process is used to convert a set of real numbers into a probability distribution. Each element in the input vector can be converted into a probability value, and the sum of all probability values is 1. In an embodiment of the present invention, the defect probability distribution vector is subjected to softmax normalization to ensure that the probability values are converted into a probability distribution with a sum of 1. Then, the category with the largest probability value is extracted from the normalized defect probability distribution vector as the primary defect category. The primary defect category represents the defect category to which the global feature vector most likely belongs. At the same time, a preset secondary threshold is set, and other categories with probability values greater than the preset secondary threshold are recorded as secondary defect categories. The secondary defect categories represent other defect categories to which the global feature vector may belong.

[0097] Step S370: combining the primary defect category, the secondary defect category, and the corresponding probability values to obtain a preliminary defect identification result. The preliminary defect identification result also includes a confidence score corresponding to each defect category.

[0098] After obtaining the primary defect category, secondary defect category, and corresponding probability values, they are combined to produce the preliminary defect identification results. A confidence score is also calculated for each defect category. The confidence score is determined based on the probability value for that defect category; higher probability values indicate higher confidence scores. The preliminary defect identification results include the primary defect category, secondary defect category, corresponding probability values, and the corresponding confidence score for each defect category.

[0099] Step S400: Determine the defect type of the defect existing in the polarizer to be detected and the spatial distribution characteristic information of the defect on the surface of the polarizer based on the preliminary defect identification result.

[0100] The preliminary defect identification results provide information on the categories and probabilities of possible defects on the polarizer surface. In this embodiment of the present invention, the defect types of the defects in the polarizer to be inspected are determined based on this information, specifically identifying the specific defect type of each defect. Furthermore, the spatial distribution characteristics of the defects on the polarizer surface are determined, including information such as their location, size, and distance between them.

[0101] As an embodiment, step S400, based on the preliminary defect identification result, determines the defect type of the defect in the polarizer to be detected and the spatial distribution characteristic information of the defect on the surface of the polarizer, which may specifically include the following steps S410 to S470: Step S410: parsing the primary defect category and the secondary defect category in the preliminary defect identification result to determine all defect types present in the polarizer to be inspected, where each defect type corresponds to a unique defect category identifier.

[0102] After obtaining preliminary defect identification results, the primary and secondary defect categories are analyzed. By matching these categories with predefined defect types, all defect types present in the polarizer under inspection are determined. Each defect type is assigned a unique defect category identifier, which is used for subsequent defect information recording and management. This analysis identifies the specific defect type present on the polarizer surface, providing a basis for defect prioritization and spatial distribution analysis.

[0103] Step S420: extract the confidence score corresponding to each defect type in the preliminary defect identification result, sort the confidence scores in descending order, and generate a defect type priority sequence.

[0104] After identifying all defect types present in the polarizer to be inspected, the confidence score corresponding to each defect type is extracted. The confidence score reflects the reliability and accuracy of the defect type identification. The confidence scores are sorted from high to low to generate a defect type priority sequence.

[0105] Step S430: number the defect candidate area units and associate each defect candidate area unit with a defect type, wherein the primary defect type is associated with the defect candidate area unit with the largest area, and the secondary defect types are associated with the remaining defect candidate area units in order of priority.

[0106] After obtaining the defect type priority sequence, the defect candidate area units are numbered, assigning each a unique number. Each defect candidate area unit is then associated with a defect type. For example, the primary defect category is associated with the defect candidate area unit with the largest area, as the largest defect candidate area unit is more likely to contain the primary defect. For secondary defect categories, the remaining defect candidate area units are associated sequentially according to the priority sequence. This association clearly defines the defect type that each defect candidate area unit may contain.

[0107] Step S440: obtaining a pixel coordinate set of each defect candidate area unit associated with a defect type in the polarizer surface image, and calculating the geometric center coordinates of the pixel coordinate set as the center positioning coordinates of the defect.

[0108] After establishing the association between defect candidate area units and defect types, for each defect candidate area unit associated with a defect type, its pixel coordinate set in the polarizer surface image is obtained. The pixel coordinate set contains the coordinate information of all pixels in the defect candidate area unit. Then, the geometric center coordinates of the pixel coordinate set are calculated. This is done by summing the horizontal and vertical coordinates of all pixels in the pixel coordinate set and dividing the sum by the number of pixels to obtain the horizontal and vertical coordinates of the geometric center. These geometric center coordinates are used as the center positioning coordinates of the defect, which can be used to determine the location of the defect on the polarizer surface.

[0109] Step S450: Determine the minimum bounding rectangle of the defect candidate area unit according to the pixel coordinate set, and calculate the width and height parameters of the minimum bounding rectangle as the size feature parameters of the defect.

[0110] The minimum bounding rectangle is the smallest rectangle that can completely contain the defect candidate area unit. In an embodiment of the present invention, the minimum bounding rectangle of the defect candidate area unit is determined based on a pixel coordinate set. For example, all pixel points in the pixel coordinate set are traversed to find the minimum and maximum values of the horizontal coordinate, as well as the minimum and maximum values of the vertical coordinate. With these minimum and maximum values as boundaries, the position and size of the minimum bounding rectangle are determined. Then, the width and height parameters of the minimum bounding rectangle are calculated. The width parameter is the difference between the right boundary coordinate and the left boundary coordinate of the minimum bounding rectangle, and the height parameter is the difference between the upper boundary coordinate and the lower boundary coordinate of the minimum bounding rectangle. These width and height parameters are used as size characteristic parameters of the defect, and the size characteristic parameters can be used to describe the size of the defect on the surface of the polarizer.

[0111] As an embodiment, step S450 determines the minimum bounding rectangle of the defect candidate area unit according to the pixel coordinate set, and calculates the width and height parameters of the minimum bounding rectangle as the size characteristic parameters of the defect. Specifically, the following steps S451 to S456 may be included: Step S451: traverse all pixel points in the pixel coordinate set, extract the horizontal coordinate and vertical coordinate of each pixel point, and obtain a horizontal coordinate set and a vertical coordinate set.

[0112] After obtaining the pixel coordinate set, traverse all the pixels in it. For each pixel, extract its horizontal and vertical coordinates and store them in the horizontal and vertical coordinate sets, respectively. The horizontal and vertical coordinate sets contain the horizontal and vertical coordinate information of all the pixels in the pixel coordinate set, respectively.

[0113] Step S452: Find the minimum value and the maximum value in the horizontal coordinate set, and use them as the left boundary coordinate and the right boundary coordinate of the minimum bounding rectangle respectively.

[0114] After obtaining the set of horizontal coordinates, find the minimum and maximum values. The minimum value is used as the left boundary coordinate of the minimum bounding rectangle, and the maximum value is used as the right boundary coordinate of the minimum bounding rectangle. Through this search operation, the horizontal boundary position of the minimum bounding rectangle is determined.

[0115] Step S453: Find the minimum value and the maximum value in the vertical coordinate set, and use them as the lower boundary coordinate and the upper boundary coordinate of the minimum bounding rectangle respectively.

[0116] After obtaining the set of vertical coordinates, find the minimum and maximum values. The minimum value is used as the lower boundary coordinate of the minimum bounding rectangle, and the maximum value is used as the upper boundary coordinate of the minimum bounding rectangle. Through this search operation, the vertical boundary position of the minimum bounding rectangle is determined.

[0117] Step S454: Calculate the difference between the right boundary coordinates and the left boundary coordinates to obtain the width parameter of the minimum bounding rectangle, and calculate the difference between the upper boundary coordinates and the lower boundary coordinates to obtain the height parameter of the minimum bounding rectangle.

[0118] After determining the left and right coordinates of the minimum bounding rectangle, calculate the difference between the right and left coordinates to obtain the minimum bounding rectangle's width parameter. The width parameter represents the horizontal size of the minimum bounding rectangle. After determining the upper and lower coordinates of the minimum bounding rectangle, calculate the difference between the upper and lower coordinates to obtain the minimum bounding rectangle's height parameter. The height parameter represents the vertical size of the minimum bounding rectangle.

[0119] Step S455: converting the width parameter and the height parameter into physical size parameters based on the actual size of the polarizer, wherein the physical size parameter is equal to the pixel size parameter multiplied by the pixel resolution conversion coefficient of the image acquisition system.

[0120] After obtaining the width and height parameters of the minimum bounding rectangle, these pixel size parameters are converted to physical size parameters based on the actual size of the polarizer. The image acquisition system's pixel resolution conversion coefficient is a predetermined factor that represents the size of each pixel in actual physical dimensions. The width and height parameters are multiplied by the image acquisition system's pixel resolution conversion coefficient to obtain the corresponding physical width and height parameters. This conversion converts the pixel size parameters into physical size parameters, allowing the defect size to be described in terms of actual physical dimensions.

[0121] Step S456: combining the standardized width parameter and height parameter to obtain a size characteristic parameter of the defect, where the size characteristic parameter is used to describe the actual size of the defect on the surface of the polarizer.

[0122] After obtaining the physical width and height parameters, they are combined to obtain the defect's size characteristic parameters. The size characteristic parameters can be used to describe the actual size of the defect on the polarizer surface. Through the size characteristic parameters, the size of the defect can be intuitively understood.

[0123] Step S460: Calculate the Euclidean distance between any two defect center location coordinates to generate an inter-defect distance matrix.

[0124] In this embodiment of the present invention, the Euclidean distance between any two defect center coordinates is calculated. For each pair of defect center coordinates, the sum of the squared difference between their X-axis coordinates and the squared difference between their Y-axis coordinates is calculated. The square root of this sum is then taken to obtain the Euclidean distance between the two defects. All Euclidean distances between defects are stored in a matrix to generate an inter-defect distance matrix. The inter-defect distance matrix can be used to analyze the spatial relationships between defects and determine which defects are closely spaced and potentially related.

[0125] As an implementation method, step S460, calculating the Euclidean distance between any two defect center location coordinates to generate an inter-defect distance matrix, may specifically include the following steps S461-467: Step S461: Obtain the center positioning coordinate set of all defects, where the center positioning coordinate set includes the X-axis coordinate and Y-axis coordinate of each defect.

[0126] After obtaining the center coordinates of each defect, the center coordinates of all defects are collected to form a center coordinate set. The center coordinate set contains the X-axis coordinate and Y-axis coordinate information of each defect.

[0127] Step S462: constructing a two-dimensional coordinate system, which is used to describe the position of the defect center positioning coordinates in the polarizer surface image.

[0128] To facilitate calculation of the distance between defect center coordinates, a two-dimensional coordinate system is constructed. The origin of the two-dimensional coordinate system can be set at the upper left corner of the polarizer surface image, with the X-axis and Y-axis representing the horizontal and vertical directions, respectively. Using this two-dimensional coordinate system, the center coordinate of each defect can be represented as a point on a two-dimensional plane.

[0129] Step S463: traverse each center positioning coordinate in the center positioning coordinate set, use it as the current defect coordinate, and pair it with all other defect coordinates in the set in sequence.

[0130] After constructing the two-dimensional coordinate system, traverse each center positioning coordinate in the center positioning coordinate set, take the currently traversed center positioning coordinate as the current defect coordinate, and then pair it with all other defect coordinates in the set in sequence.

[0131] Step S464: For each pair of defect coordinates, calculate the sum of the square of the X-axis coordinate difference and the square of the Y-axis coordinate difference, and then perform a square root operation on the sum to obtain the Euclidean distance value between the two defects.

[0132] Step S465: Using the defect number as the row index and column index, the calculated Euclidean distance value is filled into the corresponding matrix position to construct an initial distance matrix, where the matrix diagonal elements are 0, indicating the distance of the defect itself.

[0133] After obtaining the Euclidean distance values between all defect pairs, a matrix is constructed with the defect number as the row index and column index. The calculated Euclidean distance value is filled into the corresponding matrix position. For example, if the Euclidean distance value between defect i and defect j is d ij , then d ij Fill in the matrix with the values of row i, column j and row j, column i. The diagonal elements of the matrix are 0, representing the distances to the defects themselves. This matrix construction yields the initial distance matrix, which stores the Euclidean distances between all defects.

[0134] Step S466: normalizing the initial distance matrix, dividing all Euclidean distance values by the diagonal length of the polarizer surface image to obtain a normalized distance matrix.

[0135] In order to eliminate the influence of different polarizer surface image sizes, the initial distance matrix is normalized. For example, all Euclidean distance values in the initial distance matrix are divided by the diagonal length of the polarizer surface image. The diagonal length of the polarizer surface image can be calculated from the width and height of the image, that is, diagonal length = Through normalization processing, a normalized distance matrix is obtained. The elements in the normalized distance matrix represent the relative distances between defects, which facilitates the comparison and analysis between different images.

[0136] Step S467: Mark the element positions whose distances are less than a preset distance threshold in the normalized distance matrix, identify the defect pairs corresponding to these positions as potential associated defect groups, and generate an inter-defect distance matrix containing associated relationship marks.

[0137] After obtaining the normalized distance matrix, a preset distance threshold is set. The normalized distance matrix is searched for element locations with distances less than the preset threshold. The defect pairs corresponding to these locations are identified as potentially related defect groups. Potentially related defect groups indicate that these defects are closely related and may be associated, such as being caused by the same cause. The locations of these potentially related defect groups are marked in the normalized distance matrix, generating an inter-defect distance matrix that includes the relationship markers. This inter-defect distance matrix with the relationship markers can help users quickly identify which defects may be related.

[0138] Step S470: combining the defect type, center positioning coordinates, size characteristic parameters and the distance matrix between defects to obtain spatial distribution characteristic information of defects on the surface of the polarizer. The spatial distribution characteristic information also includes the number statistics of defect candidate area units corresponding to each defect type.

[0139] After obtaining the defect type, center location coordinates, dimensional characteristic parameters, and inter-defect distance matrix, this information is combined to obtain the spatial distribution characteristics of defects on the polarizer surface. This spatial distribution characteristic information describes the location, size, distance between defects, and defect type on the polarizer surface. The number of defect candidate area units corresponding to each defect type is also counted and included in the spatial distribution characteristic information. This spatial distribution characteristic information can help users fully understand the distribution of defects on the polarizer surface.

[0140] As an implementation manner, the method provided in the embodiment of the present invention may further include the following steps S500 to S900: Step S500: extracting the quality level threshold and defect tolerance parameters associated with each defect type from a preset quality standard library.

[0141] The preset quality standard library is a database that pre-stores quality level thresholds and defect tolerance parameters for various defect types. In this embodiment of the present invention, the quality level threshold and defect tolerance parameters associated with each defect type are extracted from the preset quality standard library. The quality level threshold represents the upper limit of the defect size allowed for different quality levels, while the defect tolerance parameter represents the allowable distribution range of defects on the polarizer surface. By extracting these parameters, a standard can be provided for subsequent defect acceptability determination.

[0142] Step S600: Compare the size characteristic parameter in the spatial distribution characteristic information with the corresponding quality level threshold. When the size characteristic parameter is less than the quality level threshold, the defect is determined to be an acceptable defect; otherwise, it is determined to be an unacceptable defect.

[0143] After obtaining the quality level threshold associated with each defect type, the size characteristic parameters in the spatial distribution feature information are compared with the corresponding quality level threshold. The size characteristic parameters include the width and height parameters of the defect, and the quality level threshold represents the upper limit of the defect size allowed for different quality levels. When the size characteristic parameter is less than the quality level threshold, the defect size is within the allowable range and is considered acceptable. When the size characteristic parameter is greater than or equal to the quality level threshold, the defect size exceeds the allowable range and is considered unacceptable.

[0144] As an embodiment, step S600 compares the size characteristic parameter in the spatial distribution characteristic information with the corresponding quality level threshold. When the size characteristic parameter is less than the quality level threshold, the defect is determined to be an acceptable defect; otherwise, it is determined to be an unacceptable defect. Specifically, the following steps S610 to S670 may be included: Step S610: Reading a quality level threshold table corresponding to the current defect type from a preset quality standard library, wherein the quality level threshold table includes upper limit values of defect sizes under different quality levels.

[0145] When determining the acceptability of defects, first read the quality grade threshold table corresponding to the current defect type from the preset quality standard library. The quality grade threshold table contains the upper limit values of defect sizes allowed under different quality grades, such as the upper limit value of defect size corresponding to quality grade A, the upper limit value of defect size corresponding to quality grade B, etc. By reading the quality grade threshold table, the size standards of the current defect type under different quality grades can be obtained, providing a basis for subsequently determining the threshold according to the specific quality grade. For example, for scratch defects, the quality grade threshold table may list the upper limit values of scratch length and width under the first-level quality standard, as well as the corresponding different upper limit values under the second-level and third-level quality standards.

[0146] Step S620: query the corresponding target quality level according to the product model of the polarizer to be inspected, and extract the upper limit value of the defect size corresponding to the target quality level from the quality level threshold table as the quality level threshold.

[0147] The product model of the polarizer to be inspected determines the quality grade requirements it should adhere to. Different product models may correspond to different target quality grades depending on factors such as the application scenario and customer needs. The target quality grade of the polarizer to be inspected is determined by querying a pre-established table of correspondences between product models and quality grades. The upper limit of the defect size corresponding to the target quality grade is then extracted from the quality grade threshold table read in step S610 and used as the quality grade threshold for this defect acceptability determination. For example, if the product model of the polarizer to be inspected corresponds to the first-level quality standard, the upper limit of the size of the defect type under the first-level quality standard is extracted from the quality grade threshold table.

[0148] Step S630: Acquire the size characteristic parameters corresponding to the current defect type in the spatial distribution characteristic information, where the size characteristic parameters include a width parameter and a height parameter.

[0149] After obtaining the quality level threshold, it is necessary to obtain the actual size characteristic parameters of the current defect type. These parameters are stored in the previously generated spatial distribution feature information. The size characteristic parameters include the width and height parameters of the defect. These parameters are obtained by calculating the minimum bounding rectangle of the defect candidate area unit in step S450 and its substeps and converted into physical size parameters based on the actual size of the polarizer. For example, for a circular defect, the width and height parameters may be approximately equal, while for a rectangular defect, the width and height parameters represent the lengths of its short and long sides, respectively.

[0150] Step S640: Compare the width parameter with the quality level threshold. When the width parameter is smaller than the quality level threshold, the width comparison result is passed; otherwise, it is failed.

[0151] Compare the acquired width parameter of the current defect type with the quality threshold. This is a simple numerical comparison process. If the width parameter is less than the quality threshold, the defect's width dimension meets the quality requirements, and the width comparison result is a pass. Conversely, if the width parameter is greater than or equal to the quality threshold, the defect's width dimension exceeds the allowable range, and the width comparison result is a fail. For example, if the quality threshold stipulates that the scratch width cannot exceed 0.5 mm, and the current defect's width parameter is 0.3 mm, the width comparison result is a pass; if the width parameter is 0.6 mm, the width comparison result is a fail.

[0152] Step S650: Compare the height parameter with the quality level threshold. When the height parameter is less than the quality level threshold, the height comparison result is passed, otherwise it is failed.

[0153] Similarly, the height parameter is compared. The height parameter of the current defect type is compared with the quality level threshold. If the height parameter is less than the quality level threshold, it indicates that the defect's height dimension is within the allowable range, and the height comparison result is passed. If the height parameter is greater than or equal to the quality level threshold, it indicates that the defect's height dimension exceeds the quality requirements, and the height comparison result is failed.

[0154] Step S660: When both the width comparison result and the height comparison result are passed, the defect is determined to be an acceptable defect; when at least one of the width comparison result or the height comparison result is failed, the defect is determined to be an unacceptable defect.

[0155] The acceptability of the defect is determined by combining the width comparison results and the height comparison results. When the comparison results in both the width and height directions are passed, the defect is determined to be an acceptable defect, which means that the size of the defect meets the quality requirements in all directions. If either the width comparison result or the height comparison result is failed, the defect is determined to be an unacceptable defect, which means that the size of the defect exceeds the allowable range in a certain direction. For example, for an elliptical defect, if its width comparison result is passed and the height comparison result is also passed, the defect is an acceptable defect; if the width comparison result is failed, even if the height comparison result is passed, the defect is still an unacceptable defect.

[0156] Step S670: Record the acceptability determination result of each defect into the determination result list, and associate the corresponding defect type and size characteristic parameters for subsequent generation of a polarizer quality inspection report.

[0157] After determining the acceptability of each defect, the results are recorded in a determination result list. To facilitate subsequent review and analysis, each determination result is associated with the corresponding defect type and dimensional characteristic parameters. This allows the polarizer quality inspection report to clearly display the specific circumstances of each defect and whether it meets quality requirements. For example, the determination result list might be presented in a table format, with each row recording information about a defect, including defect type, width parameter, height parameter, and acceptability determination result.

[0158] Step S700: Count the number of defect types in the spatial distribution feature information, and calculate the ratio of the number of unacceptable defects to the total number of defects as a defect qualification rate evaluation indicator.

[0159] First, the defect type statistics are obtained from the spatial distribution feature information. This result records the number of occurrences of each defect type. Next, the number of unacceptable defects is counted. This involves filtering out and counting the defects deemed unacceptable from the judgment result list. The total number of defects, i.e., the total number of all defects, is also calculated. Finally, the ratio of unacceptable defects to the total number of defects is calculated and used as an indicator for evaluating the defect yield. This metric provides a direct reflection of the overall quality of the polarizer; a lower ratio indicates better quality.

[0160] Step S800: Based on the center positioning coordinates and size characteristic parameters in the spatial distribution feature information, generate a positioning coordinate description of each defect on the polarizer surface. The positioning coordinate description includes the X-axis coordinates and Y-axis coordinates of the defect center and the coordinates of the diagonal vertices of the defect's circumscribed rectangle.

[0161] The positioning coordinate description of each defect is generated by the center positioning coordinates and size characteristic parameters in the previously generated spatial distribution feature information. The center positioning coordinates have been calculated in step S440, indicating the pixel coordinates of the center position of the defect in the polarizer surface image. The size characteristic parameters include the width parameter and height parameter of the defect, and these parameters can be used to calculate the diagonal vertex coordinates of the defect's circumscribed rectangle. Specifically, assuming that the center positioning coordinates of the defect are (Xc, Yc), the width parameter is W, and the height parameter is H, the coordinates of the upper left corner vertex of the defect's circumscribed rectangle are (Xc-W / 2, Yc-H / 2), and the coordinates of the lower right corner vertex are (Xc+W / 2, Yc+H / 2). The X-axis coordinates, Y-axis coordinates of the defect center, and the diagonal vertex coordinates of the circumscribed rectangle are combined to form a positioning coordinate description, which is used to accurately locate the position of each defect on the polarizer surface.

[0162] Step S900: Formatting the defect type, defect yield evaluation index, positioning coordinate description, and acceptability determination result according to a preset report template to generate a polarizer quality inspection report containing text description and table data.

[0163] The preset report template is a pre-designed format used to standardize the content and presentation of polarizer quality inspection reports. The previously obtained defect types, defect qualification rate assessment indicators, positioning coordinate descriptions, and acceptability determination results are formatted according to the report template. The report can include a text description section for an overall explanation and analysis of the inspection results, such as the distribution of defect types and analysis of major defect types. It can also include a tabular data section that presents detailed information about each defect in tabular form, such as defect type, center positioning coordinates, dimensional characteristic parameters, and acceptability determination results. This formatting process generates a complete, clear, and easy-to-understand polarizer quality inspection report, providing a strong basis for polarizer quality assessment and subsequent processing.

[0164] It is understandable that the various algorithms involved in the above-mentioned introductions of the embodiments of the present invention, such as the adaptive histogram equalization algorithm, the contour tracing algorithm, the Euclidean algorithm, etc., can all be learned from the relevant content in the prior art. In order to save space, they will not be expanded too much in the embodiments of the present invention. In addition, when implementing the scheme of the present invention, those skilled in the art can supplement the details according to the common knowledge in the field. For example, according to the common knowledge in the field, normalization can be used to eliminate dimensional conflicts before feature fusion, interpolation can be used to eliminate dimensional differences, and thresholds can be reasonably set based on historical data, experience or business scenario requirements. The model can be trained based on a general model training method, and the number of layers in the model structure can be set based on actual needs, the activation function can be selected, etc. The present invention will no longer provide redundant introductions to the overly detailed implementation process.

[0165] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a defect detection system provided in an embodiment of the present invention. The defect detection system can be a computer system installed on a polarizer production line, which includes at least a processor 101, a communication interface 102, and a memory 103. The processor 101, the communication interface 102, and the memory 103 can be connected via a bus or other means. The processor 101 (or central processing unit (CPU)) is the computing core and control core of the defect detection system, which can parse various instructions within the defect detection system and process various data of the defect detection system. The communication interface 102 can optionally include a standard wired interface or a wireless interface (such as Wi-Fi, a mobile communication interface, etc.), which can be used to send and receive data under the control of the processor 101. The communication interface 102 can also be used for the transmission and interaction of data within the defect detection system. The memory 103 (Memory) is a memory device in the defect detection system for storing programs and data. It is understood that the memory 103 here can include both the built-in memory of the defect detection system and the extended memory supported by the defect detection system. The memory 103 provides a storage space, which stores the operating system of the defect detection system, but the present invention does not limit this.

[0166] In one embodiment, the processor 101 executes the polarizer defect detection method based on deep learning provided in the above embodiment of the present invention by running the computer program in the memory 103.

Claims

1. A polarizer defect detection method based on deep learning, characterized in that: The method comprises: Acquire an initial image data set corresponding to the polarizer to be detected, wherein the initial image data set includes multiple polarizer surface images at different acquisition angles; Extracting defect candidate region features in the polarizer surface image and texture distribution features on the polarizer surface from the initial image data set through image preprocessing and feature extraction operations; Inputting the defect candidate region features and the texture distribution features into a pre-trained defect recognition deep learning model to perform a joint defect recognition operation to generate a preliminary defect recognition result of the polarizer surface image; Based on the preliminary defect identification result, the defect type of the defect existing in the polarizer to be detected and the spatial distribution characteristic information of the defect on the surface of the polarizer are determined.

2. The method according to claim 1, characterized in that The extracting defect candidate region features in the polarizer surface image and texture distribution features on the polarizer surface from the initial image data set through image preprocessing and feature extraction operations includes: Adjusting the grayscale distribution range of each polarizer surface image in the initial image data set by an adaptive histogram equalization algorithm to generate illumination-balanced image data; Eliminating random noise and salt-and-pepper noise in the illumination-equalized image data based on Gaussian filtering and median filtering to generate denoised image data; Strengthening the grayscale change area in the denoised image data by using a Laplace operator, highlighting the edge contour information of the defect area, and generating edge-enhanced image data; Starting from a preset seed point, adjacent pixel points in the edge-enhanced image data whose grayscale value differences are within a preset range are merged into the same area to obtain multiple defect candidate area units; Extracting the area ratio, the ratio of the perimeter to the area, and the aspect ratio of the circumscribed rectangle of each defect candidate area unit, and combining them to obtain the defect candidate area features; Calculating the texture energy, entropy value and contrast parameter of the denoised image data at different directions and distances through the gray level co-occurrence matrix, and combining them to obtain the texture distribution feature; The dimensions of the defect candidate region features and the texture distribution features are adjusted to the same dimension through linear mapping, so as to generate a joint feature set with a unified dimensional representation.

3. The method according to claim 2, characterized in that The method of enhancing the grayscale change region in the denoised image data by using the Laplace operator, highlighting the edge contour information of the defect region, and generating edge-enhanced image data includes: Converting the denoised image data into a single-channel grayscale image, retaining brightness information in the image, and generating grayscale image data; Calculating the gradient values of the pixels in the grayscale image data in the horizontal direction and the vertical direction based on the Sobel operator to obtain a horizontal gradient image and a vertical gradient image; performing a square sum and square root operation on the horizontal gradient image and the vertical gradient image, and combining them to obtain a gradient magnitude image representing edge strength; Traversing each pixel in the gradient magnitude image, comparing the gradient magnitude of the pixel with its adjacent pixels in the gradient direction, retaining the local maximum pixel, and obtaining a refined edge image; Setting a high threshold and a low threshold to perform double threshold processing on the refined edge image, marking pixels whose gradient amplitude is greater than the high threshold as strong edges, marking pixels whose gradient amplitude is between the low threshold and the high threshold and connected to the strong edge as weak edges, and marking pixels whose gradient amplitude is less than the low threshold as non-edges; Determine whether the pixels marked as weak edges have a connected path with the strong edge, retain the weak edge pixels connected to the strong edge, delete the isolated weak edge pixels, and obtain a complete edge image; The complete edge image is superimposed on the grayscale image data, and the grayscale value of the edge pixel point is adjusted to a preset highlight value to generate edge enhanced image data that highlights the edge contour of the defect area.

4. The method according to claim 2, characterized in that Starting from a preset seed point, adjacent pixel points with grayscale value differences within a preset range in the edge-enhanced image data are merged into the same area to obtain multiple defect candidate area units, including: Setting a grayscale threshold to convert the edge-enhanced image data into a black-and-white binary image, wherein the pixel value of the edge contour area is 1 and the pixel value of the background area is 0, thereby generating a binary edge image; Performing a morphological closing operation of dilation and erosion on the binary edge image based on a structure element of a preset size, filling small holes in the edge contour, connecting broken edge segments, and generating a closed edge image; Extracting a pixel coordinate set of each closed contour in the closed edge image by a contour tracing algorithm, determining the minimum bounding rectangle of each closed contour, and using the central pixel point of the minimum bounding rectangle as a seed point for region growth; Sampling the grayscale value of the pixel corresponding to each seed point in the denoised image data as an initial grayscale reference value for region growing; Taking the seed point as the center, traverse the adjacent pixels and calculate the absolute difference between the grayscale value of the adjacent pixel and the initial grayscale reference value. When the absolute difference is less than the preset grayscale difference threshold, the adjacent pixel is included in the current growth area, and the grayscale reference value of the area is updated to the average grayscale value of all pixels in the area. Repeat the neighborhood search and region growing steps until no new pixel meets the grayscale difference condition, stop the growth process of the current region, and obtain a complete region unit; The region units whose area is smaller than the preset minimum area threshold are deleted, and the region units whose area is greater than or equal to the preset minimum area threshold are retained as defect candidate region units.

5. The method according to claim 1, wherein The step of inputting the defect candidate region features and the texture distribution features into a pre-trained defect recognition deep learning model to perform a joint defect recognition operation to generate a preliminary defect recognition result of the polarizer surface image includes: Splicing the defect candidate region features and the texture distribution features along the channel dimension to generate an initial fusion feature vector; Adjusting the mean and variance of each channel in the initial fused feature vector to a preset range, eliminating the dimensional differences between different feature channels, and generating a normalized fused feature vector; Inputting the normalized fused feature vector into the residual network module of the defect recognition deep learning model, performing nonlinear transformation and dimensionality enhancement on the feature vector through multiple residual blocks. Each residual block contains two convolutional layers and a skip connection. The input features are directly superimposed on the convolutional layer output features through the skip connection to generate a deep feature representation vector; Calculating the average value of the deep feature representation vector in the spatial dimension to obtain a global feature vector with a global receptive field; Mapping the global feature vector to a preset defect category space through a linear transformation to generate a defect probability distribution vector containing probability values for each category; Performing softmax normalization on the defect probability distribution vector to convert the probability values into a probability distribution with a sum of 1, extracting the category with the largest probability value as the primary defect category, and recording other categories with probability values greater than a preset secondary threshold as secondary defect categories; The primary defect category, the secondary defect category, and the corresponding probability values are combined to obtain the preliminary defect identification result, which further includes a confidence score corresponding to each defect category.

6. The method according to claim 5, characterized in that The normalized fusion feature vector is input into the residual network module of the defect recognition deep learning model, and the feature vector is nonlinearly transformed and dimensionally enhanced through multiple residual blocks. Each residual block contains two convolutional layers and a skip connection. The input features are directly superimposed on the convolutional layer output features through the skip connection to generate a deep feature representation vector, including: Inputting the normalized fused feature vector into the first convolution layer of the first residual block, performing a convolution operation on the feature vector based on a preset number of convolution kernels, extracting local feature information, and generating a first convolution feature; Performing ReLU activation function processing on the first convolution feature to generate a first activation feature; Inputting the first activated features into the second convolutional layer of the first residual block, performing a convolution operation on the features based on the same number of convolution kernels as the first convolutional layer, further extracting deep local features, and generating second convolutional features; Adjusting the mean and variance of the second convolution feature to generate a second normalized feature; Superimposing the normalized fused feature vector onto the second normalized feature through a skip connection to generate a first residual feature; Inputting the first residual feature into a second residual block, and repeatedly performing the convolution, activation, batch normalization, and skip connection operations in the first residual block to generate a second residual feature; The output features of each residual block are input into the next residual block in turn. The number of convolution kernels in each subsequent residual block is twice that of the previous residual block. Through the cascade processing of multiple residual blocks, the dimension and abstraction level of the features are gradually improved, and a deep feature representation vector with multi-scale feature information is generated.

7. The method according to claim 1, characterized in that The determining, based on the preliminary defect identification result, the defect type of the defect in the polarizer to be detected and the spatial distribution characteristic information of the defect on the surface of the polarizer includes: parsing the primary defect category and the secondary defect category in the preliminary defect identification result to determine all defect types present in the polarizer to be inspected, where each defect type corresponds to a unique defect category identifier; Extracting the confidence score corresponding to each defect type in the preliminary defect identification result, sorting the confidence scores in descending order, and generating a defect type priority sequence; Numbering the defect candidate area units, and establishing an association relationship between each defect candidate area unit and the defect type, wherein the primary defect type is associated with the defect candidate area unit with the largest area, and the secondary defect types are associated with the remaining defect candidate area units in order of priority; Obtaining a pixel coordinate set of each defect candidate area unit associated with a defect type in the polarizer surface image, and calculating the geometric center coordinates of the pixel coordinate set as the center positioning coordinates of the defect; Determine the minimum bounding rectangle of the defect candidate area unit according to the pixel coordinate set, and calculate the width and height parameters of the minimum bounding rectangle as the size characteristic parameters of the defect; Calculate the Euclidean distance between any two defect center location coordinates to generate the distance matrix between defects; The defect type, center positioning coordinates, size characteristic parameters and defect distance matrix are combined to obtain spatial distribution characteristic information of the defects on the surface of the polarizer. The spatial distribution characteristic information also includes the number statistics of defect candidate area units corresponding to each defect type.

8. The method according to claim 7, characterized in that The step of determining the minimum bounding rectangle of the defect candidate area unit according to the pixel coordinate set and calculating the width and height parameters of the minimum bounding rectangle as the size characteristic parameters of the defect includes: Traversing all pixel points in the pixel coordinate set, extracting the horizontal coordinate and vertical coordinate of each pixel point to obtain a horizontal coordinate set and a vertical coordinate set; Find the minimum value and the maximum value in the set of horizontal coordinates, and use them as the left boundary coordinate and the right boundary coordinate of the minimum bounding rectangle respectively; Find the minimum value and the maximum value in the vertical coordinate set, and use them as the lower boundary coordinate and the upper boundary coordinate of the minimum bounding rectangle respectively; Calculate the difference between the right boundary coordinate and the left boundary coordinate to obtain the width parameter of the minimum bounding rectangle; Calculate the difference between the upper boundary coordinate and the lower boundary coordinate to obtain the height parameter of the minimum circumscribed rectangle; Converting the width parameter and the height parameter into a physical size parameter based on the actual size of the polarizer, wherein the physical size parameter is equal to the pixel size parameter multiplied by the pixel resolution conversion coefficient of the image acquisition system; The standardized width parameter and height parameter are combined to obtain a size characteristic parameter of the defect, which is used to describe the actual size of the defect on the surface of the polarizer.

9. The method according to claim 1, characterized in that The method further comprises: Extracting quality level thresholds and defect tolerance parameters associated with each defect type from a preset quality standard library; Comparing the size characteristic parameter in the spatial distribution characteristic information with the corresponding quality level threshold, and determining that the defect is an acceptable defect when the size characteristic parameter is less than the quality level threshold, otherwise determining that the defect is an unacceptable defect; Counting the number of defect types in the spatial distribution feature information, and calculating the ratio of the number of unacceptable defects to the total number of defects as a defect qualification rate assessment indicator; Based on the center positioning coordinates and size characteristic parameters in the spatial distribution feature information, a positioning coordinate description of each defect on the surface of the polarizer is generated, where the positioning coordinate description includes the X-axis coordinate and Y-axis coordinate of the defect center and the coordinates of the diagonal vertices of the defect circumscribed rectangle; The defect type, defect qualification rate evaluation index, positioning coordinate description and acceptability determination result are formatted according to a preset report template to generate a polarizer quality inspection report containing text description and table data.

10. A defect detection system, characterized in that: include: a memory storing a computer program; A processor, configured to load the computer program to implement the polarizer defect detection method based on deep learning as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Polarizer defect image real-time classification method based on parallel module deep learning

    CN110633739A

  • Product surface defect detection method and device based on deep learning and machine vision

    CN111445471A

  • Intelligent control method and system for automatic optical detection of apparent defects and medium

    CN116188475A

  • Polaroid defect detection method, device and equipment based on image and storage medium

    CN117437202A

  • Polaroid surface defect intelligent multi-sorting control system and method

    CN118688207A

Cited By

  • Appearance defect detection method and device and application thereof

    CN120747061A

  • Material quality detection method and device based on quantum sensor detection

    CN121032330A

  • Method and device for detecting material quality based on quantum sensor detection

    CN121032330B

  • Blind hole plate hole depth measuring method and system based on distributed camera 2D and 3D

    CN121095241A

  • Stone-plastic floor raw material grading method based on computer vision

    CN121121292A