Grape Maturity Detection and Visual Pre-Positioning Based on Improved YOLOv4
Abstract
:1. Introduction
2. Materials and Methods
2.1. Grape Maturity Detection Based on Improved YOLOv4
2.1.1. Data Collection
2.1.2. Data Preprocessing
2.1.3. Network Structure of the YOLOv4 Algorithm
2.1.4. Characteristics of the YOLOv4 Algorithm
2.1.5. Improvement of the YOLOv4 Algorithm
2.2. Grape Cluster Pre-Positioning Based on Binocular Stereo Vision
2.2.1. Target Matching
2.2.2. Pixel Parallax Calculation
2.2.3. Depth Estimation of Grape Clusters
3. Grape Maturity Detection and Pre-Positioning Test
3.1. Test Platform and Evaluation Index of Grape Maturity Detection
3.2. Parameter Calibration and Evaluation Index of the Grape Pre-Positioning Test
4. Results and Analysis
4.1. Training Results of the Grape Maturity Detection Model
4.2. Maturity Test Results of the SM-YOLOv4 Network
4.2.1. Comparison of Training Results of the Improved Network Model
4.2.2. Comparison of Training Results of Different Network Models
4.3. Depth Estimation Results of the SM-YOLOv4 Network
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Luo, S. Grape Industry and the Tourism Development in China. Master’s Thesis, Hubei University, Wuhan, China, 2017. [Google Scholar]
- Xu, R.; Zhao, M.; Zhang, L. Research actuality and prospect of picking robot for grapes. J. Henan Inst. Sci. Technol. 2018, 46, 74–78. [Google Scholar]
- Lee, C.Y.; Bourne, M.C. Changes in grape firmness during maturation. J. Texture Stud. 1980, 11, 163–172. [Google Scholar] [CrossRef]
- Nogales-Bueno, J.; Hernández-Hierro, J.M.; Rodríguez-Pulido, F.J.; Heredia, F.J. Determination of technological maturity of grapes and total phenolic compounds of grape skins in red and white cultivars during ripening by near infrared hyperspectral image: A preliminary approach. Food Chem. 2014, 152, 586–591. [Google Scholar] [CrossRef] [PubMed]
- Yuan, L. Study on Non-destructive Detection of ‘Kyoho’ Grape’s Quality by Multi-perspective Imaging and Nir Spectroscopy Techniques. Ph.D. Thesis, Jiangsu University, Zhengjiang, China, 2016. [Google Scholar]
- Behroozi-Khazaei, N.; Maleki, M.R. A robust algorithm based on color features for grape cluster segmentation. Comput. Electron. Agric. 2017, 142, 41–49. [Google Scholar] [CrossRef]
- Lu, W. Grape Maturity’s Nondestructive Detection Research; China Metrology Institute: Beijing, China, 2013. [Google Scholar]
- Chen, Y.; Wang, J.; Zeng, Z. Vision pre-positioning method for litchi picking robot under large field of view. Trans. Chin. Soc. Agric. Eng. 2019, 35, 7. [Google Scholar]
- Liang, X.; Jin, C.; Ni, M.; Wang, Y. Acquisition and experiment on location information of picking point of tomato fruit clusters. Trans. Chin. Soc. Agric. Eng. 2018, 34, 7. [Google Scholar]
- Mehta, S.S.; Burks, T.F. Vision-based control of robotic manipulator for citrus harvesting. Comput. Electron. Agric. 2014, 102, 146–158. [Google Scholar] [CrossRef]
- Zhu, Y.; Zhou, W.; Yang, Y.; Li, J.; Li, W.; Jin, H.; Fang, F. Automatic Identification Technology of Lycium barbarum Flowering Period and Fruit Ripening Period Based on Faster R-CNN. Chin. J. Agrometeorol. 2020, 41, 668–677. [Google Scholar]
- Ren, Y.; Du, Q. Fruit maturity recognition based on TensorFlow. New Technol. New Prod. China 2021, 21, 45–48. [Google Scholar]
- Wang, T.; Zhao, Y.; Sun, Y.; Yang, R.; Han, Z.; Li, J. Recognition Approach Based on Data-balanced Faster R-CNN for Winter Jujube with Different Levels of Maturity. Trans. Chin. Soc. Agric. Mach. 2020, 51, 457–463, 492. [Google Scholar]
- Liu, M.; Gao, T.; Ma, Z.; Song, Z.; Li, F.; Yan, Y. Target Detection Model of Corn Weeds in Field Environment Based on MSRCR Algorithm and YOLOv4-tiny. Trans. Chin. Soc. Agric. Mach. 2022, 53, 246–255, 335. [Google Scholar]
- Xu, X. Research on APP for Rapid Detection of Rice Maturity Based on Computer Vision. Master’s Thesis, Jilin University, Changchun, China, 2021. [Google Scholar]
- Bao, X.; Wang, S. Survey of object detection algorithm based on deep learning. Transducer Microsyst. Technol. 2022, 41, 5–9. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Zeng, G.; Yu, W.; Wang, R.; Lin, A. Research on Mosaic Image Data Enhancement and Detection Method for Overlapping Ship Targets. Control. Theory Appl. 2022, 39, 1139–1148. [Google Scholar]
- Yang, B.; Li, C.; Jiang, X.; Shi, H. A regularization loss function for improving the accuracy of deep learning classification models. J. South-Cent. Univ. Natl. 2020, 39, 74–78. [Google Scholar]
- Wang, L.; Qin, M.; Lei, J.; Wang, X.; Tan, K. Blueberry maturity recognition method based on improved YOLOv4-Tiny. Trans. Chin. Soc. Agric. Eng. 2021, 37, 170–178. [Google Scholar]
- Wan, L.; Ling, Y.; Zheng, X.; Li, X. Vehicle Type Recognition Based on MobileNet-YOLOv4. Softw. Guide 2021, 20, 173–178. [Google Scholar]
- Zhang, F.; Chen, Z.; Bao, R.; Zhang, C.; Wang, Z. Recognition of dense cherry tomatoes based on improved YOLOv4-LITE lightweight neural network. Trans. Chin. Soc. Agric. Eng. 2021, 37, 270–278. [Google Scholar]
- Wei, J.; Pan, S.; Tian, G.; Gao, W.; Sun, Y. Design and experiments of the binocular visual obstacle perception system for agricultural vehicles. Trans. Chin. Soc. Agric. Eng. 2021, 37, 55–63. [Google Scholar]
- Gu, B.; Liu, Q.; Tian, G.; Wang, H.; Li, H.; Xie, S. Recognizing and locating the trunk of a fruit tree using improved YOLOv3. Trans. Chin. Soc. Agric. Eng. 2022, 38, 122–129. [Google Scholar]
- Zhao, H.; Qiao, Y.; Wang, H.; Yue, Y. Apple fruit recognition in complex orchard environment based on improved YOLOv3. Trans. Chin. Soc. Agric. Eng. 2021, 37, 127–135. [Google Scholar]
- Liu, Z. Visual Recognition and Maturity Detection Technology of Guava in Natural Environment. Master’s Theses, South China Agricultural University, Guangzhou, China, 2019. [Google Scholar]
- Xue, Y.; Huang, N.; Tu, S.; Mao, L.; Yang, A.; Zhu, X.; Yang, X.; Chen, P. Immature mango detection based on improved YOLOv2. Trans. Chin. Soc. Agric. Eng. 2018, 34, 173–179. [Google Scholar]
- Long, J.; Zhao, C.; Lin, S.; Guo, W.; Wen, C.; Zhang, Y. Segmentation method of the tomato fruits with different maturities under greenhouse environment based on improved Mask R-CNN. Trans. Chin. Soc. Agric. Eng. 2021, 37, 100–108. [Google Scholar]
- Zhang, Z.; Zhang, Z.; Li, J.; Wang, H.; Li, Y.; Li, D. Potato detection in complex environment based on improved YoloV4 model. Trans. Chin. Soc. Agric. Eng. 2021, 37, 170–178. [Google Scholar]
- Chen, S.; Xiong, J.; Jiao, J.; Xie, Z.; Huo, Z.; Hu, W. Citrus fruits maturity detection in natural environments based on convolutional neural networks and visual saliency map. Precis. Agric. 2022, 23, 1515–1531. [Google Scholar] [CrossRef]
- Subramanian, P.; Sankar, T.S. Detection of maturity stages of coconuts in complex background using Faster R-CNN model. Biosyst. Eng. 2021, 202, 119–132. [Google Scholar]
- Luo, L.; Zou, X.; Ye, M.; Yang, Z.; Zhang, C.; Zhu, N.; Wang, C. Calculation and localization of bounding volume of grape for undamaged fruit picking based on binocular stereo vision. Trans. Chin. Soc. Agric. Eng. 2016, 32, 41–47. [Google Scholar]
- Lei, W.; Lu, J. Visual positioning method for picking point of grape picking robot. Jiangsu J. Agric. Sci. 2020, 36, 1015–1021. [Google Scholar]
- Luo, L.; Zou, X.; Xiong, J.; Zhang, Y.; Peng, H.; Lin, G. Picking Behavior of Grape Harvesting Robot Based on Visual Perception and Its Virtual Experiment. Trans. Chin. Soc. Agric. Eng. 2015, 31, 14–21. [Google Scholar]
- Wang, J. Research on Vision Pre-positioning of Litchi Picking Robot under Large Field of View. Master’s Thesis, South China Agricultural University, Guangzhou, China, 2019. [Google Scholar]
Cameras | U-Axis Scale Factor | V-Axis Scale Factor | U-Axis Translation | V-Axis Translation |
---|---|---|---|---|
Left camera | 529.88 | 529.54 | 645.25 | 367.12 |
Right camera | 529.62 | 529.45 | 645.87 | 384.52 |
Models | AP/% | MAP/% | Speed /(Frames·s−1) | |||
---|---|---|---|---|---|---|
A | B | C | D | |||
YOLOv4 | 84.33 | 90.76 | 91.10 | 92.18 | 89.59 | 50.09 |
SE-YOLOv4 | 90.32 | 92.05 | 93.80 | 94.36 | 92.63 | 47.63 |
Mobilenetv3-YOLOv4 | 89.28 | 92.56 | 92.43 | 93.49 | 91.94 | 97.87 |
SM-YOLOv4 | 90.62 | 93.95 | 94.29 | 95.24 | 93.52 | 92.38 |
Models | AP/% | MAP/% | Speed /(Frames·s−1) | |||
---|---|---|---|---|---|---|
A | B | C | D | |||
YOLOv5 | 88.53 | 93.96 | 93.30 | 95.38 | 92.79 | 34.79 |
SM-YOLOv4 | 90.62 | 93.95 | 94.29 | 95.24 | 93.52 | 92.38 |
YOLOv4-Tiny | 75.19 | 80.80 | 86.26 | 87.60 | 82.46 | 288.01 |
Faster_ R-CNN | 91.20 | 92.90 | 93.89 | 94.43 | 93.11 | 14.53 |
Site | SM-YOLOv4 | YOLOv5 | Faster_R-CNN | |||
---|---|---|---|---|---|---|
ED/m | EDR/% | ED/m | EDR/% | ED/m | EDR/% | |
1 | 0.032 | 4.63 | 0.069 | 9.55 | 0.057 | 8.15 |
2 | 0.023 | 3.31 | 0.061 | 8.01 | 0.046 | 6.19 |
3 | 0.032 | 4.60 | 0.074 | 11.00 | 0.062 | 9.04 |
4 | 0.024 | 3.45 | 0.068 | 9.52 | 0.052 | 7.26 |
5 | 0.029 | 4.17 | 0.066 | 9.06 | 0.053 | 7.43 |
6 | 0.030 | 4.31 | 0.065 | 8.83 | 0.047 | 6.37 |
7 | 0.025 | 3.59 | 0.063 | 8.37 | 0.049 | 6.72 |
8 | 0.023 | 3.38 | 0.062 | 8.14 | 0.055 | 7.79 |
9 | 0.021 | 3.02 | 0.067 | 9.29 | 0.050 | 6.90 |
10 | 0.031 | 4.46 | 0.073 | 10.67 | 0.056 | 7.97 |
Average value | 0.027 | 3.89 | 0.067 | 9.24 | 0.053 | 7.38 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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
Qiu, C.; Tian, G.; Zhao, J.; Liu, Q.; Xie, S.; Zheng, K. Grape Maturity Detection and Visual Pre-Positioning Based on Improved YOLOv4. Electronics 2022, 11, 2677. https://doi.org/10.3390/electronics11172677
Qiu C, Tian G, Zhao J, Liu Q, Xie S, Zheng K. Grape Maturity Detection and Visual Pre-Positioning Based on Improved YOLOv4. Electronics. 2022; 11(17):2677. https://doi.org/10.3390/electronics11172677
Chicago/Turabian StyleQiu, Chang, Guangzhao Tian, Jiawei Zhao, Qin Liu, Shangjie Xie, and Kui Zheng. 2022. "Grape Maturity Detection and Visual Pre-Positioning Based on Improved YOLOv4" Electronics 11, no. 17: 2677. https://doi.org/10.3390/electronics11172677