Abstract:To achieve the nondestructive classification of pear varieties, this study established classification models based on hyperspectral imaging technology to distinguish Cuiyu, Xuehua, and Korla pears. Hyperspectral image data were collected from 150 samples of each pear variety using a near-infrared hyperspectral imaging system (400~1 000 nm). Various preprocessing methods were applied to eliminate irrelevant information, followed by principal component analysis (PCA), and the first five principal components, with a cumulative contribution rate of 99.42% or higher, were selected. Finally, classification was performed using softmax regression. The PCA-processed data were randomly shuffled using the built-in randperm function in MATLAB. Subsequently, 60% of the samples from each pear variety were used as the training set, 20% as the validation set, and 20% as the test set. Different classification models were evaluated using the test set results. Evaluation metrics included both the convergence speed of the loss function curve and the accuracy derived from the confusion matrix. The softmax regression model achieved the best classification performance using data preprocessed by multiplicative scatter correction (MSC) combined with PCA, yielding a test accuracy of 98.87% and a loss value of 0.12. The three pear varieties were accurately differentiated, providing a reliable technical solution for the intelligent sorting of pears. This study also provides a theoretical basis for developing portable pear variety classification devices based on hyperspectral imaging.