Dongdong Ye, Xiaochang Yuan, Jianfei Xu, Chengjun Wang, Longhai Liu, Houli Liu, Jiabao Li, Depeng Ren, Chunlin Li
Food security serves as a vital cornerstone for social stability. As one of the most important staple crops globally, the quality and geographical origin of rice are directly associated with consumer health. Traditional methods for classifying rice by origin and variety rely on sensory evaluation and manual inspection, which are subject to uncertainty and human error. To address this, this paper proposes a method for classifying rice by origin and variety based on terahertz time-domain spectroscopy. Terahertz technology features the advantages of non-destructive, high-sensitivity and non-contact detection, making it well-suited for food detection. This study employs terahertz time-domain spectroscopy combined with machine learning modeling methods, using 20 types of rice as the subject of investigation, with a focus on modeling and analyzing four representative samples. Refractive index and absorption coefficient were extracted through preprocessing methods including Savitzky-Golay convolution smoothing, wavelet denoising and moving average smoothing. Modeling, classification, and detection were implemented using principal component analysis, partial least squares discriminant analysis, and least-squares support vector machine. The experimental results indicate that principal component analysis (PCA) alone performs poorly in classification tasks. However, a classification model combining PCA for dimensionality reduction with a least-squares support vector machine (SVM), following Savitzky-Golay smoothing, demonstrated the best performance, achieving a prediction accuracy of 93.3%. In an extended test involving 20 samples, the model achieved an identification accuracy of 89.6%. Quantitative metrics demonstrate the feasibility of using terahertz technology combined with optimized machine learning algorithms for classifying rice by origin and variety.