A coating layer thickness measurement method based on terahertz detection

The coating layer thickness measurement method through terahertz detection technology, combined with the support vector machine classifier optimized by core principal component analysis and improved sparrow search algorithm, combined with the generalized Rouard method and the genetic algorithm with improved dispersion attenuation, solve the terahertz time Domain spectroscopy technology uses unknown number of layers and multi-layer boundary identification problems in coating thickness measurement, achieving high-precision coating layer thickness measurement.

CN118797446BActive Publication Date: 2024-12-03SICHUAN INNOVATION RES INST OF TIANJIN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411259903.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2024-12-03
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

The existing terahertz time domain spectroscopy technology has problems such as unknown number of layers, overlapping in layer reflection and pulse echo, material attenuation and dispersion in coating thickness measurement, resulting in low measurement accuracy, especially in multi-coated thin samples. Accurately identify the boundaries of each layer and affect the accuracy of the measurement results.

Method used

The coating layer thickness measurement method is adopted based on terahertz detection, including experimental sample preparation, terahertz signal preprocessing, time-frequency domain feature extraction, core principal component analysis, and support vector machine classifier training with improved sparrow search algorithm optimization, The generalized Rouard method combines the genetic algorithm with improved dispersion attenuation to perform thickness calculations to build a frequency domain model of a multi-layer coating system to improve measurement accuracy.

Benefits of technology

Through pre-layer processing and precise signal pre-processing, measurement accuracy and reliability are improved, and high-precision coating layer thickness measurement is achieved, which overcomes the limitations of the prior art and has significant practical application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797446B_ABST
    Figure CN118797446B_ABST
Patent Text Reader

Abstract

The present invention is a coating layer thickness measurement method based on terahertz detection, which relates to the field of terahertz wave technology and includes the following steps: experimental sample preparation; terahertz signal preprocessing; extracting time-frequency domain features; using kernel principal component analysis for dimensionality reduction; dividing and mean normalizing the data set; classifier training; training a support vector machine classification model; layer number determination; thickness measurement. The present invention provides an accurate model construction basis for subsequent thickness measurement by pre-layering the coating sample; improves measurement accuracy through precise terahertz signal preprocessing and feature extraction; uses kernel principal component analysis for dimensionality reduction to optimize computational efficiency and classifier performance; uses an improved sparrow search algorithm to optimize the support vector machine to improve the classification accuracy of the classifier; combines the generalized Rouard method and the genetic algorithm improved by dispersion attenuation to accurately calculate the thickness of each layer, thereby ensuring the accuracy and reliability of the measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of terahertz waves, and in particular to a coating layer thickness measurement method based on terahertz detection. Background Art

[0002] Terahertz time-domain spectroscopy (THz-TDS) is an advanced spectroscopy technology that can use electromagnetic waves in the terahertz band to detect and analyze materials. Since terahertz waves can penetrate a variety of non-conductive materials, this technology shows great application potential in non-destructive testing, industrial quality control and safety inspection.

[0003] When it comes to measuring coating thickness, current terahertz time-domain spectroscopy thickness measurement techniques usually require a known number of layers. However, in some industrial applications, the number of coating layers varies along the surface, resulting in the possibility that the number of coating layers at the measurement location is unknown. Traditional terahertz time-domain spectroscopy techniques rely on a known number of layers in advance when determining the thickness of a layer, and accurate knowledge of the material properties of a single layer is a prerequisite for accurately estimating the thickness of a single layer in a multilayer coating. However, problems such as multiple reflections within a layer and coincidence of pulse echoes make simple time-of-flight measurement methods less accurate. In addition, the attenuation and dispersion of terahertz waves in different materials also affect the measurement accuracy.

[0004] The defects in the existing technology increase the difficulty and complexity of thickness measurement of multi-coating systems. Researchers have tried to improve the measurement accuracy by improving the transmission model, such as the Debye model and generalized Rouard method adopted by Krimi et al., the traditional transmission matrix model used by Cao et al., and the global optimization algorithm for thickness iteration. Xu et al. used a sparse representation method to quantitatively characterize the layer thickness by reconstructing the pulse response of complex terahertz echo signals. However, these methods still face challenges in practical applications, especially in the case of unknown number of layers of multi-coated thin samples and micron-level thickness measurement. It is difficult to accurately identify the boundaries of each layer, which affects the accuracy of the measurement results and limits the application of existing technologies in complex multi-layer coating systems. Summary of the invention

[0005] The present invention aims to solve the shortcomings of existing terahertz time-domain spectroscopy technology in measuring coating thickness, especially when the number of layers is unknown or the coating changes along the surface. The current technology relies on the pre-known number of layers and material properties, resulting in complexity and inaccuracy in measuring multi-layer coating systems in practical applications; multiple reflections within the layer, pulse echo overlap, attenuation and dispersion of terahertz waves in different materials, etc., make the traditional time-of-flight measurement method not accurate enough; in the micron-level thickness measurement of multi-coated thin samples, it is difficult to accurately identify the boundaries of each layer, affecting the reliability of the measurement results; and provide a coating layer thickness measurement method based on terahertz detection to improve measurement accuracy and reliability and overcome the limitations of the existing technology.

[0006] To achieve the above object, the present invention adopts the following technical solution: a coating layer thickness measurement method based on terahertz detection, comprising the following steps:

[0007] S1. Experimental sample preparation: Prepare samples with different coatings, perform terahertz time-domain spectroscopy measurements, and obtain the terahertz signal data set of the samples;

[0008] S2, terahertz signal preprocessing: preprocess the collected terahertz time-domain spectrum data to improve the accuracy of subsequent analysis;

[0009] S3. Extract time-frequency domain features: Use fast Fourier transform to extract frequency domain features, and combine them with time domain features to form a comprehensive feature set. The feature set includes 29 features, including 16 time domain features and 13 frequency domain features.

[0010] S4. Kernel principal component analysis is used for dimensionality reduction to improve computational efficiency and classifier performance. The first five principal components of the extracted 29 time-frequency domain features are selected through kernel principal component analysis, and the cumulative contribution rate of each component is 98.3%. These features after dimensionality reduction are selected as input data of the classifier.

[0011] S5. Divide and mean normalize the data set to improve data consistency and classifier performance;

[0012] S51, randomly and evenly divide the data set into a training set and a test set;

[0013] S52, then normalizing the data of the training set and the test set to the interval [0, 1] to eliminate the dimensional differences between different features, so that the feature data can be analyzed on the same scale, thereby improving the performance of the classifier;

[0014] S6, classifier training: training the support vector machine classifier optimized by the improved sparrow search algorithm to obtain an optimized classifier;

[0015] S61. Assume that the number of training samples is n, and each sample is represented by ,in is the feature vector input, representing the reduced-dimensional features extracted from the terahertz spectrum, is the category label output, indicating the corresponding number of coating layers, which are single layer, double layer and triple layer respectively. Based on the label information of the above samples, the coating terahertz signal dataset is constructed;

[0016] The data set is divided into a terahertz signal training set and a terahertz signal test set, with a ratio of 7:3. The data of the terahertz signal training set is used to train and optimize the machine learning classifier, and the terahertz signals of the terahertz signal test set are used for classification and recognition evaluation. The problem of finding the optimal classification surface is transformed into a mathematical problem of solving the optimal solution, namely:

[0017]

[0018] In the formula, To control the penalty factor for misclassified samples, is the slack variable, W is a vector, b is the offset, and the constraints are: , ;

[0019] S62. Map samples from the original space to a high-dimensional vector space through nonlinear transformation, so that the samples are linearly separable in the mapped feature space and construct the optimal classification surface; use the Lagrange multiplier method to introduce a kernel function, represented by K, to transform the dual problem;

[0020] Use the radial basis function as the kernel function to classify the original samples mapped to the high-dimensional feature space. The expression of the radial basis function is: ; The parameter g is the distribution width of the kernel function;

[0021] S63, introducing an improved sparrow search algorithm to optimize the parameters C and g of the support vector machine to improve the performance of the support vector machine model;

[0022] Optimize the sparrow search algorithm:

[0023] S631, initializing the sparrow population and setting the optimal position of individuals;

[0024] Use Sin chaotic mapping to initialize the sparrow population, enrich the diversity of solutions, and set the population size and the maximum number of iterations ;

[0025] Use Sin chaotic mapping to generate the initial population position; for each individual ,have ,in is the value of the previous position. It starts from a random value during initialization and sets the initial optimal position for each individual. and the global optimal position ;

[0026] S632, calculate the fitness value of each individual And sort the fitness values, select the individual with the best fitness value as the best individual in the current population, and set the optimal position of the individual;

[0027] S633, update the location of sparrow population producers;

[0028] Update finder location: , where is the number of iterations, is a random number;

[0029] For other individuals, the global optimal solution of the previous generation is introduced and adaptive weights are added : , where , are the positions of the current best and worst individuals, respectively. Adaptively adjust according to the number of iterations, coordinate local mining and global mining capabilities, and accelerate convergence;

[0030] S634, check whether the maximum number of iterations has been reached Or the fitness value changes less than a preset threshold; if the termination condition is met, the iteration is stopped; if the termination condition is not met, the process returns to S632;

[0031] S635, output the final global optimal position and its corresponding fitness value as the optimal solution; and obtain the optimal parameter values ​​C and g;

[0032] S7, use the optimal parameters C and g to train the support vector machine classification model, and build the ISSA-SVM classification model to classify the number of layers;

[0033] S8, layer number determination: input the terahertz signal feature vector of the sample to be tested into the trained classifier, and obtain the number of layers to be tested through the test set;

[0034] S9, thickness measurement: when the number of layers is measured, the generalized Rouard method combined with the genetic algorithm improved by dispersion attenuation is used to calculate the thickness of each layer;

[0035] S91, thickness measurement algorithm:

[0036] The Rouard method is used to establish the mathematical model of the terahertz reflection signal of the multilayer coating sample;

[0037] The Rouard method recursively calculates the reflected beams of each layer and finally obtains the total reflected beam. The specific formula is:

[0038] , ①

[0039] In the formula, and Respectively Layer and The reflection coefficient of the layer; j is the imaginary unit; For terahertz waves The phase change during layer propagation is:

[0040] , ②

[0041] In the formula, It is The thickness of the layer, It is The refractive index of the layer, It is The attenuation coefficient of the layer, is the angular frequency of the terahertz wave, is the speed of light. The total reflection coefficient of the multilayer coating sample is recursively calculated through formula ① and formula ②, thereby obtaining the terahertz reflection signal.

[0042] S92. Construct a coating transfer function with a total of L layers , the expression is:

[0043] , ③

[0044] By constructing the transfer function , and the frequency domain model of the entire multilayer coating system is obtained:

[0045] , ④

[0046] In the formula, is the input signal; To output analog signal;

[0047] S93. Optimize model parameters: thickness and attenuation coefficient ;

[0048] S931. Genetic algorithm is used for parameter fitting. First, the initial value is set based on experience. Then, the fitness function is used to evaluate the degree of model fitting. The fitness function is defined as the minimum value of the measurement error. The specific formula is as follows:

[0049] , ⑤

[0050] In the formula, is the real measurement signal, is the first frequency points, is the index variable for summation, M is the total number of frequency points;

[0051] S932. Genetic algorithm generates a new generation of population through selection, crossover and mutation operations, and iteratively optimizes parameters; parameter optimization includes the following steps:

[0052] S9321. Set an initial population of the genetic algorithm, where each individual represents a combination of a set of thickness and attenuation coefficient;

[0053] S9322, calculating the fitness value of each individual, and calculating the measurement error according to the fitness function;

[0054] S9323. According to the fitness value, select individuals with higher fitness for crossover and mutation to generate a new population;

[0055] S9324, repeat S9322 and S9323 until a predetermined number of iterations is reached or the fitness value converges;

[0056] S9325. Output the individual with the smallest measurement error as the optimized parameter combination, and then obtain the thickness of each layer of the multi-layer coating sample.

[0057] In particular, S1 specifically includes the following steps:

[0058] S11. A hemispherical shell with a diameter of 50 cm was selected as the metal substrate for the experimental sample. Multiple test areas were planned on the shell, namely, a single-layer paint coating sample area, a double-layer paint coating sample area, a triple-layer paint coating sample area, and an unsprayed reference area. The double-layer paint coating sample area covered one side of the single-layer paint coating sample area, the triple-layer paint coating sample area covered one side of the double-layer paint coating sample area, and the single-layer paint coating sample area was 20*20 cm in area. 2 , double-layer paint coating sample area is 17*20cm 2 , the sample area of ​​three layers of paint coating is 14*20cm 2 ;

[0059] S12, spraying automobile primer on the planned single-layer paint coating sample area on the shell as the first layer of paint coating sample, and the refractive index range of the primer is 2.0-2.5;

[0060] S13, spraying a middle coating paint on the planned double-layer paint coating sample area on the shell as a second layer of paint coating sample, and the refractive index range of the middle coating paint is 1.9-2.1;

[0061] S14, spraying pure white paint on the planned three-layer paint coating sample area on the shell as the third layer of paint coating sample, the refractive index range of the pure white paint is 1.8-2.0;

[0062] S15, spectral scanning, start the measurement program, the robot arm automatically controls the terahertz probe to move along the predetermined path, the terahertz wave passes through the coating, the receiver captures the reflected and transmitted signals, and completes the automated terahertz time-domain spectroscopy sample detection according to the planned grid measurement sequence; the sampling space accuracy is 1mm, and the single-point acquisition takes 3s. After completing the scan in the sample test area, 400 time-domain spectral data samples are obtained, and the length of each sample signal is 3000 data points.

[0063] Specifically, the preprocessing in S2 includes the following steps:

[0064] S21, firstly, perform time domain interception through time window filtering, intercept a specific time period of the signal for analysis or processing;

[0065] S22, then performing smoothing and denoising processing on the intercepted signal to reduce or eliminate random noise in the signal, so that the characteristics of the signal are clearer;

[0066] S23. Finally, the signal mean normalization process is performed to improve the accuracy of subsequent feature extraction and analysis.

[0067] In particular, in S51, the training set contains 280 groups of samples and the test set contains 120 groups of samples; the input parameters of the training set and the test set are a matrix of 280 rows and 5 columns and a matrix of 120 rows and 5 columns, respectively, each row corresponds to a sample, and each column is a feature after dimensionality reduction.

[0068] The beneficial effects of the present invention are:

[0069] The present invention provides an accurate model construction basis for subsequent thickness measurement by pre-stratifying the coating sample. Pre-stratification allows the reflection and propagation model of the terahertz signal to be more accurately constructed and applied during the thickness measurement process. The measurement accuracy is improved by precise terahertz signal preprocessing and feature extraction; the dimension reduction is performed using kernel principal component analysis to optimize the computational efficiency and classifier performance; the support vector machine is optimized using an improved sparrow search algorithm to improve the classification accuracy of the classifier; the thickness of each layer is accurately calculated by combining the generalized Rouard method and the genetic algorithm improved by dispersion attenuation, ensuring the accuracy and reliability of the measurement. Through the above technical solutions, the present invention effectively solves the deficiencies in the prior art, realizes high-precision measurement of coating layer thickness, and has significant practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 is a flow chart of the present invention;

[0071] Figure 2 It is a schematic diagram of the distribution of the single-layer paint coating sample area, the double-layer paint coating sample area, and the triple-layer paint coating sample area on the housing of the present invention;

[0072] Figure 3 This is a terahertz signal scanning diagram of a single-layer paint coating sample of the present invention;

[0073] Figure 4 A time domain reflection waveform diagram of a measurement point of a single-layer paint coating sample of the present invention;

[0074] Figure 5 This is a terahertz signal scanning diagram of the double-layer paint coating sample of the present invention;

[0075] Figure 6 A time domain reflection waveform diagram of a measurement point of a double-layer paint coating sample of the present invention;

[0076] Figure 7 This is a terahertz signal scanning diagram of a three-layer paint coating sample of the present invention;

[0077] Figure 8 is a time domain reflection waveform diagram of the measurement points of the three-layer paint coating sample of the present invention;

[0078] Fig. 9 It is a three-dimensional distribution diagram of the three-layer paint coating sample of the present invention;

[0079] Fig.10 It is a schematic diagram of the classification accuracy of the training set in the classification prediction results of the KPCA-ISSA-SVM support vector machine model of the present invention;

[0080] Fig.11 It is a schematic diagram of the classification accuracy of the test set in the classification prediction results of the KPCA-ISSA-SVM support vector machine model of the present invention;

[0081] Fig.12 This is a graph showing the thickness measurement results of a three-layer paint coating sample of the present invention;

[0082] In the figure: 1-single-layer paint coating sample area; 2-double-layer paint coating sample area; 3-triple-layer paint coating sample area;

[0083] The following is a detailed description of the embodiments of the present invention with reference to the accompanying drawings. DETAILED DESCRIPTION

[0084] The present invention will be further described below in conjunction with embodiments:

[0085] Depend on Figure 1-Figure 12It can be seen that a coating layer thickness measurement method based on terahertz detection includes the following steps:

[0086] S1. Experimental sample preparation: Prepare samples with different coatings, perform terahertz time-domain spectroscopy measurements, and obtain the terahertz signal data set of the samples;

[0087] S11. A hemispherical shell with a diameter of 50 cm was selected as the metal substrate for the experimental sample. Multiple test areas were planned on the shell, namely, single-layer paint coating sample area 1, double-layer paint coating sample area 2, triple-layer paint coating sample area 3, and an unsprayed reference area; among them, Figure 2 As shown, the double-layer paint coating sample area 2 covers one side of the single-layer paint coating sample area 1, and the three-layer paint coating sample area 3 covers one side of the double-layer paint coating sample area 2. The area of ​​the single-layer paint coating sample area 1 is 20*20cm 2 , double-layer paint coating sample area 2 area is 17*20cm 2 , the area of ​​the three-layer paint coating sample area 3 is 14*20cm 2 ;

[0088] S12, spraying automobile primer on the planned single-layer paint coating sample area 1 on the shell as the first layer of paint coating sample, and the refractive index range of the primer is 2.0-2.5;

[0089] S13, spraying a middle coating paint on the planned double-layer paint coating sample area 2 on the shell as a second layer of paint coating sample, wherein the refractive index range of the middle coating paint is 1.9-2.1;

[0090] S14, spraying pure white paint on the planned three-layer paint coating sample area 3 on the shell as the third layer of paint coating sample, the refractive index range of the pure white paint is 1.8-2.0;

[0091] S15, spectral scanning, start the measurement program, the robot arm automatically controls the terahertz probe to move along the predetermined path, the terahertz wave passes through the coating, the receiver captures the reflected and transmitted signals, and completes the automated terahertz time-domain spectroscopy sample detection according to the planned grid measurement sequence; the sampling space accuracy is 1mm, and the single-point acquisition takes 3s. After completing the scan in the sample test area, 400 time-domain spectral data samples are obtained, and the length of each sample signal is 3000 data points.

[0092] The pre-stratification strategy can achieve pre-stratification in cases such as terahertz paint peeling. When the number of layers is measured, the generalized Rouard method combined with the genetic algorithm improved by dispersion attenuation can achieve more efficient and accurate multi-coating thickness layering measurement.

[0093] The present invention provides an accurate model construction basis for subsequent thickness measurement by pre-stratifying the coating sample. Pre-stratification enables the reflection and propagation model of the terahertz signal to be more accurately constructed and applied during the thickness measurement process.

[0094] S2, terahertz signal preprocessing: preprocess the collected terahertz time-domain spectrum data to improve the accuracy of subsequent analysis;

[0095] S21, firstly, perform time domain interception through time window filtering, intercept a specific time period of the signal for analysis or processing;

[0096] S22, then performing smoothing and denoising processing on the intercepted signal to reduce or eliminate random noise in the signal, so that the characteristics of the signal are clearer;

[0097] S23. Finally, the signal mean normalization process is performed to improve the accuracy of subsequent feature extraction and analysis.

[0098] Time window filtering: By analyzing and processing data within a specific time window, high-frequency noise and irrelevant short-term fluctuations can be effectively removed, and long-term trends or periodic characteristics in the data can be retained; Smoothing denoising: Reduce random fluctuations between data points through averaging, moving average or other mathematical methods to make the data smoother, making it easier to observe the overall pattern of the data, helping to improve the true representation of the signal and reduce the impact of noise interference; Signal mean normalization: By subtracting the mean of all data values ​​and scaling them proportionally, the mean of the processed signal is zero (zero mean), and usually its variance is also standardized, which can eliminate the offset between data and enable data of different magnitudes or ranges to be compared on the same scale, which is beneficial to algorithm processing and improving the training efficiency of the model.

[0099] By performing the above-mentioned preprocessing steps on the data, the present invention can enhance the signal quality, that is, greatly improve the quality of the original data, remove irrelevant noise, highlight the useful information, and make the analysis results more accurate and stable; improve the model performance, that is, the preprocessed data is more suitable for modeling and prediction, and the noise interference is reduced, so that the model can better capture the real characteristics of the data and improve the prediction accuracy and generalization ability; facilitate comparison and interpretation, that is, after normalization, different data sets or features can be directly compared, which is convenient for understanding and interpreting the results of the model, especially in multivariate analysis and visualization; accelerate the calculation process, that is, reducing the scale difference and noise of the data can shorten the running time of the algorithm, which is particularly important in large-scale data analysis and complex model training.

[0100] The present invention prepares samples with different coatings, performs terahertz time-domain spectroscopy measurement, obtains a terahertz signal data set of the samples, and comprehensively applies time window filtering, smoothing denoising and signal mean normalization preprocessing steps to the collected terahertz time-domain spectroscopy data. This can effectively improve the efficiency and effect of data analysis and model building while maintaining the essential characteristics of the data, so as to improve the accuracy of subsequent analysis.

[0101] S3. Extract time-frequency domain features: Use fast Fourier transform to extract frequency domain features, and combine them with time domain features to form a comprehensive feature set. The feature set includes 29 features, including 16 time domain features and 13 frequency domain features, as shown in the following table:

[0102]

[0103] in, It's a signal Spectrum of , k=1,2,...,K; K is the number of spectral lines; is the frequency value of the kth spectral line, and F is the frequency characteristic.

[0104] is the time domain signal sample, i=1,2,…,N; N is the number of time domain samples.

[0105] S4. Kernel principal component analysis (KPCA) is used for dimensionality reduction to improve computational efficiency and classifier performance. The first five principal components are selected from the extracted 29 time-frequency domain features through KPCA processing. The cumulative contribution rate of each component is 98.3%. These reduced-dimensional features are selected as the input data of the classifier. Specifically, KPCA is used for feature selection. KPCA maps the original features to a high-dimensional space through nonlinear transformation, and then performs principal component analysis in the high-dimensional space. Compared with traditional principal component analysis, KPCA uses kernel functions to map nonlinear sample data to a high-dimensional space, and performs linear processing on the sample data in the high-dimensional space, which effectively solves the problem that principal component analysis can only process linear data, and has a higher variance contribution rate and better sample data dimensionality reduction effect.

[0106] The accuracy and efficiency of classification were significantly improved by optimizing feature selection. The extracted features were optimized and selected through the kernel principal component analysis method, which greatly reduced the dimension of the feature vector and the computational cost of the machine learning system. The kernel principal component analysis was used to select the five most informative principal components from the high-dimensional terahertz time-domain spectroscopy data to simplify the model input, which helps to achieve efficient and high-performance terahertz classification and identification of different materials.

[0107] S5. Divide and mean normalize the data set to improve data consistency and classifier performance;

[0108] S51. Randomly and evenly divide the data set into a training set and a test set; the training set contains 280 groups of samples, and the test set contains 120 groups of samples; the input parameters of the training set and the test set are a matrix of 280 rows and 5 columns and a matrix of 120 rows and 5 columns, respectively, each row corresponds to a sample, and each column is a feature after dimensionality reduction.

[0109] S52. Then, the data of the training set and the test set are normalized to the interval [0, 1] to eliminate the dimensional differences between different features and analyze the feature data on the same scale, thereby improving the performance of the classifier.

[0110] S6. Classifier training: The support vector machine (SVM) classifier optimized by the improved sparrow search algorithm is trained to obtain the optimized classifier; SVM is a powerful supervised learning algorithm, which is usually used for classification and regression analysis. The support vector machine model performs well in learning and generalization ability, making it an ideal choice for the classification of the number of layers of multi-layer dielectric structures. Its main principle is to find an optimal hyperplane in the feature space to separate data points of different categories while maximizing the classification interval, thereby achieving efficient classification. The core principle of the support vector machine model is to find an optimal linear segmentation hyperplane, and find a linear function between the classification samples parameterized by the vector w and the offset b, so as to achieve the maximum interval classification of the samples. This separation can be achieved through the following minimization optimization problem.

[0111] S61. Assume that the number of training samples is n, and each sample is represented by ,in is the feature vector input, representing the reduced-dimensional features extracted from the terahertz spectrum, is the category label output, indicating the corresponding number of coating layers, which are single layer, double layer and triple layer respectively. Based on the label information of the above samples, the coating terahertz signal dataset is constructed;

[0112] The data set is divided into a terahertz signal training set and a terahertz signal test set, with a ratio of 7:3. The data of the terahertz signal training set is used to train and optimize the machine learning classifier, and the terahertz signals of the terahertz signal test set are used for classification and recognition evaluation. The problem of finding the optimal classification surface is transformed into a mathematical problem of solving the optimal solution, namely:

[0113]

[0114] In the formula, To control the penalty factor for misclassified samples, is the slack variable, W is a vector, b is the offset, and the constraints are: , ;

[0115] S62. For linearly inseparable data in a finite-dimensional vector space, it is impossible to find a hyperplane that can well divide these two types of samples. Therefore, the samples can be mapped from the original space to a high-dimensional vector space through nonlinear transformation, so that the samples are linearly separable in the mapped feature space and the optimal classification surface is constructed; using the Lagrange multiplier method, a kernel function is introduced, denoted by K, to transform the dual problem;

[0116] Since the radial basis function (RBF) can approximate any nonlinear function, map the original sample to a high-dimensional feature space, and effectively classify it, the radial basis function can be used as the kernel function to classify the original sample mapped to the high-dimensional feature space. The expression of the radial basis function is: ; The parameter g is the distribution width of the kernel function; The parameter g needs to be optimized to obtain the optimal performance of the support vector machine, which has an important impact on the classification accuracy of the support vector machine model.

[0117] S63. In classification problems, the penalty factor of SVM The selection of the RBF kernel function parameter g usually depends on experience and cannot guarantee the best classification performance of the model. The parameter g is the distribution width of the kernel function and needs to be optimized to obtain the best classification effect; the penalty factor Then control the degree of penalty for misclassified samples. The larger the value, the greater the penalty for SVM classification errors. Therefore, the improved sparrow search algorithm (ISSA) is introduced to optimize the parameters C and g of the support vector machine to improve the performance of the support vector machine model;

[0118] Optimize the sparrow search algorithm (SSA):

[0119] SSA is an optimization algorithm based on swarm intelligence, which can effectively find the optimal solution in the global search space. Combined with adaptive weights and reverse learning strategies, the efficiency and accuracy of parameter search are improved. Sparrow search algorithm is a new swarm intelligence optimization algorithm that achieves the optimal solution to the problem by simulating the cooperation and competition mechanism of sparrows when looking for food. It has strong optimization ability and fast convergence speed. Although SSA has the advantage of setting fewer parameters, it converges slowly and is easy to fall into the local optimal solution. Therefore, in order to improve the shortcomings of swarm intelligence optimization algorithm that is easy to fall into the local optimal solution in the later stage of iteration, improve the global optimization ability, and improve the applicability and generalization ability of the algorithm, considering that Sin chaotic mapping has good chaotic characteristics, adaptive weights, can effectively coordinate local mining and global exploration, and Cauchy mutation and reverse learning strategies have strong perturbation mutation ability, which can effectively improve the algorithm to escape from the local space, an improved sparrow search algorithm (ISSA) is proposed, and the optimization steps are as follows:

[0120] S631, initializing the sparrow population and setting the optimal position of individuals;

[0121] Use Sin chaotic mapping to initialize the sparrow population, enrich the diversity of solutions, and set the population size and the maximum number of iterations ; Maximum number of iterations Usually determined based on the complexity of the problem and the required accuracy; can be determined through experiments, the common range is from dozens to hundreds of times, and the experimental setting is 200 times;

[0122] Use Sin chaotic mapping to generate the initial population position; for each individual ,have ,in is the value of the previous position. It starts from a random value during initialization and sets the initial optimal position for each individual. and the global optimal position ;

[0123] S632, calculate the fitness value of each individual And sort the fitness values, select the individual with the best fitness value as the best individual in the current population, and set the optimal position of the individual;

[0124] S633, update the location of sparrow population producers;

[0125] Update finder location: , where is the number of iterations, is a random number;

[0126] For other individuals, the global optimal solution of the previous generation is introduced and adaptive weights are added : , where , are the positions of the current best and worst individuals, respectively. Adaptively adjust according to the number of iterations, coordinate local mining and global mining capabilities, and accelerate convergence;

[0127] S634, check whether the maximum number of iterations has been reached Or the fitness value changes less than a preset threshold; if the termination condition is met, the iteration is stopped; if the termination condition is not met, the process returns to S632;

[0128] S635. Output the final global optimal position and its corresponding fitness value as the optimal solution; and obtain the optimal parameter values ​​C and g.

[0129] By improving the sparrow search algorithm to optimize the support vector machine classification algorithm, the Sin chaotic map and adaptive weight factors are used to improve the traversal and diversity of the classification parameter optimization process, accelerate the convergence of the algorithm, and avoid the blindness of the traditional parameter optimization method. The improved sparrow search algorithm combines Cauchy mutation and reverse learning strategies, uses Sin chaotic maps to initialize the sparrow population, and enriches the diversity of solutions. By introducing a certain proportion of the previous generation of global optimal solutions in the discoverer position update method, the adequacy of the global search is improved. In the parameter optimization process of the support vector machine, adaptive weights are added to coordinate local mining and global exploration capabilities, accelerate convergence, and enhance the optimization effect, so that the support vector machine performs better in the classification task of processing complex multi-layer structures, and significantly improves the accuracy and reliability of terahertz layer classification.

[0130] S7. Use the optimal parameters C and g to train the support vector machine classification model, and build the ISSA-SVM classification model to classify the number of layers. Specifically, use the improved sparrow search algorithm to jointly optimize the parameters of KPCA to reduce the dimension and SVM, use the optimal parameters to train the support vector machine classification model, and build the ISSA-SVM classification model to classify the number of layers. Use 5-fold cross validation to check the parameters of SVM. and g for optimization, the population size is set to 20, the maximum number of iterations is 200, and the optimization parameters The range of g and g is [2 -8 , 2 8 ], a classification model of the number of layers of multilayer dielectric structures based on the ISSA-SVM method was implemented in MATLAB through the LIBSVM toolbox.

[0131] S8, layer number determination: input the terahertz signal feature vector of the sample to be tested into the trained classifier, and obtain the number of layers to be tested through the test set;

[0132] S9, thickness measurement: when the number of layers is measured, the generalized Rouard method combined with the genetic algorithm improved by dispersion attenuation is used to calculate the thickness of each layer;

[0133] S91, thickness measurement algorithm:

[0134] The Rouard method is used to establish the mathematical model of the terahertz reflection signal of the multilayer coating sample;

[0135] The Rouard method recursively calculates the reflected beams of each layer and finally obtains the total reflected beam. The specific formula is:

[0136] , ①

[0137] In the formula, and Respectively Layer and The reflection coefficient of the layer; j is the imaginary unit; For terahertz waves The phase change during layer propagation is:

[0138] , ②

[0139] In the formula, It is The thickness of the layer, It is The refractive index of the layer, It is The attenuation coefficient of the layer, is the angular frequency of the terahertz wave, is the speed of light. The total reflection coefficient of the multilayer coating sample is recursively calculated through formula ① and formula ②, thereby obtaining the terahertz reflection signal.

[0140] S92. Construct a coating transfer function with a total of L layers , the expression is:

[0141] , ③

[0142] By constructing the transfer function , and the frequency domain model of the entire multilayer coating system is obtained:

[0143] , ④

[0144] In the formula, is the input signal; To output analog signal;

[0145] S93. Optimize model parameters: thickness and attenuation coefficient ;

[0146] S931. Genetic algorithm is used for parameter fitting. First, the initial value is set based on experience. Then, the fitness function is used to evaluate the degree of model fitting. The fitness function is defined as the minimum value of the measurement error. The specific formula is as follows:

[0147] , ⑤

[0148] In the formula, is the real measurement signal, is the first frequency points, is the index variable for summation, M is the total number of frequency points;

[0149] S932. Genetic algorithm generates a new generation of population through selection, crossover and mutation operations, and iteratively optimizes parameters; parameter optimization includes the following steps:

[0150] S9321. Set an initial population of the genetic algorithm, where each individual represents a combination of a set of thickness and attenuation coefficient;

[0151] S9322, calculating the fitness value of each individual, and calculating the measurement error according to the fitness function;

[0152] S9323. According to the fitness value, select individuals with higher fitness for crossover and mutation to generate a new population;

[0153] S9324, repeat S9322 and S9323 until a predetermined number of iterations is reached or the fitness value converges;

[0154] S9325. Output the individual with the smallest measurement error as the optimized parameter combination, and then obtain the thickness of each layer of the multi-layer coating sample.

[0155] This method can effectively find the optimal thickness and attenuation coefficient of multi-layer coating samples, so that the error between the model signal and the real measurement signal is minimized; that is, after accurately classifying the number of layers, the thickness of each layer of coating can be continuously adjusted. and attenuation coefficient , so that the error between the terahertz reflection signal obtained by calculation simulation and the actual measurement signal is minimized, making the model more accurately reflect the actual situation.

[0156] After the principal component analysis processing optimized by kernel function, the support vector machine model showed excellent performance on the training and test sets, achieving high accuracy of layer classification. The support vector machine classification model was trained based on the optimized parameters, and the performance of the model was tested on the training and test sets. The calculation results are shown in Fig.10 , Fig.11 As shown. The classification accuracy of the training set and the test set are 92.8571% (260 / 280) and 99.17% (119 / 120), respectively. In addition, the training time of the ISSA-SVM model is 0.41s. The results show that the optimized support vector machine model has a high classification accuracy. For the single-layer, double-layer and triple-layer layer categories, the area under the receiver operating characteristic curve (AUC) of the test set classifier reached 1, 1, and 0.98, the recall rate was 100%, 96.7%, and 100%, and the F1 score was 1, 0.98, and 0.99. These results show that the method proposed in the present invention shows very high accuracy and reliability in the classification and identification of the number of coating layers.

[0157] The KPCA-ISSA-SVM model was used to predict the thickness of the three layers of paint coating on the sample. The stratification results are shown in Figure 3-Figure 8 shown. Figure 3-Figure 8 The terahertz time-domain spectroscopy technology is used to display the terahertz reflection data of paint coatings with different numbers of layers, including multiple measurement time-domain reflection scans and single signal time-domain reflection waveforms. Figure 3 and Figure 4 The scanning pattern of the first layer of paint and the time domain waveform at a single measurement point are revealed, respectively. Figure 3 The measurement sequence is visualized in detail, while Figure 4 The signal details of the corresponding points are provided. Figure 5 and Figure 6 Corresponding to the second layer, Figure 7 and Figure 8 For the third layer, each pair of sub-images presents the measurement data of a point in the layer and the waveform of a single point in the same way. These data not only capture the time domain reflection characteristics of the coating, but also provide a basis for the application of thickness measurement algorithms.

[0158] Fig. 9 A 3D profile of three paint layers applied on a sample is presented, revealing the distribution of measurement points in space.

[0159] The specific measurement results and standard deviations obtained by the improved thickness measurement algorithm are as follows: Fig.12As shown. The measurement results show that the average thickness of the first layer of paint is 47.93 ± 5.81 um, the thickness of the second layer of paint is 98.86 ± 0.57 um, and the thickness of the top layer of paint is 57.20 ± 0.79 um, achieving accurate measurement of the thickness values ​​of the three-layer sample after rapid layering. The measurement results show that the average thickness of the first layer of paint is the smallest and has a relatively large standard deviation, indicating the large unevenness of the bottom layer during the coverage process. The thickness of the second and top layers and their standard deviations show that the consistency and accuracy of the measurement are improved with the increase of coatings. Regarding the phenomenon of low bottom layer thickness in the overlapping area, it may be caused by the following factors: the natural stacking effect during the coating process. In the case of multiple layers of coating, the bottom layer may be compressed due to the weight and pressure of the subsequent coating, resulting in the measured thickness being lower than expected. The flow and sedimentation characteristics of the material. The flow of liquid paint on the sample may cause the material to concentrate at the edge or low point, making the paint layer in the center or overlapping area relatively thin. The thickness distribution reflects the real situation.

[0160] The present invention provides an accurate model construction basis for subsequent thickness measurement by pre-stratifying the coating sample. Pre-stratification allows the reflection and propagation model of the terahertz signal to be more accurately constructed and applied during the thickness measurement process. The measurement accuracy is improved by precise terahertz signal preprocessing and feature extraction; the dimension reduction is performed using kernel principal component analysis to optimize the computational efficiency and classifier performance; the support vector machine is optimized using an improved sparrow search algorithm to improve the classification accuracy of the classifier; the thickness of each layer is accurately calculated by combining the generalized Rouard method and the genetic algorithm improved by dispersion attenuation, ensuring the accuracy and reliability of the measurement. Through the above technical solutions, the present invention effectively solves the deficiencies in the prior art, realizes high-precision measurement of coating layer thickness, and has significant practical application value.

[0161] The above is an exemplary description of the present invention. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. As long as various improvements are made using the method concept and technical solution of the present invention, or they are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A coating layer thickness measurement method based on terahertz detection, characterized in that: The following steps are involved: S1. Experimental sample preparation: Prepare samples with different coatings, perform terahertz time-domain spectroscopy measurements, and obtain the terahertz signal data set of the samples; S2, terahertz signal preprocessing: preprocess the collected terahertz time-domain spectrum data to improve the accuracy of subsequent analysis; S3. Extract time-frequency domain features: Use fast Fourier transform to extract frequency domain features, and combine them with time domain features to form a comprehensive feature set. The feature set includes 29 features, including 16 time domain features and 13 frequency domain features. S4. Kernel principal component analysis is used for dimensionality reduction to improve computational efficiency and classifier performance. The first five principal components of the extracted 29 time-frequency domain features are selected through kernel principal component analysis, and the cumulative contribution rate of each component is 98.3%. These features after dimensionality reduction are selected as input data of the classifier. S5. Divide and mean normalize the data set to improve data consistency and classifier performance; S51, randomly and evenly divide the data set into a training set and a test set; S52, then normalizing the data of the training set and the test set to the interval [0, 1] to eliminate the dimensional differences between different features, so that the feature data can be analyzed on the same scale, thereby improving the performance of the classifier; S6, classifier training: training the support vector machine classifier optimized by the improved sparrow search algorithm to obtain an optimized classifier; S61. Assume that the number of training samples is n, and each sample is represented by ,in is the feature vector input, representing the reduced-dimensional features extracted from the terahertz spectrum, is the category label output, indicating the corresponding number of coating layers, which are single layer, double layer and triple layer respectively. Based on the label information of the above samples, the coating terahertz signal dataset is constructed; The data set is divided into a terahertz signal training set and a terahertz signal test set, with a ratio of 7:

3. The data of the terahertz signal training set is used to train and optimize the machine learning classifier, and the terahertz signals of the terahertz signal test set are used for classification and recognition evaluation. The problem of finding the optimal classification surface is transformed into a mathematical problem of solving the optimal solution, namely: ; In the formula, To control the penalty factor for misclassified samples, is the slack variable, W is a vector, b is the offset, and the constraints are: , ; S62. Map samples from the original space to a high-dimensional vector space through nonlinear transformation, so that the samples are linearly separable in the mapped feature space and construct the optimal classification surface; use the Lagrange multiplier method to introduce a kernel function, represented by K, to transform the dual problem; Using the radial basis function as the kernel function, the original samples mapped to the high-dimensional feature space are classified. The expression of the radial basis function is: ; The parameter g is the distribution width of the kernel function; S63, introducing an improved sparrow search algorithm to optimize the parameters C and g of the support vector machine to improve the performance of the support vector machine model; Optimize the sparrow search algorithm: S631, initializing the sparrow population and setting the optimal position of individuals; Use Sin chaotic mapping to initialize the sparrow population, enrich the diversity of solutions, and set the population size and the maximum number of iterations ; Use Sin chaotic mapping to generate the initial population position; for each individual ,have ,in is the value of the previous position. It starts from a random value during initialization and sets the initial optimal position for each individual. and the global optimal position ; S632, calculate the fitness value of each individual And sort the fitness values, select the individual with the best fitness value as the best individual in the current population, and set the optimal position of the individual; S633, update the location of sparrow population producers; Update finder location: , where is the number of iterations, is a random number; For other individuals, the global optimal solution of the previous generation is introduced and adaptive weights are added : , where , are the positions of the current best and worst individuals, respectively. Adaptively adjust according to the number of iterations, coordinate local mining and global mining capabilities, and accelerate convergence; S634, check whether the maximum number of iterations has been reached Or the fitness value changes less than a preset threshold; if the termination condition is met, the iteration is stopped; if the termination condition is not met, the process returns to S632; S635, output the final global optimal position and its corresponding fitness value as the optimal solution; and obtain the optimal parameter values ​​C and g; S7, use the optimal parameters C and g to train the support vector machine classification model, and build the ISSA-SVM classification model to classify the number of layers; S8, layer number determination: input the terahertz signal feature vector of the sample to be tested into the trained classifier, and obtain the number of layers to be tested through the test set; S9, thickness measurement: when the number of layers is measured, the generalized Rouard method combined with the genetic algorithm improved by dispersion attenuation is used to calculate the thickness of each layer; S91, thickness measurement algorithm: The Rouard method is used to establish the mathematical model of the terahertz reflection signal of the multilayer coating sample; The Rouard method recursively calculates the reflected beams of each layer and finally obtains the total reflected beam. The specific formula is: , ① In the formula, and Respectively Layer and The reflection coefficient of the layer; j is the imaginary unit; For terahertz waves The phase change during layer propagation is: , ② In the formula, It is The thickness of the layer, It is The refractive index of the layer, It is The attenuation coefficient of the layer, is the angular frequency of the terahertz wave, is the speed of light. The total reflection coefficient of the multilayer coating sample is recursively calculated through formula ① and formula ②, thereby obtaining the terahertz reflection signal. S92. Construct a coating transfer function with a total of L layers , the expression is: , ③ By constructing the transfer function , and the frequency domain model of the entire multilayer coating system is obtained: , ④ In the formula, is the input signal; To output analog signal; S93. Optimize model parameters: thickness and attenuation coefficient ; S931. Genetic algorithm is used for parameter fitting. First, the initial value is set based on experience. Then, the fitness function is used to evaluate the degree of model fitting. The fitness function is defined as the minimum value of the measurement error. The specific formula is as follows: , ⑤ In the formula, is the real measurement signal, is the first frequency points, is the index variable for summation, M is the total number of frequency points; S932. Genetic algorithm generates a new generation of population through selection, crossover and mutation operations, and iteratively optimizes parameters; parameter optimization includes the following steps: S9321. Set an initial population of the genetic algorithm, where each individual represents a combination of a set of thickness and attenuation coefficient; S9322, calculating the fitness value of each individual, and calculating the measurement error according to the fitness function; S9323. According to the fitness value, select individuals with higher fitness for crossover and mutation to generate a new population; S9324, repeat S9322 and S9323 until a predetermined number of iterations is reached or the fitness value converges; S9325. Output the individual with the smallest measurement error as the optimized parameter combination, and then obtain the thickness of each layer of the multi-layer coating sample.

2. The coating layer thickness measurement method based on terahertz detection according to claim 1 is characterized in that: S1 specifically includes the following steps: S11. A hemispherical shell with a diameter of 50 cm was selected as the metal substrate for the experimental sample. Multiple test areas were planned on the shell, namely, a single-layer paint coating sample area (1), a double-layer paint coating sample area (2), a triple-layer paint coating sample area (3) and an unsprayed reference area; wherein, the double-layer paint coating sample area (2) covers one side of the single-layer paint coating sample area (1), the triple-layer paint coating sample area (3) covers one side of the double-layer paint coating sample area (2), and the single-layer paint coating sample area (1) has an area of ​​20*20 cm 2 , the double-layer paint coating sample area (2) is 17*20cm 2 , the area of ​​the three-layer paint coating sample area (3) is 14*20cm 2 ; S12, spraying automobile primer on the planned single-layer paint coating sample area (1) on the shell as a first layer of paint coating sample, and the refractive index range of the primer is 2.0-2.5; S13, spraying a middle coating paint on the planned double-layer paint coating sample area (2) on the shell as a second layer of paint coating sample, wherein the refractive index of the middle coating paint is in the range of 1.9-2.1; S14, spraying pure white paint on the planned three-layer paint coating sample area (3) on the shell as the third layer of paint coating sample, the refractive index of the pure white paint is in the range of 1.8-2.0; S15, spectral scanning, start the measurement program, the robot arm automatically controls the terahertz probe to move along the predetermined path, the terahertz wave passes through the coating, the receiver captures the reflected and transmitted signals, and completes the automated terahertz time-domain spectroscopy sample detection according to the planned grid measurement sequence; the sampling space accuracy is 1mm, and the single-point acquisition takes 3s. After completing the scan in the sample test area, 400 time-domain spectral data samples are obtained, and the length of each sample signal is 3000 data points.

3. The coating layer thickness measurement method based on terahertz detection according to claim 1 is characterized in that: The preprocessing in S2 includes the following steps: S21, firstly, perform time domain interception through time window filtering, intercept a specific time period of the signal for analysis or processing; S22, then performing smoothing and denoising processing on the intercepted signal to reduce or eliminate random noise in the signal, so that the characteristics of the signal are clearer; S23. Finally, the signal mean normalization process is performed to improve the accuracy of subsequent feature extraction and analysis.

4. The coating layer thickness measurement method based on terahertz detection according to claim 1 is characterized in that: In S51, the training set contains 280 groups of samples and the test set contains 120 groups of samples; the input parameters of the training set and the test set are a matrix of 280 rows and 5 columns and a matrix of 120 rows and 5 columns, respectively, each row corresponds to a sample, and each column is a feature after dimensionality reduction.