Wild Mushroom Classification Based on Multi-level Region Selection and Cross-layer Feature Fusion
Recent years have witnessed an increasing incidence of accidental consumption of poisonous wild mushrooms,making accurate identification of wild mushrooms particularly important.However,the existing wild mushroom classification algorithms tend to produce recognition errors when dealing with images with high background noise,small interclass differences,or large intraclass differences.To address this problem,this paper proposes a wild mushroom classification algorithm based on the Vision Transformer(ViT)architecture,combined with multilevel region selection and cross-layer feature fusion.The algorithm aims to capture discriminative features to ensure that the network focuses on the essential information and improves classification accuracy.The algorithm uses ViT as a network framework to extract features and global contextual information from wild mushroom images.In addition,it employs a multihead self-attention selection module designed to extract discriminative tokens and utilizes an adaptive allocation algorithm to determine the number of extracted tokens for different levels of coding layers.Finally,the algorithm utilizes a cross-layer feature fusion strategy and label smoothing loss to fine-tune the training parameters,thereby reducing the loss of detailed information and ultimately improving classification performance.For a more targeted learning of wild mushroom image features,a wild mushroom dataset was constructed.The experimental results show a significant improvement in classification accuracy compared with baseline algorithms,with an accuracy of 98.65%.