Detection of Wild Mushrooms Using Machine Learning and Computer Vision
Abstract
1. Introduction
- Contribution 1: The introduction and use of a structured, multispectral-image dataset (WOES) that enables the training and benchmarking of object detection models for wild mushroom identification. While the dataset is not publicly released due to ongoing data protection and field study constraints, this work demonstrates how tailored annotations, spectral alignment, and probabilistic spatial mapping techniques can significantly enhance the detection of Macrolepiota procera in natural environments. The dataset supports the verifiable development of our UAV-based detection pipeline, and the design principles (e.g., class distribution, multispectral preprocessing, vegetation index integration) are fully described for reproducibility. As neither OMPES nor WOES are publicly available, access requests should be directed to the corresponding author.
- Contribution 2: The introduction of a cutting-edge approach for locating wild mushrooms using UAVs and multispectral cameras. This technique combines real-time UAV surveillance with multispectral photos, enabling the identification of wild mushroom cultivation using the WOES dataset.
- Contribution 3: A proposed architecture for real-time monitoring with low-cost equipment. The ML models developed and presented in this work can be applied to images or videos acquired by either UAVs or mobile devices, enabling the detection of wild mushrooms from both ground and aerial imagery. These models can be evaluated in the present study’s evaluation of models to determine the most reliable model configuration and technique for the dataset.
2. Related Work
2.1. Related Work on Mushroom Cultivation
2.2. Related Work on the Use of YOLOv5 in Precision Farming
3. Materials and Methods
3.1. Data Collection
3.2. Hardware and Software Setup
3.3. Data Preprocessing and Annotation
- Stage 1: The collected band pictures are geometrically aligned to a common reference spectrum, specifically the REDEDGE band, to achieve precise spatial matching.
- Stage 2: The Normalised Difference Red Edge Index (NDRE) is then computed to emphasise regions with elevated chlorophyll concentration, potentially signifying favourable conditions for wild mushroom growth.
- Stage 3: The technique finds possible mushroom locations within the studied area based on NDRE values.
- Stage 4: A probability score is assigned to each identified location, assessing the possibility of mushroom existence.
- Stage 5: The processed RGB image, featuring bounding boxes and corresponding probability scores, is delivered as a PNG file over WiFi to the ground-based control station for visualisation and decision-making.
- Images of mixed-pixel resolutions (907, regular cameras).
- Mushroom class, with 543 labels.
- Annotations were initially performed manually until a high level of accuracy was achieved, after which the preliminary results were used to assist the remaining annotation process.
3.4. Calculation of the Normalised Difference Red Edge Index
3.5. Model Architecture and Training Setup
- Samples: The data type should be np.float32, and each feature should be placed in a separate column.
- Nclusters (K): Number of clusters required.
- Criteria: The condition for terminating an iteration. When these conditions are met, the algorithm stops iterating.
- Attempts: Specifies the number of times the algorithm is conducted with different beginning labellings. The method returns the labels that result in the highest degree of compactness. This density is returned as the output.
- Flags: This flag specifies how initial centres are obtained.
3.6. Training and Evaluation
4. Results and Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Park, H.J. Current Uses of Mushrooms in Cancer Treatment and Their Anticancer Mechanisms. Int. J. Mol. Sci. 2022, 23, 10502. [Google Scholar] [CrossRef] [PubMed]
- Garibay-Orijel, R.; Córdova, J.; Cifuentes, J.; Valenzuela, R.; Estrada-Torres, A.; Kong, A. Integrating Wild Mushrooms Use into a Model of Sustainable Management for Indigenous Community Forests. For. Ecol. Manag. 2009, 258, 122–131. [Google Scholar] [CrossRef]
- Agrahar-Murugkar, D.; Subbulakshmi, G. Nutritional Value of Edible Wild Mushrooms Collected from the Khasi Hills of Meghalaya. Food Chem. 2005, 89, 599–603. [Google Scholar] [CrossRef]
- Rózsa, S.; Andreica, I.; Poșta, G.; Gocan, T.M. Sustainability of Agaricus blazei Murrill Mushrooms in Classical and Semi-Mechanized Growing System, through Economic Efficiency, Using Different Culture Substrates. Sustainability 2022, 14, 6166. [Google Scholar] [CrossRef]
- Moysiadis, V.; Sarigiannidis, P.; Vitsas, V.; Khelifi, A. Smart Farming in Europe. Comput. Sci. Rev. 2021, 39, 100345. [Google Scholar] [CrossRef]
- Boursianis, A.D.; Papadopoulou, M.S.; Diamantoulakis, P.D.; Liopa-Tsakalidi, A.; Barouchas, P.; Salahas, G.; Karagiannidis, G.K. Internet of Things (IoT) and Agricultural Unmanned Aerial Vehicles (UAVs) in Smart Farming: A Comprehensive Review. Internet Things 2022, 18, 100187. [Google Scholar] [CrossRef]
- Amatya, S.; Karkee, M.; Zhang, Q.; Whiting, M.D. Automated Detection of Branch Shaking Locations for Robotic Cherry Harvesting Using Machine Vision. Robotics 2017, 6, 31. [Google Scholar] [CrossRef]
- Uryasheva, A.; Kalashnikova, A.; Shadrin, D.; Evteeva, K.; Moskovtsev, E.; Rodichenko, N. Computer Vision-Based Platform for Apple Leaves Segmentation in Field Conditions to Support Digital Phenotyping. Comput. Electron. Agric. 2022, 201, 107269. [Google Scholar] [CrossRef]
- Zahan, N.; Hasan, M.Z.; Malek, M.A.; Reya, S.S. A Deep Learning-Based Approach for Edible, Inedible and Poisonous Mushroom Classification. In Proceedings of the 2021 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD), Dhaka, Bangladesh, 27–28 February 2021; pp. 440–444. [Google Scholar] [CrossRef]
- Picek, L.; Šulc, M.; Matas, J.; Heilmann-Clausen, J.; Jeppesen, T.S.; Lind, E. Automatic Fungi Recognition: Deep Learning Meets Mycology. Sensors 2022, 22, 633. [Google Scholar] [CrossRef] [PubMed]
- Lee, J.J.; Aime, M.C.; Rajwa, B.; Bae, E. Machine Learning-Based Classification of Mushrooms Using a Smartphone Application. Appl. Sci. 2022, 12, 11685. [Google Scholar] [CrossRef]
- Siniosoglou, I.; Argyriou, V.; Bibi, S.; Lagkas, T.; Sarigiannidis, P. Unsupervised Ethical Equity Evaluation of Adversarial Federated Networks. In Proceedings of the 16th International Conference on Availability, Reliability and Security, Vienna, Austria, 17–20 August 2021; pp. 1–6. [Google Scholar] [CrossRef]
- Martínez-Ibarra, E.; Gómez-Martín, M.B.; Armesto-López, X.A. Climatic and Socioeconomic Aspects of Mushrooms: The Case of Spain. Sustainability 2019, 11, 1030. [Google Scholar] [CrossRef]
- Barea-Sepúlveda, M.; Espada-Bellido, E.; Ferreiro-González, M.; Bouziane, H.; López-Castillo, J.G.; Palma, M.; Barbero, G.F. Toxic Elements and Trace Elements in Macrolepiota procera Mushrooms from Southern Spain and Northern Morocco. J. Food Compos. Anal. 2022, 108, 104419. [Google Scholar] [CrossRef]
- Adamska, I.; Tokarczyk, G. Possibilities of Using Macrolepiota procera in the Production of Prohealth Food and in Medicine. Int. J. Food Sci. 2022, 2022, 5773275. [Google Scholar] [CrossRef]
- Chaschatzis, C.; Karaiskou, C.; Goudos, S.K.; Psannis, K.E.; Sarigiannidis, P. Detection of Macrolepiota procera Mushrooms Using Machine Learning. In Proceedings of the 2022 5th World Symposium on Communication Engineering (WSCE), Nagoya, Japan, 16–18 September 2022; pp. 74–78. [Google Scholar] [CrossRef]
- Wei, B.; Zhang, Y.; Pu, Y.; Sun, Y.; Zhang, S.; Lin, H.; Zeng, C.; Zhao, Y.; Wang, K.; Chen, Z. Recursive-YOLOv5 Network for Edible Mushroom Detection in Scenes With Vertical Stick Placement. IEEE Access 2022, 10, 40093–40108. [Google Scholar] [CrossRef]
- Subramani, S.; Imran, A.F.; Abhishek, T.T.M.; Karthik, S.; Yaswanth, J. Deep Learning Based Detection of Toxic Mushrooms in Karnataka. Procedia Comput. Sci. 2024, 235, 91–101. [Google Scholar] [CrossRef]
- Wang, Y.; Yang, L.; Chen, H.; Hussain, A.; Ma, C.; Al-gabri, M. Mushroom-YOLO: A Deep Learning Algorithm for Mushroom Growth Recognition Based on Improved YOLOv5 in Agriculture 4.0. In Proceedings of the 2022 IEEE 20th International Conference on Industrial Informatics (INDIN), Perth, Australia, 25–28 July 2022; pp. 239–244. [Google Scholar] [CrossRef]
- Panyasiri, K.; Srisai, T.; Srisai, P.; Chaiyaprasert, W.; Srisai, S. Mushroom Spawn Quality Classification with Machine Learning. Comput. Electron. Agric. 2020, 179, 105814. [Google Scholar] [CrossRef]
- Tutuncu, K.; Cinar, I.; Kursun, R.; Koklu, M. Edible and Poisonous Mushrooms Classification by Machine Learning Algorithms. In Proceedings of the 2022 11th Mediterranean Conference on Embedded Computing, Budva, Montenegro, 7–10 June 2022; pp. 1–4. [Google Scholar] [CrossRef]
- Yin, H.; Yi, W.; Hu, D. Computer vision and machine learning applied in the mushroom industry: A critical review. Comput. Electron. Agric. 2022, 198, 107015. [Google Scholar] [CrossRef]
- Zhang, D.; Huang, Z.K.; Wang, H.; Wu, Y.P.; Wang, Y.; Zou, J.H. Research and Application of Wild Mushrooms Classification Based on Multi-Scale Features to Realize Hyperparameter Evolution. J. Graph. 2022, 43, 580–589. Available online: http://www.txxb.com.cn/EN/10.11996/JG.j.2095-302X.2022040580 (accessed on 17 June 2025).
- Luo, Y.; Zhang, Y.; Sun, X.; Dai, H.; Chen, X. Intelligent Solutions in Chest Abnormality Detection Based on YOLOv5 and ResNet50. J. Healthc. Eng. 2021, 2021, 2267635. [Google Scholar] [CrossRef] [PubMed]
- Wang, A.; Peng, T.; Cao, H.; Xu, Y.; Wei, X.; Cui, B. TIA-YOLOv5: An Improved YOLOv5 Network for Real-Time Detection of Crop and Weed in the Field. Front. Plant Sci. 2022, 13, 1091655. [Google Scholar] [CrossRef]
- Mohanty, T.; Pattanaik, P.; Dash, S.; Tripathy, H.P.; Holderbaum, W. Smart Robotic System Guided with YOLOv5 Based Machine Learning Framework for Efficient Herbicide Usage in Rice (Oryza sativa L.) under Precision Agriculture. Comput. Electron. Agric. 2025, 231, 110032. [Google Scholar] [CrossRef]
- Yang, W.; Qiu, X. A Novel Crop Pest Detection Model Based on YOLOv5. Agriculture 2024, 14, 275. [Google Scholar] [CrossRef]
- Raza, A.; Shaikh, M.K.; Siddiqui, O.A.; Ali, A.; Khan, A. Enhancing Agricultural Pest Management with YOLO V5: A Detection and Classification Approach. UMT Artif. Intell. Rev. 2023, 3, 21–43. [Google Scholar] [CrossRef]
- Jiang, Z.; Yin, B.; Lu, B. Precise Apple Detection and Localization in Orchards using YOLOv5 for Robotic Harvesting Systems. arXiv 2024. [Google Scholar] [CrossRef]
- Khanal, S.R.; Sapkota, R.; Ahmed, D.; Bhattarai, U.; Karkee, M. Machine Vision System for Early-stage Apple Flowers and Flower Clusters Detection for Precision Thinning and Pollination. arXiv 2023. [Google Scholar] [CrossRef]
- Choudhary, V.; Guha, P.; Mishra, S. Novel YOLOv5 Model for Automatic Detection of Cowpea Leaves: Smart Agriculture. Asian J. Converg. Technol. 2023, 9, 1–6. [Google Scholar] [CrossRef]
- Xue, J.; Su, B. Significant Remote Sensing Vegetation Indices: A Review of Developments and Applications. J. Sens. 2017, 2017, 1353691. [Google Scholar] [CrossRef]
- Davidson, C.; Jaganathan, V.; Sivakumar, A.N.; Czarnecki, J.M.P.; Chowdhary, G. NDVI/NDRE Prediction from Standard RGB Aerial Imagery Using Deep Learning. Comput. Electron. Agric. 2022, 203, 107396. [Google Scholar] [CrossRef]
- Gitelson, A.A.; Viña, A.; Ciganda, V.; Rundquist, D.C.; Arkebauer, T.J. Remote estimation of canopy chlorophyll content in crops. Geophys. Res. Lett. 2005, 32. [Google Scholar] [CrossRef]
- Solano-Alvarez, N.; Valencia-Hernández, J.A.; Vergara-Pineda, S.; Millán-Almaraz, J.R.; Torres-Pacheco, I.; Guevara-González, R.G. Comparative Analysis of the NDVI and NGBVI as Indicators of the Protective Effect of Beneficial Bacteria in Conditions of Biotic Stress. Plants 2022, 11, 932. [Google Scholar] [CrossRef] [PubMed]
- Steven, M.D. The Sensitivity of the OSAVI Vegetation Index to Observational Parameters. Remote Sens. Environ. 1998, 63, 49–60. [Google Scholar] [CrossRef]
- Kılıç, D.K.; Nielsen, P. Comparative Analyses of Unsupervised PCA K-Means Change Detection Algorithm from the Viewpoint of Follow-Up Plan. Sensors 2022, 22, 9172. [Google Scholar] [CrossRef] [PubMed]
- Skalski, P. Make Sense. 2025. Available online: https://github.com/SkalskiP/make-sense/ (accessed on 17 June 2025).
- Goutte, C.; Gaussier, E. A Probabilistic Interpretation of Precision, Recall and F-Score, with Implication for Evaluation. In Proceedings of the Advances in Information Retrieval, Santiago de Compostela, Spain, 21–23 March 2005; Losada, D.E., Fernández-Luna, J.M., Eds.; Springer: Berlin/Heidelberg, Germany, 2005; pp. 345–359. [Google Scholar]
- Deng, L.; Mao, Z.; Li, X.; Hu, Z.; Duan, F.; Yan, Y. UAV-based multispectral remote sensing for precision agriculture: A comparison between different cameras. ISPRS J. Photogramm. Remote Sens. 2018, 146, 124–136. [Google Scholar] [CrossRef]
- Sa, I.; Chen, Z.; Popovic, M.; Khanna, R.; Liebisch, F.; Nieto, J.; Siegwart, R. weedNet: Dense Semantic Weed Classification Using Multispectral Images and MAV for Smart Farming. arXiv 2017. [Google Scholar] [CrossRef]
- Moysiadis, V.; Chaschatzis, C.; Triantafyllou, A.; Liatifis, A.; Siniosoglou, I.; Kelly, V.; Karaiskou, C.; Tsiamitros, D.; Kakamoukas, G.; Krestou, A.; et al. Pleurotus Mushroom Dataset. 2025. Available online: https://ieee-dataport.org/documents/pleurotus-mushroom-dataset (accessed on 17 June 2025).
Study | Focus Area | Techniques Used | Limitation or Gap | Gap Filled by Our Work |
---|---|---|---|---|
[18] | Toxic vs. non-toxic classification using deep learning | SVM, ResNet50, YOLOv5, AlexNet | No species-specific or habitat localization | Adds spatial mapping and species-specific wild detection |
[19] | Spawn quality detection in controlled environments | DNN, SVM, KNN, NCC, Decision Trees | Not applicable to wild mushrooms or field detection | Applies real-time object detection in natural habitats |
[20] | Growth detection of shiitake mushrooms indoors | Improved YOLOv5, Cloud system (iMushroom) | Limited to indoor, controlled conditions | Extends YOLOv5 use to outdoor, wild scenarios |
[21] | Classification of edible vs. poisonous mushrooms using tabular data | C4.5, Naive Bayes, SVM, Logistic Regression (WEKA) | No visual or spatial recognition, only dataset-based classification | Utilizes vision-based detection rather than tabular data |
[22] | Review of CV/ML applications in mushroom production | Survey and analysis of ML/CV methods | Lacks implementation or model deployment; broad scope | Implements a field-deployable, targeted solution addressing specific species in wild |
[17] | Detection of edible mushrooms using high-resolution imaging and real-time object recognition | Object detection algorithm with industrial cameras; cloud computing support | Focuses on edible mushroom state detection, not species identification or spatial mapping in wild environments | Adds species-specific identification and geospatial mapping in natural, unstructured forest settings |
[23] | Wild mushroom classification using attention mechanisms and lightweight deployment | CBAM, multi-scale fusion, hyperparameter evolution, enhanced YOLOv5 | Focused on recognition and mobile deployment; lacks spatial mapping for in situ wild mushroom harvesting | Adds geographic probability mapping and detection integration for wild harvesting scenarios |
[24] | Medical image analysis using YOLOv5 for chest anomaly detection in X-rays | YOLOv5 with ResNet50, Fast RCNN, EfficientDet, evaluation on VinBigData dataset | Non-agricultural application; limited to clinical X-ray data without environmental or field context | Extends YOLOv5 utility to outdoor, real-time agricultural object detection and habitat analysis |
[25,26,27,28,29,30,31] | Smart agriculture applications, including crop/weed detection, pest control, and plant health monitoring | YOLOv5 with attention modules, transformers, data augmentation, transfer learning | Task-specific models; lacks integrated species-level detection with environmental spatial correlation | Combines YOLOv5 with spatial mapping to support wild mushroom detection and area prediction |
Band | Left | Up |
---|---|---|
NIR | 16 | 24 |
RED | 35 | 15 |
GREEN | 29 | 2 |
RGB | 21 | 20 |
Band | Lower Threshold (kHz) | Upper Threshold (kHz) |
---|---|---|
NIR | 38 | 40 |
RED | 37 | 39 |
GREEN | 38 | 40 |
RGB | 16 | 18 |
Hyperparameter | Default | Evolve (Wild Mushrooms) | Evolve (Characteristic Procera) |
---|---|---|---|
lr0 | 0.01 | 0.01048 | 0.01451 |
lrf | 0.01 | 0.01503 | 0.01 |
momentum | 0.937 | 0.93603 | 0.90295 |
weight_decay | 0.0005 | 0.00048 | 0.00042 |
warmup_epochs | 3.0 | 4.1597 | 3.9362 |
warmup_momentum | 0.8 | 0.95 | 0.54134 |
warmup_bias_lr | 0.1 | 0.12656 | 0.10064 |
box | 0.05 | 0.03872 | 0.04636 |
cls | 0.5 | 0.37151 | 0.4517 |
cls_pw | 1.0 | 1.0625 | 1.0195 |
obj | 1.0 | 1.0087 | 0.97986 |
obj_pw | 1.0 | 2.0 | 2.0 |
iou_t | 0.20 | 0.2 | 0.2 |
anchor_t | 4.0 | 5.5727 | 2.879 |
fl_gamma | 0.0 | 0.0 | 0.0 |
hsv_h | 0.015 | 0.02162 | 0.01234 |
hsv_s | 0.7 | 0.70183 | 0.9 |
hsv_v | 0.4 | 0.33002 | 0.43276 |
degrees | 0.0 | 0.0 | 0.0 |
translate | 0.1 | 0.03293 | 0.11176 |
scale | 0.5 | 0.42495 | 0.43276 |
shear | 0.0 | 0.42495 | 0.0 |
perspective | 0.0 | 0.0 | 0.0 |
flipud | 0.0 | 0.0 | 0.0 |
fliplr | 0.5 | 0.5 | 0.5 |
mosaic | 1.0 | 0.61121 | 0.43276 |
mixup | 0.0 | 0.0 | 0.0 |
copy_paste | 0.0 | 0.0 | 0.0 |
Model | Hyperparameters | mAP | P | R | F1 |
---|---|---|---|---|---|
Wild Mushrooms | Default | 0.95 | 0.97 | 0.91 | 0.94 |
Wild Mushrooms | Evolved | 0.98 | 0.98 | 0.94 | 0.96 |
Characteristic Procera | Default | 0.75 | 0.91 | 0.72 | 0.80 |
Characteristic Procera | Evolved | 0.83 | 0.89 | 0.82 | 0.85 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chaschatzis, C.; Karaiskou, C.; Iakovidou, C.; Radoglou-Grammatikis, P.; Bibi, S.; Goudos, S.K.; Sarigiannidis, P.G. Detection of Wild Mushrooms Using Machine Learning and Computer Vision. Information 2025, 16, 539. https://doi.org/10.3390/info16070539
Chaschatzis C, Karaiskou C, Iakovidou C, Radoglou-Grammatikis P, Bibi S, Goudos SK, Sarigiannidis PG. Detection of Wild Mushrooms Using Machine Learning and Computer Vision. Information. 2025; 16(7):539. https://doi.org/10.3390/info16070539
Chicago/Turabian StyleChaschatzis, Christos, Chrysoula Karaiskou, Chryssanthi Iakovidou, Panagiotis Radoglou-Grammatikis, Stamatia Bibi, Sotirios K. Goudos, and Panagiotis G. Sarigiannidis. 2025. "Detection of Wild Mushrooms Using Machine Learning and Computer Vision" Information 16, no. 7: 539. https://doi.org/10.3390/info16070539
APA StyleChaschatzis, C., Karaiskou, C., Iakovidou, C., Radoglou-Grammatikis, P., Bibi, S., Goudos, S. K., & Sarigiannidis, P. G. (2025). Detection of Wild Mushrooms Using Machine Learning and Computer Vision. Information, 16(7), 539. https://doi.org/10.3390/info16070539