## 4 Experimental Process and Analysis
### Prediction of Dye Formulas and Ultrasonic Pretreatment Power  
#### 4.4.1 Dataset and Experimental Environment  
The experiments described in this paper were performed on a server with the following specifications: 20 vCPU Intel(R) Xeon(R) Platinum 8457C, GPU-L20 (48 GB), and the operating system Linux. The algorithms and models were implemented using the Python language. The experimental dataset comprised spectral reflectance data, spectral characteristic parameters, spectral similarity metric parameters, dye concentration, and ultrasonic pretreatment power for 648 stained veneers. The 648 pine veneers were divided into 108 groups of six veneers each. Within each group, identical dye concentration and ultrasonic pretreatment power settings were applied, both selected randomly. Due to experimental constraints, the ultrasonic power was restricted to a random range of 0 to 300 W, with the treatment conducted at 65 \({}^{\circ}\)C for 120 min. Following the pretreatment, the dyeing process was initiated, as described in Section 4.2.1. The partial settings for the dye concentration and the ultrasonic pretreatment power are presented in Table 1, located in Appendix A. A hyperspectral analyzer was employed to extract the spectral reflectivity of the veneer both before and after dyeing. In this experiment, the SPECIM FX10 hyperspectral camera (SPECIM, SPECTRAL IMAGING LTD., Oulu, Finland) was used to scan the surface of the wood veneer. Its key specifications, including a wavelength range of 400-1000 nm, a spectral resolution of 5.5 nm, a spectral sampling interval of 2.7 nm, 224 spectral bands, a spatial resolution of 1024, and a dual-source halogen light (400-2500 nm), are detailed in Table 2 of Appendix A. These parameters, particularly the spectral resolution and sampling interval, ensure high precision and sensitivity in the 400-700 nm range. The camera's performance was validated through rigorous calibration, providing reliable spectral reflectance data. Detailed specifications are available in the SPECIM FX10 technical manual, uploaded as Supplementary Material. This process yielded the spectral reflectivity of the veneer at each wavelength within the 400-700 nm band, both before and after dyeing. Subsequently, the corresponding spectral characteristic parameters and the spectral similarity metric parameters of the dyed veneer were calculated. For the purposes of this analysis, \(X\) and \(Y\) represent two spectra, \(X=(x_{1},x_{2},\cdots,x_{N})\) and \(Y=(y_{1},y_{2},\cdots,y_{N})\), respectively. The spectral characteristic parameters are presented in Table 3, and the calculation method of the spectral similarity metric parameters is provided in Table 4, both located in Appendix A. The MIC values among each spectral feature, dye concentration, and ultrasonic pretreatment power are shown in Figures 8 and 9. The target variables, including the concentrations of three reactive dyes--reactive Red (R), reactive Yellow (Y), and reactive brilliant Blue (B)--and ultrasonic pretreatment Power (P), are represented by the abbreviations R, Y, B, and P, respectively, in the figures. Based on the MIC between various spectral features and the four variables, dye concentration and ultrasonic pretreatment power, the Spectral Angle Measure Distance (\(SAD\)), the Spectral Information Divergence (\(SID\)), the German-McClure function distance (\(d_{GermanMcClure}\)), and the \(Frechet\) distance (\(d_{Frechet}\)) were selected as spectral similarity metric parameters. Additionally, the green peak reflectivity (\(R_{g}\)), the yellow edge amplitude (\(D_{y}\)), the blue border position (\(\lambda_{b}\)), and the blue edge area (\(SD_{b}\)) were chosen as spectral characteristic parameters. In addition, we examined the changes in the reflectance spectra of the stained veneer as the ultrasonic power and dye concentration were varied.