Qianxi tomatoes are rich in nutrition, tasting sweet, sour and delicious, different varieties of qianxi tomato' s flavor and nutritional value is obviously different, especially lycopene, citric acid, vitamin C and amino acid content varies greatly and the traditional artificial classification method of low efficiency, strong subjectivity, high rate of error detection and other issues are pressing to be solved. Therefore, in order to screen the high comprehensive nutritional value and good flavor of the qianxi tomatoes to achieve the rapid and accurate classification of the qianxi tomatoes, a classification model based on qianxi tomatoes spectral features and a GWO optimized SVM algorithm was proposed to solve the problem of automated qianxi tomatoes classification. In this study, a total of 240 qianxi tomatoes of four varieties were taken as the research objects, divided into 160 training sets and 80 test sets according to the ratio of 2:1. The qianxi tomatoes fruit reflective intensity in the range of 350 to 1 000 nm was obtained by using a visible/near-infrared spectral acquisition system, and the sample reflectance by spectrally corrected was obtained and analyzed. The effective information of the qianxi tomatoes spectrum in the range of 481. 15 to 800. 03 nm was intercepted to enhance the signal-to-noise ratio. Since the modeling effect is affected by the interference of irrelevant information in the data acquisition process, Savitzky-Golay (SG) smoothing pretreatment was performed with the smoothing point to 3. After SG smoothing pretreatment, the characteristic wavelength variables are extracted by successive projections algorithm (SPA) the reflectance of the optimal selected 11 characteristic wavelength variables as the input matrix X, preset sample variables 1, 2, 3, and 4 as output matrix Y, the SPA-SVM qualitative classification model of qianxi tomatoes was established. The average classification accuracy of the training set is 59. 38% , the test set is 48. 75%. On this basis, the gray wolf optimization (GWO) algorithm was introduced to train 160 samples training set, seeking the optimal penalty coefficient (c) and the nuclear function parameter (g) of the SVM. Based on the training results of the model, the classification results of 80 test set samples were predicted to establish the SPA-GWO-SVM qualitative classification model of qianxi tomatoes and the average classification accuracy of the training set is 100% , the test set is 81. 25%. The research results show that the performance of the support vector machine model optimized by the grey wolf algorithm has been improved significantly. The average classification accuracy of the training set is improved by 40. 62% , and the average classification accuracy of the test set is improved by 32. 50% , which shows that the gray wolf optimization algorithm can be used to improve the performance of the support vector machine classification model and realize the classification of qianxi tomatoes. This study provides a new idea and method for the rapid and accurate classification of qianxi tomatoes and other fruits and vegetables.