Gastrodia elata (G. elata) is a traditional Chinese medicinal material valued for its therapeutic properties, but its quality can be compromised by adulteration.Rapid, non-destructive methods to evaluate the quality of G. elata are needed to ensure authenticity and efficacy.In this study, hyperspectral imaging (HSI) in the visible near-IR (VNIR, 359-986 nm) and shortwave IR (SWIR, 840-1704 nm) regions was employed, combined with machine learning (ML) techniques to predict the content of key components in G. elata, including gastrodin (GAS), p-hydroxybenzyl alc. (HBA), parishin A (PA), parishin B (PB), parishin C (PC), and parishin E (PE).High-performance liquid chromatog. (HPLC) was used to measure the content of these components, and three machine learning models-backpropagation neural network (BPNN), extreme learning machine (ELM), and decision tree (DT)-were developed using the original spectral data, principal component anal. (PCA)-reduced data, and genetic algorithm (GA)-selected data.The GA feature selection process was conducted in three iterations: GA1, GA2, and GA3.GA1 represents the first selection of characteristic wavelengths, GA2 refines the selection based on GA1, and GA3 further selects wavelengths based on GA2.The optimal model combinations for each component were as follows: GAS-DT-GA1-SWIR (Max-R2V: 0.65), HBA-DT-PCA-SWIR (Max-R2V: 0.85), PA-ELM-GA1-SWIR (Max-R2V: 0.73), PB-ELM-GA1-SWIR (Max-R2V: 0.83), PC-ELM-GA1-SWIR (Max-R2V: 0.79), and PE-DT-PCA-VNIR (Max-R2V: 0.78).All models achieved a R2V exceeding 0.60 for the validation set, indicating strong prediction performance.This study demonstrates that HSI combined with ML is a powerful and efficient tool for the non-destructive quality evaluation of G. elata.The approach has significant potential to ensure the authenticity and quality of traditional Chinese medicinal products, providing a new avenue for rapid testing and quality control in the industry.