Classification of Edible and Poisonous Mushrooms Using Machine Learning Algorithms

There are millions of different types of mushrooms that grow all over the planet, but only one type is edible. Understanding how to differentiate between edible and dangerous mushrooms is an expertise that takes experience. Therefore, it's crucial to classify toxic and edible mushrooms. In addition to employing fungi's physical characteristics, machine learning (ML) techniques may be employed as well to distinguish between poisonous and edible mushrooms. Models will be developed to classify edible and deadly mushrooms based on features from the Mushroom collection and various distinct machine-learning algorithms. The results of this study were examined, and it was determined if the mushrooms were edible or dangerous by considering the physical characteristics of the mushrooms.


Introduction
As the fruiting bodies of fungi, mushrooms are a well-known dietary source.Some cultures and nations view different types of wild or field mushrooms as a delicacy.But a lot of mushrooms can be toxic when consumed, and the distinction between edible and poisonous mushrooms is not always an easy one.Not only that, but some supposedly "edible" mushrooms can be toxic when consumed by certain humans under certain conditions, which may be hard to predict.The number of people worldwide who die from eating mushrooms each year is unknown, it is at least 100 deaths per year, but Dadpour et al. consider that this number is a minimum estimate.In some countries, one of the types of fungal intoxication, intoxication by amatoxin with hepatocellular damage, becomes a noticeable burden on the healthcare system and, possibly, even one of the most common reasons for liver transplantation.Although there is no global information, local studies imply an increase in both the absolute number and the incidence of fungal intoxication.The risk of fungal diseases in Europe is linked to large-scale migration, some of whom live in poor economic conditions and search for food.For this reason, poisonous mushrooms unknown to the immigrants were eaten.The toxicology of most fungal species is unknown, new toxins are constantly emerging, and known symptoms are reported outside their known natural ranges.Mushrooms are a highly diversified group of fungi that are ecologically important and have strong cultural connections with humans.Although many fungi are safe to eat and are favored for their culinary taste, some are toxic and deadly to ingest.Given the health hazards of eating poisonous mushrooms, it is critical to have a trustworthy automatic technique for determining which varieties are and are not edible.This automatically computed task is challenging because of the various complex features across and within species.Expert practitioners, in this case, mycologists, can generally accomplish this task visually by eye.Nevertheless, pattern classification in the feature space is challenging its visualization can lead to investigations in impossible areas.

Literature Survey Automated Determination of Mushroom Edibility Using an Augmented Dataset
Author: S. Chamath.This paper argues that the augmented database of mushroom features used here can successfully use color, texture, and three-dimensional measures to correctly classify edible and poisonous mushrooms thereby simultaneously increasing the accuracy and efficiency of classification using the same underlying methods and data.This paper investigates methods and databases employed to automatically measure the class of a mushroom as edible or poisonous in terms of species and observable features.Our research focuses on data-driven methods utilizing a large database of mushroom features.Results are comparative quantifications of the classification accuracy and efficiency.

Automatic Prediction of Poisonous Mushrooms by Connectionist Systems
Author: María Navarro-Caceres, María Angelica González Arrieta.A brief overview of the classification system for edible and toxic mushrooms is provided in this study.In fact, there are not only classification systems but also applications that support expert decision-making.To achieve this goal, they studied different neural network models and learning algorithms and choose the best one based on the test outcomes.

Identification of Edible and Non-Edible Mushroom Through Convolution Neural Network
Author: Devika G, Asha Gowda Karegowda.In this paper, they used image data of mushrooms and used machine learning algorithms such as sNet, L eNet, AlexNet, cNet, and DCNN to classify mushrooms as edible or inedible.Classification was perform ed and performance was evaluated using different CNN network architectures.

Machine Learning Methods to Classify Mushrooms for Edibility
Author: Rakesh Kumar Y, Dr. V. Chandrasekhar A survey of the literature on the classification of poisonous and non-poisonous mushrooms is provided in this article.Learning approaches like Naïve Bayes, KNeural Networks, Support Vector Machine (SVM), Artificial Neural Network (ANN), and Decision Tree techniques have been employed on mushroom categorization.In this overview of the literature, the performance of all different mushroom classification methods, advantages, and disadvantages encountered in classifying mushrooms using machine learning techniques have been collected and compared.

Classification of Mushroom Fungi Using Machine Learning Techniques
Author: Ottom, Noor Aldeen Alawad, Khalid M. O. Nahar.In this paper, they used data mining and four machine learning algorithms (neural network, SVM, decision tree, KNN) to predict fungal toxicity.The Neural Network achieved 99.1% accuracy of data on 8,124 mushrooms.• Email: editor@ijfmr.com

Existing System
• The objective is to develop a system that can correctly detect edible mushrooms using 22 different mushroom characteristics.The challenge for the ML algorithms employed in the classification of the mushroom is to create a system that can reliably recognize and categorize edible mushrooms without endangering human health.• Among the prominent stories resulting from the poisoning of mushrooms are, In Melbourne an unsettling series of events took place.Hours after consuming poisonous mushroom meal they soon transferred to a hospital tragically 2 passed away and another 2 remained in critical condition.• In India from Meghalaya, three employees of the Institute of Science and Bio Resource (ISBR), were found dead.Police said the three are believed to have died due to mushroom poisoning.

Proposed System
Developing an innovative and accurate mushroom classification system is paramount for the safeguarding of public health, the promotion of sustainable foraging practices, and the conversation of biodiversity.The purpose of this project is to utilize ML algorithms to develop a robust and user-friendly solution that not only prevents mushroom-related poisonings but also empowers foragers, culinary enthusiasts, and researchers with a reliable tool for responsible mushroom-related poisonings but also empowers foragers, culinary enthusiasts, and researchers with a reliable tool for responsible mushroom identification.By bridging the gap between technology and mycology, this proposed classification system seeks to make a meaningful contribution to global health, education, and environmental stewardship.

System Architecture
The system architecture design for the mushroom classification into edible or non-edible categories using machine learning algorithms is a sophisticated blueprint that intricately weaves together various components to create a robust and efficient framework.At the heart of this architecture is the data flow, starting with the input layer where mushroom images are uploaded for classification.This initiates a cascade of processes, beginning with a preprocessing module that standardizes and augments the raw images.The preprocessed data then flows into the feature extraction layer.Following feature extraction, the system incorporates a model training pipeline, where the machine learning model learns the complex patterns and relationships within the dataset.The training process involves iterations and adjustments of hyperparameters to optimize the model's performance.Once trained, the model transitions into the evaluation phase, where it is rigorously tested on a separate test dataset to assess its accuracy, precision, recall, and other relevant metrics.The performance evaluation offers important information about the model's capacity for generalization as well as its precision in dividing mushrooms into edible and inedible categories.The user interface module plays a pivotal role in user interaction, offering a seamless platform for users to upload mushroom images and receive realtime classification results.This module serves as the bridge between the user and the underlying machine learning model, enhancing accessibility and usability.In summary, the system architecture for mushroom classification is a comprehensive and intricately designed framework that harmonizes data processing, model training, user interaction, scalability, security, and maintenance.This architecture serves as the backbone for a sophisticated and user-friendly mushroom classification system, providing accurate and reliable results for users navigating the diverse world of mushrooms.

Layers of Convolution
CNNs have three main types of layers: full layer (FC), pooling layer, and convolution layer.When these layers are combined the CNN architecture is created.To build the model, we'll make use of the sequential model from the Keras library.The convolutional neural network will next be built by adding layers.The first 2 Conv2D layers used 32 filters with a 5.5 kernel size.The MaxPool2D layer will select the highest value from each 2X2 pixel region of the image when the pool size is set to (2,2).As a result, the image's dimensions will shrink by a factor of 2. The dropout rate in the dropout layer was kept constant at 0.25, which means that neurons chosen at random make up 25% of the population.With a few changes to the parameters, we apply these three layers again.To convert 2-D data into a vector in 1-D space, we then apply a flattened layer.This layer is followed by a dropout layer, a thick layer, and another thicker layer.By supplying a probability value, this layer estimates which of the seven alternatives has the highest likelihood.It does this by using the SoftMax activation function.

System Implementation
At this level, we attempt to evaluate the functionality of our application using Python as a programming language.The application is broken up into a variety of modules before being programmed for deployment.

Figure 2 :
Figure 2: System Architecture Design of Convolution Neural Network

Figure 5 :
Figure 5: Output of given Mushroom image and showing it is deemed unfit for consumption