A High-Accuracy Contour Segmentation and Reconstruction of a Dense Cluster of Mushrooms Based on Improved SOLOv2
Abstract
:1. Introduction
- (1)
- The PR-SOLOv2 instance segmentation model is introduced that leverages PointRend to improve segmentation accuracy. This model effectively handles dense overlapping mushrooms and enhances boundary accuracy, achieving a segmentation accuracy of 93.04%.
- (2)
- The work proposes a novel contour reconstruction method based on the curvature and length of mask contours obtained through instance segmentation. This approach enables the reconstruction of mushroom contours with high precision.
- (3)
- The work introduces a least-squares ellipse fitting technique for mushrooms with regular shapes. For irregularly shaped or occluded mushrooms, a corner-based segmentation method is applied to accurately reconstruct contours. This classification and fitting approach significantly improves the quality of contour reconstruction.
- (4)
- The proposed work demonstrates a successful segmentation rate of 98.92%. This high success rate shows the effectiveness of the proposed methods.
2. Related Work
3. Mushroom Instance Segmentation Dataset Construction
4. Research on High-Accuracy Mushroom Segmentation
5. Contour Reconstruction of Mushroom
5.1. Reconstruction of Regular Contours
5.2. Reconstruction of Irregular Contours
- (1)
- Detect corner points at abrupt changes in contour shape. If the concave contours cannot be ignored, define its start and end point as corner points;
- (2)
- By corner coordinates, the coordinate line between adjacent corner coordinates is regarded as a sub-contour segment, and the whole mushroom contour is divided into N sub-contour segments;
- (3)
- Calculate the length of each sub-contour segment and choose the longest sub-contour segment;
- (4)
- Based on the longest sub-contour, the mushroom contour is classified and fitted according to the difference in arch curvature and length of the longest sub-contour.
- (5)
- Calculate the arch curvature C of the contour (Equation (4)).
6. Experimental Results and Discussion
6.1. Segmentation Experiment and Discussion Based on PR-SOLOv2
6.1.1. Model Training
6.1.2. Model Evaluation Metrics
6.1.3. Instance Segmentation Results and Discussion
- (1)
- Experiment and result of dense overlapping mushroom segmentation
- (2)
- Segmentation of a tilting mushroom
- (3)
- Segmentation result of tiny mushrooms
- (4)
- Comparison of segmentation effects
- (5)
- Comparison of segmentation effect under different light sources
- (6)
- Further validation of PR-SOLOv2 algorithm
6.2. Experimental Results and Discussion of Contour Reconstruction
6.3. Verification of Center Coordinates
6.3.1. Center Point Ground Truth Determination Method
6.3.2. Calculation of Fitting Accuracy
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Diego, C.Z.; Pardo-Giménez, A. Edib SOLOv2: Dynamic and fast instance segmentation le and medicinal mushrooms (technology and applications); Current overview of mushroom production in the world. In Edible and Medicinal Mushrooms: Technology and Applications; Wiley: Hoboken, NJ, USA, 2017; pp. 5–13. [Google Scholar]
- Zhang, J.; Cai, W.; Huang, C. Chinese Edible Fungus Cultivation, 1st ed.; China Agriculture Press: Beijing, China, 2020; Chapter 1. [Google Scholar]
- Reed, J.N.; Miles, S.J.; Butler, J.; Baldwin, M.; Noble, R. Automatic mushroom harvester development. J. Agric. Eng. Res. 2001, 78, 15–23. [Google Scholar] [CrossRef]
- Rowley, J.H. Developing Flexible Automation for Mushroom Harvesting (Agaricus bisporus): Innovation Report. Ph.D. Thesis, University of Warwick, Warwick, UK, 2009. [Google Scholar]
- Yang, C.H.; Xiong, L.Y.; Wang, Z.; Wang, Y.; Shi, G.; Kuremot, T.; Yang, Y. Integrated detection of citrus fruits and branches using a convolutional neural network. Comput. Electron. Agric. 2020, 174, 105469. [Google Scholar] [CrossRef]
- Yang, S.; Jia, B.; Yu, T.; Yuan, J. Research on multiobjective optimization algorithm for cooperative harvesting trajectory optimization of an intelligent multiarm straw-rotting fungus harvesting robot. J. Agric. 2022, 12, 986. [Google Scholar] [CrossRef]
- Noble, R.; Reed, J.N.; Miles, S.; Jackson, A.F.; Butler, J. Influence of mushroom strains and population density on the performance of a robotic harvester. J. Agric. Eng. Res. 1997, 68, 215–222. [Google Scholar] [CrossRef]
- Slaughter, D.C.; Harrell, R.C. Color vision in robotic fruit harvesting. Trans. ASAE 1987, 30, 1144–1148. [Google Scholar] [CrossRef]
- Gené-Mola, J.; Gregorio, E.; Guevara, J.; Auat, F.; Sanz-Cortiella, R.; Escolà, A.; Rosell-Polo, J.R. Fruit detection in an apple orchard using a mobile terrestrial laser scanner. Biosyst. Eng. 2019, 187, 171–184. [Google Scholar] [CrossRef]
- Lin, G.; Tang, Y.; Zou, X.; Li, J.; Xiong, J. In-field citrus detection and localisation based on RGB-D image analysis. Biosyst. Eng. 2019, 186, 34–44. [Google Scholar] [CrossRef]
- Magalhães, S.A.; Moreira, A.P.; Santos, F.N.D.; Dias, J. Active Perception Fruit Harvesting Robots—A Systematic Review. J. Intell. Robot. Syst. 2022, 105, 1–22. [Google Scholar] [CrossRef]
- Montoya-Cavero, L.E.; de León Torres, R.D.; Gómez-Espinosa, A.; Cabello, J.A.E. Vision systems for harvesting robots: Produce detection and localization. Comput. Electron. Agric. 2021, 192, 106562. [Google Scholar] [CrossRef]
- Yan, B.; Fan, P.; Lei, X.; Liu, Z.; Yang, F. A real-time apple targets detection method for picking robot based on improved YOLOv5. Remote Sens. 2021, 13, 1619. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef]
- Onishi, Y.; Yoshida, T.; Kurita, H.; Fukao, T.; Arihara, H.; Iwai, A. An automated fruit harvesting robot by using deep learning. ROBOMECH J. 2019, 6, 1–8. [Google Scholar] [CrossRef]
- Zhou, C.; Hu, J.; Xu, Z.; Yue, J.; Ye, H.; Yang, G. A novel greenhouse-based system for the detection and plumpness assessment of strawberry using an improved deep learning technique. Front. Plant Sci. 2020, 11, 559. [Google Scholar] [CrossRef] [PubMed]
- Ganesh, P.; Volle, K.; Burks, T.F.; Mehta, S.S. Deep orange: Mask R-CNN based orange detection and segmentation. IFAC PapersOnLine 2019, 52, 70–75. [Google Scholar] [CrossRef]
- Ghiani, L.; Sassu, A.; Palumbo, F.; Mercenaro, L.; Gambella, F. In-field automatic detection of grape bunches under a totally uncontrolled environment. Sensors 2021, 21, 3908. [Google Scholar] [CrossRef]
- Yu, Y.; Zhang, K.; Yang, L.; Zhang, D. Fruit detection for strawberry harvesting robot in non-structural environment based on Mask-RCNN. Comput. Electron. Agric. 2019, 163, 104846. [Google Scholar] [CrossRef]
- Zhang, K.; Lammers, K.; Chu, P.; Li, Z.; Lu, R. System design and control of an apple harvesting robot. Mechatronics 2021, 79, 102644. [Google Scholar] [CrossRef]
- Tillett, R.D.; Batchelor, B.G. An algorithm for locating mushrooms in a growing bed. Comput. Electron. Agric. 1991, 6, 191–200. [Google Scholar] [CrossRef]
- Yu, G.H.; Luo, J.M.; Zhao, Y. Region marking technique based on sequential scan and segmentation method of mushroom images. Trans. Chin. Soc. Agric. 2006, 22, 4. [Google Scholar]
- Yang, Y.Q.; Ye, M.; Lu, Y.H.; Ren, S.G. Localization algorithm based on corner density detection for overlapping mushroom image. Comput. Syst. Appl. 2018, 24, 119–125. [Google Scholar]
- Yang, S.; Ni, B.; Du, W.; Yu, T. Research on an improved segmentation recognition algorithm of overlapping Agaricus bisporus. Sensors 2022, 22, 3946. [Google Scholar] [CrossRef] [PubMed]
- 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]
- Mukherjee, A.; Sarkar, T.; Chatterjee, K.; Lahiri, D.; Nag, M.; Rebezov, M.; Lorenzo, J.M. Development of artificial vision system for quality assessment of oyster mushrooms. Food Anal. Methods 2022, 15, 1663–1676. [Google Scholar] [CrossRef]
- Wang, Z.J.; Zhang, L.L.; Li, S.F.; Zhang, Q.Y.; Fu, Q.Q.; Liu, S.J. Identification and classification of eatable fungi based on machine learning algorithm. J. Fuyang Teach. Coll. Nat. Sci. 2021, 38, 7. [Google Scholar]
- Zhou, J.; Ding, W.; Zhu, X.; Cao, J.; Niu, X. Evaluation on formation rate of Pleurotus eryngii primordium under different humidity conditions by computer vision. J. Zhejiang Univ. Sci. Agric. Life Sci. 2017, 43, 262–272. [Google Scholar] [CrossRef]
- Huang, B.R.; Chen, J.Y.; Lai, X.Y.; Chen, G.W.; Huang, K.W. Application of Deep Learning for Mushrooms Cultivation. In Proceedings of the 2021 International Conference on Technologies and Applications of Artificial Intelligence (TAAI), Taipei, Taiwan, 21 January 2021; pp. 250–253. [Google Scholar]
- Huang, M.; Jiang, X.; He, L.; Choi, D.; Pecchia, J.; Li, Y. Development of a robotic harvesting mechanism for button mushrooms. Trans. ASABE 2017, 64, 565–575. [Google Scholar] [CrossRef]
- Ketwongsa, W.; Boonlue, S.; Kokaew, U. A new deep learning model for the classification of poisonous and edible mushrooms based on improved AlexNet convolutional neural network. J. Appl. Sci. 2022, 12, 3409. [Google Scholar] [CrossRef]
- Sevilla, W.H.; Hernandez, R.M.; Ligayo, M.A.D.; Costa, M.T.; Quismundo, A.Q. Machine vision recognition system of edible and poisonous mushrooms using a small training set-based deep transfer learning. In Proceedings of the 2022 International Conference on Decision Aid Sciences and Applications (DASA), Chiangrai, Thailand, 23–25 March 2022; pp. 1701–1705. [Google Scholar]
- Zha, L.; Gong, Z.J.; Shao, S.; Li, Z.P.; Yu, C.X.; Yang, H.L. An anchor-free network for detection of Volvariella volvacea growth status. Acta Edulis Fungi 2022, 29, 8. [Google Scholar]
- Lee, C.H.; Choi, D.; Pecchia, J.; He, L.; Heinemann, P. Development of a mushroom harvesting assistance system using computer vision. In Proceedings of the 2019 ASABE Annual International Meeting, American Society of Agricultural and Biological Engineers (ASABE), Boston, MA, USA, 7–10 July 2019; pp. 1–10. [Google Scholar]
- Rong, J.; Wang, P.; Yang, Q.; Huang, F. A field-tested harvesting robot for oyster mushroom in greenhouse. J. Agron. 2021, 11, 1210. [Google Scholar] [CrossRef]
- Zheng, Y.Y.; Zheng, L.X. Research on Flammulina velutipes head detection algorithm based on deep learning. Mod. Comput. 2020, 30, 23–29. [Google Scholar]
- Lu, C.P.; Liaw, J.J. A novel image measurement algorithm for common mushroom caps based on convolutional neural network. Comput. Electron. Agric. 2020, 171, 105336. [Google Scholar] [CrossRef]
- Masoudian, A. Computer Vision Algorithms for an Automated Harvester. Ph.D. Thesis, The University of Western Ontario, London, ON, Canada, 2013. [Google Scholar]
- Sert, E.; Okumus, I.T. Segmentation of mushroom and cap width measurement using modified K-means clustering algorithm. Adv. Electr. Electron. Eng. 2014, 12, 354–360. [Google Scholar] [CrossRef]
- Soomro, S.; Munir, A.; Choi, K.N. Hybrid two-stage active contour method with region and edge information for intensity inhomogeneous image segmentation. PLoS ONE 2018, 13, e0191827. [Google Scholar] [CrossRef] [PubMed]
- Pchitskaya, E.; Bezprozvanny, I. Dendritic spines shape analysis—Classification or clusterization? Perspective. Front. Synaptic Neurosci. 2020, 12, 31. [Google Scholar] [CrossRef]
- Ji, J.; Sun, J.; Zhao, K.; Jin, X.; Ma, H.; Zhu, X. Measuring the cap diameter of white button mushrooms (Agaricus bisporus) by using depth image processing. Appl. Eng. 2021, 37, 623–633. [Google Scholar] [CrossRef]
- Arjun, A.D.; Chakraborty, S.K.; Mahanti, N.K.; Kotwaliwale, N. Non-destructive assessment of quality parameters of white button mushrooms (Agaricus bisporus) using image processing techniques. J. Food Sci. Technol. 2022, 59, 2047–2059. [Google Scholar] [CrossRef]
- Baisa, N.L.; Al-Diri, B. Mushrooms Detection, Localization and 3D Pose Estimation using RGB-D Sensor for Robotic-picking Applications. arXiv 2022, arXiv:2201.02837. [Google Scholar]
- Zhao, K.; Zhang, M.; Ji, J.; Sun, J.; Ma, H. Whiteness measurement of Agaricus bisporus based on image processing and color calibration model. Food Meas. 2023, 17, 2152–2161. [Google Scholar] [CrossRef]
- Retsinas, G.; Efthymiou, N.; Anagnostopoulou, D.; Maragos, P. Mushroom detection and three dimensional pose estimation from multi-view point clouds. Sensors 2023, 23, 3576. [Google Scholar] [CrossRef]
- Zhang, J.; Li, C.; Rahaman, M.M.; Yao, Y.; Ma, P.; Zhang, J.; Zhao, X.; Jiang, T.; Grzegorzek, M. A comprehensive survey with quantitative comparison of image analysis methods for microorganism biovolume measurements. Arch. Comput. Methods Eng. 2023, 30, 639–673. [Google Scholar] [CrossRef]
- Chen, C.; Wang, F.; Cai, Y.; Yi, S.; Zhang, B. An Improved YOLOv5s-Based Agaricus bisporus Detection Algorithm. J. Agron. 2023, 13, 1871. [Google Scholar] [CrossRef]
- Chen, C.; Yi, S.; Mao, J.; Wang, F.; Zhang, B.; Du, F. A Novel Segmentation Recognition Algorithm of Agaricus bisporus Based on Morphology and Iterative Marker-Controlled Watershed Transform. J. Agron. 2023, 13, 347. [Google Scholar] [CrossRef]
- Yin, H.; Xu, J.; Wang, Y.; Hu, D.; Yi, W. A Novel Method of Situ Measurement Algorithm for Oudemansiella raphanipies Caps Based on YOLO v4 and Distance Filtering. Agronomy 2022, 13, 134. [Google Scholar] [CrossRef]
- Yin, H.; Yang, S.; Cheng, W.; Wei, Q.; Wang, Y.; Xu, Y. AC R-CNN: Pixelwise Instance Segmentation Model for Agrocybe cylindracea Cap. Agronomy 2023, 14, 77. [Google Scholar] [CrossRef]
- Wang, T.; Liew, J.H.; Li, Y.; Chen, Y.; Feng, J. SODAR: Segmenting objects by dynamically aggregating neighboring mask representations. arXiv 2022, arXiv:2202.07402. [Google Scholar]
- Wang, X.; Kong, T.; Shen, C.; Jiang, Y.; Li, L. SOLO: Segmenting objects by locations. In Proceedings of the European Conference on Computer Vision (ECCV), Glasgow, UK, 23–28 August 2020; Springer: Cham, Switzerland, 2020; pp. 649–665. [Google Scholar]
- Wang, X.; Zhang, R.; Kong, T.; Li, L.; Shen, C. SOLOv2: Dynamic and fast instance segmentation. Adv. Neural Inf. Process. Syst. 2020, 33, 17721–17732. [Google Scholar]
- Long, J.; Shelhamer, E.; Darrell, T. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 12 June 2015; pp. 3431–3440. [Google Scholar]
- Li, T.Y.; Jiang, W.W.; Xing, J.T.; Xu, Z.; Zhang, L.; Tian, F. Intrusion detection of offshore area perimeter in oilfield operation site. Comput. Syst. Appl. 2022, 31, 236–241. [Google Scholar]
- Ji, J.T.; Liu, X.H.; Zhao, K.X. Automatic rumen filling scoring method for dairy cows based on SOLOv2 and cavity feature of point cloud. Trans. Chin. Soc. Agric. Eng. 2022, 38, 186–197. [Google Scholar]
- Kirillov, A.; Wu, Y.; He, K.; Girshick, R. PointRend: Image segmentation as rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13 June 2020; pp. 9799–9808. [Google Scholar]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22 October 2017; pp. 2980–2988. [Google Scholar]
Author | Approach | Major Findings | Segmentation Success Rate | Mean Time |
---|---|---|---|---|
Masoudian [38] | SVM for image classification, multi-step segmentation | This approach is not well suited for large datasets. | 88.57% | 0.49 s |
Soomro et al. [40] | Two-stage segmentation for intensity inhomogeneous images | The two-stage segmentation technique overcomes issues related to the initial contour, making it suitable for inhomogeneous image segmentation. | 97.99% | 1.41 s |
Ji et al. [42] | Depth image processing for mushroom diameter measurement | The method detects mushrooms and provides essential information for robotic selective harvesting, improving production quality and efficiency. | 92.37% | 0.5 s |
Baisa and Al-Diri [44] | RGB-D data for mushroom detection and 3D pose estimation | The algorithm provides a robust method for mushroom detection, localization, and 3D pose estimation, which can be valuable for robotic picking applications. | 98.99% | - |
Retsinas et al. [46] | Vision module for 3D pose estimation using Intel RealSense cameras | The method aims to accurately detect the 3D pose of mushrooms without relying on 3D annotation data, which can facilitate mushroom harvesting by robotic systems. | 96.31% | 3 s |
Zhang et al. [47] | Review of microorganism biovolume measurement methods | The work has research significance and application value, offering insights into microorganism biovolume measurement using digital image analysis methods. | - | - |
Chen et al. [48] | Improved YOLOv5s algorithm for Agaricus bisporus detection | The improved algorithm shows convincing recognition accuracy, robustness, and low error rates in Agaricus bisporus detection. | 98% | 0.018 s |
Chen et al. [49] | Watershed-based segmentation for Agaricus bisporus recognition | The proposed algorithm demonstrates recognition of Agaricus bisporus with low error rates and real-time processing capabilities. | 95.7% | 0.706 |
Tillett et al. [21] | Algorithm for locating mushrooms in growing beds | The algorithm is designed for use in robotic harvesting systems and provides a basis for identifying and tracking mushrooms in a growing bed. | 93% | - |
Yang et al. [23] | Corner density-based localization algorithm for overlapping mushrooms | The algorithm demonstrates a success rate of 86.3% in locating overlapping mushrooms, providing an efficient solution for mushroom localization. | 96.37% | 0.712 s |
Yang et al. [24] | Improved segmentation recognition algorithm for overlapping Agaricus bisporus | The algorithm achieves over 90% recognition rate for Agaricus bisporus in overlapping situations, making it suitable for complex planting environments. | 97.25% | 0.212 s |
Lu and Liaw [37] | CNN-based mushroom cap diameter measurement | The algorithm provides an estimation of mushroom cap diameters and outperforms the Circle Hough Transform. | 82.7% | - |
Algorithm | P | R | AP (%) | AP50 (%) | AP75 (%) | |
---|---|---|---|---|---|---|
Mask RCNN | 0.933 | 0.852 | 83.510 | 95.061 | 89.006 | 0.68 |
YOLACT | 0.901 | 0.838 | 80.743 | 93.451 | 87.853 | 0.41 |
SOLOv2 | 0.959 | 0.917 | 90.279 | 96.103 | 92.747 | 0.36 |
PR-SOLOv2 | 0.982 | 0.945 | 93.037 | 99.056 | 95.249 | 0.39 |
Plant | Algorithm | Number | Num of Successful Segment Mushroom | Segmentation Success Rate (%) |
---|---|---|---|---|
Plant 1 | Mask RCNN | 4865 | 4209 | 86.52 |
YOLACT | 4865 | 3908 | 80.33 | |
SOLOv2 | 4865 | 4407 | 90.59 | |
PR-SOLOv2 | 4865 | 4784 | 98.34 | |
Plant 2 | Mask RCNN | 4497 | 3853 | 85.68 |
YOLACT | 4497 | 3617 | 80.43 | |
SOLOv2 | 4497 | 4077 | 90.66 | |
PR-SOLOv2 | 4497 | 4403 | 97.91 |
Image Number | 1 | 2 | 3 | 4 | Average |
---|---|---|---|---|---|
The contour number | 63 | 54 | 52 | 50 | |
Average CDR | 0.28% | 0.32% | 0.31% | 0.30% | 0.3% |
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. |
© 2024 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
Yang, S.; Zhang, J.; Yuan, J. A High-Accuracy Contour Segmentation and Reconstruction of a Dense Cluster of Mushrooms Based on Improved SOLOv2. Agriculture 2024, 14, 1646. https://doi.org/10.3390/agriculture14091646
Yang S, Zhang J, Yuan J. A High-Accuracy Contour Segmentation and Reconstruction of a Dense Cluster of Mushrooms Based on Improved SOLOv2. Agriculture. 2024; 14(9):1646. https://doi.org/10.3390/agriculture14091646
Chicago/Turabian StyleYang, Shuzhen, Jingmin Zhang, and Jin Yuan. 2024. "A High-Accuracy Contour Segmentation and Reconstruction of a Dense Cluster of Mushrooms Based on Improved SOLOv2" Agriculture 14, no. 9: 1646. https://doi.org/10.3390/agriculture14091646
APA StyleYang, S., Zhang, J., & Yuan, J. (2024). A High-Accuracy Contour Segmentation and Reconstruction of a Dense Cluster of Mushrooms Based on Improved SOLOv2. Agriculture, 14(9), 1646. https://doi.org/10.3390/agriculture14091646