Optical film detection method, device and equipment based on image processing
Through the optical film detection method based on image processing, multi-frame images of multi-layer optical films under different lighting conditions are collected, feature fusion and defect feature extraction are performed, and the problem of difficult identification of micro defects in the prior art is solved, precise identification of multi-layer film defects and closed-loop quality control are achieved, and the quality consistency of the optical film is improved.
Patent Information
- Application Number
- CN202510686709.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The existing optical film defect detection technology is difficult to effectively identify small defects, especially under complex lighting conditions, and lacks the adaptability to the characteristics of multilayer films, making it impossible to form a closed-loop quality control system.
Using an optical film detection method based on image processing, a multi-frame image of a multi-layer optical film under different lighting conditions is collected, pre-processing and feature value calculations are performed to obtain the feature value response matrix. Then, the optimal weight coefficient of each frame image is calculated, multi-frame image feature fusion is performed, multi-scale defect features are extracted, spectral response features are matched to the relationship matrix of wavelength-film thickness mapping, and finally autoregressive prediction and processing control parameters are optimized to achieve closed-loop control.
The precise identification and classification of defects in different film layers is achieved, the detection accuracy is improved, the defects in each layer of films with different wavelengths of light are effectively adapted to, the yield and consistency of the optical film is improved, and a closed-loop quality control system is formed.
Smart Images

Figure CN120219382A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an optical film detection method, device and equipment based on image processing. Background Art
[0002] Since sunlight is composed of light with different wavelengths, the design of multi-layer optical films requires the thickness of each layer of film to be precisely matched to a specific wavelength to obtain the best optical effect. However, during the manufacturing process of optical films, due to the influence of factors such as materials, processes, and the environment, tiny defects such as bubbles, scratches, and uneven thickness are likely to occur in each layer of film. These defects are often extremely small in size, low in contrast, and distributed in different film layers, making it difficult for traditional single-frame image detection methods to effectively identify them.
[0003] Currently, there are mainly three challenges in optical film defect detection technology: First, it is difficult to distinguish tiny defects from background noise, especially under complex lighting conditions, and the detection sensitivity of a single image processing algorithm is limited; second, the multi-layer film structure makes the defect characteristics corresponding to light with different wavelengths vary, and existing general detection algorithms lack the adaptive ability for the characteristics of multi-layer films; third, there is a lack of effective connection between defect detection and manufacturing parameter optimization, and a closed-loop quality control system cannot be formed. Traditional image processing methods such as edge detection and region segmentation have poor effects when dealing with low-contrast and multi-level optical film defects, while basic deep learning methods, although having strong feature extraction capabilities, are insufficient in adapting to defect detection of small samples and small targets. Summary of the Invention
[0004] The main object of the present invention is to provide an optical film detection method, device and equipment based on image processing. The present invention realizes the precise identification and classification of defects in different film layers, and further realizes the closed-loop control of the defect detection result and manufacturing parameter optimization.
[0005] To achieve the above object, the present invention provides an optical film detection method based on image processing, including the following steps: Collect multiple frames of images of a multi-layer optical film under different lighting conditions, and perform preprocessing and feature value calculation on the multiple frames of images to obtain a feature value response matrix; Calculate the optimal weight coefficient of each frame of image according to the feature value response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation; Perform multi-scale defect feature extraction on the integrated feature representation to obtain defect candidate regions; Extract spectral response features based on the defect candidate regions, and calculate the matching degree between the spectral response features and a preset wavelength-thickness mapping relationship matrix to obtain a multi-layer film defect distribution map; Perform autoregressive prediction and processing control parameter optimization on the multi-layer film defect distribution map to obtain a closed-loop control scheme.
[0006] The present invention also provides an optical film detection device based on image processing, comprising: An acquisition module, configured to acquire multiple frames of images of a multi-layer optical film under different illumination conditions, perform preprocessing and eigenvalue calculation on the multiple frames of images to obtain an eigenvalue response matrix; A feature fusion module, configured to calculate the optimal weight coefficient of each frame of image according to the eigenvalue response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation; A feature extraction module, configured to perform multi-scale defect feature extraction on the integrated feature representation to obtain defect candidate regions; A matching degree calculation module, configured to extract spectral response features based on the defect candidate regions, and calculate the matching degree between the spectral response features and a preset wavelength-thickness mapping relationship matrix to obtain a multi-layer film defect distribution map; A parameter optimization module, configured to perform autoregressive prediction and processing control parameter optimization on the multi-layer film defect distribution map to obtain a closed-loop control scheme.
[0007] The present invention also provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method described in any one of the above are implemented.
[0008] In summary, the technical solution provided by the present invention uses a multi-frame image fusion technology based on the maximum eigenvalue. This method fully utilizes the image information under different illumination conditions to achieve high-sensitivity detection of micro defects. The eigenvalue response matrix effectively captures local structural changes, and the calculation of weight coefficients optimized by dynamic programming ensures the optimality of multi-frame fusion, greatly improving the detection accuracy. Through the calculation of the matching degree between the wavelength-thickness mapping relationship matrix and the spectral response features, accurate identification and classification of defects in different film layers are achieved. The self-regulating graph convolutional UNet network can automatically learn the topological relationship of the defect region and extract multi-scale features, enabling the system to effectively detect defects in each layer of film adapted to different wavelengths of light, especially having strong resolution ability for micro defects in a multi-layer stacked structure. Adopting a lightweight network structure reduces the demand for computing resources. Through the optimized design of eigenvalue calculation and dynamic programming algorithm, the algorithm complexity is reduced, enabling the system to achieve real-time detection under limited hardware resources, meeting the on-line detection requirements of industrial production lines. Based on the exogenous input autoregressive model of multi-variable radial basis function and the hybrid parameter identification algorithm, a closed-loop control of defect detection results and manufacturing parameter optimization is achieved. The system can automatically adjust manufacturing process parameters according to the defect distribution of the film layer corresponding to different wavelengths of light, greatly improving the yield and consistency of optical films. Description of the Drawings
[0009] Figure 1 is a schematic diagram of the steps of an optical film detection method based on image processing in an embodiment of the present invention; Figure 2 is a block diagram of the structure of an optical film detection device based on image processing in an embodiment of the present invention; Figure 3 is a schematic block diagram of the structure of a computer device in an embodiment of the present invention.
[0010] The realization, functional features, and advantages of the objectives of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed Embodiments
[0011] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0012] Referring to Figure 1 , this embodiment provides an optical film detection method based on image processing, including the following steps: S1, collect multiple frames of images of a multi-layer optical film under different lighting conditions, preprocess the multiple frames of images, and calculate eigenvalue responses to obtain an eigenvalue response matrix; Among them, the angle and intensity of the light source are dynamically adjusted to ensure sufficient information is obtained under different incident angles and different light intensities, so as to comprehensively reflect the characteristics of the optical film. During the change of lighting conditions, a high-resolution industrial camera is used to synchronously collect multiple frames of images, which cover different lighting conditions such as from low angles to high angles, from weak light to strong light, etc., to ensure that the influence of lighting on the film layer characteristics is fully considered during subsequent feature analysis. Geometric correction is performed on the collected original images to eliminate the distortion error brought by the camera system. The geometric correction adopts a correction algorithm based on perspective transformation to make the pixel points in the image correspond to the correct positions in the standardized coordinate system. Adaptive histogram equalization operation is performed on the corrected images. The gray distribution is adaptively adjusted within the local area, making the overall brightness distribution of the image more uniform, thereby weakening the influence of uneven lighting on subsequent feature extraction. Through the equalization process, the contrast of the image is enhanced while maintaining the detail information of the original image, improving the visibility of film layer defects. After the lighting equalization is completed, a bilateral filtering algorithm is applied to suppress noise while retaining edge information. Bilateral filtering is a non-linear filtering method that combines spatial distance weights and pixel intensity similarity weights, enabling effective noise removal while maintaining edge sharpness, and is suitable for application scenarios that require retaining film layer details during the optical film detection process. Contrast Limited Adaptive Histogram Equalization (CLAHE) is performed on the images processed by bilateral filtering. By adaptively adjusting the local contrast, the over-enhancement phenomenon caused by traditional histogram equalization is effectively avoided. The image sequence with enhanced details is integrated into a preprocessed image sequence. In order to quantify the feature response of the optical film under different lighting conditions, a Hermitian positive definite matrix is constructed based on this preprocessed image sequence. The Hermitian positive definite matrix is a matrix with excellent mathematical properties, which reflects the statistical characteristics of image data and provides stable calculation results during the feature analysis process. When constructing the Hermitian positive definite matrix, each frame of image is used as part of the input data, and the statistical correlation between pixel points is calculated to form a matrix representing the characteristics of the optical film. The maximum eigenvalue of the Hermitian positive definite matrix is calculated and normalized. The maximum eigenvalue represents the amount of information of the matrix in the main feature direction, and the normalization process ensures that the eigenvalues under different lighting conditions are compared within the same scale range, improving the stability of feature fusion. All the calculated normalized maximum eigenvalues form an eigenvalue response matrix.
[0013] Set a sliding window of fixed size for the preprocessed image to ensure capturing the detailed features of the optical film in a local area. During this process, each frame of the image is divided into multiple local neighborhood windows, with each pixel point serving as the center of the window, enabling the window to slide smoothly across the entire image range to ensure coverage of all pixel areas and extract the local pixel data therein. Subtract the local mean from the pixel data within the local neighborhood window to eliminate the influence of global brightness or contrast, making the calculation process more focused on the relative change relationship of the pixels. Perform an inner product operation on the processed local pixel data, that is, calculate the inner product between the pixel values within each local neighborhood window and their adjacent pixel values to construct a Hermitian positive definite matrix. Perform eigenvalue decomposition on the Hermitian positive definite matrix to extract the information that can best characterize the local structural changes of the image. And select the largest eigenvalue to reflect the main change direction of the pixel data within the local neighborhood window, effectively capturing the significant features of the optical film defects. Rearrange the largest eigenvalue data according to the pixel position correspondence to construct an eigenvalue matrix containing the largest eigenvalues corresponding to all pixel positions. Perform normalization processing on this eigenvalue matrix to ensure stable data distribution. Through methods such as linear transformation or non-linear scaling, map all eigenvalues to a fixed numerical range, eliminate the influence of dimensions, and improve the comparability of the data. Based on the normalized eigenvalue matrix, calculate the detection statistic for each pixel position to reflect the feature distribution of the local area of the optical film. These detection statistics are calculated based on the spatial distribution pattern of the largest eigenvalue, such as using local variance, mean deviation, or adaptive weight calculation methods, making the statistics highlight the abnormal areas of the film layer. All the calculated detection statistics are arranged according to pixel positions to form an eigenvalue response matrix.
[0014] S2. Calculate the optimal weight coefficients for each frame of the image according to the eigenvalue response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficients to obtain an integrated feature representation; Specifically, an integration framework is defined for the eigenvalue response matrix. This framework utilizes the different information weights of multiple frames of images and combines them into a single representation, enabling the final fused features to retain the key information of the optical film to the greatest extent and enhancing the detectability of defects. Within this framework, the eigenvalue response of each frame of image is regarded as an independent input and adjusted by specific weight coefficients, such that different images play their best roles in the overall fusion process. When calculating the weight coefficients, a quality assessment mechanism is introduced to ensure that high-quality images play a greater role during the fusion process, while the influence of low-quality images is appropriately weakened. A quality assessment method is established within the integration framework. This method measures the contribution degree of an image by analyzing the gradient information and clarity level of each frame of image. The calculation of the gradient information is based on the Sobel operator or Laplacian transform to quantify the clarity of the image edges, while the clarity level is evaluated using local contrast or frequency domain analysis methods based on Fourier transform. Through these assessment methods, a quality assessment index is assigned to each frame of image to measure the weight that should be assigned to this frame of image during the final fusion process. The relationship between the quality assessment index and weight assignment is transformed into a dynamic programming problem, so as to determine the final fusion scheme through an optimal decision-making method. After modeling the relationship between quality assessment and weight assignment as a dynamic programming problem, the entire optimization process is divided into multiple quantization levels, such that the entire optimization calculation progresses step by step according to a phased decision-making process. Dynamic programming decomposes the global optimal problem into a series of sub-problems. Each sub-problem corresponds to a specific weight assignment scheme. Through forward calculation, the optimal weight coefficient at the current stage is obtained for each stage and stored in the dynamic programming table. To ensure the efficiency of the calculation, the dynamic programming process calculates the optimal solution of each sub-problem step by step from front to back and stores these solutions in a structured data table. By backtracking through the entire dynamic programming table, the globally optimal weight assignment scheme is obtained, thereby determining the optimal weight coefficients for each frame of image. The optimal weight coefficients are applied to the eigenvalue response matrix of each frame of image, and linear weighted combination is performed to generate a fused feature matrix. Edge-preserving filtering is performed on the fused feature matrix, such that the final integrated feature representation does not result in the loss of edge information due to the fusion process, obtaining a multi-frame integrated feature representation.
[0015] S3. Extract multi-scale defect features from the integrated feature representation to obtain defect candidate regions; It should be noted that based on the integrated feature representation, the mapping relationship between pixel points and graph nodes is established, so that each pixel point is regarded as a node in the graph structure. At the same time, the initial graph structure is constructed by using the spatial proximity between pixel points to ensure that the spatial topological information of pixel points is reflected in the graph model. In this process, in order to ensure the connectivity of the graph, the connection strength between nodes is calculated according to the similarity of pixel values, and the graph adjacency relationship is generated, so that the correlation information between pixels can be effectively utilized in subsequent calculations. Self-connections are added to the adjacency relationship of the graph, so that each node retains its own feature contribution during the information transmission process, and the adjacency matrix is normalized by the degree matrix to obtain a normalized adjacency matrix, so as to avoid the problem of feature distortion caused by uneven degree distribution during numerical calculations. On the basis of the normalized adjacency matrix, a modulation matrix is introduced, and a self-modulating graph convolutional layer is constructed by matrix multiplication. This self-modulating mechanism dynamically adjusts the feature influence degree of different regions to enhance the adaptability of the model in the complex optical film feature environment. An encoder-decoder structured UNet network is built based on the self-modulating graph convolutional layer. This network realizes the efficient recognition of the defective area of the optical film through layer-by-layer feature extraction and multi-scale information fusion. In the encoder part of the UNet, preliminary graph convolutional operations are performed on the input integrated feature representation to extract local spatial information. At the same time, pooling operations are combined to gradually reduce the size of the feature map and capture hierarchical features with different receptive fields. After multiple layers of graph convolution and pooling, feature maps of different scales are formed. The deeper feature maps capture large-scale defect information, while the shallower feature maps retain more fine-grained texture features. In the decoder part of the UNet network, upsampling operations are performed on these feature maps with different receptive fields to gradually restore the resolution of the feature map to the size of the original input. And during each upsampling process, the corresponding encoder layer feature map is concatenated and fused with the current decoder layer feature map to ensure that high-level structural information is retained while restoring image details. After concatenation, the self-modulating graph convolutional layer is used to extract and enhance the features of the fused feature map to obtain the target feature map. Classification judgment is performed on the target feature map to generate a defective probability distribution map, which is a probability heat map, where the value of each pixel point represents the probability of it belonging to the defective area. In order to determine the specific location of the defect, the threshold segmentation method is used to binarize the defective probability distribution map, that is, by setting a suitable threshold, the pixel points higher than the threshold are judged as the defective area, while the pixel points lower than the threshold are considered as the normal area. The defective candidate area is accurately extracted from the defective probability distribution map.
[0016] S4. Extract the spectral response features based on the defective candidate area, and calculate the matching degree between the spectral response features and the preset wavelength-thickness mapping relationship matrix to obtain the multi-layer film defective distribution map; Specifically, optical modeling and analysis are performed on the multi-layer optical film structure to construct a wavelength-film thickness mapping relationship matrix including reflectivity, transmittance, and absorptance. This mapping relationship matrix establishes a correspondence between the film thickness of each layer of the optical film and the optical responses at different incident angles and wavelengths. During the modeling process, the thin-film interference theory, Fresnel equations, and transfer matrix method are used to calculate the spectral response characteristics of the multi-layer film under different optical parameters. This process takes into account the influence of the thickness change of the film layer on the spectral characteristics, as well as the corresponding changes at different incident angles, so that the mapping matrix can be used for subsequent feature matching and defect analysis. Extract the spectral characteristics of the defect candidate region. Since optical film defects often involve minute structural changes, and these changes will generate complex spectral responses under different lighting conditions, in order to extract spectral characteristics more precisely, local region Fourier transform and wavelet decomposition are applied in the defect region. Analyze the spectral information of the defect region through Fourier transform, extract the main spatial frequency distribution from it, and perform multi-scale analysis in combination with wavelet decomposition, so that the frequency characteristics and phase information of the defect region at different spectral resolutions can be completely captured. Through multi-scale frequency domain analysis, a high-dimensional spectral response feature vector is obtained, which reflects the spectral change patterns of the defect region at different wavelengths and lighting conditions. Perform non-linear dimensionality reduction and feature optimization on the multi-dimensional spectral response feature vector to form a more compact discriminative spectral fingerprint feature. Deep learning methods such as kernel principal component analysis or autoencoders are used for feature dimensionality reduction to remove redundant dimensions while retaining key information. Through feature optimization methods, such as linear discriminant analysis or maximum information coefficient, the distinguishability of spectral features is enhanced, so that different types of defect spectral patterns can be more clearly distinguished in the feature space. Input the discriminative spectral fingerprint feature into the kernel function mapper to improve the non-linear separability of the feature. The kernel function mapper projects the spectral feature into a higher-dimensional feature space, making it easier to linearly separate the originally indistinguishable defect categories in the new feature space. Calculate the Mahalanobis distance between the feature space representation output by the kernel function mapper and the wavelength-film thickness mapping relationship matrix, measure the similarity between the feature space representation and the mapping relationship matrix, construct a hierarchical matching metric value, and provide a quantitative spectral similarity index for each pixel point, so as to determine whether the region belongs to a specific film layer defect. Establish a decision model based on the hierarchical matching metric value to determine the film layer attribution of the defect. During the decision-making process, in order to improve the classification accuracy, Bayesian prior constraints are introduced to optimize the classification result by combining prior knowledge. Since optical film defects have spatial consistency, that is, the spectral characteristics of adjacent regions are often correlated, a spatial consistency regularization term is added to the decision model to ensure that the decision result is smooth in space and reduce misclassification caused by random noise. Through the method of maximum a posteriori probability estimation, generate a film layer attribution label with the optimal classification confidence. Fuse the film layer attribution label with the defect morphological features.Since the defects have a certain spatial distribution pattern, such as edge characteristics, connectivity, etc., a conditional random field model is used for context optimization. The conditional random field model ensures that the morphological features of the defect area are consistent with its spectral features through a global optimization method, thereby reducing misclassification and boundary blurring. Generate a defect distribution map of the multilayer film, reflecting the defect positions and severity levels of different film layers.
[0017] S5. Perform autoregressive prediction and optimization of processing control parameters on the defect distribution map of the multilayer film to obtain a closed-loop control scheme.
[0018] Among them, an exogenous input autoregressive model of multivariate radial basis function is constructed for the multi-layer film defect distribution map. In this model, the defect index in the multi-layer film defect distribution map is used as the output variable of the system, and at the same time, the processing control parameters are used as the control input variables to establish a prediction model reflecting the characteristics and evolution trend of the multi-layer optical film. During the modeling process, the radial basis function method is adopted to enhance the nonlinear fitting ability of the model, so that it can better adapt to the complex film defect distribution characteristics. By analyzing the spatio-temporal evolution trend of the defect area, key defect indexes are extracted, including defect size, defect distribution density, spectral feature offset, etc., and these indexes are used as the output vector of the model. At the same time, key processing control parameters, such as deposition rate, temperature, air pressure, sputtering power, etc., are used as the input variables of the model. Through this modeling method, the dynamic characteristics of defect formation in the optical film manufacturing process are effectively characterized. The hybrid parameter identification algorithm is applied to the prediction model. This algorithm includes two stages: particle swarm iterative identification and multivariate hierarchical multi-innovation stochastic gradient identification. In the first stage, the particle swarm optimization algorithm is used to globally search for the model parameters. By simulating the random movement of particles in the search space, the model can jump out of the local optimal solution and obtain a better initial parameter estimate. Since the particle swarm algorithm has strong global search ability, the optimal region of the model parameters can be quickly determined. In the second stage, the multivariate hierarchical multi-innovation stochastic gradient identification algorithm is applied to finely adjust the initial parameters to improve the prediction accuracy of the model. In this process, the multi-level gradient calculation method is used to make the parameter optimization process more stable and effectively avoid the optimization failure caused by local oscillation. After the optimization of these two stages, an optimized model parameter that accurately describes the parameter-defect relationship is obtained. Based on the optimized model parameters, a nonlinear model predictive control framework is established to achieve the optimal control of the processing process. In this framework, the prediction horizon and the control horizon are set. The prediction horizon determines the prediction range of the future defect evolution trend of the system, while the control horizon determines the time window for control adjustment. To ensure the stability of the control scheme, a multi-objective cost function including the output error and the control input is constructed. The core objective of this cost function is to minimize the deviation between the film defect and the target specification, and at the same time minimize the drastic fluctuation of the processing control parameters to avoid the process instability caused by over-adjustment. In this process, each index in the cost function is adjusted by the weight factor to make it more in line with the actual production requirements. For example, a higher weight is given to the uniformity of the defect distribution to ensure that the film quality is given priority during the optimization process. After establishing the multi-objective cost function, the sequential quadratic programming optimization algorithm is introduced to solve the optimal control input sequence. Sequential quadratic programming is an efficient algorithm for solving constrained optimization problems. Under the premise of satisfying the control input range limit and the output constraint conditions, a set of optimal processing control parameters is found to minimize the impact of film defects to the greatest extent.During the solution process, the gradient information is used to perform a local quadratic approximation on the cost function, and a quadratic programming sub-problem is constructed. Then, the control variables are gradually optimized through iterative solution methods to make them gradually approach the global optimal solution. Throughout the optimization process, the adjustment of the control input needs to comply with physical constraint conditions. For example, the change in the deposition rate cannot exceed the tolerance range of the equipment, and the temperature adjustment must be maintained within a reasonable process window. These constraint conditions need to be strictly considered during the solution to ensure that the final control scheme is feasible in actual production. According to the film thickness and defect distribution corresponding to different wavelengths of light, the optimized control parameters are adjusted in real time to ensure that the optical performance of the film meets the design requirements. Since the spectral characteristics of the film are related to its thickness distribution, the shift of the spectral response is continuously monitored during the optimization process, and key parameters such as the deposition rate and process temperature are dynamically adjusted according to the feedback information. Through a closed-loop control scheme, the intelligent optimization of the optical film manufacturing process is achieved, effectively suppressing film defects and ensuring the stability and consistency of product quality.
[0019] In one example, multiple frames of images of a multi-layer optical film under different lighting conditions are collected, and the multiple frames of images are preprocessed and eigenvalue calculations are performed to obtain an eigenvalue response matrix, including: Adjust the light source angle and intensity, and collect multiple frames of images of the multi-layer optical film under different lighting conditions; Perform geometric correction on the multiple frames of images to obtain the corrected images, and perform an adaptive histogram equalization operation on the corrected images to obtain the light-balanced images; Apply a bilateral filtering algorithm to the light-balanced images to obtain smoothed images that suppress noise and retain edge information; Perform contrast-limited adaptive histogram equalization on the smoothed images to obtain images with enhanced details, and integrate the image sequence with enhanced details into a preprocessing image sequence; Construct a Hermitian positive definite matrix based on each frame of image in the preprocessing image sequence, calculate the maximum eigenvalue of the Hermitian positive definite matrix and standardize it to obtain the eigenvalue response matrix.
[0020] In this example, a controllable light source system is established so that the light source can irradiate the optical film at different angles and intensities to obtain the reflection, transmission, and scattering characteristics under different optical conditions. Set the light source angle and the light intensity as two control variables, where represents the incident angle of the light source relative to the surface of the optical film, and represents the radiation intensity of the light source. Different will affect the reflection and transmission paths of light, and different Affect the spectral response of the optical film. Under different illumination conditions, the defects in the film layer exhibit different visibilities. Set a group of illumination combinations, and use a high-resolution camera to collect corresponding multiple frames of images to form a complete data set. After collecting multiple frames of images, due to the risk of perspective distortion, lens distortion or optical offset in the camera system, geometric correction is performed to map the original image to the corrected image in the standard coordinate system through the transformation function . Use the perspective transformation matrix for correction, and its general form is: ; where is a 3×3 matrix, and its parameters are obtained by calculating the matching of calibration points, so that the geometric distortion of the transformed image is corrected. Perform adaptive histogram equalization on the corrected image to adjust the local contrast of the image. Let the gray histogram of the corrected image be , where represents the gray level, then the transformation function of histogram equalization is expressed as: ; where is the equalized gray value, is the total number of pixels in the image. To avoid the over-enhancement problem caused by global equalization, an adaptive method is adopted to divide the image into multiple local regions, and histogram equalization is calculated independently for each region to maintain the contrast adaptability of different regions. To reduce noise and at the same time retain the edge features of the optical film, bilateral filtering is applied to the image after illumination equalization. Bilateral filtering is a non-linear smoothing algorithm that combines spatial distance weights and pixel similarity weights, so that the pixels in the edge region will not be blurred. Its filtering formula is: ; where is the spatial weight function, is the pixel similarity weight function, controls the degree of spatial expansion, controls the influence of intensity change on the weight, is the normalization factor, so that the sum of all weights is equal to 1. After noise suppression, to enhance the contrast of the optical film defects, contrast-limited adaptive histogram equalization is performed on the smoothed image. Let the cumulative distribution function of the histogram of the local window be , then the limited transformation function is expressed as: ; where is the set contrast limit threshold, which ensures that the enhancement does not over-amplify the brightness of certain regions, enabling the enhancement of image details without distortion. All enhanced images are integrated into a preprocessed image sequence , which is used for subsequent feature extraction. Based on each frame of the preprocessed image sequence, a Hermitian positive definite matrix is constructed to extract the local features of the film layer. During this process, each image frame is divided into multiple local windows, and each window forms a pixel feature matrix , and then the covariance matrix is calculated: ; where is the Hermitian positive definite matrix, and its eigenvalues are used to analyze the local feature distribution of the image. Calculate the maximum eigenvalue of this matrix: ; where represents the set of eigenvalues of matrix , and the maximum value among them is selected as the main eigenvalue of the local region. To ensure that the range of eigenvalues is suitable for subsequent calculations, normalization is performed. The normalization formula is as follows: ; where is the mean of all maximum eigenvalues, is the standard deviation, so that all eigenvalues are normalized to the same scale range. Organize all the calculated normalized maximum eigenvalues into an eigenvalue response matrix , which effectively reflects the characteristic changes of the optical film in different regions.
[0021] In an example, based on each frame of the preprocessed image sequence, a Hermitian positive definite matrix is constructed, the maximum eigenvalue of the Hermitian positive definite matrix is calculated and normalized to obtain an eigenvalue response matrix, including: Set a sliding window of a fixed size for each frame of the preprocessed image sequence, construct a local neighborhood window centered on each pixel point in each frame of the image, and extract the pixel data within the local neighborhood window; Perform an inner product operation on the pixel data within the local neighborhood window after subtracting the local mean to construct a Hermitian positive definite matrix; Perform eigenvalue decomposition on the Hermitian positive definite matrix, and select the maximum eigenvalue to form the maximum eigenvalue data representing the local structural changes of the image; Rearrange the maximum eigenvalue data according to the pixel position correspondence relationship to construct an eigenvalue matrix containing the maximum eigenvalues at all positions; Perform normalization processing on the eigenvalue matrix to obtain a normalized feature matrix, and calculate the detection statistic at each pixel position based on the normalized feature matrix, and organize the detection statistics into an eigenvalue response matrix.
[0022] In this example, a sliding window of a fixed size is set for each frame of the image, and a local neighborhood window is constructed centered on each pixel point to extract the pixel data within this window. Let the preprocessed image be , and the size of the sliding window is set to . Then, the local neighborhood window at pixel point is expressed as: ; where represents the local window centered on pixel point , containing all the pixel values within this area. The pixel data within the local neighborhood window is subjected to mean normalization to remove the influence of global brightness, so that subsequent calculations only focus on local structural changes. Let the mean of the pixel data within this window be: ; Then, the normalized pixel data is: ; The normalized local pixel data is used for inner product operation to construct the Hermitian positive definite matrix , and its calculation method is: ; where is the normalized pixel column vector within the window, is its transpose, and the matrix reflects the covariance structure of this local area. The Hermitian positive definite matrix is subjected to eigenvalue decomposition to obtain the main eigenvalues of this area. Let 's set of eigenvalues be , then the maximum eigenvalue among them is selected: ; This maximum eigenvalue reflects the main direction of local structural changes and can highlight the abnormality of the defective area of the optical film. The maximum eigenvalues of all pixel points are arranged according to their original positions to form the complete eigenvalue matrix : ; To ensure the scale consistency of eigenvalues in the calculation, the eigenvalue matrix is normalized. Let the mean and standard deviation of the eigenvalue matrix be and respectively, then the normalized eigenvalue matrix is calculated as follows: ; The normalized feature matrix can eliminate the scale differences between different images, making the comparison of eigenvalues more stable. Calculate the detection statistic at each pixel position based on the standardized feature matrix , through local mean deviation or spatial gradient calculation, for example: ; This detection statistic reflects the feature deviation between the current pixel and its local area, and can highlight the defective areas of the optical film. Organize all detection statistics according to pixel positions into an eigenvalue response matrix : ; This matrix is used for subsequent defect detection and analysis, so as to effectively identify the abnormal areas of the film layer during the optical film detection process.
[0023] In one example, calculate the optimal weight coefficients for each frame of image according to the eigenvalue response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficients to obtain an integrated feature representation, including: Define an integration framework for the eigenvalue response matrix, and combine multiple frames of images into a single representation through weight coefficients; Introduce a quality evaluation mechanism into the integration framework, and establish a quality evaluation index for measuring the contribution degree of images by evaluating the gradient information and clarity level of each frame of image; Convert the quality evaluation index and weight assignment relationship into a dynamic programming problem, divide the dynamic programming problem into multiple quantization levels, and establish a phased decision-making process; Calculate the optimal solution of each sub-problem from front to back based on the phased decision-making process, store it in the dynamic programming table, and determine the optimal weight coefficients of each frame of image through backtracking; Apply the optimal weight coefficients to the eigenvalue response matrices of each frame of image, perform linear weighted combination, generate a fused feature matrix, and perform edge-preserving filtering on the fused feature matrix to obtain a multi-frame integrated feature representation.
[0024] In this example, define a mathematical framework so that the eigenvalue response matrices of all frames can be combined into a single representation through weight coefficients. Let the -th frame of image have an eigenvalue response matrix of , where represents the pixel position, while represents the frame index in the time series. Let the weighted combination form of all frames be: ; Among them, represents the weight coefficient of the -th frame, satisfying the normalization constraint condition: ; To reasonably allocate to ensure that the fused feature matrix optimally describes the characteristics of the optical film, a quality assessment mechanism is introduced. The core of the quality assessment lies in measuring the clarity and gradient information of each frame of image, such that high-quality images contribute a larger weight, while low-quality images have a smaller weight. Let the local gradient matrix of the -th frame of image be ; To obtain the global quality metric, calculate the mean gradient of the entire image: ; where, represents the quality assessment index of the -th frame, and are the number of rows and columns of the image respectively. Introduce the clarity metric based on the Laplace transform: ; where, is the Laplace operator, used to calculate the local second-order variation of the image. Combine the gradient information and the clarity index into a comprehensive quality assessment function: ; where, and are weight parameters, ensuring an appropriate balance of the influence of gradient information and clarity information on the quality assessment. To ensure the global optimality of the fusion process, transform the quality assessment index into a dynamic programming problem of weight allocation. Define a stagewise decision process to decompose the entire weight allocation problem into multiple levels, each level corresponding to a different image frame, and optimize the weight allocation layer by layer according to the optimal strategy. In dynamic programming, let represent the optimal weight function of the -th frame, and the goal is to find the optimal weight allocation such that the quality of the final fusion matrix is optimal, that is, to maximize: ; To solve this optimization problem, construct a dynamic programming table and use the forward calculation method to calculate the solutions of all possible sub-problems and store them in the table, and then find the final optimal weight allocation scheme through backtracking: ; The calculated optimal weight coefficient The eigenvalue response matrix applied to all image frames is weighted and summed to obtain the finally fused feature matrix : ; To improve the optical feature fidelity of the fusion matrix, edge-preserving filtering is performed on it to ensure that the boundary information will not be blurred during the fusion process. The guided filtering method is adopted, and its filtering model is: ; Among them, and are determined by minimizing the following energy function: ; Among them, is the smoothing factor used to control the edge-preserving degree. By solving this optimization problem, the multi-frame integrated feature representation after edge-preserving filtering is obtained. This matrix effectively retains the detail information of the optical film while reducing noise interference.
[0025] In this embodiment, the method further includes an autonomous model order selection process after obtaining the integrated feature representation and before performing multi-scale defect feature extraction, including: constructing a state space model for the integrated feature representation, forming an initial state equation describing the dynamic characteristics of the optical film layer by taking the image feature sequence as the system output and the change of illumination conditions as the system input; calculating the system observation matrix and control matrix based on the initial state equation, and performing singular value decomposition on the system observation matrix to obtain a diagonal matrix containing different singular values and the corresponding left and right singular vectors; arranging the singular values in the diagonal matrix in descending order, calculating the ratio sequence of adjacent singular values, and determining the initial model order by setting a gradient threshold to construct a candidate set of model orders; for each order in the candidate set of model orders, using the subspace method to identify the system parameter matrix corresponding to the order and establishing a series of system models with different orders; calculating the state estimation cross Gramian matrix for the system models with different orders, and the cross Gramian matrix is obtained by calculating the inner product between different state vectors, reflecting the mutual relationship between system states; calculating the energy error ratio between the state estimation energy and the system observation energy for each model based on the cross Gramian matrix, and using the energy error ratio as the model evaluation index; selecting the model with the smallest energy error ratio from the system models with different orders as the optimal order model to determine the optimal state space dimension of the optical film layer system; using the optimal order model to perform state estimation and prediction on the integrated feature representation, suppressing noise interference through the Kalman filtering algorithm, and generating an enhanced integrated feature representation as the input data for subsequent multi-scale defect feature extraction.
[0026] In one example, multi-scale defect feature extraction is performed on the integrated feature representation to obtain defect candidate regions, including: Based on the integrated feature representation, establish the mapping relationship between pixel points and graph nodes, construct the initial graph structure based on the spatial proximity between pixel points, and calculate the connection strength between nodes according to the pixel value similarity to generate the adjacency relationship of the graph; Add self-connections to the adjacency relationship of the graph and perform degree matrix normalization to obtain the normalized adjacency matrix. Multiply the normalized adjacency matrix by the adjustment matrix to construct the self-adjusting graph convolutional layer; Based on the self-adjusting graph convolutional layer, construct a UNet network with an encoder-decoder structure. Extract multi-level features through graph convolution and pooling operations in the encoder part of the integrated feature representation to form feature maps with different receptive fields; In the decoder part of the UNet network, perform upsampling operations on the feature maps with different receptive fields, splice and fuse them with the feature maps of the corresponding layers in the encoder, and process the fused features through the self-adjusting graph convolutional layer to obtain the target feature map; Perform classification judgment on the target feature map to generate a defect possibility distribution map, and extract defect candidate regions from the defect possibility distribution map according to the threshold segmentation method.
[0027] In this example, establish the mapping relationship between pixel points and graph nodes. Let the integrated feature representation be , where represents the pixel position in the image, and the mapping relationship is defined as a graph , where is the set of nodes corresponding to pixels, is the set of edge connections between pixel points. To construct the graph structure, define the initial adjacency relationship based on the spatial proximity of pixel points, that is, if two pixel points and satisfy the following in Euclidean distance: ; then there is an edge connection between them, where is the preset neighborhood range. Calculate the connection strength between nodes according to the pixel value similarity. Let the feature vectors of two pixel points be and , then their similarity weight is defined as: ; where represents the weight between nodes and , is the hyperparameter that controls the similarity measurement range. All form the adjacency matrix , that is: ; To ensure the stability of information dissemination, self-connections are added to the adjacency matrix so that each node retains its own feature contribution, that is, construct , where is the identity matrix. Calculate the degree matrix , and its diagonal elements are: ; And perform normalization to obtain the normalized adjacency matrix: ; To enhance the model's adaptive ability to features in different regions, a modulation matrix is introduced, which represents the feature importance of different regions, and finally a self-modulating graph convolutional layer is constructed: ; Among them, is the feature matrix of the th layer, is the weight matrix of graph convolution, is the non-linear activation function. On this basis, a UNet network with an encoder-decoder structure based on self-modulating graph convolutional layers is constructed. The encoder part of the UNet network performs multi-layer graph convolution on the input integrated feature representation , and each layer uses the graph convolution operation to extract features and combines with pooling operations: ; The feature maps extracted by each layer have a larger receptive field and at the same time reduce redundant information, forming a multi-level feature representation. After layers of encoding, feature maps of different scales are formed. In the decoder part, the feature maps generated by the encoder are upsampled to restore them to the original size, and each upsampling layer is concatenated with the corresponding encoder feature map to fuse low-level and high-level information, and the concatenated features are further processed by the self-modulating graph convolutional layer: ; Among them, represents the concatenation operation, which fuses information of different scales, and finally forms the target feature map. Classify and judge the target feature map, and calculate the defect probability distribution map , where the value of each pixel represents the probability that it belongs to a defect: ; Among them, is the weight of the classification layer, is the activation function, such as Sigmoid or Softmax. Extract the defect candidate regions through the threshold segmentation method: ; Among them, is a set threshold, such that a binary defect area identification matrix is formed to obtain a defect candidate area.
[0028] In one example, spectral response features are extracted based on the defect candidate area, and the matching degree between the spectral response features and a preset wavelength-thickness mapping relationship matrix is calculated to obtain a multi-layer film defect distribution map, including: Optical modeling analysis is performed on the multi-layer optical film structure to construct a wavelength-thickness mapping relationship matrix including reflectivity, transmittance, and absorptance, and the mapping relationship matrix correlates the thickness of each layer with the optical responses at different incident angles and wavelengths; Local region Fourier transform and wavelet decomposition are applied to the defect candidate area to extract the spectral features and phase information of the defect area under different illumination conditions from the multi-scale frequency domain analysis, and a multi-dimensional spectral response feature vector is generated; Nonlinear dimensionality reduction and feature optimization are performed on the multi-dimensional spectral response feature vector to form discriminative spectral fingerprint features; The discriminative spectral fingerprint features are input into a kernel function mapper, and the Mahalanobis distance between the feature space representation output by the kernel function mapper and the wavelength-thickness mapping relationship matrix is calculated to construct a hierarchical matching metric value; A decision model is established based on the hierarchical matching metric value, and Bayesian prior constraints and spatial consistency regularization terms are introduced into the decision model to generate a film layer attribution label with the maximum posterior probability; The film layer attribution label and the defect morphological features are fused and processed, and context optimization is performed through a conditional random field model to generate a multi-layer film defect distribution map.
[0029] In this example, a wavelength-thickness mapping relationship matrix including reflectivity, transmittance, and absorptance is established to correlate the optical responses at different incident angles, wavelengths, and film layer thicknesses. Let the incident angle of the light wave be , the wavelength be , and the film layer thickness be , where represents the numbers of different film layers, then the optical response is calculated by the Fresnel formula, and the reflectivity and transmittance of the film layer are respectively expressed as: ; ; Among them, is the refractive index of the film layer , is the refraction angle inside the film layer, and according to Snell's law, there is: ; Meanwhile, the light absorption rate is obtained from the law of conservation of energy: ; The optical response data of all layers are combined into a wavelength-thickness mapping relationship matrix , and each element of it corresponds to the optical parameters at a certain wavelength-thickness and incident angle. Frequency domain analysis is performed on the defect candidate regions to extract spectral features. In order to analyze the response characteristics of the defect regions under different illumination conditions, the spectral signals of the defect regions are subjected to local Fourier transform, and the Fourier transform is defined as follows: ; where is the spectral information, represents the frequency domain coordinates. Meanwhile, in order to obtain spectral features at different scales, wavelet decomposition is used to decompose the signal into different frequency components, and the wavelet transform is defined as: ; where is the wavelet basis function, is the scale parameter, is the translation parameter, and the multi-scale spectral features formed are expressed as: ; where is the Fourier transform feature, is the wavelet transform feature, which constitutes a multi-dimensional spectral response feature vector. Nonlinear dimensionality reduction and feature optimization are performed on the spectral feature vector to extract key information. Let the spectral feature matrix be , and kernel principal component analysis is used for dimensionality reduction. The mapping function is defined to project it into a high-dimensional feature space: ; The most discriminative feature dimensions are extracted through principal component analysis: ; where is the dimensionality reduction projection matrix, forming discriminative spectral fingerprint features. In order to match with the wavelength-thickness mapping relationship matrix, the Mahalanobis distance of the spectral fingerprint features in the feature space is calculated, and the matching metric value is defined as: ; where is the covariance matrix, which measures the correlation between features. The smaller the distance, the higher the matching degree. Based on the matching metric value, a decision model is established to determine the film layer attribution of the defect area. Bayesian prior constraints are introduced to ensure that the matching results conform to physical laws. Let the prior probability of the defect area be , then the maximum a posteriori probability estimation is: ; Meanwhile, in order to enhance spatial continuity, a spatial consistency regularization term is introduced to make the film layer classification results of adjacent pixels consistent. The optimization objective function is: ; where, represents the pixel neighborhood, controls the spatial smoothness degree, and finally generates the film layer attribution label. The film layer attribution label is fused with the defect morphological features, and context optimization is performed through a conditional random field model. Define the energy function: ; where, is the observation probability of a single pixel, is the neighborhood constraint. Optimizing this energy function obtains the final multi-layer film defect distribution map.
[0030] In this embodiment, before extracting the spectral response features from the defect candidate region, the following steps are further included: performing region division on the defect candidate region, dividing the defect candidate region into multiple sub-regions according to the defect morphological features and spatial distribution, and establishing a sub-region index table; extracting the original image blocks corresponding to the sub-region index table to form a high-resolution reconstruction data set including the defect and its surrounding regions; constructing a memory-efficient super-resolution enhancement network structure, and the super-resolution enhancement network includes a feature extraction module, a non-linear mapping module, and an image reconstruction module; designing a residual channel attention unit for the non-linear mapping module of the super-resolution enhancement network, introducing a skip connection and a channel re-weighting mechanism to enhance the expression ability of the defect texture features; applying a frequency domain transformation to the high-resolution reconstruction data set, analyzing the interference fringes and high-frequency noise features unique to the multi-layer optical film, and establishing a frequency domain suppression filter; integrating the frequency domain suppression filter into the feature extraction module of the super-resolution enhancement network, and adaptively suppressing the film layer artifacts through a learnable frequency domain mask; constructing an objective function based on the contrast loss and the structural similarity loss, training the super-resolution enhancement network to eliminate the film layer artifacts while retaining the defect features in the reconstructed image; performing quantization and computational graph optimization on the trained super-resolution enhancement network to obtain a lightweight model suitable for real-time processing, and applying the lightweight model to the defect candidate region; remapping the enhanced defect candidate region back to the original image space to form an optical film defect region with high-resolution details and low artifact interference as the input for subsequent spectral response feature extraction.
[0031] In one example, autoregressive prediction and optimization of processing control parameters are performed on the multilayer film defect distribution map to obtain a closed-loop control scheme, including: Construct an exogenous input autoregressive model of multivariate radial basis function for the multilayer film defect distribution map, use the defect index in the multilayer film defect distribution map as the system output, and use the processing control parameters as the control input to establish a prediction model reflecting the characteristics of the multilayer optical film; Apply a hybrid parameter identification algorithm to the prediction model. The hybrid parameter identification algorithm includes two stages: particle swarm iterative identification and multivariate hierarchical multi-innovation stochastic gradient identification, to obtain optimized model parameters characterizing the relationship between parameters and defects; Based on the optimized model parameters, establish a nonlinear model predictive control framework, set the prediction horizon and control horizon, and construct a multi-objective cost function including output error and control input; Introduce a sequential quadratic programming optimization algorithm to the multi-objective cost function, solve the optimal control sequence under the control input range limit and output constraint conditions, and adjust the processing control parameters in real time according to the film layer thickness and defect distribution corresponding to different wavelength lights to form a closed-loop control scheme.
[0032] In this example, an exogenous input autoregressive model of multivariate radial basis function is constructed for the multilayer film defect distribution map, and the defect index is used as the system output and the processing control parameters are used as the control input to establish a prediction model reflecting the change of optical film characteristics. Define the input-output relationship of the system. Let the defect index of each pixel or region in the defect distribution map be represented by and the processing control parameters be represented by , both of which change with time . When constructing the model, use the radial basis function to describe the nonlinear characteristics of the system. The model is expressed as: ; where represents the system state vector, is the th center vector, is the radial basis function, and the Gaussian function is adopted, that is: ; Here represents the Euclidean distance between the state and the center, is the expansion parameter, is the weight parameter, is the proportional coefficient of the control input on the system output, is the modeling error, is the number of basis functions. This model establishes a connection between the defect indicators in the multi-layer film defect distribution map and the processing parameters, reflecting the changing trend of film layer characteristics under different processing conditions. Parameter identification is performed on the prediction model to obtain the optimal model parameters characterizing the relationship between parameters and defects. A hybrid parameter identification algorithm is applied, which includes two stages: global search for model parameters using particle swarm iteration identification. The particle swarm algorithm seeks the global optimal solution through iterative updates of multiple candidate solutions in the population, and its update formula is: ; ; where represents the current th candidate parameter vector, represents the velocity vector, is the historical best solution of the current individual, is the global optimal solution, is the inertia weight, and are learning factors, and are random numbers within [0,1]. This stage provides a better initial parameter set. In the second stage, multivariate hierarchical multi-innovation stochastic gradient identification is used to refine and optimize the initial parameters. Let the cost function be: ; where represents the parameter vector to be optimized, including all and parameters, represents the model prediction output. The multivariate stochastic gradient method updates the parameters in a hierarchical strategy, and each layer adjusts the parameters according to the gradient information. Its update formula is: ; where is the learning rate. The update process combines the multi-innovation strategy, that is, calculating the gradients in parallel at multiple initial points and updating the parameters according to the weighted average of multiple innovation gradients, thereby improving the convergence speed and accuracy. After two stages of identification, a set of optimal parameters is obtained, making the prediction model accurately reflect the nonlinear relationship between the processing control parameters and the defect indicators. After obtaining the optimized model parameters , a nonlinear model predictive control framework is constructed based on this prediction model. Under the nonlinear model predictive control framework, the prediction horizon and the control horizon are set, where represents the prediction range of the system state within the future time instants, while Indicates the duration for updating the actual control input. A multi-objective cost function is constructed to balance the output error and the change in the control input. The cost function is expressed as: ; where is the predicted system output, is the desired output, i.e., the target defect index, represents the change in the control input, is the weight factor for the change in the control input, used to limit the amplitude of the input adjustment. This cost function reflects that while ensuring that the defect index is as close as possible to the desired target, the processing parameters are adjusted as smoothly as possible to avoid excessive interference with the process stability. To solve the above multi-objective cost function, a sequential quadratic programming optimization algorithm is introduced in the actual control process. The sequential quadratic programming algorithm transforms the non-linear optimization problem into a series of quadratic programming sub-problems through local quadratic approximation and solves the optimal control sequence under the control input range and the output constraint . Let the current time be , the problem to be solved is written as: ; ; where is the control input increment sequence, is the Hessian matrix, is the gradient vector, and represent the matrix and vector of the constraint conditions respectively. By iteratively solving this quadratic programming problem, the optimal control input sequence at the current time is obtained. During the control process, according to the film thickness and defect distribution corresponding to different wavelengths of light, the defect index is collected in real time and the output prediction at the future time is carried out using the prediction model. At the same time, the processing parameters are adjusted in real time according to the latest control input . For example, when it is detected that the film thickness is too thin and the number of defects increases at a certain specific wavelength, the prediction model will reflect the output deviation, and the optimal control sequence calculated through the non-linear model predictive control framework will adjust key parameters such as the deposition rate or temperature so that the film reaches the predetermined target, thereby realizing closed-loop control. This process is repeated continuously. At each moment, through the update of the prediction model, the identification of the mixing parameters, and the sequential quadratic programming optimization, it is ensured that the entire processing process is always in the optimal control state, ensuring the stability and consistency of the product quality.
[0033] Referring to Figure 2 , this embodiment provides an optical film detection device based on image processing, including: The acquisition module 1 is used to acquire multiple frames of images of the multi-layer optical film under different illumination conditions, preprocess the multiple frames of images and calculate eigenvalue, so as to obtain an eigenvalue response matrix; The feature fusion module 2 is used to calculate the optimal weight coefficient of each frame of image according to the eigenvalue response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation; The feature extraction module 3 is used to extract multi-scale defect features from the integrated feature representation to obtain defect candidate regions; The matching degree calculation module 4 is used to extract spectral response features based on the defect candidate regions, and calculate the matching degree between the spectral response features and a preset wavelength-thickness mapping relationship matrix to obtain a multi-layer film defect distribution map; The parameter optimization module 5 is used to perform autoregressive prediction on the multi-layer film defect distribution map and optimize the processing control parameters to obtain a closed-loop control scheme.
[0034] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the description in the above method embodiment, and details will not be repeated here.
[0035] Refer to Figure 3 , in the embodiment of the present invention, a computer device is further provided. The computer device may be a server, and its internal structure may be as Figure 3 shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface, and a database connected through a system bus. Among them, the processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0036] Those skilled in the art can understand that Figure 3 the structure shown in
[0037] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article or method comprising a series of elements not only includes those elements but also other elements not expressly listed, or further includes elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, apparatus, article or method comprising such element.
[0038] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. An optical film detection method based on image processing, characterized in that, Including the following steps: Collecting multiple frames of images of a multi-layer optical film under different lighting conditions, preprocessing the multiple frames of images and calculating eigenvalue, to obtain an eigenvalue response matrix; Calculating the optimal weight coefficient of each frame of image according to the eigenvalue response matrix, and performing multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation; Performing multi-scale defect feature extraction on the integrated feature representation to obtain defect candidate regions; Extracting spectral response features based on the defect candidate regions, and calculating the matching degree between the spectral response features and a preset wavelength-thickness mapping relationship matrix to obtain a multi-layer film defect distribution map; Performing autoregressive prediction and processing control parameter optimization on the multi-layer film defect distribution map to obtain a closed-loop control scheme.
2. The optical film detection method based on image processing according to claim 1, characterized in that The step of collecting multiple frames of images of a multi-layer optical film under different lighting conditions, preprocessing the multiple frames of images and calculating eigenvalue, to obtain an eigenvalue response matrix, includes: Adjusting the light source angle and intensity, and collecting multiple frames of images of a multi-layer optical film under different lighting conditions; Performing geometric correction on the multiple frames of images to obtain corrected images, and performing an adaptive histogram equalization operation on the corrected images to obtain images with balanced lighting; Applying a bilateral filtering algorithm to the images with balanced lighting to obtain smoothed images that suppress noise and retain edge information; Performing contrast-limited adaptive histogram equalization on the smoothed images to obtain images with enhanced details, and integrating the image sequence with enhanced details into a preprocessing image sequence; Constructing a Hermitian positive definite matrix based on each frame of image in the preprocessing image sequence, calculating the maximum eigenvalue of the Hermitian positive definite matrix and normalizing it to obtain an eigenvalue response matrix.
3. The optical film detection method based on image processing according to claim 2, wherein, The step of constructing a Hermitian positive definite matrix based on each frame of image in the preprocessing image sequence, calculating the maximum eigenvalue of the Hermitian positive definite matrix and normalizing it to obtain an eigenvalue response matrix, includes: Setting a sliding window of a fixed size for each frame of image in the preprocessing image sequence, constructing a local neighborhood window centered on each pixel point in each frame of image, and extracting pixel data within the local neighborhood window; Performing an inner product operation on the pixel data within the local neighborhood window after subtracting the local mean to construct a Hermitian positive definite matrix; Performing eigenvalue decomposition on the Hermitian positive definite matrix, and selecting the maximum eigenvalue to form maximum eigenvalue data representing local structural changes of the image; Rearranging the maximum eigenvalue data according to the pixel position correspondence relationship to construct an eigenvalue matrix containing the maximum eigenvalues at all positions; Performing normalization processing on the eigenvalue matrix to obtain a normalized feature matrix, and calculating the detection statistic at each pixel position based on the normalized feature matrix, and organizing the detection statistics into an eigenvalue response matrix.
4. The optical film detection method based on image processing according to claim 1, wherein The step of calculating the optimal weight coefficient of each frame of image according to the eigenvalue response matrix, and performing multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation, includes: Defining an integration framework for the eigenvalue response matrix, and combining multiple frames of images into a single representation through weight coefficients; Introduce a quality assessment mechanism into the integrated framework. By evaluating the gradient information and clarity level of each frame of image, establish a quality assessment index for measuring the contribution degree of the image. Convert the quality assessment index and the weight assignment relationship into a dynamic programming problem, divide the dynamic programming problem into multiple quantization levels, and establish a phased decision-making process. Based on the phased decision-making process, calculate the optimal solution of each sub-problem from front to back, store it in the dynamic programming table, and determine the optimal weight coefficient of each frame of image through backtracking. Apply the optimal weight coefficient to the eigenvalue response matrix of each frame of image, perform linear weighted combination to generate a fused feature matrix, and perform edge-preserving filtering on the fused feature matrix to obtain a multi-frame integrated feature representation.
5. The optical film detection method based on image processing according to claim 1, wherein Perform multi-scale defect feature extraction on the integrated feature representation to obtain defect candidate regions, including: Based on the integrated feature representation, establish a mapping relationship between pixel points and graph nodes, construct an initial graph structure based on the spatial proximity between pixel points, and calculate the connection strength between nodes according to pixel value similarity to generate the adjacency relationship of the graph. Add self-connections to the adjacency relationship of the graph and perform degree matrix normalization to obtain a normalized adjacency matrix, and multiply the normalized adjacency matrix by the adjustment matrix to construct a self-adjusting graph convolutional layer. Based on the self-adjusting graph convolutional layer, construct a UNet network with an encoder-decoder structure. Extract multi-level features from the integrated feature representation through graph convolution and pooling operations in the encoder part to form feature maps with different receptive fields. In the decoder part of the UNet network, perform upsampling operations on the feature maps with different receptive fields, splice and fuse them with the feature maps of the corresponding layers in the encoder, and process the fused features through the self-adjusting graph convolutional layer to obtain the target feature map. Perform classification judgment on the target feature map to generate a defect probability distribution map, and extract defect candidate regions from the defect probability distribution map according to the threshold segmentation method.
6. The optical film detection method based on image processing according to claim 1, characterized in that, Extract spectral response features based on the defect candidate regions, and calculate the matching degree with a preset wavelength-thickness mapping relationship matrix to obtain a multi-layer film defect distribution map, including: Perform optical modeling analysis on the multi-layer optical film structure to construct a wavelength-thickness mapping relationship matrix including reflectivity, transmittance, and absorptance. The mapping relationship matrix associates the thickness of each layer of film with the optical responses at different incident angles and wavelengths. Apply local region Fourier transform and wavelet decomposition to the defect candidate regions, extract the spectral features and phase information of the defect regions under different illumination conditions from multi-scale frequency domain analysis, and generate a multi-dimensional spectral response feature vector. Perform non-linear dimensionality reduction and feature optimization on the multi-dimensional spectral response feature vector to form discriminative spectral fingerprint features. Input the discriminative spectral fingerprint features into a kernel function mapper, calculate the Mahalanobis distance between the feature space representation output by the kernel function mapper and the wavelength-thickness mapping relationship matrix, and construct a hierarchical matching metric value. A decision model is established based on the hierarchical matching metric values, and Bayesian prior constraints and spatial consistency regularization terms are introduced into the decision model to generate a film layer attribution label with the maximum posterior probability; The film layer attribution label is fused with the defect morphological features, and context optimization is performed through a conditional random field model to generate a multi-layer film defect distribution map.
7. The optical film detection method based on image processing according to claim 1, wherein Performing autoregressive prediction and processing control parameter optimization on the multi-layer film defect distribution map to obtain a closed-loop control scheme, including: Construct an exogenous input autoregressive model of a multi-variable radial basis function for the multi-layer film defect distribution map, use the defect index in the multi-layer film defect distribution map as the system output, and use the processing control parameters as the control input to establish a prediction model reflecting the characteristics of the multi-layer optical film; Apply a hybrid parameter identification algorithm to the prediction model, and the hybrid parameter identification algorithm includes two stages: particle swarm iterative identification and multi-variable hierarchical multi-innovation stochastic gradient identification, to obtain optimized model parameters characterizing the parameter-defect relationship; Based on the optimized model parameters, establish a non-linear model predictive control framework, set the prediction time domain and the control time domain, and construct a multi-objective cost function including the output error and the control input; Introduce a sequential quadratic programming optimization algorithm into the multi-objective cost function, solve the optimal control sequence under the control input range limit and output constraint conditions, and adjust the processing control parameters in real time according to the film layer thickness and defect distribution corresponding to different wavelength lights to form a closed-loop control scheme.
8. An optical film detection device based on image processing, characterized in that, For implementing the steps of the method according to any one of claims 1 to 7, the device includes: An acquisition module, configured to acquire multiple frames of images of a multi-layer optical film under different illumination conditions, perform preprocessing and eigenvalue calculation on the multiple frames of images to obtain an eigenvalue response matrix; A feature fusion module, configured to calculate the optimal weight coefficient of each frame of image according to the eigenvalue response matrix, and perform multi-frame image feature fusion based on the optimal weight coefficient to obtain an integrated feature representation; A feature extraction module, configured to perform multi-scale defect feature extraction on the integrated feature representation to obtain defect candidate regions; A matching degree calculation module, configured to extract spectral response features based on the defect candidate regions, and calculate the matching degree between the spectral response features and a preset wavelength-film thickness mapping relationship matrix to obtain a multi-layer film defect distribution map; A parameter optimization module, configured to perform autoregressive prediction and processing control parameter optimization on the multi-layer film defect distribution map to obtain a closed-loop control scheme.
9. A computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Optical film defect detection method and system thereof
US20170004612A1
Cited By
Method and system for detecting surface defects of clean plate
CN120876423A
Copper-clad plate layering defect diagnosis method based on pattern recognition
CN120876972A
Optical lens flexible clamping identification control method and system
CN120891605A
Duodenoscope reprocessing detection method based on machine vision
CN121120518A
PVC film coating uniformity detection method based on spectral analysis
CN121409979A