# Machine Learning-Based Classification of Mushrooms Using a Smartphone Application
## 4 Discussion
While high levels of overall accuracy were relatively easy to reach, more granular metrics, such as sensitivity and specificity, showed some variation between the two platforms. Interestingly, the smartphone-based method demonstrated greater sensitivity, resulting in a lower false-negative rate. If our sample was a toxic mushroom, the smartphone would be less likely to misidentify it as an edible one. Based on the results of inter-phone testing, our trained models generated consistent performance metrics regardless of the employed platform. We automatically resize captured images to the optimal image resolution for each of the devices to ensure that our mobile application and trained models produce the best results. The sheer diversity of mushroom genera and species is one limitation of our classification model. The current model provides proof-of-concept for classifying mushrooms at the genus level, whereas our future work will concentrate on refining classification models to discriminate among species within specific genera. The current supervised-learning method provides the pre-trained class with the closest matching label. While the probability calculation provided a measure of image similarity to the classes defined in database, the conventional discriminative classification is by definition unable to correctly process images from new and merging classes. Future work will involve the implementation of non-exhaustive learning techniques capable of automatically detecting the presence of new, never-before-seen classes in order to enable the detection and labeling of species not defined in the initial training database [31,32]. **Supplementary Materials:** The following supporting information can be downloaded at: [[https://www.mdpi.com/article/10.3390/app122211685/s1](https://www.mdpi.com/article/10.3390/app122211685/s1)]([https://www.mdpi.com/article/10.3390/app122211685/s1](https://www.mdpi.com/article/10.3390/app122211685/s1)), Figure S1: Comparison of sensitivity and specificity for the two classes of _Gryomitra_ and _Morchella._; Figure S2: Comparison of sensitivity and specificity for the three classes of _Clavulina_, _Inocybe_, and _Marasmusius_; Figure S3: Comparison of sensitivity and specificity for the two classes of _Gryomitra_ and _Morchella._; Figure S4: Comparison of sensitivity and specificity for _Clavulina_, _Inocybe_, and _Marasmusius_ classes. ; Figure S5: Comparison of the class accuracies in three different classifiers computed using 10\(\times\) cross-validation. ; Table S1: Computed mean accuracies and confidence interval for classification performed using 2-, 3-, and 5-classes models. ; Table S2: Significance test results. **Author Contributions:** Data curation, J.J.L., B.R. and M.C.A. ; Formal analysis, J.J.L. ; Funding acquisition, E.B. ; Investigation, J.J.L., M.C.A., B.R. and E.B. ; Methodology, J.J.L. and E.B. ; Project administration, E.B. ; Supervision, M.C.A. and E.B. ; Writing--original draft, J.J.L. and E.B. ; Writing--review & editing, M.C.A., B.R. and E.B. All authors have read and agreed to the published version of the manuscript. **Funding:** U.S. Department of Agriculture, Agricultural Research Service, under Agreement No. 59-8072-1-002. **Institutional Review Board Statement:** Not applicable. **Data Availability Statement:** Not applicable. **Acknowledgments:** This research was supported by the Center for Food Safety Engineering at Purdue University, funded by the U.S. Department of Agriculture, Agricultural Research Service, under Agreement No. 59-8072-1-002. Any opinions, findings, conclusions, or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the view of the U.S. Department of Agriculture. **Conflicts of Interest:** The author declare no conflict of interest.