Wild Gastrodia elata resources are in short supply and the market is dominated by cultivated Gastrodia elata resources and the medicinal value of both is very different. It is significant to find a highly accurate and stable technique to identify wild and cultivated Gastrodia elata. It could prevent market fraud and protect the rights of consumers. In this context, this study is the first to combine three-dimensional correlated spectral (3DCOS) images with deep learning to identify wild and cultivated Gastrodia elata. Also, partial least squares discrimination analysis (PLS-DA) and support vector machine (SVM) models are compared with this model. The PLS-DA and SVM models are built based on Fourier transform mid-infrared (FT-MIR) spectral data after nine different preprocessing. The PLS-DA model with second-order derivatives (2D) gives the best results when comparing the effects of the models with different preprocessing. the SVM model with parameters c, g in a reasonable range also gives satisfactory model results. The advantage of the deep learning model over them is that no processing of the original spectral data is required. With only 46 iterations, the accuracy of the model is stable at 100% for the training set, test set and external validation set. The excellent performance of the model allows it to be used as a technical reference to solve studies on the qualitative aspects of Gastrodia elata.