Coating glass micro-defect frequency domain identification method

CN122887915APending Publication Date: 2026-10-09JIAXING BAISHENG PHOTOELECTRIC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611377372.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]针对现有技术的不足,本发明提供了镀层玻璃微缺陷频域识别方法,旨在解决镀层玻璃表面微缺陷检测中,膜层干涉效应产生的光学伪影与真实缺陷在频域中相互混叠、难以有效分离的问题

Benefits of technology

1、本发明根据膜层厚度参数和折射率参数计算膜层上下表面反射光的光程差,基于光程差计算干涉特征频率,并以干涉特征频率为基准设定高频截止频率和低频截止频率。该机制使频域滤波器的截止频率与镀层玻璃的实际膜层物理特性相匹配,能够将干涉条纹对应的频谱分量准确定位至特定的频带范围内,避免因固定截止频率导致的干涉频谱残留或有效缺陷频谱被误滤除。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887915A_ABST
    Figure CN122887915A_ABST
Patent Text Reader

Abstract

The application discloses a coated glass micro-defect frequency domain identification method, relates to the field of coated glass surface defect visual detection technology, and comprises the following steps: acquiring a coated glass surface image and performing two-dimensional fast Fourier transform to obtain a full frequency domain spectrum; calculating an optical path difference, calculating an interference characteristic frequency based on the optical path difference, and setting high-frequency and low-frequency cutoff frequencies; performing high-frequency mask and low-frequency mask extraction respectively, generating high-frequency and low-frequency characteristic maps through inverse Fourier transform; generating high-frequency attention weights through point-by-point convolution and generating low-frequency attention weights through grouping convolution; compressing, activating and gate-constraining the two kinds of attention weights to form fusion weights, adaptively weighting and fusing the high-frequency and low-frequency characteristic maps according to the fusion weights, and generating a dual-frequency fusion characteristic map; after multi-stage feature extraction and multi-scale feature fusion, performing target classification and boundary box regression, and outputting a defect detection result. The application can effectively separate interference artifacts from real defects and improve micro-defect detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology for defects on coated glass surfaces, and more particularly to a frequency domain identification method for micro-defects in coated glass. Background Technology

[0002] With the rapid development of photovoltaics, building energy conservation, and electronic displays, coated glass is increasingly widely used in various products. Micro-defects on the surface of coated glass (such as pinholes, scratches, particulate contamination, and uneven film thickness) directly affect the optical performance and service life of products. Accurate detection of these micro-defects has become a crucial aspect of production quality control. Current methods for detecting defects in coated glass primarily employ machine vision technology, using industrial cameras to capture images of the glass surface and image processing algorithms to identify defect areas.

[0003] Chinese invention patent application CN120876437A, published on October 31, 2025, discloses a photovoltaic glass defect detection method and system based on image recognition. The method extracts interference features from the reflection image to generate an optical artifact distribution map, locates the interference region in the frequency domain space of the transmission image, constructs a process response template by combining the deposition pulse frequency, and performs polarization coherence screening and time-varying deconvolution collaborative filtering to eliminate artifacts. However, the aforementioned patent applications mainly target the detection of macroscopic defects on the surface of photovoltaic glass coatings, focusing on suppressing interference artifacts through dual-modal acquisition of reflection and transmission images and auxiliary filtering using process parameters. However, they do not consider the direct influence of physical parameters such as the thickness and refractive index of the coated glass film on the frequency of interference fringes, and lack an adaptive setting mechanism for the frequency domain cutoff frequency based on the physical characteristics of the film. At the same time, the method adopts a unified processing strategy for high-frequency detail features and low-frequency background features, and fails to further perform differentiated attention-weighted fusion of high and low frequency features based on frequency domain separation. This results in micro-defects being submerged by the spectral energy of the interference fringes in the frequency domain due to their weak amplitude, and the detection capability for micro-defects with small scale and low contrast is insufficient. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a frequency domain identification method for micro-defects in coated glass, aiming to solve the problem that optical artifacts generated by film interference effects and real defects overlap in the frequency domain and are difficult to separate effectively during the detection of micro-defects on the surface of coated glass.

[0005] To achieve the above objectives, the present invention provides a frequency domain identification method for micro-defects in coated glass, comprising the following steps: S1. Obtain the original image of the coated glass surface, and perform a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum. S2. Collect the film thickness parameters and film refractive index parameters of the coated glass. Calculate the optical path difference of the reflected light from the upper and lower surfaces of the film based on the film thickness parameters and film refractive index parameters. Calculate the interference characteristic frequency of the interference fringes based on the optical path difference. Set the high-frequency cutoff frequency and low-frequency cutoff frequency based on the interference characteristic frequency. S3. Perform high-frequency mask extraction on the full-frequency spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, perform low-frequency mask extraction on the full-frequency spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, perform inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and perform inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map. S4. High-frequency attention weights are generated by extracting local gradient changes of high-frequency feature maps through pointwise convolution, and low-frequency attention weights are generated by maintaining the channel independence of low-frequency feature maps through grouped convolution. S5. After compressing the channels by performing pointwise convolution on the high-frequency attention weights and low-frequency attention weights, the spatial attention weights are generated by GELU activation and pointwise convolution. The spatial attention weights are constrained by sigmoid gating to form fusion weights. The high-frequency feature map and the low-frequency feature map are adaptively weighted and fused according to the fusion weights to generate a dual-frequency fusion feature map. S6. Perform multi-stage feature extraction on the dual-frequency fusion feature map to generate a multi-scale feature map set, perform multi-scale feature fusion on the multi-scale feature map set to generate a fused feature map set, perform target classification and bounding box regression on the fused feature map set to generate defect detection results.

[0006] Furthermore, the step of acquiring the original image of the coated glass surface and performing a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum includes: Images of the coated glass surface within the area illuminated by the ring-shaped LED light source are acquired using a high-resolution industrial camera, and these images are used as the original images. Perform a two-dimensional fast Fourier transform on the original image to convert it from the spatial domain to the frequency domain, generating a complex spectrum; Perform a spectrum shift on the complex spectrum to move the zero-frequency component of the complex spectrum to the center position of the complex spectrum, thereby generating a centered spectrum; Extract the complete complex data of the centered spectrum as the full-frequency domain spectrum.

[0007] Furthermore, the process of acquiring the film thickness and refractive index parameters of the coated glass, calculating the optical path difference of reflected light from the upper and lower surfaces of the film based on the film thickness and refractive index parameters, calculating the interference characteristic frequency of the interference fringes based on the optical path difference, and setting a high-frequency cutoff frequency and a low-frequency cutoff frequency based on the interference characteristic frequency, includes: The film thickness parameters of the coated glass were acquired using a spectral confocal displacement sensor. The reflectance spectrum of the coated glass is fitted using a spectral reflectance fitting algorithm to obtain the refractive index parameters of the film. The optical thickness of the film is obtained by multiplying the film thickness parameter and the film refractive index parameter. The optical thickness of the film is doubled to obtain the geometric optical path difference of the film. Extract the pre-stored phase jump values ​​of the upper and lower surfaces of the film, and perform a difference operation on the phase jump values ​​of the upper and lower surfaces of the film to obtain the relative phase jump difference. Obtain the center wavelength of the illumination source, divide the relative phase jump difference by 2π, and then multiply it by the center wavelength to obtain the phase-corrected optical path difference; The effective optical path difference of the film is obtained by performing an addition operation on the geometric optical path difference and the phase-corrected optical path difference; The interferometric characteristic frequency is obtained by taking the reciprocal of the effective optical path difference of the film layer; the magnification of the imaging system and the pixel size of the camera are obtained, and the product of the interferometric characteristic frequency and the pixel size of the camera is divided by the magnification of the imaging system to obtain the reference frequency. Multiply the reference frequency with the preset high-frequency cutoff coefficient and the preset low-frequency cutoff coefficient respectively to obtain the high-frequency cutoff frequency and the low-frequency cutoff frequency.

[0008] Furthermore, the step of performing high-frequency mask extraction on the full-frequency domain spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, performing low-frequency mask extraction on the full-frequency domain spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, performing inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and performing inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map includes: Using the zero-frequency position of the full-frequency spectrum as the origin and the high-frequency cutoff frequency as the radial distance threshold, a high-frequency mask of the same size as the full-frequency spectrum is constructed. Using the zero-frequency position of the full-frequency spectrum as the origin and the low-frequency cutoff frequency as the radial distance threshold, a low-frequency mask of the same size as the full-frequency spectrum is constructed. Element-wise multiplication is performed on the full-frequency spectrum and the high-frequency mask to obtain the high-frequency spectrum; Element-wise multiplication is performed on the full-frequency spectrum and the low-frequency mask to obtain the low-frequency spectrum; Perform an inverse Fourier transform on the high-frequency spectrum to obtain the high-frequency feature map; Perform an inverse Fourier transform on the low-frequency spectrum to obtain the low-frequency feature map.

[0009] Furthermore, the step of generating high-frequency attention weights by extracting local gradient changes of high-frequency feature maps through pointwise convolution, and generating low-frequency attention weights by maintaining channel independence of low-frequency feature maps through grouped convolution, includes: By performing spatial convolution independently on each channel of the high-frequency feature map through deep convolutional layers, local gradient changes within each channel are extracted to generate a multi-channel spatial response map. A linear combination is performed on all channels of the multi-channel spatial response map to generate high-frequency attention weights; The low-frequency feature map is divided into several channel groups according to the channel dimension. Standard convolution is performed independently on each channel group to extract the spatial distribution features within each channel group and generate a set of grouped convolution response maps. The outputs of all channels in the grouped convolutional response map set are aggregated and channel shuffling is performed to generate low-frequency attention weights.

[0010] Furthermore, after compressing the channels through pointwise convolution of the high-frequency and low-frequency attention weights, GELU activation and pointwise convolution are performed to generate spatial attention weights. These spatial attention weights are then constrained by a sigmoid gate to form fusion weights. Adaptive weighted fusion of the high-frequency and low-frequency feature maps is then performed according to these fusion weights to generate a dual-frequency fusion feature map, including: The high-frequency attention weights and low-frequency attention weights are concatenated along the channel dimension to generate concatenated attention weights. Perform pointwise convolutional dimensionality reduction on the spliced ​​attention weights to compress the number of channels in the spliced ​​attention weights and generate dimensionality-reduced attention weights; Perform GELU activation on the dimensionality-reduced attention weights to generate activated attention weights; Perform pointwise convolution to increase the dimensionality of the attention activation weights, restore the number of channels of the attention activation weights to the original total number of channels before splicing, and generate spatial attention weights.

[0011] Furthermore, the step of constraining spatial attention weights through sigmoid gating to form fusion weights, and then performing adaptive weighted fusion of the high-frequency feature map and the low-frequency feature map according to the fusion weights to generate a dual-frequency fusion feature map includes: Apply sigmoid activation to the spatial attention weights to constrain them to the [0, 1] interval; The spatial attention weights are split along the channel dimension into high-frequency spatial attention weights and low-frequency spatial attention weights. The high-frequency spatial attention weights have the same number of channels as the high-frequency feature map, and the low-frequency spatial attention weights have the same number of channels as the low-frequency feature map. Element-wise multiplication is performed on the high-frequency feature map and the high-frequency spatial attention weights to generate a high-frequency weighted feature map; A subtraction operation is performed between the constant 1 and the low-frequency spatial attention weights to generate low-frequency complementary weights; Element-wise multiplication is performed on the low-frequency feature map and the low-frequency complementary weights to generate a low-frequency weighted feature map. Element-wise addition is performed on the high-frequency weighted feature map and the low-frequency weighted feature map to generate a dual-frequency fused feature map.

[0012] Furthermore, the step of performing multi-stage feature extraction on the dual-frequency fused feature map to generate a multi-scale feature map set, fusing the multi-scale feature map set to generate a fused feature map set, and performing target classification and bounding box regression on the fused feature map set to generate defect detection results includes: The dual-frequency fused feature map is input into the feature pyramid backbone network, which contains multiple sequentially connected downsampling stages. Each downsampling stage performs convolutional downsampling and activation function operations in sequence, outputting stage feature maps. All stage feature maps are collected to generate a multi-scale feature map set. A top-down feature fusion process is performed on the multi-scale feature map set. The deepest stage feature map is sequentially upsampled to the spatial size of the previous stage feature map using bilinear interpolation. The upsampled deep feature map is then concatenated with the previous stage feature map along the channel dimension. The concatenated feature map is then subjected to pointwise convolution for channel compression to generate the corresponding fused feature map. The fusion operation is iteratively performed until the shallowest layer is reached, generating a fused feature map set. The fused feature map set contains the same number of fused feature maps as the number of stages.

[0013] Furthermore, the step of performing target classification and bounding box regression on the fused feature map set to generate defect detection results includes: For each fused feature map in the fused feature map set, pixel-wise prediction is performed through classification convolution head and regression convolution head respectively. The classification convolution head outputs the class probability distribution of each spatial location on the preset total number of defect categories, and the maximum probability value in the class probability distribution is used as the confidence level. The regression convolution head outputs the bounding box offset corresponding to each spatial location. A threshold filtering is performed on the confidence scores of all fused feature map outputs, retaining candidate detection boxes with confidence scores higher than the preset confidence threshold; Non-maximum suppression is performed on the retained candidate detection boxes, the cross-union ratio (CUI) between candidate detection boxes is calculated as the overlap, and redundant detection boxes with an overlap higher than the preset CUI threshold are removed; the defect category label and defect location bounding box are output as the defect detection result.

[0014] The frequency domain identification method for micro-defects in coated glass provided by this invention has the following advantages: 1. This invention calculates the optical path difference of reflected light from the upper and lower surfaces of the film based on the film thickness and refractive index parameters, calculates the interference characteristic frequency based on the optical path difference, and sets the high-frequency cutoff frequency and low-frequency cutoff frequency as a reference. This mechanism matches the cutoff frequency of the frequency domain filter with the actual physical properties of the coated glass film, enabling accurate positioning of the spectral components corresponding to the interference fringes within a specific frequency band, avoiding the erroneous filtering of interference spectrum residues or effective defect spectra caused by a fixed cutoff frequency.

[0015] 2. This invention generates high-frequency attention weights by extracting local gradient changes in high-frequency feature maps through pointwise convolution, and generates low-frequency attention weights by maintaining channel independence of low-frequency feature maps through grouped convolution. The two attention weights are then subjected to pointwise convolution to compress channels, GELU activation, and sigmoid gating to form fused weights. This dual-frequency attention fusion mechanism allows high-frequency and low-frequency channels to obtain independent weight allocations. High-frequency attention weights focus on defect edges and texture abrupt change regions, while low-frequency attention weights retain the global distribution information of the film background. The fused dual-frequency feature map preserves both the high-frequency detail response of micro-defects and the structural integrity of the low-frequency background.

[0016] 3. This invention inputs the dual-frequency fusion feature map into the feature pyramid backbone network for multi-stage feature extraction and multi-scale feature fusion, and performs target classification and bounding box regression on defects at different scales. It can simultaneously detect micro-defects of different sizes, from sub-pixel pinholes to millimeter-level scratches, thereby improving the scale adaptability of the detection method. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the frequency domain identification method for micro-defects in coated glass according to the present invention. Figure 2 This is a flowchart of the dual-frequency attention weight generation process of the present invention; Figure 3 This is a flowchart of the defect detection result output of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figures 1-3 This invention provides a frequency domain identification method for micro-defects in coated glass, comprising the following steps: S1. Obtain the original image of the coated glass surface, and perform a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum. In this embodiment, acquiring the original image of the coated glass surface and performing a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum includes: Images of the coated glass surface within the area illuminated by a ring-shaped LED light source are acquired using a high-resolution industrial camera, and these images are used as the original images.

[0020] Specifically, a high-resolution industrial camera refers to a digital camera equipped with a large-area image sensor and an output pixel count of no less than five million, with the optical axis of its lens arranged perpendicular to the surface of the coated glass. A ring-shaped LED light source refers to an illuminator consisting of multiple light-emitting diodes evenly arranged around the periphery of the camera lens. Its emitted light illuminates the surface of the coated glass at a fixed angle relative to the optical axis, causing micro-defects on the surface to scatter the incident light, thus creating grayscale contrast on the surrounding smooth film layer.

[0021] The illumination area refers to the circular illumination coverage area projected by the ring LED light source onto the coated glass surface. The camera takes a picture of the glass surface within this area. The coated glass surface image refers to the digital matrix output by the camera that reflects the grayscale distribution of the glass surface within the illumination area. This digital matrix is ​​directly used as the original image, i.e., the initial input data for frequency domain analysis.

[0022] Perform a two-dimensional fast Fourier transform on the original image to convert it from the spatial domain to the frequency domain, generating a complex spectrum.

[0023] Specifically, the two-dimensional fast Fourier transform refers to the separable algorithm that performs the one-dimensional fast Fourier transform on the digital matrix of the original image by row and column respectively, decomposing the spatial domain gray-level distribution into a linear superposition of multiple complex exponential basis functions with multiple frequencies, directions and complex amplitudes, thus completing the mathematical mapping from the spatial domain to the frequency domain.

[0024] The spatial domain refers to a two-dimensional data space described by the row and column coordinates of pixels and their corresponding gray values. The frequency domain refers to a two-dimensional frequency space with the horizontal and vertical frequency coordinates as the horizontal and vertical axes and the complex amplitude as the numerical value. The complex spectrum refers to the complex matrix output after the Fast Fourier Transform, where each element corresponds to a complex value at a frequency coordinate, containing all the information of the amplitude and phase spectrum of that frequency component.

[0025] Perform a spectrum shift on the complex spectrum to move the zero-frequency component of the complex spectrum to the center position of the complex spectrum, thereby generating a centered spectrum.

[0026] Specifically, spectrum shifting refers to a cyclic translation operation on a complex spectrum matrix, swapping the zero-frequency components located at the four corners of the matrix to the geometric center, and correspondingly moving the high-frequency components to the edge regions of the matrix. The zero-frequency components correspond to the DC average of the gray levels of all pixels in the original image, i.e., the overall average brightness of the image. Centered spectrum refers to the complex matrix obtained after shifting, in which the zero-frequency and low-frequency components are located in the central region, and the high-frequency components are distributed in the surrounding regions far from the center, which conforms to the coordinate arrangement requirements of spatial filtering operations based on the zero-frequency point in frequency domain filtering processing.

[0027] Extract the complete complex data of the centered spectrum as the full-frequency domain spectrum.

[0028] Specifically, complete complex data refers to the complex values ​​at each frequency position in the centered spectrum matrix, where both the real and imaginary parts are retained without any amplitude or phase selection. Full-domain spectrum refers to the spectrum data used as input for subsequent frequency domain mask extraction operations, where all complex data from the centered spectrum are used. This spectrum contains all spatial frequency components of the original image from zero frequency to the Nyquist frequencies in both the horizontal and vertical directions.

[0029] S2. Collect the film thickness parameters and film refractive index parameters of the coated glass. Calculate the optical path difference of the reflected light from the upper and lower surfaces of the film based on the film thickness parameters and film refractive index parameters. Calculate the interference characteristic frequency of the interference fringes based on the optical path difference. Set the high-frequency cutoff frequency and low-frequency cutoff frequency based on the interference characteristic frequency. In this embodiment, the process of collecting the film thickness and refractive index parameters of the coated glass, calculating the optical path difference of reflected light from the upper and lower surfaces of the film based on the film thickness and refractive index parameters, calculating the interference characteristic frequency of the interference fringes based on the optical path difference, and setting a high-frequency cutoff frequency and a low-frequency cutoff frequency based on the interference characteristic frequency includes: The film thickness parameters of the coated glass were acquired using a spectral confocal displacement sensor.

[0030] Specifically, a spectral confocal displacement sensor is a non-contact ranging device that uses white light to generate axial dispersion through a dispersive objective lens, focusing light of different wavelengths to different depth positions. During data acquisition, the sensor is vertically aligned with the coated glass surface, capturing the peak wavelengths of the reflected spectra from the upper and lower surfaces of the glass. The physical thickness of the film is calculated based on the difference in axial distance corresponding to the two peak wavelengths. The film thickness parameter refers to this value as a quantitative representation in micrometers.

[0031] The reflectance spectrum of the coated glass is fitted using a spectral reflectance fitting algorithm to obtain the refractive index parameters of the film.

[0032] Specifically, the spectral reflectance fitting algorithm refers to a numerical optimization method that establishes the theoretical relationship between film reflectance and wavelength, refractive index, and film thickness based on the Fresnel formula for thin-film optics and the multi-beam interference model. During the fitting operation, the measured reflectance spectrum is used as input, and the Levenberg-Marquardt iterative optimization algorithm is employed to adjust the refractive index variable, minimizing the sum of squared residuals between the theoretical and measured spectra. The film refractive index parameter refers to the real part of the refractive index of the film material at the center wavelength of the illumination source, obtained after iterative convergence.

[0033] The optical thickness of the film is obtained by multiplying the film thickness parameter and the film refractive index parameter.

[0034] Specifically, the optical thickness of a film refers to the product of the geometric thickness of the film and the refractive index of the material. This product directly determines the amount of phase delay experienced by the light beam when passing through the film. The multiplication operation refers to using the geometric thickness of the film measured by the spectral confocal displacement sensor as the multiplicand and the refractive index obtained by the spectral reflectance fitting algorithm as the multiplier. The product of the two numbers is the optical thickness of the film.

[0035] The optical thickness of the film is doubled to obtain the geometric optical path difference of the film.

[0036] Specifically, the geometrical optical path difference (GOP) refers to the difference in geometrical path length between the beam reflected from the upper surface of the film and the beam reflected from the lower surface and exiting the film. Since the beam reflected from the lower surface passes through the film twice more than the beam reflected from the upper surface, the GOP can be obtained by multiplying the film's optical thickness by two.

[0037] Extract the pre-stored phase jump values ​​of the upper and lower surfaces of the film, and perform a difference operation on the upper and lower surfaces of the film to obtain the relative phase jump difference.

[0038] Specifically, the phase jump value of the upper surface reflection of the film refers to the phase jump caused by the abrupt change in refractive index when the light beam is reflected at the interface between the air and the film. The phase jump value of the lower surface reflection of the film refers to the phase jump caused by the reflection of the light beam at the interface between the film and the glass substrate. Pre-storage refers to using an ellipsometer to measure and calibrate the reflection phase of coated glass samples from the same batch, and writing the calibration results into a configuration file for real-time retrieval. The difference calculation refers to subtracting the phase jump value of the lower surface from the phase jump value of the upper surface, and the result is the relative phase jump difference.

[0039] Obtain the center wavelength of the illumination source, divide the relative phase jump difference by 2π, and then multiply it by the center wavelength to obtain the phase-corrected optical path difference.

[0040] Specifically, the center wavelength of the lighting source refers to the wavelength value corresponding to the maximum radiation intensity in the emission spectrum of the ring LED light source. It is obtained by actual measurement of the light source under nominal working conditions using a spectroradiometer. The phase correction optical path difference refers to the proportion of the phase shift in a single period obtained by dividing the relative phase jump difference by 2π, and then multiplying it by the center wavelength to convert this proportion into an equivalent additional optical path value.

[0041] The effective optical path difference of the film is obtained by performing an addition operation on the geometric optical path difference and the phase-corrected optical path difference.

[0042] Specifically, the effective optical path difference of the film layer refers to the total optical path difference between two reflected beams, including differences in geometric path and phase difference in interface reflection. Its value is equal to the sum of the geometric optical path difference and the phase-corrected optical path difference of the film layer. The addition operation refers to adding the two optical path difference values ​​together, and the sum is the effective optical path difference of the film layer.

[0043] The interferometric characteristic frequency is obtained by taking the reciprocal of the effective optical path difference of the film layer; the magnification of the imaging system and the camera pixel size are obtained, and the product of the interferometric characteristic frequency and the camera pixel size is divided by the magnification of the imaging system to obtain the reference frequency.

[0044] Specifically, the reciprocal operation refers to calculating the reciprocal of the effective optical path difference of the film layer. Its physical meaning is the spatial angular frequency of the interference fringes on the coated glass surface in the spatial domain, measured in radians per millimeter. The imaging system magnification refers to the scaling ratio by which the optical lens of a high-resolution industrial camera projects the object's surface scale onto the image sensor's image plane. It is obtained by calculating the ratio of the actual size to the image plane size after imaging using a resolution test chart. The camera pixel size refers to the physical distance between the centers of adjacent pixels on the image sensor, which can be found in the sensor product datasheet. Multiplying the interference characteristic frequency by the camera pixel size yields the interference fringe frequency corresponding to each pixel; dividing this by the imaging system magnification gives the normalized reference frequency value in the digital image's frequency domain coordinates.

[0045] Multiply the reference frequency with the preset high-frequency cutoff coefficient and the preset low-frequency cutoff coefficient respectively to obtain the high-frequency cutoff frequency and the low-frequency cutoff frequency.

[0046] Specifically, the preset high-frequency and low-frequency cutoff coefficients are dimensionless positive real numbers, determined through prior experiments. Their values ​​are based on the fluctuation range of the film thickness in mass production and the influence of the spectral width of the illumination source on the frequency broadening of the interference fringes. The multiplication operation refers to multiplying the reference frequency by the high-frequency and low-frequency cutoff coefficients respectively, and the product results are used as the high-frequency and low-frequency cutoff frequencies to define the extraction boundaries of the frequency domain mask.

[0047] S3. Perform high-frequency mask extraction on the full-frequency spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, perform low-frequency mask extraction on the full-frequency spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, perform inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and perform inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map. In this embodiment, the steps of performing high-frequency mask extraction on the full-frequency domain spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, performing low-frequency mask extraction on the full-frequency domain spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, performing inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and performing inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map include: Using the zero-frequency position of the full-frequency spectrum as the origin and the high-frequency cutoff frequency as the radial distance threshold, a high-frequency mask of the same size as the full-frequency spectrum is constructed.

[0048] Specifically, the zero-frequency position refers to the geometric center coordinates of the DC component in the full-frequency domain spectrum matrix after spectral shifting. A frequency-domain Cartesian coordinate system is established with this coordinate as the origin. The radial distance refers to the Euclidean distance of any frequency coordinate point in the spectrum matrix relative to the zero-frequency position, and its calculation formula is as follows: In the formula, Radial distance, This represents the horizontal offset of the frequency coordinate point relative to the zero-frequency position. The vertical offset of the frequency coordinate point relative to the zero-frequency position is the high-frequency mask. The high-frequency mask refers to a binary matrix with the same number of rows and columns as the full-frequency spectrum. The matrix element values ​​are 1 when the radial distance is greater than the high-frequency cutoff frequency, and 0 when the radial distance is less than or equal to the high-frequency cutoff frequency. This mask only allows spatial frequency components higher than the high-frequency cutoff threshold to pass through in the frequency domain.

[0049] Using the zero-frequency position of the full-frequency spectrum as the origin and the low-frequency cutoff frequency as the radial distance threshold, a low-frequency mask of the same size as the full-frequency spectrum is constructed.

[0050] Specifically, a low-frequency mask refers to a binary matrix with the same number of rows and columns as the full-frequency spectrum, and the radial distance calculation formula is the same as described above. The matrix elements of the low-frequency mask are set to 1 when the radial distance is less than or equal to the low-frequency cutoff frequency, and 0 when the radial distance is greater than the low-frequency cutoff frequency. This mask only allows background frequency components within the range from zero frequency to the low-frequency cutoff threshold to pass through in the frequency domain.

[0051] Element-wise multiplication of the full-frequency spectrum with the high-frequency mask is performed to obtain the high-frequency spectrum.

[0052] Specifically, element-wise multiplication refers to multiplying the complex amplitudes at the same row and column positions in the full-frequency spectrum matrix and the high-frequency mask matrix one-to-one with the binary weights. The rule is that when the weight is 1, the original complex amplitude is retained, and when the weight is 0, the complex amplitude is set to zero. The high-frequency spectrum refers to the complex matrix output after the element-wise multiplication operation. This matrix retains only the spatial frequency components above the high-frequency cutoff frequency, while the low-frequency components and zero-frequency background components corresponding to the interference fringes are filtered out.

[0053] Element-wise multiplication is performed on the full-frequency spectrum and the low-frequency mask to obtain the low-frequency spectrum.

[0054] Specifically, element-wise multiplication refers to multiplying the complex amplitudes and binary weights at the same row and column positions in the full-frequency spectrum matrix and the low-frequency mask matrix one-to-one, with the operation rules being the same as described above. The low-frequency spectrum refers to the complex matrix output after the element-wise multiplication operation. This matrix retains only the spatial frequency components from zero frequency to the low-frequency cutoff frequency range, while the mid-frequency components corresponding to interference fringes and the high-frequency components corresponding to defect edges are filtered out.

[0055] Perform an inverse Fourier transform on the high-frequency spectrum to obtain the high-frequency feature map.

[0056] Specifically, the inverse Fourier transform refers to performing a two-dimensional discrete inverse Fourier transform algorithm on the complex matrix of the high-frequency spectrum, mapping the complex amplitude distribution in the frequency domain back to the gray-level distribution in the spatial domain. Its transform kernel is the conjugate form of the complex exponential basis function. The high-frequency feature map refers to the real matrix output after the inverse transform. The gray-level values ​​in this matrix correspond to local regions in the original image with rapid changes in spatial gray-level, including fine structural features such as micro-defect edges, scratch boundaries, and abrupt changes in coating texture.

[0057] Perform an inverse Fourier transform on the low-frequency spectrum to obtain the low-frequency feature map.

[0058] Specifically, the inverse Fourier transform refers to performing a two-dimensional discrete inverse Fourier transform algorithm on the low-frequency spectrum complex matrix, with the transform kernel being the same as described above. The low-frequency feature map refers to the real matrix output after the inverse transform. The gray values ​​in this matrix correspond to the global background components in the original image with a relatively slow rate of change in spatial gray levels, including the basic reflectivity distribution of the coating surface and the slow gray-level shift introduced by illumination inhomogeneity.

[0059] S4. High-frequency attention weights are generated by extracting local gradient changes of high-frequency feature maps through pointwise convolution, and low-frequency attention weights are generated by maintaining the channel independence of low-frequency feature maps through grouped convolution. In this embodiment, the step of generating high-frequency attention weights by extracting local gradient changes of high-frequency feature maps through pointwise convolution and generating low-frequency attention weights by maintaining channel independence of low-frequency feature maps through grouped convolution includes: By performing spatial convolution independently on each channel of the high-frequency feature map through deep convolutional layers, local gradient changes within each channel are extracted to generate a multi-channel spatial response map.

[0060] Specifically, a deep convolutional layer refers to a lightweight convolutional structure where the number of convolutional kernels equals the number of input channels, and each kernel performs convolution operations only with its corresponding input channel. Its kernel spatial size is 3×3 pixels. Performing independent spatial convolution on each channel of the high-frequency feature map means that the convolutional kernel of each channel only slides through its own channel's spatial dimension and performs multiplication and addition operations; no cross-channel convolutional mixing occurs. A multi-channel spatial response map refers to the three-dimensional tensor output by the deep convolutional layer, whose spatial height and width are the same as the input high-frequency feature map. Figure 1 The number of channels remains constant, and the response value at each spatial location reflects the gradient intensity of the grayscale value in the local neighborhood of the corresponding channel at that location.

[0061] A linear combination is performed on all channels of the multi-channel spatial response map to generate high-frequency attention weights.

[0062] Specifically, linear combination refers to introducing a set of learnable channel weight coefficients, weighting and summing the response values ​​of the multi-channel spatial response map in each channel, and then adding a bias term. The calculation formula is as follows: In the formula, This is the high-frequency attention weight matrix, whose spatial size is related to the high-frequency features. Figure 1 And the number of channels is 1; This represents the total number of channels in the high-frequency feature map. For the first The learnable weight coefficients of each channel are randomly initialized using a normal distribution with a mean of 0 and a standard deviation of 0.01, and are iteratively updated through backpropagation during network training. The first in the multi-channel spatial response diagram The spatial response matrix of each channel, where each element represents the local gradient intensity at the corresponding spatial location of that channel; The learnable bias parameter is initialized to 0. This linear combination converges multi-channel gradient response information into a single-channel spatial weight matrix, with larger values ​​corresponding to regions of drastic gradient change, such as defect edges.

[0063] The low-frequency feature map is divided into several channel groups according to the channel dimension. Standard convolution is performed independently on each channel group to extract the spatial distribution features within each channel group and generate a set of grouped convolution response maps.

[0064] Specifically, channel grouping refers to uniformly dividing all channels along the channel dimension of the low-frequency feature map into multiple non-overlapping subsets. The number of groups is a preset hyperparameter, and its value is determined by the fact that the total number of channels in the low-frequency feature map must be divisible by the number of groups; typical values ​​are 2 or 4. Standard convolution refers to a conventional convolution operation in which the convolution kernel simultaneously covers all input channels within a group, performs a weighted summation, and produces a single output channel. Its convolution kernel space size is 3×3 pixels, and each group is configured with independent standard convolution kernel parameters. The grouped convolution response map set refers to the set of three-dimensional tensors output by each channel group after standard convolution. The output tensor space size of each group is related to the input low-frequency feature map. Figure 1 To.

[0065] The outputs of all channels in the grouped convolutional response map set are aggregated and channel shuffling is performed to generate low-frequency attention weights.

[0066] Specifically, concatenation refers to stitching the convolutional response maps of each group together along the channel dimension into a complete three-dimensional tensor. The number of channels in this tensor is equal to the sum of the output channels of each group. Channel shuffling refers to performing a dimensional transformation operation on the channel dimension of the stitched tensor: reshaping the total number of channels into a two-dimensional matrix of the number of groups and the number of channels in each group, transposing this matrix restores the two-dimensional shape to a one-dimensional channel sequence, so that channels originally belonging to different groups are staggered along the channel dimension. This operation does not change the spatial size of the tensor.

[0067] Low-frequency attention weights refer to the three-dimensional tensor output after channel shuffling, whose spatial dimensions are related to the input low-frequency features. Figure 1 The number of channels is equal to the sum of the number of output channels of each group, and the response value at each spatial location comprehensively reflects the local spatial distribution characteristics of the corresponding group at that location.

[0068] S5. After compressing the channels by performing pointwise convolution on the high-frequency attention weights and low-frequency attention weights, the spatial attention weights are generated by GELU activation and pointwise convolution. The spatial attention weights are constrained by sigmoid gating to form fusion weights. The high-frequency feature map and the low-frequency feature map are adaptively weighted and fused according to the fusion weights to generate a dual-frequency fusion feature map. In this embodiment, after compressing the channels by pointwise convolution of the high-frequency attention weights and low-frequency attention weights, GELU activation and pointwise convolution are performed to generate spatial attention weights. The spatial attention weights are then constrained by a sigmoid gate to form fusion weights. Adaptive weighted fusion of the high-frequency feature map and the low-frequency feature map is then performed according to the fusion weights to generate a dual-frequency fusion feature map, including: The high-frequency attention weights and low-frequency attention weights are concatenated along the channel dimension to generate concatenated attention weights.

[0069] Specifically, the channel dimension refers to the third dimension in a 3D tensor besides its spatial height and width, used to store the feature responses extracted by different convolutional kernels. Concatenation refers to joining high-frequency attention weights and low-frequency attention weights end-to-end along the channel dimension, requiring the two tensors to have identical spatial height and width, but their channel numbers can differ. The concatenated attention weights refer to the resulting 3D tensor, whose spatial dimensions are identical to the two input weights, and whose channel number is the sum of the channel numbers of the two input weights.

[0070] Perform pointwise convolutional dimensionality reduction on the spliced ​​attention weights to compress the number of channels in the spliced ​​attention weights and generate dimensionality-reduced attention weights.

[0071] Specifically, pointwise convolution refers to the standard convolution operation with a kernel size of 1×1. This operation performs a weighted linear combination of response values ​​at the same spatial location along the channel dimension without changing the spatial size. Dimensionality reduction refers to compressing the number of channels in the concatenated attention weights to a preset number of channels using pointwise convolution. This preset value is determined based on a balance between network computational overhead and feature compression efficiency, typically taking one-quarter or one-eighth of the total number of channels before concatenation. Dimensionality-reduced attention weights refer to the three-dimensional tensor output after dimensionality reduction by pointwise convolution. Its spatial size is consistent with the concatenated attention weights, and the number of channels is the preset value after dimensionality reduction.

[0072] Perform GELU activation on the dimensionality-reduced attention weights to generate activated attention weights.

[0073] Specifically, GELU activation refers to the Gaussian error linear unit activation function. This function performs a nonlinear transformation on each scalar value of the input by multiplying the input value by the cumulative distribution function of the standard normal distribution at that input value. When the input value is much greater than zero, the cumulative distribution function value approaches one, and the output is approximately equal to the original input value; when the input value is much less than zero, the cumulative distribution function value approaches zero, and the output approaches zero; when the input value is near zero, the output exhibits a smooth nonlinear transition. This activation function introduces nonlinearity into the network while preserving some gradient information in the negative region, avoiding gradient saturation problems and facilitating effective gradient backpropagation in deep networks. The activation attention weights refer to the three-dimensional tensor output after element-wise processing by the GELU activation function, whose spatial size and number of channels are consistent with the dimensionality reduction attention weights.

[0074] Perform pointwise convolution to increase the dimensionality of the attention activation weights, restore the number of channels of the attention activation weights to the original total number of channels before splicing, and generate spatial attention weights.

[0075] Specifically, pointwise convolutional dimensionality upscaling refers to using a standard convolutional kernel with a spatial size of 1×1 to restore the number of channels activating attention weights from the preset value after dimensionality reduction to the original total number of channels before concatenation, i.e., the sum of the number of channels for high-frequency attention weights and low-frequency attention weights. The parameters of this dimensionality upscaling convolutional layer and the aforementioned dimensionality reduction convolutional layer are initialized independently and are not shared. Spatial attention weights refer to the three-dimensional tensor output after pointwise convolutional dimensionality upscaling, whose spatial size is consistent with the concatenated attention weights, and whose number of channels is equal to the total number of channels for the concatenated attention weights.

[0076] In this embodiment, the step of constraining spatial attention weights through sigmoid gating to form fusion weights, and then performing adaptive weighted fusion of high-frequency feature maps and low-frequency feature maps according to the fusion weights to generate a dual-frequency fusion feature map includes: Apply sigmoid activation to the spatial attention weights to constrain them to the interval [0, 1].

[0077] Specifically, sigmoid activation refers to using the sigmoid function as the activation function to perform a point-by-point nonlinear transformation on each scalar element in the spatial attention weight matrix. This function maps any real value of the input to an open interval between 0 and 1. After sigmoid activation, the value of each element in the spatial attention weight matrix falls within the interval [0, 1], giving the matrix the interpretability of probabilistic weights, making it easier to use as weighting coefficients in subsequent feature fusion multiplication and addition operations. Constraining to the [0, 1] interval means using the bounded range property of the sigmoid function to limit the dynamic range of the original spatial attention weights to between 0 and 1, avoiding negative weights or weights with amplitudes exceeding 1 in the weighted fusion, which would cause the amplitude of the fused features to deviate from the normal distribution range.

[0078] Spatial attention weights are split along the channel dimension into high-frequency spatial attention weights and low-frequency spatial attention weights. The high-frequency spatial attention weights have the same number of channels as the high-frequency feature map, and the low-frequency spatial attention weights have the same number of channels as the low-frequency feature map.

[0079] Specifically, channel-dimensional splitting refers to dividing the spatial attention weight tensor into two independent three-dimensional tensors along the channel direction, with the split point being the number of channels in the high-frequency feature map. The high-frequency spatial attention weight refers to the first tensor set whose number of channels after splitting equals the number of channels in the high-frequency feature map, and its spatial height and width are consistent with the high-frequency feature map. The low-frequency spatial attention weight refers to the second tensor set whose number of channels after splitting equals the number of channels in the low-frequency feature map, and its spatial height and width are consistent with the low-frequency feature map.

[0080] Element-wise multiplication is performed on the high-frequency feature map and the high-frequency spatial attention weights to generate a high-frequency weighted feature map.

[0081] Specifically, element-wise multiplication refers to multiplying the high-frequency feature map one-to-one with the values ​​in the high-frequency spatial attention weights that have the same row, column, and channel indices. The product is then filled into the corresponding positions of the output tensor without changing the spatial size and number of channels of the feature map. The high-frequency weighted feature map refers to the three-dimensional tensor output after this multiplication operation, whose spatial size and number of channels are completely identical to the high-frequency feature map. The response value at each spatial position is the product of the original response value of the high-frequency feature map and the attention weight corresponding to that position.

[0082] A subtraction operation is performed between the constant 1 and the low-frequency spatial attention weights to generate low-frequency complementary weights.

[0083] Specifically, constant 1 refers to a single-valued tensor with the same spatial size and number of channels as the low-frequency spatial attention weights; that is, the value of each element at each spatial position and each channel in this tensor is 1. The value at each position in this single-valued tensor is subtracted from the value at the corresponding position in the low-frequency spatial attention weights, and the difference is used to fill the corresponding spatial and channel positions in the output tensor. Low-frequency complementary weights refer to the three-dimensional tensor generated after the subtraction operation, whose spatial size and number of channels are consistent with the low-frequency spatial attention weights. The value of each element is equal to 1 minus the value of the corresponding low-frequency spatial attention weight element, and the value range is within the interval [0, 1].

[0084] Element-wise multiplication is performed on the low-frequency feature map and the low-frequency complementary weights to generate a low-frequency weighted feature map.

[0085] Specifically, element-wise multiplication refers to multiplying the low-frequency feature map one-to-one with the values ​​in the low-frequency complementary weights that have the same row, column, and channel indices. The product is then filled into the corresponding positions of the output tensor without changing the spatial size and number of channels of the feature map. The low-frequency weighted feature map refers to the three-dimensional tensor output after this multiplication operation, whose spatial size and number of channels are completely identical to the low-frequency feature map. The response value at each spatial position is the product of the original response value of the low-frequency feature map and the corresponding complementary weight at that position.

[0086] Element-wise addition is performed on the high-frequency weighted feature map and the low-frequency weighted feature map to generate a dual-frequency fused feature map.

[0087] Specifically, element-wise addition refers to adding the values ​​with the same row, column, and channel indices in the high-frequency weighted feature map and the low-frequency weighted feature map one by one, requiring that the spatial height, spatial width, and number of channels of the two input tensors be consistent. The dual-frequency fusion feature map refers to the three-dimensional tensor output after this addition operation, whose spatial size and number of channels are the same as the two input weighted feature maps, and the value at each spatial location is the sum of the response values ​​of the high-frequency weighted feature map and the low-frequency weighted feature map.

[0088] S6. Perform multi-stage feature extraction on the dual-frequency fusion feature map to generate a multi-scale feature map set, perform multi-scale feature fusion on the multi-scale feature map set to generate a fused feature map set, perform target classification and bounding box regression on the fused feature map set to generate defect detection results.

[0089] In this embodiment, the process of extracting multi-stage features from the dual-frequency fused feature map to generate a multi-scale feature map set, fusing the multi-scale feature map set to generate a fused feature map set, and performing target classification and bounding box regression on the fused feature map set to generate defect detection results includes: The dual-frequency fused feature map is input into the feature pyramid backbone network, which contains multiple sequentially connected downsampling stages. Each downsampling stage performs convolutional downsampling and activation function operations in sequence, outputting stage feature maps. All stage feature maps are then collected to generate a multi-scale feature map set.

[0090] Specifically, the feature pyramid backbone network refers to a deep convolutional neural network that uses a residual connection structure. The number of stages is a preset network structure parameter, determined during network design based on the input image size and the required feature abstraction level, typically four to five stages. The downsampling stage refers to the sequential execution of convolution operations with a stride greater than 1 and batch normalization operations within each stage, followed by nonlinear mapping through a modified linear unit activation function, which halves the feature map space size while doubling the number of channels.

[0091] A stage feature map refers to the three-dimensional tensor output at the end of each downsampling stage. Its spatial resolution decreases progressively with each stage, while its semantic abstraction increases progressively. Aggregation refers to storing all stage feature maps in a list format, arranged from shallowest to deepest; this list is the multi-scale feature map set.

[0092] A top-down feature fusion process is performed on the multi-scale feature map set. The deepest stage feature map is sequentially upsampled to the spatial size of the previous stage feature map using bilinear interpolation. The upsampled deep feature map is then concatenated with the previous stage feature map along the channel dimension. The concatenated feature map is then subjected to pointwise convolution for channel compression to generate the corresponding fused feature map. The fusion operation is iteratively performed until the shallowest layer is reached, generating a fused feature map set. The fused feature map set contains the same number of fused feature maps as the number of stages.

[0093] Specifically, top-down feature fusion refers to a path that aggregates information from the deepest low-resolution high-semantic feature map to the shallower high-resolution low-semantic feature map level by level. Bilinear interpolation upsampling refers to using the values ​​of the four nearest known pixels in the feature map for weighted interpolation calculation, enlarging the spatial height and width of the deep feature map to the exact same size as the feature map of the previous stage. Concatenation refers to connecting the upsampled deep feature map and the feature map of the previous stage end-to-end in the channel dimension, and the number of channels after merging is the sum of the number of channels of the two. Pointwise convolution refers to using a standard convolution kernel with a spatial size of 1×1 to perform convolution operation on the concatenated feature map, compressing the number of channels to the same number of channels as the feature map of the previous stage, so as to eliminate the computational burden caused by excessive channel dimension.

[0094] The fused feature map refers to the three-dimensional tensor output after the compression operation, which retains the semantic discriminative power of deep features while incorporating the spatial localization accuracy of shallow features. Iterative execution refers to using the currently generated fused feature map as input for new deep features, and continuing to repeat the above upsampling, concatenation, and compression operations with shallower stage feature maps until the shallowest stage feature map is reached. The fused feature map set refers to the list of all fused feature maps stored in stage order after iteration, and its number is equal to the number of downsampling stages.

[0095] In this embodiment, the step of performing target classification and bounding box regression on the fused feature map set to generate defect detection results includes: For each fused feature map in the fused feature map set, pixel-wise prediction is performed through classification convolution head and regression convolution head respectively. The classification convolution head outputs the class probability distribution of each spatial location on the total number of preset defect categories, and the maximum probability value in the class probability distribution is used as the confidence level. The regression convolution head outputs the bounding box offset corresponding to each spatial location.

[0096] Specifically, the classification convolutional head refers to a standard convolutional layer added on the fused feature map. Its output channels equal the total number of preset defect categories, determined by the number of defect types labeled in the training dataset. Typical defect categories include pinholes, scratches, particulate contamination, and uneven film thickness. The regression convolutional head refers to another standard convolutional layer arranged in parallel with the classification convolutional head. It has four output channels, corresponding to the offsets of the predicted bounding box relative to preset anchor boxes in four dimensions: the x-coordinate of the center point, the y-coordinate of the center point, the width, and the height. The preset anchor boxes are obtained by clustering all labeled bounding boxes in the training dataset.

[0097] Pixel-wise prediction refers to using each spatial location as the center, the classification convolutional head outputs the probability distribution of that location belonging to various types of defects, the regression convolutional head outputs the bounding box offset corresponding to that location, and the maximum probability value in the probability distribution is taken as the confidence level that the location belongs to the corresponding defect category.

[0098] A threshold screening is performed on the confidence scores of all fused feature map outputs, retaining candidate detection boxes with confidence scores higher than the preset confidence threshold.

[0099] Specifically, threshold filtering involves comparing the predicted confidence values ​​of all fused feature maps at each spatial location with a preset confidence threshold, retaining spatial locations with confidence values ​​greater than the threshold and their corresponding bounding box offsets. The preset confidence threshold is a real number between 0 and 1, determined by plotting a precision-recall curve on the validation set and selecting the threshold point that maximizes the F1 score. Candidate detection boxes refer to the set of rectangular bounding boxes calculated from the retained spatial locations, their corresponding class labels, and the bounding box offsets.

[0100] Non-maximum suppression is performed on the retained candidate detection boxes, the cross-union ratio (CUI) between candidate detection boxes is calculated as the overlap, and redundant detection boxes with an overlap higher than the preset CUI threshold are removed; the defect category label and defect location bounding box are output as the defect detection result.

[0101] Specifically, non-maximum suppression (NMS) involves sorting candidate bounding boxes in descending order of confidence, selecting the bounding box with the highest confidence as the retained box, and calculating the intersection-union ratio (IU) of the remaining bounding boxes with the retained box. The IU is the ratio of the intersection area to the union area of ​​two bounding boxes. A preset IU threshold is a real number between 0 and 1, determined by statistically analyzing the distribution of the same defect being repeatedly covered by multiple bounding boxes in the validation set. Bounding boxes with an IU greater than this threshold are considered redundant and discarded. Bounding boxes with an IU less than or equal to this threshold are retained for the next iteration until all bounding boxes are processed. Finally, the defect category label and defect location bounding box coordinates are output for each retained bounding box.

[0102] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.

[0103] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0104] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for frequency domain identification of micro-defects in coated glass, characterized in that, Includes the following steps: S1. Obtain the original image of the coated glass surface, and perform a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum. S2. Collect the film thickness parameters and film refractive index parameters of the coated glass. Calculate the optical path difference of the reflected light from the upper and lower surfaces of the film based on the film thickness parameters and film refractive index parameters. Calculate the interference characteristic frequency of the interference fringes based on the optical path difference. Set the high-frequency cutoff frequency and low-frequency cutoff frequency based on the interference characteristic frequency. S3. Perform high-frequency mask extraction on the full-frequency spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, perform low-frequency mask extraction on the full-frequency spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, perform inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and perform inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map. S4. High-frequency attention weights are generated by extracting local gradient changes of high-frequency feature maps through pointwise convolution, and low-frequency attention weights are generated by maintaining the channel independence of low-frequency feature maps through grouped convolution. S5. After compressing the channels by performing pointwise convolution on the high-frequency attention weights and low-frequency attention weights, the spatial attention weights are generated by GELU activation and pointwise convolution. The spatial attention weights are constrained by sigmoid gating to form fusion weights. The high-frequency feature map and the low-frequency feature map are adaptively weighted and fused according to the fusion weights to generate a dual-frequency fusion feature map. S6. Perform multi-stage feature extraction on the dual-frequency fusion feature map to generate a multi-scale feature map set, perform multi-scale feature fusion on the multi-scale feature map set to generate a fused feature map set, perform target classification and bounding box regression on the fused feature map set to generate defect detection results.

2. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process of acquiring the original image of the coated glass surface and performing a two-dimensional fast Fourier transform on the original image to obtain the full-frequency spectrum includes: Images of the coated glass surface within the area illuminated by the ring-shaped LED light source are acquired using a high-resolution industrial camera, and these images are used as the original images. Perform a two-dimensional fast Fourier transform on the original image to convert it from the spatial domain to the frequency domain, generating a complex spectrum; Perform a spectrum shift on the complex spectrum to move the zero-frequency component of the complex spectrum to the center position of the complex spectrum, thereby generating a centered spectrum; Extract the complete complex data of the centered spectrum as the full-frequency domain spectrum.

3. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process involves collecting the film thickness and refractive index parameters of the coated glass, calculating the optical path difference of reflected light from the upper and lower surfaces of the film based on these parameters, calculating the interference characteristic frequencies of the interference fringes based on the optical path difference, and setting high-frequency and low-frequency cutoff frequencies using these interference characteristic frequencies as a reference. The film thickness parameters of the coated glass were acquired using a spectral confocal displacement sensor. The reflectance spectrum of the coated glass is fitted using a spectral reflectance fitting algorithm to obtain the refractive index parameters of the film. The optical thickness of the film is obtained by multiplying the film thickness parameter and the film refractive index parameter. The optical thickness of the film is doubled to obtain the geometric optical path difference of the film. Extract the pre-stored phase jump values ​​of the upper and lower surfaces of the film, and perform a difference operation on the phase jump values ​​of the upper and lower surfaces of the film to obtain the relative phase jump difference. Obtain the center wavelength of the illumination source, divide the relative phase jump difference by 2π, and then multiply it by the center wavelength to obtain the phase-corrected optical path difference; The effective optical path difference of the film is obtained by performing an addition operation on the geometric optical path difference and the phase-corrected optical path difference; The interferometric characteristic frequency is obtained by taking the reciprocal of the effective optical path difference of the film layer; the magnification of the imaging system and the pixel size of the camera are obtained, and the product of the interferometric characteristic frequency and the pixel size of the camera is divided by the magnification of the imaging system to obtain the reference frequency. Multiply the reference frequency with the preset high-frequency cutoff coefficient and the preset low-frequency cutoff coefficient respectively to obtain the high-frequency cutoff frequency and the low-frequency cutoff frequency.

4. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process of performing high-frequency mask extraction on the full-frequency spectrum based on the high-frequency cutoff frequency to generate a high-frequency spectrum, performing low-frequency mask extraction on the full-frequency spectrum based on the low-frequency cutoff frequency to generate a low-frequency spectrum, performing inverse Fourier transform on the high-frequency spectrum to generate a high-frequency feature map, and performing inverse Fourier transform on the low-frequency spectrum to generate a low-frequency feature map includes: Using the zero-frequency position of the full-frequency spectrum as the origin and the high-frequency cutoff frequency as the radial distance threshold, a high-frequency mask of the same size as the full-frequency spectrum is constructed. Using the zero-frequency position of the full-frequency spectrum as the origin and the low-frequency cutoff frequency as the radial distance threshold, a low-frequency mask of the same size as the full-frequency spectrum is constructed. Element-wise multiplication is performed on the full-frequency spectrum and the high-frequency mask to obtain the high-frequency spectrum; Element-wise multiplication is performed on the full-frequency spectrum and the low-frequency mask to obtain the low-frequency spectrum; Perform an inverse Fourier transform on the high-frequency spectrum to obtain the high-frequency feature map; Perform an inverse Fourier transform on the low-frequency spectrum to obtain the low-frequency feature map.

5. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process of generating high-frequency attention weights by extracting local gradient changes in high-frequency feature maps through pointwise convolution and generating low-frequency attention weights by maintaining channel independence of low-frequency feature maps through grouped convolution includes: By performing spatial convolution independently on each channel of the high-frequency feature map through deep convolutional layers, local gradient changes within each channel are extracted to generate a multi-channel spatial response map. A linear combination is performed on all channels of the multi-channel spatial response map to generate high-frequency attention weights; The low-frequency feature map is divided into several channel groups according to the channel dimension. Standard convolution is performed independently on each channel group to extract the spatial distribution features within each channel group and generate a set of grouped convolution response maps. The outputs of all channels in the grouped convolutional response map set are aggregated and channel shuffling is performed to generate low-frequency attention weights.

6. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process involves pointwise convolution of the high-frequency and low-frequency attention weights to compress the channels, followed by GELU activation and pointwise convolution to generate spatial attention weights. These spatial attention weights are then constrained by a sigmoid gate to form fusion weights. Adaptive weighted fusion of the high-frequency and low-frequency feature maps is then performed according to these fusion weights to generate a dual-frequency fusion feature map. This process includes: The high-frequency attention weights and low-frequency attention weights are concatenated along the channel dimension to generate concatenated attention weights. Perform pointwise convolutional dimensionality reduction on the spliced ​​attention weights to compress the number of channels in the spliced ​​attention weights and generate dimensionality-reduced attention weights; Perform GELU activation on the dimensionality-reduced attention weights to generate activated attention weights; Perform pointwise convolution to increase the dimensionality of the attention activation weights, restore the number of channels of the attention activation weights to the original total number of channels before splicing, and generate spatial attention weights.

7. The frequency domain identification method for micro-defects in coated glass according to claim 6, characterized in that, The process involves constraining spatial attention weights through sigmoid gating to form fusion weights, and then adaptively weighting and fusing the high-frequency and low-frequency feature maps according to the fusion weights to generate a dual-frequency fusion feature map, including: Apply sigmoid activation to the spatial attention weights to constrain them to the [0, 1] interval; The spatial attention weights are split along the channel dimension into high-frequency spatial attention weights and low-frequency spatial attention weights. The high-frequency spatial attention weights have the same number of channels as the high-frequency feature map, and the low-frequency spatial attention weights have the same number of channels as the low-frequency feature map. Element-wise multiplication is performed on the high-frequency feature map and the high-frequency spatial attention weights to generate a high-frequency weighted feature map; A subtraction operation is performed between the constant 1 and the low-frequency spatial attention weights to generate low-frequency complementary weights; Element-wise multiplication is performed on the low-frequency feature map and the low-frequency complementary weights to generate a low-frequency weighted feature map. Element-wise addition is performed on the high-frequency weighted feature map and the low-frequency weighted feature map to generate a dual-frequency fused feature map.

8. The frequency domain identification method for micro-defects in coated glass according to claim 1, characterized in that, The process involves multi-stage feature extraction from the dual-frequency fused feature map to generate a multi-scale feature map set, multi-scale feature fusion of the multi-scale feature map set to generate a fused feature map set, and performing target classification and bounding box regression on the fused feature map set to generate defect detection results, including: The dual-frequency fused feature map is input into the feature pyramid backbone network, which contains multiple sequentially connected downsampling stages. Each downsampling stage performs convolutional downsampling and activation function operations in sequence, outputting stage feature maps. All stage feature maps are collected to generate a multi-scale feature map set. A top-down feature fusion process is performed on the multi-scale feature map set. The deepest stage feature map is sequentially upsampled to the spatial size of the previous stage feature map using bilinear interpolation. The upsampled deep feature map is then concatenated with the previous stage feature map along the channel dimension. The concatenated feature map is then subjected to pointwise convolution for channel compression to generate the corresponding fused feature map. The fusion operation is iteratively performed until the shallowest layer is reached, generating a fused feature map set. The fused feature map set contains the same number of fused feature maps as the number of stages.

9. The frequency domain identification method for micro-defects in coated glass according to claim 8, characterized in that, The process of performing target classification and bounding box regression on the fused feature map to generate defect detection results includes: For each fused feature map in the fused feature map set, pixel-wise prediction is performed through classification convolution head and regression convolution head respectively. The classification convolution head outputs the class probability distribution of each spatial location on the preset total number of defect categories, and the maximum probability value in the class probability distribution is used as the confidence level. The regression convolution head outputs the bounding box offset corresponding to each spatial location. A threshold filtering is performed on the confidence scores of all fused feature map outputs, retaining candidate detection boxes with confidence scores higher than the preset confidence threshold; Non-maximum suppression is performed on the retained candidate detection boxes, the cross-union ratio (CUI) between candidate detection boxes is calculated as the overlap, and redundant detection boxes with an overlap higher than the preset CUI threshold are removed; the defect category label and defect location bounding box are output as the defect detection result.

Citation Information

Patent Citations

  • Photovoltaic glass defect detection method and system based on image recognition

    CN120876437A