A method for detecting surface defects of a glass after coating

By employing multi-polarization angle-reflection differential imaging, dual-scale scattering-reflection coupled imaging, and an adaptive deep learning model, the problems of low efficiency and insufficient accuracy in detecting defects on coated glass surfaces have been solved, achieving efficient and accurate defect identification and classification, adaptable to different types of coated glass.

CN122238375APending Publication Date: 2026-06-19HUNAN YUNDI TEMPERED GLASS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN YUNDI TEMPERED GLASS CO LTD
Filing Date
2026-03-17
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, the detection of defects on coated glass surfaces relies on manual visual inspection or single optical imaging, which is inefficient, lacks precision, makes it difficult to identify minute defects and classifies them inaccurately, has a low level of automation, and cannot meet the needs of large-scale production.

Method used

By employing multi-polarization angle-reflection differential imaging, dual-scale scattering-reflection coupled imaging, and an adaptive deep learning model based on the defect formation mechanism, combined with deep learning technology and coating process rules, defects can be made salient, accurately identified, and classified.

Benefits of technology

It improves the efficiency and accuracy of surface defect detection for coated glass, accurately identifies minute defects and makes scientific judgments, reduces human interference, ensures the stability and consistency of test results, and is adaptable to different types of coated glass.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122238375A_ABST
    Figure CN122238375A_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting surface defects on coated glass, comprising the following steps: S1, performing multi-polarization angle-reflection differential imaging for defect saliency detection on the coated glass to be inspected, utilizing the difference in polarization reflection characteristics to achieve physical enhancement and preliminary identification of the defect area; S2, employing a micro-defect identification method based on dual-scale scattering-reflection coupled imaging to accurately detect minute defects on the surface of the coated glass. This invention relates to the field of glass coating surface defect detection technology. This method for detecting surface defects on coated glass utilizes multi-polarization angle reflection imaging to saliency the defect area, enabling minute defects to be effectively magnified and clearly displayed; the dual-scale scattering-reflection coupled imaging method achieves accurate identification and classification of micro-defects through the synergistic effect of specular reflection and scattering images; and uses a deep learning model combined with defect formation mechanism constraints to accurately classify and grade the severity of defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surface defect detection in glass coatings, and more specifically, to a method for detecting surface defects after glass coating. Background Technology

[0002] Coated glass is widely used in optics, architecture, display, and decoration. Its surface defects directly affect the glass's performance and appearance. Traditional defect detection methods mainly rely on manual visual inspection or single optical imaging techniques, which have the following problems: Defect identification is inefficient; manual inspection relies on operator experience, is slow, and is difficult to handle large-scale production; minute defects are difficult to detect, and conventional imaging methods cannot distinguish between minute defects and the reflection differences of uniform films, limiting detection accuracy; defect classification is inaccurate, as traditional methods lack analysis of defect formation mechanisms, making it difficult to accurately determine defect types and severity; and automation is low, as existing automated inspection systems cannot fully integrate optical imaging characteristics with coating process rules, resulting in insufficient reliability of inspection results.

[0003] Therefore, there is an urgent need for a detection method that can detect and determine defects on coated glass surfaces with high precision and automation, while also taking into account the identification of minute defects and the assessment of defect levels. Summary of the Invention

[0004] The purpose of this invention is to provide a method for detecting surface defects after glass coating. This method solves the problems of existing defect detection methods, which mainly rely on manual visual inspection or single optical imaging methods, resulting in low defect identification efficiency, difficulty in detecting minute defects, inaccurate defect classification, low level of automation, and inability to meet usage requirements.

[0005] This invention achieves the above objective through the following technical solution: a method for detecting surface defects after glass coating, comprising the following steps: S1. Perform multi-polarization angle-reflection differential imaging for defect saliency detection on the coated glass to be inspected, and use the difference in polarization reflection characteristics to achieve physical enhancement and preliminary identification of the defect area; S2. A micro-defect identification method based on dual-scale scattering-reflection coupled imaging is used to accurately detect minute defects on the surface of coated glass. S3. Construct an adaptive depth detection model based on the constraint of defect formation mechanism, integrate deep learning technology with the defect formation law of coating process, and complete the final detection and judgment of defects on the surface of coated glass.

[0006] Furthermore, in step S1, the defect saliency detection of the coated glass to be inspected using multi-polarization angle-reflection differential imaging includes: A multi-polarization angle reflection imaging system consisting of an adjustable polarization light source and a polarization camera was constructed. Polarization reflection images with different polarization angles were acquired from the same detection area of ​​coated glass. After pixel-level registration of the images, the reflected light intensity values ​​of the corresponding pixels at each polarization angle were extracted. A polarization reflection difference matrix is ​​constructed based on the reflected light intensity value, and the difference in reflected light intensity between the defect region and the normal film region is amplified through difference operations; A defect saliency map is generated using the polarization reflection difference matrix, which suppresses the background reflection signal of the uniform film and highlights the light intensity characteristics of the defect region. An image segmentation algorithm is performed on the defect saliency map to extract the contour and location information of the defect region and to calculate the two-dimensional size of the defect.

[0007] Furthermore, when constructing the multi-polarization angle reflection imaging system, the adjustable polarization light source and the polarization camera are set coaxially and perpendicular to the detection surface of the coated glass to be tested, and the acquired polarization reflection image includes at least three polarization angles: 0°, 45°, and 90°. The polarization reflection difference matrix is ​​constructed by summing the absolute differences of the reflected light intensity values ​​at different polarization angles, and the matrix dimension is consistent with the dimension of the acquired polarization reflection image.

[0008] Furthermore, the image segmentation algorithm performed on the defect saliency map includes: Adaptive binarization processing is performed on the defect saliency map. The threshold value of the difference matrix pixel value is automatically set based on the maximum inter-class variance method to distinguish defect pixels from background pixels and obtain a defect binarized image. Morphological opening and closing operations are performed sequentially on the binarized image to remove isolated noise points, connect defective small connected regions, and repair broken parts of the defect contour. Contour feature points are extracted from the segmented defect region, the two-dimensional size parameters of the defect are calculated, and the pixel size is converted into the actual physical size according to the pixel calibration coefficient of the imaging system.

[0009] Furthermore, the micro-defect identification method based on dual-scale scattering-reflection coupling imaging in step S2 includes: A dual-scale scattering-reflection coupled optical detection system integrating a specular reflection channel and a scattering enhancement channel was constructed to enable the detection fields of the two channels to overlap and achieve synchronous imaging of the same detection area. The mirror reflection image of the coated glass is acquired through the mirror reflection channel. After preprocessing, the mirror reflection light intensity value is extracted. Based on the spatial distribution and uniformity index of the light intensity value, the film uniformity anomaly is detected. Scattering images of the coated glass are acquired through a scattering enhancement channel, and the scattered light intensity value is extracted after preprocessing. Based on the specular reflection light intensity and the scattered light intensity, a scattering-reflection coupling characteristic index is constructed to quantify the difference in light response between the micro-defect region and the normal region and form a coupling characteristic index map. Based on the numerical variation and spatial distribution of the coupling characteristic index, minor defects are identified and their severity is preliminarily classified.

[0010] Furthermore, the specular reflection channel uses coaxial parallel lighting to vertically illuminate the detection area, while the scattering enhancement channel uses an annular dark field lighting method to obliquely illuminate the detection area at a preset angle, wherein the preset angle is... Furthermore, the optical path design of the scattering enhancement channel prevents specular reflection light from entering the acquisition camera; The scattering-reflection coupling characteristic index is the ratio of the scattered light intensity to the specular reflection light intensity. Its preset normal threshold is calibrated according to the coating process type, film material and usage scenario. When the coupling characteristic index of the detection area exceeds the threshold, it is determined that there is a minor defect.

[0011] Furthermore, the preset normal threshold calibration method for the scattering-reflection coupling characteristic index is as follows: Images of multiple inspection areas of defect-free coated glass from the same batch, with the same process and material are collected. The coupling feature index of all pixels is calculated to form a defect-free sample dataset. The mean and standard deviation of the dataset are solved, and the basic threshold is set to the mean plus three times the standard deviation. For high-precision optical applications, the threshold is corrected to the mean plus 2.5 times the standard deviation; for general decorative applications, the threshold is corrected to the mean plus 3.5 times the standard deviation.

[0012] Furthermore, the construction of the adaptive depth detection model based on defect formation mechanism constraints in step S3 includes: Based on the specific coating process of coated glass, the physical mechanism of defect formation is sorted out, a defect mechanism parameter system including film thickness gradient is established, and the correlation between process and defect formation is quantified. Based on the defect mechanism parameters, a probability field model of defect direction is constructed to quantify the probability characteristics of different types of defects in spatial distribution, extension direction and morphological characteristics and form a probability field matrix. A defect mechanism constraint network is constructed with a target detection network as the backbone and an additional mechanism constraint branch. The defect saliency map, specular reflection image, scattering image and coupling feature index map are used as network inputs. After multi-scale feature fusion and extraction, the network outputs the predicted results of the defect location, type and level. A mechanistic constraint loss function is introduced into the network loss function to construct the total loss function. The network is then trained, validated, and tested. The successfully trained model is used for the final detection and judgment of defects on the coated glass surface.

[0013] Furthermore, the total loss function is a weighted sum of the conventional detection loss and the mechanism constraint loss, and the formula is:

[0014] in, The weighting coefficient for mechanism constraint loss is determined based on the number of steps in the coating process. The conventional detection loss is a weighted sum of the intersection-union loss and the classification loss. The intersection-union loss uses the generalized intersection-union loss to measure the deviation between the predicted box and the ground truth box, and the classification loss uses the cross-entropy loss to achieve accurate classification of defect types. The mechanism constraint loss is the loss due to the difference in probability distribution between the defect prediction result and the defect direction probability field model. The deviation between the model prediction value and the theoretical value is quantified by absolute value error calculation.

[0015] Furthermore, when training the defect mechanism constraint network, the coated glass defect image dataset is divided into a training set, a validation set, and a test set according to a preset ratio, and data augmentation operations are performed on the training set. The network is optimized using a preset optimizer, with the initial learning rate, weight decay coefficient, batch size and number of training rounds set. The learning rate is dynamically adjusted using a cosine annealing learning rate scheduling strategy, and an early stopping strategy is introduced to prevent model overfitting. After training, the model accuracy is verified using a test set. The model is considered to be successfully trained when both the defect detection precision and recall are not lower than the preset threshold. The parameters of the qualified model are saved as a deployment-ready detection model. After the relevant images of the coated glass to be inspected are input into the model in a preset format, the model outputs the precise location, type, size and grade of the defect, thus completing the final detection, classification and grade determination of the defect.

[0016] The beneficial effects of this invention are as follows: 1. By using multi-polarization angle reflection imaging to saliency the defect area, minute defects can be effectively magnified and clearly displayed; the dual-scale scattering-reflection coupled imaging method achieves accurate identification and classification of micro-defects through the synergistic effect of specular reflection and scattering images.

[0017] 2. By combining deep learning models with the constraints of defect formation mechanisms, we have achieved accurate classification and severity grading of defects, enabling scientific judgment on different types of defects and providing a more comprehensive defect assessment.

[0018] 3. Compared with traditional manual detection methods, the use of automated image processing and deep learning algorithms not only greatly improves the efficiency of detection, but also reduces the interference of human factors, ensuring the stability and consistency of detection results.

[0019] 4. During the generation of the defect saliency map, the background reflection signal is effectively suppressed, which can avoid background interference from the uniform film layer and further improve the accuracy of defect detection.

[0020] 5. Combining the physical mechanism of coating process and the formation law of surface defects, it can adapt to different types of coated glass, especially in high-precision optical application scenarios, and can achieve more precise defect detection and classification.

[0021] 6. By establishing a complete inspection process, from image acquisition, defect saliency, micro-defect identification to the final deep learning classification model, the entire inspection process is highly integrated and systematic, enabling large-scale application in industrial production. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart illustrating the overall method of the present invention; Figure 2 This is a detailed flowchart of step S1 of the present invention; Figure 3 This is a detailed flowchart of step S2 of the present invention; Figure 4 This is a detailed flowchart of step S3 of the present invention. Detailed Implementation

[0023] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.

[0024] Example 1: Please see Figure 1-4 This invention provides a technical solution: a method for detecting surface defects after glass coating, the method comprising: S1. Defect saliency detection of coated glass under test by multi-polarization angle-reflection differential imaging, and physical enhancement and preliminary identification of defect areas by the difference in polarization reflection characteristics; Among these, multiple polarization angles refer to using multiple different polarization directions to acquire images during the imaging process. Under different polarization angles, the polarization state of the reflected light from the object's surface is different, and this characteristic can be used to highlight certain features of the object's surface; differential reflection imaging is a technique that images by analyzing the differences in reflected light under different conditions. In this method, by comparing reflected light under different polarization angles, images that can highlight defects are obtained; defect saliency detection utilizes the differences in polarization reflection characteristics to make the defect areas on the coated glass surface more obvious in the image, achieving physical enhancement of the defect areas, while also performing preliminary defect identification; differences in polarization reflection characteristics mean that different materials or different states of the same material, such as the normal area and defect area of ​​coated glass, have different reflection characteristics of polarized light, including differences in the polarization direction and intensity of the reflected light. These differences can be used to distinguish between defect areas and normal areas; S2. A micro-defect identification method based on dual-scale scattering-reflection coupled imaging is used to accurately detect minute defects on the surface of coated glass. Among these, dual-scale means that information at two different scales is considered during the imaging process, possibly from macroscopic and microscopic levels, or different scales such as different spatial resolutions, to acquire image information more comprehensively for detecting minute defects; scattering refers to the fact that when light shines on an object's surface, it scatters in various directions due to factors such as the surface roughness and microstructure. Minor defects may cause special scattering phenomena, and defect information can be obtained by analyzing the scattered light; reflection refers to the fact that light shines on an object's surface and reflects back according to certain rules. The reflection characteristics of normal areas and areas with minute defects may differ, and analyzing the reflected light helps to identify minute defects; coupled imaging fuses the information from scattering imaging and reflection imaging, comprehensively utilizing the advantages of both imaging methods to improve the detection accuracy of minute defects on coated glass surfaces; S3. Construct an adaptive depth detection model based on the constraint of defect formation mechanism, and combine deep learning with the defect formation law of coating process to complete the final detection and judgment of defects on the surface of coated glass. Among these, the defect formation mechanism constraint involves a deep understanding of the causes and processes of surface defects in coated glass. This knowledge of physics and chemistry is incorporated as constraints into the deep detection model, making the model more realistic and improving detection accuracy and reliability. Adaptability allows the model to automatically adjust its parameters and detection strategies based on different coated glass samples, defect types, and characteristics to adapt to various complex situations and achieve more precise detection. The deep detection model, typically built on deep learning algorithms, automatically learns features and patterns from large amounts of data to perform final detection and judgment of surface defects in coated glass. Combining deep learning with the formation rules of coating process defects, the model leverages the powerful data learning and feature extraction capabilities of deep learning while incorporating knowledge of the formation rules of defects in the coating process. This allows the model to be both data-driven and follow physical laws during the detection process, thereby improving detection effectiveness.

[0025] It should be noted that, when using multi-polarization angle-reflection differential imaging for defect saliency detection, the difference in polarization and reflection characteristics can physically enhance the defect area, achieving preliminary identification and laying the foundation for subsequent detection. It can also quickly locate obvious defects. The micro-defect identification method based on dual-scale scattering-reflection coupled imaging accurately detects minute defects by integrating scattering and reflection information from two scales, overcoming the limitations of single imaging methods and improving the ability to capture minute flaws. An adaptive depth detection model based on defect formation mechanism constraints is constructed, combining deep learning with the defect laws of coating process. This makes the model both data learning-capable and follows physical laws, enabling adaptive adjustment and improving detection accuracy and reliability. Ultimately, it achieves comprehensive and accurate defect detection and judgment, ensuring the quality of coated glass, reducing the defect rate, and improving production efficiency.

[0026] In one embodiment, defect saliency detection of the coated glass to be inspected using multi-polarization angle-reflection differential imaging includes: A multi-polarization angle reflection imaging system was constructed, consisting of an adjustable polarization light source and a polarization camera. The adjustable polarization light source and the polarization camera were coaxially positioned and perpendicular to the surface of the coated glass to be inspected. For the same inspection area on the coated glass surface, 0°, 45°, and 90° polarization reflection images were acquired by adjusting the polarization angle of the polarization light source. After pixel-level registration of the three acquired polarization reflection images, the reflected light intensity values ​​of the corresponding pixels at each polarization angle were extracted and denoted as follows: , , ; A polarization reflection difference matrix is ​​constructed based on the reflected light intensity value. The difference in reflected light intensity between the defective region and the normal film region is amplified using differential operations. The calculation formula is as follows:

[0027] in, These are the pixel values ​​of the polarization reflection difference matrix. For absolute value operations, the matrix dimension must be consistent with the dimension of the acquired polarization reflection image; A defect saliency map is generated using a polarization reflection difference matrix. The background reflection signal of the uniform film is effectively suppressed by the difference operation, highlighting the light intensity characteristics of the defect area and realizing the physical enhancement of the defect area. An image segmentation algorithm is executed on the defect saliency map to accurately extract the contour and location information of the defect region and complete the two-dimensional size calculation of the defect.

[0028] This design allows for the construction of a multi-polarization angle reflection imaging system to acquire images at different polarization angles. A difference matrix is ​​then constructed to generate a defect saliency map, which is then segmented and extracted to extract defect information. Multi-polarization angle imaging fully utilizes the differences in polarization reflection characteristics, amplifying the difference in reflected light intensity between defects and normal areas, thus achieving physical enhancement of the defects. The construction of the difference matrix and the generation of the saliency map effectively suppress background signals, highlight defect features, and improve defect identification sensitivity. Image segmentation algorithms are used to accurately extract defect contours and locations, and two-dimensional dimensions can be calculated, providing detailed and accurate defect information for subsequent inspections. This helps to comprehensively understand the defect situation and improve the accuracy and completeness of the inspection.

[0029] In one embodiment, a micro-defect identification method based on dual-scale scattering-reflection coupled imaging is used to accurately detect minute defects on the surface of coated glass, including: A dual-scale scattering-reflection coupled optical detection system was constructed. This system integrates two independent and synchronously acquireable optical detection channels: a specular reflection channel and a scattering enhancement channel. The detection fields of the two channels completely overlap, ensuring synchronous imaging of the same detection area. The coated glass to be tested is inspected through a mirror reflection channel: The detection area is uniformly illuminated using coaxial parallel lighting, with the lighting direction perpendicular to the coated glass detection surface. A planar array camera is used to acquire specular reflection images. After grayscale conversion and noise reduction preprocessing, the specular reflection intensity value of each pixel in the image is extracted and denoted as [value missing]. ,based on Spatial distribution characteristics and uniformity indicators of the film layer, and detection of film layer scratches, bulges and other abnormalities in film layer uniformity; The coated glass to be tested is inspected using a scattering enhancement channel: the inspection area is obliquely illuminated using a ring-shaped dark field illumination method, with the illumination light at an angle to the surface of the coated glass being inspected. The included angle effectively prevents specular reflection light from entering the acquisition camera, capturing only the scattered light signal generated at the micro-defect. A high-sensitivity area array camera is used to acquire the scattered image. After grayscale enhancement and noise suppression processing, the scattered light intensity value of each pixel in the image is extracted and denoted as... ; A scattering-reflection coupling characteristic index is constructed based on the specular reflection intensity and the scattered light intensity. This index is used to quantify the difference in photoresponse between the micro-defect region and the normal region. The calculation formula is as follows:

[0030] in, It is the scattering-reflection coupling characteristic index. The intensity of the scattered light, To calculate the intensity of specular reflection, the corresponding value is calculated for each pixel in the image. Values ​​are used to form a coupling characteristic index diagram; Based on the scattering-reflection coupling characteristic index The numerical variation characteristics and spatial distribution patterns are used to identify micro-cracks, pinholes, and particulate contamination-like micro-defects on the surface of the coated glass to be tested. When the value exceeds the preset normal threshold, it is determined that there is a minor defect in the corresponding pixel area. The numerical value provides a preliminary classification of the severity of minor defects.

[0031] This design establishes a dual-scale optical inspection system, acquiring images through both specular reflection and scattering enhancement channels. A coupled feature index map is constructed to identify minute defects. The simultaneous acquisition of the two channels ensures the synchronicity and accuracy of the inspection. The specular reflection channel can detect abnormalities in the film uniformity, while the scattering enhancement channel can capture the scattered light signals from micro-defects. The coupled feature index map constructed by combining the two comprehensively quantifies the difference in light response between micro-defects and normal areas. Based on the changes and distribution patterns of the index, minute defects are identified and classified, enabling precise detection of micro-cracks, pinholes, and other minute defects. This improves the detection capability for minute defects and ensures the quality of coated glass.

[0032] In one embodiment, an adaptive depth detection model based on defect formation mechanism constraints is constructed. This model combines deep learning with the defect formation rules of the coating process to complete the final detection and judgment of defects on the coated glass surface, including: Based on the specific coating processes such as vapor deposition and magnetron sputtering of the coated glass to be tested, the physical mechanisms of defect formation during the process are sorted out, and a defect mechanism parameter system including film thickness gradient, vapor deposition particle deposition direction and thermal stress crack direction is established. Each parameter is matched with the specific coating process parameters, and the correlation between process and defect formation is quantified. Based on the defect mechanism parameters, a probability field model of the defect direction is constructed. Based on the material deposition law and thermal stress release law of the coating process, the probability characteristics of different types of defects in spatial distribution, extension direction and morphological characteristics under the coating process are quantified, and a probability field matrix corresponding to the pixel dimension of the detection image is formed. A defect mechanism-guided network was constructed, which uses YOLOv8 as the backbone detection network and adds a mechanism constraint branch. The backbone network uses C2f modules as feature extraction units, and the mechanism constraint branch is a combination of fully connected layers and convolutional layers. The network input includes defect saliency map, specular reflection image, scattering image, and scattering-reflection coupling feature index map. The input images are uniformly scaled to 640×640 pixels. After multi-scale feature fusion and feature pyramid extraction of the input images, the network outputs the predicted results of the defect location, type, and level. In the design of the loss function for the defect mechanism-constrained network, a mechanism-constrained loss function is introduced to ensure that the model training process both fits the image features and follows the defect formation rules of the coating process. The total loss function... The calculation formula is:

[0033] in, For standard detection loss, a weighted sum of the intersection-union loss and classification loss used in object detection tasks is employed. The weighting coefficients for mechanistic constraint losses are determined according to the complexity of the coating process, with the following rules applied when the coating process steps... When walking, Pick Coating process steps When walking, Pick Coating process steps When walking, Take 0.30.5, The loss is the mechanism constraint loss, and the loss is the difference in probability distribution between the defect prediction result and the defect direction probability field model. A training dataset of coated glass defect images was constructed, and the dataset was divided into training, validation, and test sets in an 8:1:1 ratio. Data augmentation operations such as random flipping, random cropping, brightness adjustment, and Gaussian noise addition were performed on the training set images. The defect mechanism constraint network was trained using the labeled dataset. Specific training parameters were set and training was performed according to fixed steps. After training, the accuracy of the model was verified using the test set. After successful verification, the relevant images of the coated glass to be detected were input into the trained model in a preset format. The model output the precise location, type, size, and grade of the defects, thus completing the final detection, classification, and grade determination of defects on the coated glass surface.

[0034] This design, based on the coating process, analyzes the defect mechanism parameters, constructs a probability field model, builds a defect mechanism constraint network and designs a loss function, constructs a dataset to train the model, analyzes the defect mechanism parameters and constructs a probability field model, integrates process knowledge into detection, making the model more realistic. The constructed defect mechanism constraint network, combined with multiple image inputs and multi-scale feature fusion extraction, can comprehensively and accurately detect defects. Introducing a mechanism constraint loss function allows the model training to follow process rules. Constructing a dataset and augmenting the data can improve the model's generalization ability. The trained and validated model can accurately output defect information, complete the final detection and judgment, and improve the reliability and accuracy of detection.

[0035] In one embodiment, conventional detection loss The calculation formula is:

[0036] in, The weighting coefficients for the cross-union ratio loss are determined according to the positioning accuracy requirements of defect detection. If the detection requires a certain positioning accuracy... hour, Pick The detection requires positioning accuracy. hour, Pick The detection requires positioning accuracy. hour, Pick , For the intersection-union loss, the generalized intersection-union loss (GIoU) ​​is adopted to accurately measure the overlap and positional deviation between the predicted defect box and the ground truth box. For classification loss, cross-entropy loss is adopted to measure the difference in probability distribution between the predicted and actual defect types, so as to achieve accurate classification of different defect types such as microcracks, pinholes, particulate contamination, and scratches.

[0037] This design determines the weight coefficients of the Cross-Union Ratio (CUI) loss based on the positioning accuracy requirements, and uses Generalized Cross-Union Ratio (GUIR) and Cross-Entropy loss to calculate the conventional detection loss. The weight coefficients are determined according to the positioning accuracy requirements, allowing for flexible adjustment of the proportions of CUIR and classification loss in the total loss. This makes model training more focused on meeting actual detection needs. GUIR accurately measures the overlap and positional deviation between the predicted and ground truth boxes, improving positioning accuracy. Cross-Entropy loss measures the difference in probability distribution between the predicted and ground truth defect types, achieving accurate classification. The combination of these two technologies helps the model simultaneously ensure positioning and classification accuracy during detection, improving detection quality.

[0038] In one embodiment, mechanism-constrained loss The calculation formula is:

[0039] in, This represents the total number of pixels in the defect-direction probability field model, which is consistent with the total number of pixels in the image input to the network. The model predicts the first The directional probability value corresponding to the defect type at each pixel is extracted from the probability feature map output by the mechanism constraint branch. In the probability field model of the defect direction, the first... The theoretical direction probability value corresponding to the defect type at each pixel is pre-calibrated based on the defect formation mechanism of the coating process. The absolute value operation is used to constrain the model prediction results to fit the defect distribution law of the process mechanism.

[0040] This design calculates the sum of the absolute differences between the predicted and theoretical direction probability values ​​based on the total number of pixels, using this sum as the mechanism constraint loss. By calculating the sum of the absolute differences between the predicted defect type direction probability value and the theoretical value at each pixel, the model's prediction results can be directly measured to determine the degree of fit between the model's prediction results and the distribution law of defects in the process mechanism. This loss function constrains the model at the pixel level, ensuring that the model not only focuses on image features during training but also follows the defect formation law of the coating process. This makes the model's prediction results more consistent with reality, improves the accuracy and reliability of the model's defect detection, and enhances the model's ability to identify different types of defects.

[0041] In one embodiment, an image segmentation algorithm is performed on the defect saliency map to extract the defect region and calculate the two-dimensional size of the defect, including: Adaptive binarization is performed on the defect saliency map, and the threshold for pixel values ​​in the difference matrix is ​​automatically set based on the Otsu method (maximum inter-class variance). threshold The rules for determining it are as follows: Calculate all pixels in the defect saliency map The grayscale histogram of values ​​is used to traverse all possible grayscale values, dividing them into foreground and background categories. The grayscale value corresponding to the maximum inter-class variance between the two categories is the threshold. ,when When the pixel is in the defective state, it is identified as a defect pixel; otherwise, it is identified as a background pixel, thus obtaining a defect binarized image. Morphological opening and closing operations are performed sequentially on the binarized image. The opening operation uses a 3×3 rectangular structuring element, and the closing operation uses a 5×5 rectangular structuring element. The opening operation removes isolated noise points in the image, and the closing operation connects the small connected components of the defect, repairs the broken parts of the defect contour, and completes the accurate segmentation of the defect region. For the segmented defect region, extract its contour feature points, calculate the length and width of the minimum bounding rectangle of the defect contour as the two-dimensional size parameters of the defect. If it is an irregularly shaped defect, calculate the pixel area and contour perimeter of the defect region at the same time, and convert the pixel size into the actual physical size according to the pixel calibration coefficient of the imaging system.

[0042] This design features adaptive binarization of the defect saliency map, morphological operations to segment the defect region, extraction of contours to calculate two-dimensional dimensions and conversion to actual dimensions. Adaptive binarization, based on the maximum inter-class variance method, automatically sets thresholds, accurately distinguishing defects from the background based on image characteristics, thus improving segmentation accuracy. Morphological opening and closing operations remove noise, connect connected components, and repair contours, achieving precise segmentation. Extracting contours to calculate two-dimensional dimensions and converting them to actual dimensions provides quantitative data for defect assessment, facilitating defect classification and severity judgment. This helps in taking timely measures during production, ensuring product quality, and improving production efficiency and product qualification rate.

[0043] In one embodiment, the preset normal threshold is calibrated based on the coating process type, film material, and usage scenario of the coated glass to be inspected. The threshold determination rule is as follows: at least 50 images of defect-free coated glass from the same batch, with the same process, and the same material are collected, and for each inspection area, the corresponding values ​​of all pixels are calculated. Values ​​are used to form defect-free samples. Given a dataset, calculate the mean of that dataset. and standard deviation Set the preset normal threshold to ; If the coated glass to be tested is used in a high-precision optical application, the threshold will be adjusted to... If it is a typical decorative use case, the threshold will be adjusted to... ; When the detection area When the value is greater than this threshold, it is determined that a minor defect exists, and The larger the difference between the value and the threshold, the more significant the feature representing a minor defect.

[0044] This design, based on the calculation of mean and standard deviation of defect-free samples collected according to coating processes, determines a preset normal threshold. This threshold is then adjusted according to the usage scenario. By collecting a large number of defect-free samples from the same batch and calculating the mean and standard deviation to determine the threshold, the threshold becomes more consistent with actual conditions, improving the accuracy of defect detection. Adjustments are made considering the usage scenario; high-precision optical scenarios have strict requirements, so lowering the threshold can reduce missed detections; ordinary decorative scenarios have relatively lenient requirements, so raising the threshold can avoid false detections. This method of flexibly adjusting the threshold according to actual conditions makes the detection more targeted and practical, meeting the needs of defect detection on coated glass surfaces in different scenarios and improving the reliability of the detection results.

[0045] In one embodiment, the film thickness gradient is the rate of change of film thickness at different locations on the surface of the coated glass to be tested. It is a core mechanism parameter characterizing the uniformity of the film layer, and its calculation formula is as follows:

[0046] in, For film thickness gradient, , The film thickness is measured by a film thickness detection device at any two pixels within the detection area. Standard film thickness and thickness gradient designed for coating processes The threshold determination rule is as follows: According to the coating process design requirements, when the allowable deviation of the film thickness... hour, The threshold is set to 0.05; When the allowable deviation of the film thickness is hour, The threshold is set to 0.10; When the allowable deviation of film thickness hour, The threshold is set to 0.15; film thickness gradient When the value is greater than the corresponding threshold, it means that the film thickness variation in the detection area exceeds the process requirements, and the corresponding film uniformity is unqualified. This parameter serves as the core input of the defect direction probability field model and is used to constrain the model's identification rules for film thickness unevenness defects.

[0047] This design calculates the film thickness gradient based on the measured film thickness and determines the threshold according to process requirements to judge film uniformity. The film thickness gradient can intuitively reflect the rate of change of film thickness and is the core parameter characterizing film uniformity. By calculating the film thickness gradient at different locations through actual measurement, the film thickness variation can be accurately obtained. Determining the threshold according to the coating process design requirements can clarify the qualified standard for film uniformity. When the film thickness gradient value is greater than the threshold, it is judged as unqualified. It can be used as the core input of the defect direction probability field model, constraining the model's identification rules for film thickness non-uniformity defects, helping to detect film non-uniformity problems in a timely manner, ensuring the quality of coated glass, and improving the controllability of the production process.

[0048] In one embodiment, the specific training parameters of the defect mechanism constraint network are set as follows: The optimizer used is the AdamW optimizer, with an initial learning rate of 0.001, a weight decay coefficient of 0.0005, a batch size of 32, and a training epoch of 200. A cosine annealing learning rate scheduling strategy is used to dynamically adjust the learning rate, with an adjustment period of 50 epochs. The minimum learning rate is set to 0.00001. An early stopping strategy is used during training, automatically terminating model training when the total loss function value of the validation set does not decrease for 20 consecutive epochs.

[0049] This design employs the AdamW optimizer with predefined initial learning rate and other parameters. The cosine annealing scheduling strategy adjusts the learning rate, and an early stopping strategy is used. The AdamW optimizer combines the advantages of Adam with weight decay, effectively optimizing network parameters and preventing overfitting. Reasonable settings of parameters such as the initial learning rate and weight decay coefficient ensure stable model learning in the early stages of training. The cosine annealing learning rate scheduling strategy dynamically adjusts the learning rate, enabling the model to converge quickly during training while avoiding getting trapped in local optima. The early stopping strategy prevents overfitting by terminating training promptly when the validation set loss no longer decreases, saving training time and computational resources, improving training efficiency, and ensuring the model's generalization ability and detection performance.

[0050] In one embodiment, the specific training steps of the defect mechanism constraint network are as follows: For network initialization, the weights of all convolutional and fully connected layers in the backbone detection network and mechanism constraint branch of the defect mechanism constraint network are initialized using the Kaiming normal distribution, and the bias terms are initialized to 0. The training set input is to input the data-enhanced training set images into the initialized network in batches of 32. The network obtains the prediction results of defect location, type and level through forward propagation, and outputs the predicted defect direction probability value. Loss calculation: Based on the forward propagation results, calculate the conventional detection loss separately. Mechanism-constrained loss And combined with weighting coefficients Calculate the total loss function ; Backpropagation and parameter update, based on the AdamW optimizer, according to the total loss function. Gradient calculation is performed on all parameters of the network. A gradient pruning strategy is used to limit the gradient norm to within 5 to avoid gradient explosion. The network weights and biases are updated according to the initial learning rate. The learning rate is dynamically adjusted. Every 50 epochs of training, the learning rate is decayed through a cosine annealing learning rate scheduling strategy until it drops to the minimum and remains stable. Validation set validation: After each epoch of training, the validation set images are input into the currently trained network, the total loss function value and defect detection accuracy of the validation set are calculated, and the optimal model parameters are recorded. The changes in the aggregate loss function value are monitored and verified in real time. If the value does not decrease for 20 consecutive epochs, an early stop strategy is triggered to terminate training. If the preset number of training rounds of 200 epochs is reached, training is also terminated. Model testing and validation involves inputting test set images into the trained optimal model and calculating the model's defect detection precision, recall, and F1 score. When both precision and recall are high... If the training is deemed successful, the learning rate and weight coefficients are adjusted and the training is repeated. The model is saved by storing the trained model parameters in .pth format, forming a deployable glass coating surface defect detection model.

[0051] This design meticulously plans the training steps, including network initialization, input, loss calculation, and backpropagation. Network initialization uses appropriate methods to assign values ​​to weights and biases, laying a solid foundation for model training. The training set input and forward propagation yield prediction results, providing a basis for loss calculation. The conventional detection loss and mechanistic constraint loss are calculated separately to obtain the total loss, enabling a comprehensive evaluation of model performance. Backpropagation and parameter updates optimize network parameters based on the total loss. Gradient pruning avoids gradient explosion, and dynamic adjustment of the learning rate makes training more efficient. Validation on the validation set allows for real-time monitoring of model performance. Early stopping prevents overfitting, and model testing ensures model qualification. Finally, the model is saved for deployment. The entire training process is rigorous and reasonable, guaranteeing both model training quality and detection performance.

[0052] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0053] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting surface defects after glass coating, characterized in that, Includes the following steps: S1. Perform multi-polarization angle-reflection differential imaging for defect saliency detection on the coated glass to be inspected, and use the difference in polarization reflection characteristics to achieve physical enhancement and preliminary identification of the defect area; S2. A micro-defect identification method based on dual-scale scattering-reflection coupled imaging is used to accurately detect minute defects on the surface of coated glass. S3. Construct an adaptive depth detection model based on the constraint of defect formation mechanism, integrate deep learning technology with the defect formation law of coating process, and complete the final detection and judgment of defects on the surface of coated glass.

2. The method for detecting surface defects after glass coating according to claim 1, characterized in that, The defect saliency detection in step S1, which involves multi-polarization angle-reflection differential imaging of the coated glass to be inspected, includes: A multi-polarization angle reflection imaging system consisting of an adjustable polarization light source and a polarization camera was constructed. Polarization reflection images with different polarization angles were acquired from the same detection area of ​​coated glass. After pixel-level registration of the images, the reflected light intensity values ​​of the corresponding pixels at each polarization angle were extracted. A polarization reflection difference matrix is ​​constructed based on the reflected light intensity value, and the difference in reflected light intensity between the defect region and the normal film region is amplified through difference operations; A defect saliency map is generated using the polarization reflection difference matrix, which suppresses the background reflection signal of the uniform film and highlights the light intensity characteristics of the defect region. An image segmentation algorithm is performed on the defect saliency map to extract the contour and location information of the defect region and to calculate the two-dimensional size of the defect.

3. The method for detecting surface defects after glass coating according to claim 2, characterized in that: When constructing the multi-polarization angle reflection imaging system, the adjustable polarization light source and the polarization camera are set coaxially and perpendicular to the detection surface of the coated glass to be tested, and the acquired polarization reflection image contains at least three polarization angles: 0°, 45°, and 90°. The polarization reflection difference matrix is ​​constructed by summing the absolute differences of the reflected light intensity values ​​at different polarization angles, and the matrix dimension is consistent with the dimension of the acquired polarization reflection image.

4. The method for detecting surface defects after glass coating according to claim 2, characterized in that, The image segmentation algorithm performed on the defect saliency map includes: Adaptive binarization processing is performed on the defect saliency map. The threshold value of the difference matrix pixel value is automatically set based on the maximum inter-class variance method to distinguish defect pixels from background pixels and obtain a defect binarized image. Morphological opening and closing operations are performed sequentially on the binarized image to remove isolated noise points, connect defective small connected regions, and repair broken parts of the defect contour. Contour feature points are extracted from the segmented defect region, the two-dimensional size parameters of the defect are calculated, and the pixel size is converted into the actual physical size according to the pixel calibration coefficient of the imaging system.

5. The method for detecting surface defects after glass coating according to claim 1, characterized in that, The micro-defect identification method based on dual-scale scattering-reflection coupling imaging in step S2 includes: A dual-scale scattering-reflection coupled optical detection system integrating a specular reflection channel and a scattering enhancement channel was constructed to enable the detection fields of the two channels to overlap and achieve synchronous imaging of the same detection area. The mirror reflection image of the coated glass is acquired through the mirror reflection channel. After preprocessing, the mirror reflection light intensity value is extracted. Based on the spatial distribution and uniformity index of the light intensity value, the film uniformity anomaly is detected. Scattering images of the coated glass are acquired through a scattering enhancement channel, and the scattered light intensity value is extracted after preprocessing. Based on the specular reflection light intensity and the scattered light intensity, a scattering-reflection coupling characteristic index is constructed to quantify the difference in light response between the micro-defect region and the normal region and form a coupling characteristic index map. Based on the numerical variation and spatial distribution of the coupling characteristic index, minor defects are identified and their severity is preliminarily classified.

6. The method for detecting surface defects after glass coating according to claim 5, characterized in that: The mirror reflection channel uses coaxial parallel lighting to vertically illuminate the detection area, while the scattering enhancement channel uses an annular dark field lighting method to obliquely illuminate the detection area at a preset angle. The preset angle is... Furthermore, the optical path design of the scattering enhancement channel prevents specular reflection light from entering the acquisition camera; The scattering-reflection coupling characteristic index is the ratio of the scattered light intensity to the specular reflection light intensity. Its preset normal threshold is calibrated according to the coating process type, film material and usage scenario. When the coupling characteristic index of the detection area exceeds the threshold, it is determined that there is a minor defect.

7. The method for detecting surface defects after glass coating according to claim 5, characterized in that, The preset normal threshold calibration method for the scattering-reflection coupling characteristic index is as follows: Images of multiple inspection areas of defect-free coated glass from the same batch, with the same process and material are collected. The coupling feature index of all pixels is calculated to form a defect-free sample dataset. The mean and standard deviation of the dataset are solved, and the basic threshold is set to the mean plus three times the standard deviation. For high-precision optical applications, the threshold is corrected to the mean plus 2.5 times the standard deviation; for general decorative applications, the threshold is corrected to the mean plus 3.5 times the standard deviation.

8. The method for detecting surface defects after glass coating according to claim 1, characterized in that, The step S3, which involves constructing an adaptive depth detection model based on defect formation mechanism constraints, includes: Based on the specific coating process of coated glass, the physical mechanism of defect formation is sorted out, a defect mechanism parameter system including film thickness gradient is established, and the correlation between process and defect formation is quantified. Based on the defect mechanism parameters, a probability field model of defect direction is constructed to quantify the probability characteristics of different types of defects in spatial distribution, extension direction and morphological characteristics and form a probability field matrix. A defect mechanism constraint network is constructed with a target detection network as the backbone and an additional mechanism constraint branch. The defect saliency map, specular reflection image, scattering image and coupling feature index map are used as network inputs. After multi-scale feature fusion and extraction, the network outputs the predicted results of the defect location, type and level. A mechanistic constraint loss function is introduced into the network loss function to construct the total loss function. The network is then trained, validated, and tested. The successfully trained model is used for the final detection and judgment of defects on the coated glass surface.

9. The method for detecting surface defects after glass coating according to claim 8, characterized in that: The total loss function is a weighted sum of the conventional detection loss and the mechanism constraint loss, and the formula is: in, The weighting coefficient for mechanism constraint loss is determined based on the number of steps in the coating process. The conventional detection loss is a weighted sum of the intersection-union loss and the classification loss. The intersection-union loss uses the generalized intersection-union loss to measure the deviation between the predicted box and the ground truth box, and the classification loss uses the cross-entropy loss to achieve accurate classification of defect types. The mechanism constraint loss is the loss due to the difference in probability distribution between the defect prediction result and the defect direction probability field model. The deviation between the model prediction value and the theoretical value is quantified by absolute value error calculation.

10. The method for detecting surface defects after glass coating according to claim 8, characterized in that: When training the defect mechanism constraint network, the coated glass defect image dataset is divided into a training set, a validation set, and a test set according to a preset ratio, and data augmentation operations are performed on the training set. The network is optimized using a preset optimizer, with the initial learning rate, weight decay coefficient, batch size and number of training rounds set. The learning rate is dynamically adjusted using a cosine annealing learning rate scheduling strategy, and an early stopping strategy is introduced to prevent model overfitting. After training, the model accuracy is verified using a test set. The model is considered to be successfully trained when both the defect detection precision and recall are not lower than the preset threshold. The parameters of the qualified model are saved as a deployment-ready detection model. After the relevant images of the coated glass to be inspected are input into the model in a preset format, the model outputs the precise location, type, size and grade of the defect, thus completing the final detection, classification and grade determination of the defect.