# Miniaturized Near-Infrared Analyzer for Quantitative Detection of Trace Water in Ethylene Glycol
## 3 Results and Discussion
### Establishment and Optimization of Water Content Prediction Models
#### 3.3.2 Comparison of Different Pretreatment Methods  
Following the identification of PLSR as the optimal modeling method in the preceding comparison, preprocessing of the NIR spectral data was conducted to eliminate external interference and enhance model performance. The NIR spectral acquisition can be affected by various external factors, including sample color, particle size, physical state, and light scattering effects, all of which can compromise spectral accuracy to varying degrees. Baseline drift and signal fluctuations, primarily induced by these factors, necessitate appropriate preprocessing to mitigate their impact. Techniques such as the Savitzky-Golay first derivative (FD), Savitzky-Golay smoothing (S-G-S), Standard Normal Variate (SNV), and unit vector normalization were applied to the raw spectra. Each method possesses distinct characteristics, and their combinations produce varied outcomes.  
As shown in Table 4, The model that combined FD with PLSR demonstrated the best predictive performance, achieving (Rc = 0.989) and (RMSEC = \(1.414\cdot 10^{-2}\%\)) for the training set, as well as (Rp = 0.992) and (RMSEP = \(1.451\cdot 10^{-2}\%\)) for the validation set. As illustrated in Figure 3, the preprocessed spectra after FD smoothing showed a significant enhancement of the O-H combination band absorption peak near 1940 nm, which is closely associated with water content. This approach effectively suppressed noise and baseline drift, accentuating subtle variations in water-related spectral features while minimizing background interference. Consequently, this preprocessing method allows the PLSR model to achieve optimal performance in predicting trace water concentrations in ethylene glycol solutions.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Pretreatment Method**} & \multicolumn{2}{c}{**Training Set**} & \multicolumn{2}{c}{**Validation Set**} \\ \cline{2-5}  & \(\mathbf{R_{C}}\) & RMSEC (\%) & \(\mathbf{R_{P}}\) & RMSEP (\%) \\ \hline Normalization & 0.978 & \(1.554\cdot 10^{-2}\) & 0.991 & \(1.492\cdot 10^{-2}\) \\ S-G Smoothing & 0.976 & \(1.329\cdot 10^{-2}\) & 0.988 & \(1.539\cdot 10^{-2}\) \\ SNV & 0.987 & \(2.227\cdot 10^{-2}\) & 0.989 & \(2.416\cdot 10^{-2}\) \\ FD + Smoothing & 0.989 & \(1.414\cdot 10^{-2}\) & 0.992 & \(1.451\cdot 10^{-2}\) \\ FD + Normalization & 0.994 & \(1.558\cdot 10^{-2}\) & 0.993 & \(1.662\cdot 10^{-2}\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Influence of different spectral pretreatment methods on model performance.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**LVs**} & \multicolumn{2}{c}{**Training Set**} & \multicolumn{2}{c}{**Validation Set**} & \multirow{2}{*}{**PRESS**} \\ \cline{2-2} \cline{4-6}  & & \(\mathbf{R_{C}}\) & & & \(\mathbf{R_{P}}\) & & \(\mathbf{RMSEP (\%)}\) \\ \hline PLSR & 3 & 0.994 & \(3.024\cdot 10^{-2}\) & 0.991 & \(1.873\cdot 10^{-2}\) & \(0.713\cdot 10^{-4}\) \\ SVMR & - & 0.986 & \(3.624\cdot 10^{-2}\) & 0.985 & \(4.924\cdot 10^{-2}\) & \(1.477\cdot 10^{-4}\) \\ PCR & 3 & 0.987 & \(4.068\cdot 10^{-2}\) & 0.986 & \(2.868\cdot 10^{-2}\) & \(0.889\cdot 10^{-4}\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of near-infrared spectroscopy model performance for ethylene glycol water content.