Gastrodia elata belongs to the rare medicinal herbs, in China classified as a plant under state protection (Category II). This research utilizes Fourier Transform Infrared Spectroscopy (FTIR) combined with machine learning algorithms to develop an intelligent grading detection model for Gastrodia elata, with different grades of spring and winter Gastrodia elata harvested in Zhaotong, Yunnan as the main research objects. An initial exploration of both the original spectra (OS) and the preprocessed spectra (PS), which were processed through eleven distinct pretreatment methodologies, was conducted using Principal Component Analysis (PCA) within the spectral range spanning 4000 to 400 cm-¹. Remarkably, the FTIR of the diverse grades of Gastrodia elata exhibited a discernible clustering pattern, with the preprocessed spectral data exhibiting a superior clustering effect compared to the original spectral data. To ascertain the optimal detection model, we employed a diverse array of machine learning algorithms, including Naive Bayes (NB), Support Vector Machine (SVM), Tree (T), Logistic Regression (LR), and Multi-layer Perceptron (MLP), to establish a comprehensive grade detection model for Gastrodia elata, leveraging both the original spectral data and those subjected to effective preprocessing. Upon comparison, the MLP model emerged as the superior choice, demonstrating exceptional overall classification performance. Notably, the MLP model achieved 100 % accuracy on the test set, irrespective of the preprocessing method applied to the spectral data. Drawing upon these findings, the authors designed an intelligent detection system, namely "Intelligent Detection System for the Grade of Gastrodia elata Based on MLP Model and FTIR Technology". This research highlights the potential of machine learning classification models using FTIR technology to accurately detect and distinguish Gastrodia elata grades.