## 3 Results and Discussion
### Optimization of Spectral Preprocessing Methods  
During the collection of Raman spectra, various factors such as the collection environment, sample background, and light scattering can introduce significant redundancies into the raw spectra. Therefore, preprocessing of the original Raman spectra is necessary before constructing the PLS calibration model. This study compared different spectral preprocessing methods, including normalization (Nor), standard normal variation (SNV), wavelet transform (WT) [47], first-order derivation (D1 st), and multivariate scatter correction (MSC) [30], as well as their different combinations, to investigate their effects on the calibration model of PLS. The D1 st preprocessing method effectively removes baseline  
Figure 2: Raman spectra of different samples ((a): pure samples of diesel, biodiesel, and soybean; (b): samples with different biodiesel contents). drift and background noise, which increases peak resolution and improves the signal-to-noise ratio. MSC and SNV have similar purposes and are mainly used to eliminate the influence of physical factors, such as variations in the spectral range and solid particle size, on spectral data. Spectral analysis showed that the preprocessed spectra exhibited richer peaks, clearer waveforms and higher resolution. The model evaluation criteria were R\({}^{2}\)CV and RMSECV. As shown in Table 2, D1 st was the optimal individual preprocessing method (R\({}^{2}\)CV = 0.9741, RMSECV = 0.1661% (\(v/v\))). Compared to the original spectra (R\({}^{2}\)CV of 0.9738 and RMSECV of 0.1912% (\(v/v\))), the PLS calibration model achieved significant improvements. The others preprocessing methods, i.e., Nor, SNV, WT, and MSC, did not enhance the R\({}^{2}\)CV and RMSECV of the model; instead, they led to a decrease in performance. However, a slightly better prediction performance was observed for the prediction dataset after applying the Nor and MSC methods, with R\({}^{2}\)P values increasing from 0.9868 to 0.9894 and 0.9896, respectively. The three preprocessing methods, D1 st, MMS and MSC, which have different enhancements to the model, were combined in various forms. It was finally determined that the spectral data obtained after D1-MSC preprocessing would be used as input variables for establishing the calibration model. Combined with the optimal LVs (5), the D1-MSC-PLS model achieved an R\({}^{2}\)CV of 0.9812 and an RMSECV of 0.1558% (\(v/v\)). When this model was used for prediction, the R\({}^{2}\)P was 0.9932, the RMSEP was 0.1413% (\(v/v\)), and the MREP was 7.10%. These performance indicators showed slight improvements compared to the original spectra (R\({}^{2}\)P of 0.9868, RMSEP of 0.1654% (\(v/v\)), and MREP of 9.51%) and the D1-PLS (R\({}^{2}\)P of 0.9842, RMSEP of 0.1931% (\(v/v\)), and MREP of 11.07%) models, confirming D1-MSC as the effective spectral preprocessing method for constructing the PLS model. The stability within the model can be increased by optimizing the smoothing points in D1 st using LOO-CV. The number of smoothing points is crucial for the D1 st method. If the quantity is too small, the denoising effect of the spectrum will be poor, and instead, valuable information may be eliminated, leading to signal distortion. The R\({}^{2}\)CV and RMSECV were used as indicators to assess model predictive performance. Figure 3b shows that RMSECV decreased and then increased as the number of smoothing points was increased. The minimum RMSECV (0.1661% (\(v/v\))) and optimal R\({}^{2}\)CV (0.9741) were achieved when the number of smoothing points was 9. At that point, the PLS calibration model exhibited good predictive power. Additionally, the optimization of the model's latent variables (LVs) [43] was conducted. As shown in Figure 3a, the RMSECV initially decreased and then increased with cross-validation. The minimum RMSECV was reached when the LV was 5. Going beyond 5 LVs increased the risk of overfitting. Therefore, setting 5 the LV for the model was deemed reasonable.