Submitted:
24 November 2025
Posted:
26 November 2025
You are already at the latest version
Abstract
Automation and computer vision are increasingly vital in modern agriculture, yet mushroom harvesting remains largely manual due to complex morphology and occluded growing environments. This study investigates the application of deep learning–based instance segmentation and keypoint detection to enable robotic harvesting of Lentinula edodes (shiitake) mushrooms. A dedicated RGB-D image dataset, the first open-access RGB-D dataset for mushroom harvesting, was created using a Microsoft Azure DK 3D camera under varied lighting and backgrounds. Two state-of-the-art segmentation models, YOLOv8-seg and Detectron2 Mask R-CNN, were trained and evaluated under identical conditions to compare accuracy, inference speed, and robustness. YOLOv8 achieved higher mean average precision (mAP = 67.9) and significantly faster inference, while Detectron2 offered comparable qualitative performance and greater flexibility for integration into downstream robotic systems. Experiments comparing RGB and RG-D inputs revealed minimal accuracy differences, suggesting that colour cues alone provide sufficient information for reliable segmentation. A proof-of-concept keypoint-detection model demonstrated the feasibility of identifying stem cut-points for robotic manipulation. These findings confirm that deep learning–based vision systems can accurately detect and localise mushrooms in complex environments, forming a foundation for fully automated harvesting. Future work will focus on expanding datasets, incorporating true four-channel RGB-D networks, and integrating perception with robotic actuation for intelligent agricultural automation.
Keywords:
1. Introduction
1.1. Background and Motivation
1.2. The Challenge of Mushroom Harvesting
1.3. Research Context
1.4. Objectives and Contributions
- -
- Construct a novel RGB-D dataset of shiitake mushrooms containing pixel-level annotations for deep-learning training.
- -
- Compare YOLOv8-seg and Mask R-CNN in terms of accuracy, speed, and robustness under variable conditions.
- -
- Evaluate the effect of depth data on model performance.
- -
- Demonstrate proof-of-concept keypoint-based cut-point localisation for robotic harvesting.
- -
- Creation of the first open-access RGB-D dataset dedicated to mushroom-harvesting research.
- -
- A comparative quantitative and qualitative evaluation of two state-of-the-art segmentation frameworks, highlighting trade-offs between real-time efficiency and detection accuracy.
- -
- Experimental demonstration of a multi-stage perception framework suitable for integration with a robotic harvesting system.
1.5. Paper Organization
2. Materials and Methods
2.1. Initial Hypothesis
2.2. Dataset
2.2.1. Choice of Sensor
2.2.2. Data Collection
2.3. Model Choice and Annotation
2.3.1. Data Annotation
- Objects were outlined as accurately as possible.
- Very small or unclear mushrooms were omitted.
- Only visible portions were annotated.
- In occluded cases, the portion including the cap was annotated.
2.3.2. Instance Segmentation Algorithms
- Mask R-CNN (Detectron2 implementation), long regarded as an instance segmentation benchmark.
- YOLOv8-seg, the recent YOLO variant supporting detection, segmentation, classification, and pose estimation.
2.3.3. YOLOv8
2.3.4. Detectron2
2.3.5. Pre-training
2.4. Model Training
2.4.1. Hyperparameters
2.4.2. YOLOv8 Training
2.4.3. Detectron2 Mask R-CNN
2.5. Depth Model Training
2.5.1. Depth Frame Matching and Integration
2.5.2. RG-D Training
2.6. Depth Reconstruction
2.6.1. Mushroom Segmentation and Point-Cloud Reconstruction
3.7. Cut-Point Estimation
3.7.1. Keypoint Annotation
2.7.2. YOLOv8-Pose
2.7.3. Detectron2
2.8. Evaluation Metrics
3. Results
3.1. Colour Instance Segmentation
3.2. RG-D Instance Segmentation
3.3. Cut-Point Estimation
4. Discussion
4.1. Colour Instance Segmentation
4.2. RGB vs RG-D
4.3. Depth Reconstruction
4.4. Cut-Point Estimation
5. Further Work
5.1. Dataset and Model Development
5.2. Integration with Robotic Harvesting Systems
5.3. Broader Applications and Research Directions
6. Conclusions
Supplementary Materials
Author Contributions
Funding
Conflicts of Interest
Abbreviations
| IoU | Intersection over UnionAP Average Precision |
| RGB-D | Red, green, blue and depth (3D camera) |
| RGB | Red, green and blue. |
| RG-D | Reg, green and depth (with blue channel removed). |
| CNN | Convolutional Neural Network |
References
- Licardo, J.T.; Domjan, M.; Orehovački, T. Intelligent Robotics—A Systematic Review of Emerging Technologies and Trends. Electronics 2024, 13, 542. [CrossRef]
- Soori, M.; Dastres, R.; Arezoo, B.; Karimi, F.; Jough, G. Intelligent robotic systems in Industry 4.0: A review. Journal of Advanced Manufacturing Science and Technology 2024, pp.2024007 – 0.
- Liakos, K.G.; Busato, P.; Moshou, D.; Pearson, S.; Bochtis, D. Machine learning in agriculture: A review. Sensors 2018, 18, 2674.
- Boussetta, R.; Smail, R.; Hadjaj-Castro, A.; Foucher, S. Object detection in agriculture using deep learning: A review and case study. Applied Sciences 2021, 11, 8102.
- Wang, D.; Cao, W.; Zhang, F.; Li, Z.; Xu, S.; Wu, X. A Review of Deep Learning in Multiscale Agricultural Sensing. Remote Sens. 2022, 14, 559. [CrossRef]
- Sa, I.; Ge, Z.; Dayoub, F.; Upcroft, B.; Perez, T.; McCool, C. DeepFruits: A fruit detection system using deep neural networks. Sensors 2016, 16, 1222.
- Singh, R., Nisha, R.; Naik, R.; Upendar, K.; Nickhil, C.; Chandra Deka, S. Sensor fusion techniques in deep learning for multimodal fruit and vegetable quality assessment: A comprehensive review. Food Measure 2024, 18, 8088–8109. [CrossRef]
- Miao, Z.; Yu, X.; Li, N.; Zhang, Z.; He, C.; Li, Z.; Deng, C.; Sun, T. Efficient tomato harvesting robot based on image processing and deep learning. Precision Agric 2023 24, 254–287. [CrossRef]
- Yin, H.; Yi, W.; Hu, D.; Computer vision and machine learning applied in the mushroom industry: A critical review, Computers and Electronics in Agriculture 2022, Volume 198, 107015, ISSN 0168-1699. [CrossRef]
- Williams, H.; Jones, A.; Mayol-Cuevas, W. Automatic mushroom detection and localisation using computer vision and deep learning. Journal of Agricultural Engineering 2020, 51, 89–97.
- Koirala, B.; Zakeri, A.; Kang, J.; Kafle, A.; Balan, V.; Merchant, F.A.; Benhaddou, D.; Zhu, W. Robotic Button Mushroom Harvesting Systems: A Review of Design, Mechanism, and Future Directions. Appl. Sci. 2024, 14, 9229. [CrossRef]
- Wang, X.; Deep Learning in Object Recognition, Detection, and Segmentation", Foundations and Trends. Signal Processing 2016, Vol. 8: No. 4, pp 217-382. [CrossRef]
- Aziz, L.; Haji Salam, M.S.B.; Sheikh, U.U.; Ayub, S. Exploring Deep Learning-Based Architecture, Strategies, Applications and Current Trends in Generic Object Detection: A Comprehensive Review, IEEE Access 2020, vol. 8, pp. 170461-170495, . [CrossRef]
- Zhao, Z.; Zheng, P.; Xu, S.; Wu, X. Object Detection With Deep Learning: A Review, IEEE Transactions on Neural Networks and Learning System 2019, vol. 30, no. 11, pp. 3212-3232. [CrossRef]
- Sujatanagarjuna, A.; Kia, S.; Briechle, D.F.; Leiding, B. MushR: A Smart, Automated, and Scalable Indoor Harvesting System for Gourmet Mushrooms. Agriculture 2023, 13, 1533. [CrossRef]
- He, K.; Gkioxari, G.; Dollár, P.; and Girshick, R.; Mask r-cnn, in Proceedings of the IEEE international conference on computer vision, 2017, pp. 2961–2969.
- Jocher, G.; Chaurasia, A.; and Qiu, J.; YOLO by Ultralytics, version 8.0.0, Jan. 2023. Available from: https://github.com/ultralytics/ultralytics.
- Baisa, N.L.; Al-Diri, B. Mushrooms detection, localization and 3d pose estimation using rgb-d sensor for robotic-picking applications, arXiv preprint arXiv:2201.02837 2022, 2022.
- Rong, J.; Wang, P,; Yang, Q.; Huang, F. A field-tested harvesting robot for oyster mushroom in greenhouse, Agronomy [online], vol. 11, no. 6 2021, 2021, ISSN: 2073-4395. [CrossRef]
- Devika, G. & Karegowda, A. 2021). Identification of Edible and Non-Edible Mushroom Through Convolution Neural Network. 2021, 10.2991/ahis.k.210913.039.
- Djekić, I., Velebit, B., Pavlić, B. et al. Food Quality 4.0: Sustainable Food Manufacturing for the Twenty-First Century. Food Eng Rev, 2023, 15, 577–608. [CrossRef]
- Hassoun, A. Food sustainability 4.0: harnessing fourth industrial revolution technologies for sustainable food systems. Discov Food, 2025, 5, 171 . [CrossRef]
- 3. T. Limited. “Xtion pro live.” Accessed: 18/08/2023. (), available from: http:// xtionprolive.com/asus-3d-depth-camera/asus-xtion-pro-live.
- Microsoft. “Azure kinect dk.” Accessed: 18/08/2023. (), available from: https://azure. microsoft.com/en-gb/products/kinect-dk.
- OpenNI. “Openni 2 sdk binaries docs.” Accessed: 18/08/2023. (), available from: https: //structure.io/openni.
- Microsoft, Azure kinect dk documentation. https://learn.microsoft.com/en-us/ azure/kinect-dk/, Accessed: 18/08/2023, 2022.
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks, Advances in neural information processing systems, 2015, vol. 28.
- Liu, W.; Anguelov, D.; Erhan, D. et al., Ssd: Single shot multibox detector, in proceedings of Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11– 14, 2016, Proceedings, Part I 14, Springer, 2016, pp. 21–37.
- Jocher, G.; Chaurasia, A.; and Qiu, J. YOLO by Ultralytics, version 8.0.0, Jan. 2023. available from: https://github.com/ultralytics/ultralytics.
- Lin, T.-Y.; Maire, M.; Belongie, S.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft COCO: Common objects in context. European Conference on Computer Vision (ECCV) 2014, 740–755.
- Bisong, E. (2019). Google Colaboratory. In: Building Machine Learning and Deep Learning Models on Google Cloud Platform. Apress, Berkeley, CA. [CrossRef]
- Randles, B.M.; Pasquetto, I.V.; Golshan, M.S.; Borgman, C.L. Using the Jupyter Notebook as a Tool for Open Science: An Empirical Study, 2017 ACM/IEEE Joint Conference on Digital Libraries (JCDL), Toronto, ON, Canada, 2017, pp. 1-2. [CrossRef]
- The opencv reference manual, 2.4.9.0, Itseez, Apr. 2014.
- Zhou, Q.Y.; Park, J.; Koltun, V. Open3D: A modern library for 3D data processing, arXiv:1801.09847 2018, 2018.
- CVAT.ai Corporation, Computer Vision Annotation Tool (CVAT), version 2.2.0, Sep. 2022. available from: https://github.com/opencv/cvat.










| Metric | Detectron 2 Mask R-CNN | YOLOv8m-seg |
| AP@[IoU = 0.50:0.95] | 55.5 | 67.9 |
| AP@[IoU = 0.50] | 77.7 | 94.9 |
| Total Inference Time (ms) Pure Compute Time (ms) |
420.5 77.5 |
60.2 6.0 |
| Metric | AP | AP@.50 | AP@.50 | AR |
| Bounding Box (RGB) | 52.442 | 77.379 | 58.416 | 57.400 |
| Bounding Box (RG-D) | 51.410 | 76.259 | 59.554 | 56.300 |
| Segmentation (RGB) | 55.446 | 77.653 | 64.246 | 59.700 |
| Segmentation (RG-D) | 53.653 | 75.596 | 63.339 | 58.100 |
| Metric | AP50 | AP50:95 | |
| YOLOv8-pose | Bounding box | 8.29 | 0.02 |
| Keypoint | 0.44 | 0.26 | |
| Detectron | Bounding box | 14.22 | 0.02 |
| Keypoint | 0.40 | 0.00 |
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 (http://creativecommons.org/licenses/by/4.0/).