摘要:To rapidly detect whether apples are infected by fungi, a portable electronic nose was used in this study to collect the gas information from apples, and the collected information was processed by smoothing filtering, data dimensionality reduction, and outlier removal. Following this, we utilized K-nearest neighbors (KNN), random forest (RF), support vector machine (SVM), a convolutional neural network (CNN), a back-propagation neural network (BPNN), a particle swarm optimization–back-propagation neural network (PSO-BPNN), a gray wolf optimization–backward propagation neural network (GWO-BPNN), and a sparrow search algorithm–backward propagation neural network (SSA-BPNN) model to discriminate apple samples, and adopted the 10-fold cross-validation method to evaluate the performance of each model. The results show that SSA can effectively optimize the performance of the BPNN, such that the recognition accuracy of the optimized SSA-BPNN model reaches 98.40%. This study provides an important reference value for the application of an electronic nose in the non-destructive and rapid detection of fungal infection in apples.