# Wild Mushroom Classification Based on Improved MobileViT Deep Learning
## 1 Introduction  
Edible wild mushrooms are very nutritious, can improve the body's immunity, and have a variety of anti-disease abilities. In recent years, wild mushrooms are also frequently found in the market, and more and more people go to pick wild mushrooms. Wild mushrooms can be identified based on their shape, color, smell, microscopic features, pselaphesia, and other characteristics. However, due to the diversity of wild mushrooms, the challenges facing the classification of wild mushrooms are that the characteristics of wild mushrooms are small, and the image angle, illumination, target background, and other factors in the natural scene lead to significant differences between wild mushrooms, which are difficult to distinguish. Poisoning incidents occur from time to time, even leading to death. It is essential to identify the inedible and edible mushrooms correctly. This study aims to classify wild mushrooms using a method based on a combination of Transformer and ConvNets [1; 2; 3] to provide an auxiliary identification method for people. In recent years, there have been several methods that can classify wild mushrooms, among which the most reliable method is molecular identification. However, this method is time-consuming, has a high threshold, and is unsuitable for real-time classification detection. Most of the current articles on wild mushroom classification use machine learning methods. Methods used in the literature include [4] decision tree (DT), plain Bayesian (NB), AdaBoost (AB), and support vector machine (SVM) machine learning algorithms. However, these methods rely on features that people manually label and the method learns the labeled wild mushroom information, rather than the collected visual information, for classification. Since the feature attributes of wild mushrooms are closely related to the species, their ability to adapt and generalize is reduced in the absence of prior knowledge of the species. The accuracy rate plummets when visual information collected from images is passed into machine learning methods; thus, this method is inapplicable to the visual classification problem of wild mushrooms. Little research has been done to identify wild mushrooms using deep learning methods. In recent years, attempts have been made using ConvNets for the visual classification problem of wild mushrooms with good results [5]. Although ConvNets can extract local information on images well and the model converges quickly, there are limitations to extracting global information. The accuracy obtained when putting wild mushroom data into pure ConvNets is not high, so we believe the pure ConvNets model has some limitations for wild mushroom classification. Since the ViT (Vision Transformer) model was proposed in 2020, the Transformer architecture has created a boom in the field of vision, and many people have introduced the attention mechanism into vision tasks. Transformer has the advantage of global extraction, but the number of its parameters is too large and lacks the inductive bias ability of convolution, which leads to overfitting. Thus, it requires pretraining on large-scale datasets and requires strong regularity [6; 7; 8]. The currently proposed method of wild mushroom classification does not fully consider the characteristics of minor differences between wild mushroom classes and significant differences within classes. As described above, a new global attention feature fusion network, M-ViT, is proposed, using local and global information interaction. For the problem of minor differences in the characteristics of wild mushrooms, multidimensional attention is fused for feature mapping of global high-level information (such as semantic information), which can help locate significant objects and help reduce the interference of the background. In addition, the convolution network is used to enhance the receptive field, extract local low-level information (such as texture), and improve the generalization ability of the wild mushroom classification model.