Abstract
Accurate classification of pear varieties is crucial for enhancing agricultural efficiency and ensuring consumer satisfaction. In this study, Bayesian optimized (BO) deep learning is utilized to identify and classify nine types of pears from 43,200 images. On two challenging datasets with different intensities of added Gaussian white noise, Bayesian optimization automatically searched for the optimal hyperparameters and identified two optimal models, whose classification performance was objectively evaluated. The results indicate that dataset configuration significantly impacts classification outcomes. The optimal model A achieved an accuracy of 97.29% on dataset A (training-to-testing ratio = 21:10), while the optimal model B achieved an accuracy of 90.39% on dataset B (training-to-testing ratio = 1:10). This study also explored the impact of different proportions of validation sets within the training set on the performance of the optimal models. Additionally, on the original Fruit360 dataset, the accuracy of the BO optimal model reached 100% (training-to-testing ratio = 12:5). Furthermore, feature visualization, strongest activations, and local interpretable model-agnostic explanations (LIME) techniques were used to demonstrate the optimal models' understanding of pear images with noise and to reveal how and why the models make classification decisions. In summary, this study's dataset configuration is closer to real agricultural applications, and BO deep learning addresses the challenge of manually finding optimal hyperparameters for CNNs in agricultural applications, the interpretability methods enhance the transparency and reliability of CNN-based models. These laying the foundation for the widespread application of deep learning methods in agriculture.