Terahertz time-domain spectroscopy (THz-TDS) was employed to measure the absorption spectra for three types of dyestuff at the frequency range of 0.3–2.2 THz. The raw spectra data were implemented dimensionality reduction by using principal component analysis (PCA). Depending on the weak cluster trend determined by the score plot, different levels of Savitzky-Golay (SG) smoothing combined with PCA processing was performed for elevating the recognition rate. The recognition effects were assessed by fuzzy c-means (FCM) and k-means clustering techniques, which consistently demonstrated the combination of polynomial order 1 and window size 5 for SG smoothing achieved the highest accuracy of 94.44%. For k-means and FCM clustering, the identification accuracies of raw spectra were 87.5% and 84.72% respectively, suggesting the elevation recognition rate by using SG smoothing with polynomial order 1 and window size 5. Our results suggested SG smoothing coupled with PCA was a potent method to cope with THz spectra recognition for dyestuffs.
The safety of wheat flour as a crucial food ingredient is paramount. Benzoyl peroxide (BPO) is banned in wheat flour in many regions due to health risks, yet it may be illegally added to enhance appearance. In the present study, BPO adulteration in wheat flour was quantitatively analyzed using terahertz time-domain spectroscopy (THz-TDS). First, the spectral characterization of wheat samples at 0.1–6 THz was obtained, and THz spectral data within specific frequency bands was processed using Savitzky-Golay (SG) filtering. Then, Competitive Adaptive Reweighted Sampling (CARS) and Variable Combination Population Analysis (VCPA) methods were used to select optimal frequency points. Finally, a chemometric model combining linear models (Lasso Regression, Ridge Regression, and Partial Least Squares Regression) with nonlinear models (Back-Propagation Neural Network, Random Forest, and Support Vector Machine) was employed for quantitative analysis. The experimental outcomes demonstrated that the detection models established through the standard analytical process met the detection requirements ( R P ≥ 0.95), and the best performance results were obtained from the chemometric models based on linear relationships. Among them, the Lasso Regression and Ridge Regression models obtained after optimization of the VCPA method had high prediction accuracy ( R P ≥ 0.97). The results showed that the THz spectroscopy technique combined with standard chemical analysis procedure could effectively realize the quantitative detection of BPO in wheat flour, providing an efficient and reliable tool for the safety detection of wheat flour.