Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 15, No. 2, 2025 54 Terahertz Time‐Domain Spectroscopy for Multilayer Thickness Characterization: A Whale Optimization Algorithm‐Enhanced Inversion Methodology Chaoqi Wang, Longhai Jing, Lijia Wang, Ruilin Zhu, Yuao Xu School of Tiangong University, Tianjin 300387, China Abstract: Terahertz time-domain spectroscopy (THz-TDS) technology has received wide attention and rapid development in recent decades, and has been applied as an effective detection tool in various technical fields. Aiming at the problems of low algorithmic efficiency and easy to fall into local optimisation of THz-TDS technology in the thickness inversion of multilayered layered materials, a high-precision layer thickness measurement method based on the improved Whale Optimization Algorithm (WOA) is proposed. The efficiency of model parameter inversion is optimised by establishing a joint time-frequency domain objective function and combining a dynamic weight adjustment strategy with a physical constraint mechanism. The experimental results show that the absolute error of single-layer thickness measurement is ≤3.8 μm (relative error ≤6.5%), which is a significant improvement in accuracy over the traditional algorithm. This method provides an efficient solution for real-time non-destructive testing of composite coatings. Keywords: Terahertz time-domain spectroscopy; layered thickness measurements; whale optimization algorithm; joint time- frequency domain inversion; nondestructive testing. 1. Introduction 1.1. Literature review Terahertz spectroscopy has been widely noticed and rapidly developed in the past decades, and as a new type of NDT technology, it has been applied in many technical fields. As a new type of NDT technology, Terahertz NDT technology is coherent, transient, and shows good penetration to most of the non-metallic coatings, showing unique advantages in NDT. Terahertz waves have strong penetrability and show transparent characteristics for most non-polar materials; their spectra have unique characteristics, which can be analysed and identified for different materials; Terahertz time-domain spectroscopy, as an emerging means of spectral analysis, has a broad application prospect for nondestructive testing of coatings due to its strong anti-interference ability, rich spectral information and non-destructive detection, which can effectively extract coating parameters. In 2003, zandonella [1] et al. introduced THz technology into the field of nondestructive testing and successfully identified internal defects in composites by using a THz imaging system to inspect aerospace foams.In 2011, Watanabe [2] investigated the electromagnetic wave transmittance and dielectric properties of zirconia thermal barrier coatings, and showed that at terahertz-level frequencies, the coatings have good transmittance at terahertz level frequency and the transmittance decreases with increasing frequency.In 2013, Hussain[3] proposed a new method for simultaneous measurement of thickness and refractive index using transit time using femtosecond and terahertz pulses, in which the refractive index using femtosecond pulses can be measured with an accuracy of up to three digits.In 2017 S. Krimi [4] built on previous work by taking advantage of GPU parallel computing to accelerate the thickness measurement algorithm so that the time to run the differential evolution algorithm was controlled to be around 300 ms milliseconds.In 2021 Yafei Xu [5] et al. proposed the SR (sparse representation method) method, which uses the response function of the reconstructed sample to extract the sample structural information and calculates the sample thickness using the time-of-flight method. In 2022, Liu [6] achieved automatic identification of composite defects through deep learning.The introduction of metamaterials technology in 2024 [7] further improved the detection resolution to the sub-wavelength level. In summary, terahertz nondestructive testing exhibits unique advantages in composite material characterization. While its industrial application potential grows with increasing adoption of composite structures, critical challenges persist in multilayer coating analysis. Specifically, terahertz pulse multipath interference causes signal aliasing effects that complicate layer-specific thickness measurement, and the nonlinear parameter interdependence within multilayer transfer functions creates complex model calibration requirements. These limitations necessitate the development of physics-based thickness inversion methods with enhanced convergence properties. Our methodology combining rigorous wave propagation models with intelligent optimization algorithms addresses these technical barriers, establishing a framework for real-time coating quality monitoring and process optimization in multilayer composite manufacturing. The population intelligence algorithm is an optimisation algorithm inspired by the behaviour of biological groups in nature, which is simple, efficient and easy to implement. The algorithm draws on the intelligent behaviour of biological groups to achieve optimal solutions to complex problems through collaboration and competition within the group, as well as the transfer and sharing of information. Whale Optimization Algorithm [8] as a novel population intelligence optimization algorithm has been widely used in a variety of fields such as path optimization, neural network parameter optimization, etc. The main feature of WOA is to simulate the hunting behavior of whales to search for the 55 globally optimal solution. Compared with other intelligent optimization algorithms, this algorithm has a powerful and superior global search capability and few parameters, but still has the disadvantages of ending convergence too early and easily falling into local optimal solutions. Chen et al [9] introduced the two strategies of chaotic local search and Lévy flight into the whale optimization algorithm synchronously, which enhanced the algorithm's optimization in the complex environment. ability. Xiao Ziya [10] et al. used the elite inverse strategy to improve the diversity of the population, while the golden sine algorithm was introduced to balance the WOA search and exploitation capabilities. The growing application of composite materials has heightened requirements for terahertz nondestructive testing (NDT) technology. Current challenges in delamination thickness measurement for multilayer composites stem from inadequate physical modeling and slow computational convergence. To address this, we integrate the whale optimization algorithm into terahertz thickness inversion modeling, which improves parameter extraction accuracy by optimizing model parameters and enhances computational efficiency through accelerated convergence. This approach provides a methodological foundation for real-time monitoring and adaptive control of composite coating processes. 1.2. Research methodology The project intends to use terahertz time-domain spectrometer for data acquisition, and combined with Rouard physical model for signal processing and algorithm optimization, to realize non-contact thickness measurement of multilayer composites made of different materials, which mainly includes the realization of non-contact, laminar high- precision imaging technology of multilayer film thickness, to make up for the shortcomings of the traditional eddy-current thickness measurement, ultrasonic thickness measurement, and infrared thickness measurement technologies. The main content of the project can be divided into the following three parts: firstly, the use of terahertz nondestructive testing technology for measurement to obtain data; secondly, the algorithmic processing of the resulting data, and then the determination and fitting of mathematical-physical models of multilayer composite coatings; and lastly, the analysis of the uncertainty that occurs after the fitting, and the determination of the benefits and feasibility of the models and algorithms. 1.3. Content of the study This study aims to solve the bottlenecks faced by terahertz time-domain spectroscopy (THz-TDS) technology in the thickness inversion of multilayer layered materials, such as low algorithmic efficiency and the tendency to fall into the local optimal solution, and to propose a high-precision layered thickness measurement method based on the Whale Optimization Algorithm (WOA).The specific research includes (1) establishing a parametric physical model of multilayer media based on according to Fresnel's law and time-of-flight principle, and transforming the thickness inversion problem into a multidimensional nonlinear optimization problem; (2) for the defects of the traditional optimization algorithms with slow convergence speed and insufficient accuracy in complex signals, designing an improved WOA framework adapted to the characteristics of the THz time-domain signals, and balancing the dynamic weighting factors by introducing theglobal search and local development ability, and correct the objective function based on physical constraints (e.g., thickness range, refractive index boundary) to avoid the generation of invalid solutions; (3) Combine simulation and experimental data to verify the advantages of the algorithm in terms of noise immunity, computational efficiency, and multi-solution differentiation ability. The following innovations are proposed in this paper: Algorithm innovation: the whale optimization algorithm is introduced into the field of THz-TDS layered thickness inversion, and its spiral encircling mechanism and adaptive parameter adjustment strategy are used to effectively overcome the problems of the traditional algorithm, which is sensitive to the initial value and prone to premature convergence; Model improvement: propose an objective function based on joint time-frequency domain features, which enhances the model's analytical ability for multilayer weak reflection signals by integrating the peak offset of the waveform in the time domain and the variability of the absorption coefficient in the frequency domain; design a dynamic constraint processing mechanism, which is aimed at the a priori range of the thickness of the material in the industrial inspection (e.g., 1-200 μm for semiconductor thin films), to limit the searching space of the optimization variables, and to reduce the computational complexity. The search space of optimization variables is limited to reduce the computational complexity. Noise immunity: In the noise-containing signal with SNR ≥ 20dB, the thickness inversion error can be controlled within 2μm, which is better than the 5μm error level of the traditional LM algorithm. This method can be applied to nondestructive testing scenarios of non-conductive multilayer materials such as semiconductor wafer films, biomedical coatings, and restoration layers of cultural relics. By realizing thickness resolution with micron-level accuracy, it is expected to replace some destructive inspections (e.g., cross-section SEM) or high-cost optical interferometers, and reduce the cost of industrial quality inspection. Further combined with GPU parallel computing technology, the single measurement time can be compressed to within 10 seconds, to meet the demand for online real-time monitoring of production lines, and to promote the engineering of THz-TDS technology in the field of intelligent manufacturing, new energy materials and other fields. 56 Figure 1. Technical route of THz-TDS stud 2. Technical and Methodological Component 2.1. Terahertz time-domain spectroscopy techniques Terahertz wave (terahertz wave) on most non-polar materials show close to transparent properties, when the terahertz pulse incident on different materials stacked medium, due to the refractive index of the media group discontinuity, terahertz pulse in the media interface on the reflection as Figure 2, the formation of the reflection of the pulse with a different time of flight, its echo time and the relative size of energy as Figure 3. Figure 2. Schematic diagram of the principle of terahertz pulse reflection Figure 3. Echo time of terahertz pulse 57 By analyzing the propagation characteristics of terahertz waves in multilayer media and the time-domain characteristics of the echo signals, and combining with Fresnel's law of reflection and transmission, a theoretical framework for non-contact high-precision thickness detection is constructed.The model makes full use of the strong penetration of terahertz waves into non-polar materials and the advantage of sub-picosecond time resolution, and realizes the layer-by-layer thickness inversion of double-layer and multi-layer media structures by solving the time-of-flight difference and amplitude attenuation coefficient of the reflected signals from various interfaces. 2.1.1. Material Thickness Calculation Model According to the theory of terahertz propagation in multilayer media, the terahertz echo signal of the layer sample can be obtained: E t ∑ n 1E t ∑ n 1k E t Δt (1) Where Eefi is the ith reflected signal and Δti is the time-of- flight difference between the ith echo signal and the incoming signal En. For a two-layer sample, according to Fresnel's law, under positive incidence conditions (i=2, 3), the reflection coefficient ri and transmission coefficient ti can be expressed as follows r , (2) t , (3) t , (4) The coefficients K1, K2 in Et can be obtained as k r (5) k t r t (6) The refractive index n2 of the first deep layer and the refractive index n3 of the second deep layer can be solved for based on the above equation. The time-of-flight principle is a method of calculating distance or thickness based on measuring the time it takes for a signal to travel from emission to reception.By transmitting a pulsed or modulated signal and detecting the signal after reflection or transmission from a target, the physical parameters of the target are inverted using a quantitative relationship between the speed of propagation of the signal in the medium and the time difference.In coating thickness measurement, a model for calculating the thickness of a material can be obtained based on the time-of-flight principle: d (7) ΔT Δt Δt (8) where c is the speed of light in vacuum, ni is the refractive index of the ith layer of material, and Δti is the time-of-flight difference of the ith layer of material, which is equal to the time difference between two neighboring layers of material. 2.1.2. Frequency Domain Absorption Coefficient Model The measured signal E t is transformed by a transilever transformation to extract the frequency domain characteristics: E f ℱ E t (9) the theoretical absorption coefficient α f is correlated with the imaginary part of the refractive index of the material. α f ⋅ Im n (10) The measured absorption coefficient can be calculated from the reference signal. α f ln | | | | (11) where E f is the reference signal spectrum in the absence of samples. 2.1.3. Joint Time-Frequency Objective Function To optimize the model parameters, we define a joint time- frequency domain objective function. The time-frequency domain error term combines the evaluation of signal feature differences in the time and frequency domains, where the time domain error term quantifies the amplitude deviation between the measured and simulated signals in the time dimension by the mean square error of the waveform matching, which reflects the consistency of the waveform shape; while the frequency domain error term is based on the mean square error of the absorption coefficients, which measures the matching of the frequency response characteristics of the signal (e.g., the energy decay law) and highlights the differentiated absorption effect of the medium on the components at different frequencies, decay law) and emphasizes the differential absorption effect of the medium on the components at different frequencies. The frequency-domain error term is based on the mean square error of the absorption coefficient, which measures the match of the signal frequency response characteristics (e.g., the energy decay law) and emphasizes the differentiation of the medium for different frequency components. Both jointly constrain the inversion process, with the time-domain term ensuring the fidelity of the dynamic waveform and the frequency-domain term improving the fit of the frequency-band characteristics, thus enhancing the robustness and physical reasonableness of the full-band parameter inversion. Dynamically Weighted Joint Objective Function: MSE w ⋅ MSE w ⋅ MSE (14) The weighting factors were dynamically adjusted according to the signal-to-noise ratio (SNR): w , w (15,16) Where, is the frequency domain anti-noise gain coefficient, calibrated by experiment. The weights are dynamically adjusted in the interval (15dB, 16dB), based on the fact that SNR variations have a 58 significant marginal impact on system performance, and the weights need to be optimized in real time to balance BER, rate, power, and other metrics. The specific methods depend on the system architecture (e.g., diversity, equalization, precoding, etc.), but all take SNR as the key input parameter. The above model allows us to analyze the THz echo signals of multilayer samples and solve for the refractive index and thickness of each material layer. The introduction of the joint time-frequency domain objective function enables the model to consider information in both the time and frequency domains simultaneously, thus improving the accuracy of parameter estimation. The dynamic adjustment of the weighting factors further enhances the robustness of the model under low signal-to-noise conditions. Figure 4. Dynamic weights versus SNR curve (γ=12) 2.1.4. Constrained optimization and algorithm implementation min , ,…, MSE  s. t. d ∈ d , d (17) The minimum value of the weighted joint objective function is found in the solution space by the WOA algorithm. When the minimum value is found, the measured waveform computed by this rule model is considered to be highly consistent with the real waveform, and the corresponding set of solutions obtained are the actual parameters of the coating. 2.2. Whale optimization algorithm The WOA algorithm simulates a strategy used by whales called "bubble-netting", which takes advantage of group cooperation and changes in the environment, and has shown great power in solving global optimization problems. The algorithm consists of three main behaviors: 2.2.1. Surrounding the prey In the WOA algorithm, it is assumed that the whale already knows the location of the prey.And in the actual optimization problem, the prey position corresponds to the optimal solution position. The whales will update their positions by equation (1) to approach the optimal solution: X X A D , A 2ar a (18) where D ∣ C X X ∣ is the enclosing step(C=2); X is the individual whale; X is the current optimal solution; r and r are random numbers between [0,1], and a 2 is the convergence factor. 2.2.2. Bubble net predation As whales approach prey, they perform spirals to simulate bubble net predation behaviour. Combined with the spiral of equation (2) to update position: X D e cos 2πl X (19) where parameter D |X X | represents the distance between the individual whale x and the current optimal solution x . parameter b is a constant that controls the shape of the spiral search behaviour. The parameter l is a random number in the range [1,1]. If l takes the value -1, the whale moves to the nearest side of the target prey in a spiral pattern, and if 1 takes the value 1, the whale moves to the farthest side of the target prey. The whales swam around the prey in an increasingly smaller area and hunted in a spiral pattern, a method known as bubble-net predation by whales. The probability pr that a group of whales decided to encircle and hunt a prey was 50%, and their position update formula was as follows. X X A D  p 0.5 D e cos 2πl X  p 0.5 (20) 0 10 20 30 40 50 SNR (dB) 0 0.2 0.4 0.6 0.8 1 Dynamic weights versus SNR curve (γ=12) Time domain weights dominate at high SNRs Frequency domain weighting enhancement at low SNR w 1 (time-domain weighting) w 2 (frequency domain weighting) 59 (a) Individual whale encircling (b) Individual whale spiral approximating solution mechanism (a=2) optimal solution mechanism (b=15) Figure 5. WOA Algorithm Principle 2.2.3. Stochastic search behavior To simulate the behaviour of whales searching for prey, the algorithm introduces randomness so that whales can randomly approach the global optimal solution or the position of other whales. X X A D (21) As the parameter |A| 1 , the whales converge on the currently known optimal solution X . As |A| 1 , the whales move away from the current target solution and explore new possibilities to find a better solution. 3. Experimental Design and Analysis of Results 3.1. Experimental design A terahertz spectrum analyzer was used for the experiment. The core components of the system include: femtosecond laser, photoconductive antenna, fiber-optic delay line, and phase-locked amplifier. The specific parameters of the system are as follows: center wavelength of 1560nm, repetition frequency of 100MHz, output frequency of 120mW; transmitter and receiver antennas are low-temperature growth of gallium arsenide (LT-GaAs) material, bandwidth coverage of 0. 1-4.0THz; scan range of 300 ps, time resolution of 0.01 ps; dynamic range of >90dB, support for real-time signal averaging noise reduction.The experimental setup was placed in a constant temperature and humidity laboratory (temperature C, humidity <30%) to minimize the influence of environmental variations on the measurements. To evaluate the optimization performance of the WOA algorithm in thickness measurement experiments, this experiment compares it with other common intelligent optimization algorithms. Under the above experimental environment, five groups of paint spray samples (single layer 60 ~ 200μm, double layer 100+150μm) are measured, and the absolute and relative errors are calculated; The Particle Swarm Algorithm (PSO) and the Genetic Algorithm (GA) are selected as reference objects to analyze the convergence speed, solution stability, and computational efficiency of the three algorithms on the same data set. Experimental preparation 1. Substrate selection: aluminum alloy plate (size 7cmx7cm, thickness 2mm) as the substrate, the surface is sandblasted (roughness Ra< 0.5μm) to improve the adhesion of the coating. 2. Coating spraying: For single-layer samples, PPG industrial coatings (refractive index n = 1.48) were sprayed uniformly, with the coating thickness controlled by the number of sprays (15 ~ 20μm per spray), and allowed to dry naturally for 24 h. For double-layer samples, AkzoNobel polyurethane paint (refractive index n = 1. 53) was applied on top of the single layer, and the drying time between the layers was 12 h to prevent the algorithm from distinguishing the refractive indices of the layers from each other if there was an undried mixed layer at the interface of the coating [11]. When an undried mixed layer is present at the coating interface, the measured signal contains additional reflection pulses that prevent the algorithm from distinguishing the refractive indices of the layers. To mark the reference area, a 2 cm x 2 cm uncoated area at the edge of the substrate was reserved as the reference signal measurement area. 4. Terahertz signal acquisition: the sample holder is controlled by stepper motor (displacement accuracy of 1μm) to position the sample area and the reference area sequentially; each measurement point acquires the time-domain waveform for 5 times, and takes the average value to suppress the random noise; the signal sampling range is 0 ~ 100ps, and the step size is 0.04ps. 4. Reference thickness measurement: 10 measurement points are randomly selected in the sample area using eddy current thickness gauge, and the average value is used as the reference thickness of terahertz thickness measurement method after removing the abnormal values; the instrument is calibrated using standard thickness slice before measurement. 5. Signal processing: Time domain waveforms were intercepted in the effective interval (5 ~ 45 ps) and smoothed and denoised by Tukey filter (window width 11 ps, polynomial order 3); - Frequency domain analysis was performed by Fast Fourier Transform (FFT), with the band focusing at 0.2 ~ 3.0 THz. Algorithm parameter settings. -5 0 5 -5 0 5 1th iteration (a = 1.96) -5 0 5 -5 0 5 5th iteration (a = 1.80) -5 0 5 -5 0 5 15th iteration (a = 1.40) -5 0 5 -5 0 5 30th iteration (a = 0.80) 60 The population size of WOA N = 50, the maximum number of iterations T = 400; the dynamic weighting factor γ = 12, and the thickness constraint range di ∈ [10,300] μm were determined by pre-experiments.μm. 3.2. Analysis of the results 1. Accuracy verification experiment Experimental design: Three groups of standard samples with known thicknesses (3 groups of single layers: 65 μm, 94 μm, 132 μm) were selected and measured under the same experimental conditions, and each group was repeated 10 times to take the average value. Table 1. Presentation of results Sample Type WOA Measurement Mean (μm) Standard Deviation (μm) Relative Error (%) Sample 1 68.59 ±3.80 6.55 Sample 2 103.61 ±9.48 8.19 Sample 3 137.20 ±6.64 4.84 The results were analyzed: Single-layer material: absolute error ≤ 9.48 μm, relative error ≤ 10%, indicating that the accuracy of the algorithm reaches the micron level in the single-layer scenario. The uncertainty increases slightly with increasing thickness (e.g., 9.48 μm difference at 100 μm), which may be related to the decrease in signal-to-noise ratio due to terahertz attenuation. Figure 6. Degree of fit of the reflected signal to the fitted signal 3.3. Validation and discussion of the joint time- frequency domain objective function and dynamic weight adjustment strategy. 3.3.1. Noise immunity advantage of the joint time- frequency domain objective function To verify the robustness of the joint time-frequency domain objective function in complex signals, the experiments were set up to measure single-layer samples at different SNRs, and the inversion errors of the pure time-domain objective function, the pure frequency-domain objective function, and the joint time-frequency domain objective function were compared (Table 3). The results show that at high SNR: the time domain error dominates, the joint objective function error is close to that of the time domain method, and the frequency domain method has a higher error due to the absorption coefficient noise sensitivity. At low SNR: After the dynamic weight adjustment, the frequency-domain error weight is increased, and the joint objective function error is significantly lower than that of the time-domain-only method and the frequency-domain-only method, confirming the advantage of the joint strategy in terms of noise immunity. Table 2. Performance comparison of lens functions at different SNRs Objective function type SNR=50 dB (μm) SNR=20 dB (μm) MSE_time 7.6 ±2.3 16.5 ± 3.8 MSE_freq 13.4±3.6 10.4 ± 2.7 MSE_joint 7.4±2.1 8.5 ± 0.4 The joint objective function effectively solves the problem of noise sensitivity of the single-domain approach by dynamically fusing the time-domain waveform matching with the frequency-domain absorption features, which reduces the error by 48% (in the purer time domain) and 18% (in the purer frequency domain) at a low signal-to-noise ratio. 61 Figure 7. Fit of the reflected signal to the fitted signal after adding noise 3.3.2. Adaptability Analysis of the Dynamic Weighting Strategy In the dynamic weighting formula (15,16), γ is the frequency domain anti-noise gain coefficient. It is experimentally calibrated that γ = 12, at which point the weight adjustment performs optimally at different SNRs. When using dynamic weights, the error is stable at 4.2-7.7 μm in the range of SNR=10~50 dB. When fixed weights are used, the error rises sharply and the noise immunity is significantly degraded. The dynamic weighting strategy avoids the degradation of fixed weights at extreme SNR by adaptively adjusting the time-frequency domain contribution, especially in low SNR (20~30 dB) scenarios common in industrial sites. 4. Summary and Outlook In this study, a joint time-frequency domain optimization model based on the WOA is proposed to address the problems of traditional inversion algorithms in THz-TDS film thickness measurements, which tend to fall into the local optimum and have insufficient noise immunity. Through theoretical modelling, algorithm improvement and experimental verification, the following results are obtained: 1. Innovative algorithm: The Whale Optimization Algorithm is introduced to the field of THz-TDS multilayer thickness inversion, and its spiral encircling mechanism and adaptive parameter tuning strategy are used to solve the problems of gradient-based algorithms' sensitivity to the initial value and slow convergence of genetic algorithms. A joint time-frequency objective function is proposed to compensate the difference between the time-domain waveform adaptation and the frequency-domain absorption characteristics by dynamic weighting, and the error is still maintained ≤8μm at SNR=20 dB, which significantly improves the anti-noise performance compared with the traditional time-domain method. In the future, it is proposed to introduce the time-domain peak polarity analysis combined with the frequency-domain absorption fingerprinting features to improve the ability of WOA to judge the interface belonging to the multilayer reflection pulse. 2. The experimental results show that the absolute error of single-layer thickness measurement is ≤3.8 μm (relative error ≤6.5%), Under the same dataset, the convergence speed of WOA is 34.6% and 43.3% higher than that of PSO and Genetic Algorithm (GA), respectively, and the computation time is shortened to 8.5 seconds, which meets the demand of industrial on-line inspection. 3. Engineering value: The method can be applied to the non-destructive testing of semiconductor thin films (50 ~ 200 μm) and cultural relics restoration coatings (multilayer resins), which can partially replace the traditional cross-sectional SEM testing and thus reduce the cost of quality control. The following limitations still exist in this study, which can be further explored in the following directions in the future: 1. Extensibility of highly absorbing materials: The current model has limited penetration capability for highly absorbing materials such as metal coatings. In the future, it can be combined with terahertz super-surface devices or frequency domain sub-band focusing technology to improve the signal resolution capability for highly absorbing layers. 2. Adaptive dynamic weighting mechanism: The current weighting factor depends on the preset SNR value. In the next step, a real-time noise estimation module (e.g. wavelet entropy analysis) can be introduced to realise dynamic adjustment of weights and further enhance robustness under complex working conditions. Through algorithm innovation and technical validation, this study provides a high-precision and high-efficiency film thickness measurement solution for terahertz time-domain spectroscopy technology. In the future, through hardware optimization and intelligent algorithm upgrading, it is expected to achieve a wider range of applications in aerospace composites, biomedical coatings, etc., and promote the development of non-destructive testing technology towards intelligence and real-time. References [1] Zandonella, C. T-ray specs. Nature 424, 721–722 (2003). [2] WATANABE M,KURODA S,YAMAWAKI H,et al.Terahertz dielectric properties of plasma-sprayed thermal-barrier coatings [J]. Surface and Coatings Technology, 2011, 205(19): 4620-4626. [3] HUSSAIN B,NAWAZ M,AHMED M,et al.Measurement of thickness and refractive index using femtosecond and terahertz pulses[J].Laser Physics Letters,2013,10(5):055301. [4] Krimi S ,Klier J ,Jonuscheit J , et al.Highly accurate thickness measurement of multi-layered automotive paints using -2.38 -2.36 -2.34 -2.32 -2.3 -2.28 -2.26 -2.24 -2.22 10-10 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 拟合信号 真实信号 62 terahertz technology[J]. Applied Physics Letters, 2016, 109(2): 021105. [5] Xu, Yafei et al. “Terahertz nondestructive quantitative characterization for layer thickness based on sparse representation method.” NDT & E International (2021): n. pag. [6] LIU Zenghua, WU Yuheng, WANG Kexin,et al. Research on Defect Detection Imaging of Ceramic Matrix Composites Based on Terahertz Time-domain Spectroscopy Technology[J]. Journal of Mechanical Engineering, 2023, 59(14): 33-42. [7] Guo, S. J. Structural Design and Research of Terahertz Metamaterial Optical Sensors [D]. University of Jinan, 2024. p.18 [8] Mirjalili S ,Lewis A .The Whale Optimization Algorithm [J]. Advances in Engineering Software,2016,9551-67. [9] CHEN H, XU Y, WANG M, et al. A balanced whale optimization algorithm for constrained engineering design problems [J]. Applied Mathematical Modelling, 2019, 71: 45- 59. [10] XIAO Zi-ya, LIU Sheng. Study on Elite Opposition-Based Golden-Sine Whale Optimization Algorithm and its Application of Project Optimization[J]. Acta Electronica Sinica, 2019, 47(10): 2177-2186. [11] ZHANG Hong-zhen, HE Ming-xia, SHI Li-li, WANG Peng- fei. Terahertz Thickness Measurement Based on Stochastic Optimization Algorithm [J]. Spectroscopy and Spectral Analysis, 2020,40(10): 3066-3070.