## 3 Results and Discussion  
### Near-Infrared Spectroscopy Preprocessing Results  
The composition of NIR spectroscopy data is complex. In addition to characteristic variables, there is also baseline drift or background noise caused by the acquisition environment and equipment. Therefore, useless information must be filtered from the high-dimensional, non-zero variable complex data before modeling, to effectively mine the characteristic data of the spectrum. Because the base liquor is a transparent liquid, NIR detection utilizes the transmission principle of the spectrum. The commonly used baseline correction method for transmission spectra is the first derivative method [52; 53] to increase the resolution of the spectral signal. However, the random noise in an NIR spectrum is generally a high-frequency signal, and the derivative method will amplify the noise signal. Therefore, effective baseline correction and noise filtering methods should be selected first to accurately extract the NIR feature spectra. First, the adaptive iterative reweighted penalized least squares method was used for baseline correction. According to Formula (2), when the value of the original spectrum \(x^{t}\) was greater than the fitted baseline value, it was regarded as the spectral peak, and the weight was set to 0 to effectively retain the characteristics of the spectral data. Figure 1 shows the influence of different penalty terms on the smoothness of the fitted curve, in which the spectral peak features could be completely retained. When the penalty term was increased to \(\lambda\) = 10 \(\times\) 10\({}^{8}\) (Figure 1b), overfitting gradually occurred. The baseline correction effect was better when \(\lambda\) was set to 10 \(\times\) 10\({}^{6}\) and 10 \(\times\) 10\({}^{7}\), and the value of the penalty term was further determined according to the accuracy of the prediction model. Then, the SG convolution smoothing algorithm was used for filtering, and the spectral resolution was enhanced using the first derivative method (Figure 2). Comparing the first derivative of the original spectral data in Figure 2A with the first derivative of the preprocessed spectral data in Figure 2B, it can be seen that the first derivative after preprocessing effectively eliminated the influence of high-frequency noise. The first derivative method can only remove part of the linear baseline and noise signal, but can also amplify the interference signal. Therefore, the baseline correction and filtering of NIR spectra are required before applying the first derivative. Finally, a multi-class SVM prediction model was established, and the optimal baseline correction and smoothing filter parameters were selected based on the results of the prediction model (Figure 3). It can be seen from Figure 3A that the stability of the classification model was not high when the baseline correction penalty term \(\lambda\) = 10 \(\times\) 10\({}^{6}\). When the penalty term \(\lambda\) = 10 \(\times\) 10\({}^{7}\), as in Figure 3B, the prediction accuracy of the classification model was relatively stable. When the penalty term \(\lambda\) = 10 \(\times\) 10\({}^{8}\) (Figure 3C), as mentioned earlier, the baseline correction showed an overfitting phenomenon, resulting in low prediction accuracy of the classification model. Preprocessing parameters with a prediction accuracy greater than 86% were selected as the basis for further research (Table 1). Figure 1: Effect of parameter \(\lambda\) on baseline correction of near-infrared spectroscopy. **(a)** Baseline correction penalty factor \(\lambda\) = 10 \(\times\) 10\({}^{7}\), **(b)** baseline correction penalty factor \(\lambda\) = 10 \(\times\) 10\({}^{8}\), and **(c)** baseline correction penalty factor \(\lambda\) = 10 \(\times\) 10\({}^{6}\). Figure 2: Preprocessed NIR spectra based on the first derivative. **(A)** Raw NIR spectra, and **(B)** baseline correction and filtered NIR spectra. Figure 3: Comparison of the results of different preprocessing parameters based on a multi-classification support vector machine.