Mushroom species classification and implementation based on improved MobileNetV3.
Journal:
Journal of food science
Published Date:
Apr 1, 2025
Abstract
Current methods for mushroom species classification face limitations in generalization ability and lack exploration of model deployment. To address these issues, this study systematically compares five models, including Transformer and common convolutional neural networks. MobileNetV3 was chosen as the model for this study, combining transfer learning with the adaptive hybrid optimizer (AHO) and dynamic cyclic learning rate strategies proposed in this research. The AHO merges Adam's fast convergence with stochastic gradient descent's stable fine-tuning. It adjusts the learning rate dynamically based on training progress, enabling quick convergence early on and precise adjustments later. The optimized model was trained, validated, and deployed on a dataset constructed in this study, which includes 3633 images covering three types of mushrooms. The model achieved a validation accuracy of 98.13% and an average test accuracy of 97.98%, with the smallest standard deviation of validation loss fluctuation (0.0343), confirming the model's stability. Notably, due to the slightly larger number of images in the Matsutake training subset (1412 images) compared to the other two categories (1148 and 1073 images), the test accuracy for Matsutake (99.28%) was slightly higher than that for Red mushroom (96.97%) and Beefsteak mushroom (97.69%), highlighting a minor limitation. However, the recall and F1 scores for each class are balanced, suggesting that the model exhibits robust performance in addressing interclass similarities, as corroborated by t-SNE visualization and Grad-CAM analysis. Additionally, the study confirmed the feasibility of practical application through deployment on PC, Android, and embedded platforms, providing a guiding solution for laboratory research, wild mushroom picking, and automated mushroom sorting. PRACTICAL APPLICATION: This study provides an AI model based on a lightweight neural network for identifying different mushroom species. It can be widely applied in scenarios such as mushroom harvesting, sorting, and research, helping farmers, consumers, and researchers easily and accurately identify mushroom varieties, thereby contributing to the development of the mushroom industry.