Tomato is an important vegetable that is rich in antioxidants, vitamins, and minerals and has significant economic and health value. In this study, hyperspectral images in the wavelength range of 370 to 1715 nm were first preprocessed to improve the data quality and comparability. Subsequently, the tomatoes were chemically destroyed, and the average activities of peroxidase enzyme, phenylalanine ammonia-lyase enzyme, and α-amylase enzyme were 5.108 mU∕g, 7.347 U∕g, and 35.856 U∕g, respectively. Then, two spectral selection algorithms, the genetic algorithm (GA) and the successive projection algorithm, were used to extract effective wavelength bands from high dimensional spectral data. And the extracted effective wavelength variables were combined with partial least squares (PLS) regression to build the optimal spectral selection model GA-PLS. Finally, three additional spectral prediction models were created by combining the GA-selected spectra with three other algorithms: support vector machine, particle swarm optimization-backpropagation neural network, and random forest. After comparing the predictive performance of four models, it was found that the GA-PLS model had the highest prediction accuracy and stability. Furthermore, compared with tomato stems, the near infrared (NIR) bands of tomato leaves were more accurate in predicting the enzyme content of tomato plants. It was found that the GA-PLS model had a better prediction performance for the three enzymes in the NIR band of leaves with R p (average coefficient of determination for the three enzymes) and RMSEP (average root means square error of the three enzymes) of 0.815 and 1.659, respectively. This provides an effective method for phytochemical composition analysis using hyperspectral imaging.