Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse
Abstract
:1. Introduction
2. Materials and Methods
2.1. Data Acquisition
2.2. Dataset Construction and Pre-processing
2.2.1. Sample Enhancement
2.2.2. Dataset Construction
2.3. Tomato Maturity Recognition Methods
2.3.1. YOLOv5 Target Detection Network
2.3.2. Improved Loss Function
2.3.3. Experimental Comparison Models
2.4. Experiment Platform and Parameter Setting
2.4.1. Experiment Platform
2.4.2. Experiment Parameter
2.5. Evaluation Indices
3. Results and Analysis
3.1. Different Maturity Recognition Results
3.2. Different Model Detection Performance Comparison
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Costa, J.; Miguel; Heuvelink, E.P. The global tomato industry. In Tomatoes; CABI: Wallingford, UK, 2018; pp. 1–26. [Google Scholar]
- Ghezavati, V.R.; Hooshyar, S.; Tavakkoli-Moghaddam, R. A Benders’ decomposition algorithm for optimizing distribution of perishable products considering postharvest biological behavior in agri-food supply chain: A case study of tomato. Cent. Eur. J. Oper. Res. 2017, 25, 29–54. [Google Scholar] [CrossRef]
- Zhang, L.; Jia, J.; Gui, G.; Hao, X.; Gao, W.; Wang, M. Deep learning based improved classification system for designing tomato harvesting robot. IEEE Access 2018, 6, 67940–67950. [Google Scholar] [CrossRef]
- Fenn; Matthew, A.; James, J.; Giovannoni. Phytohormones in fruit development and maturation. Plant J. 2020, 105, 446–458. [Google Scholar] [CrossRef]
- Teka; Tilahun, A. Analysis of the effect of maturity stage on the postharvest biochemical quality characteristics of tomato (Lycopersicon esculentum Mill.) fruit. Int. Res. J. Pharm. Appl. Sci. 2013, 3, 180–186. [Google Scholar]
- Malik, M.H.; Zhang, T.; Li, H.; Zhang, M.; Shabbir, S.; Saeed, A. Mature tomato fruit detection algorithm based on improved HSV and watershed algorithm. IFAC-PaperOnLine 2018, 51, 431–436. [Google Scholar] [CrossRef]
- Liu, G.; Mao, S.; Kim, J.H. A mature-tomato detection algorithm using machine learning and color analysis. Sensors 2019, 19, 2023. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Li, H.; Zhang, M.; Gao, Y.; Li, M.; Ji, Y. Green ripe tomato detection method based on machine vision in greenhouse. Trans. Chin. Soc. Agric. Eng. 2017, 33, 328–334. [Google Scholar]
- Liu, L.; Li, Z.; Lan, Y.; Shi, Y.; Cui, Y. Design of a tomato classifier based on machine vision. PLoS ONE 2019, 14, e0219803. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Zhang, L.; McCarthy, M.J. Measurement and evaluation of tomato maturity using magnetic resonance imaging. Postharvest Biol. Technol. 2012, 67, 37–43. [Google Scholar] [CrossRef]
- Jiang, Y.; Chen, S.; Bian, B.; Li, Y.; Wang, X. Discrimination of tomato maturity using hyperspectral imaging combined with graph-based semi-supervised method considering class probability information. Food Anal. Methods 2021, 14, 968–983. [Google Scholar] [CrossRef]
- Huang, Y.; Si, W.; Chen, K.; Sun, Y. Assessment of tomato maturity in different layers by spatially resolved spectroscopy. Sensors 2020, 20, 7229. [Google Scholar] [CrossRef] [PubMed]
- Alajrami, M.A.; Abu-Naser, S.S. Abu-Naser. Type of tomato classification using deep learning. Int. J. Acad. Pedagog. Res. (IJAPR) 2020, 3, 21–25. [Google Scholar]
- Long, J.H.; Zhao, C.J.; Lin, S.; Guo, W.Z.; Wen, C.W.; 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]
- Liu, G.; Nouaze, J.C.; Touko Mbouembe, P.L.; Kim, J.H. YOLO-tomato: A robust algorithm for tomato detection based on YOLOv3. Sensors 2020, 20, 2145. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Li, T.H.; Sun, M.; Ding, X.; Li, Y.; Zhang, G.; Shi, G.; Li, W. Tomato recognition method at the ripening stage based on YOLO v4 and HSV. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2021, 37, 183–190. [Google Scholar]
- Ge, Y.; Lin, S.; Zhang, Y.; Li, Z.; Cheng, H.; Dong, J.; Shao, S.; Zhang, J.; Qi, X.; Wu, Z. Tracking and Counting of Tomato at Different Growth Period Using an Improving YOLO-Deepsort Network for Inspection Robot. Machines 2022, 10, 489. [Google Scholar] [CrossRef]
- GH/T 1193-2021; Tomato. Standards Press of China: Beijing, China, 2021.
- Nagaraju, M.; Chawla, P.; Kumar, N. Performance improvement of Deep Learning Models using image augmentation techniques. Multimedia Tools Appl. 2022, 81, 9177–9200. [Google Scholar] [CrossRef]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. arXiv 2022, arXiv:2207.02696. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. 2016, 779–788. Available online: https://www.cv-foundation.org/openaccess/content_cvpr_2016/html/Redmon_You_Only_Look_CVPR_2016_paper.html (accessed on 26 January 2023).
- Song, Q.; Li, S.; Bai, Q.; Yang, J.; Zhang, X.; Li, Z.; Duan, Z. Object detection method for grasping robot based on improved YOLOv5. Micromachines 2021, 12, 1273. [Google Scholar] [CrossRef]
- Zhu, X. Design of Barcode Recognition System Based on YOLOV5. Journal of Physics: Conference Series. IOP Publ. 2021, 1995, 012052. [Google Scholar]
- Zhu, X.; Lyu, S.; Wang, X.; Zhao, Q. TPH-YOLOv5: Improved YOLOv5 based on transformer prediction head for object detection on drone-captured scenarios. Proc. IEEE/CVF Int. Conf. Comput. Vis. 2021, 2778–2788. [Google Scholar]
- Xing, L.; Fan, X.; Dong, Y.; Xiong, Z.; Xing, L.; Yang, Y.; Bai, H.; Zhou, C. Multi-UAV cooperative system for search and rescue based on YOLOv5. Int. J. Disaster Risk Reduct. 2022, 76, 102972. [Google Scholar] [CrossRef]
- Hao, W.; Zhili, S. Improved mosaic: Algorithms for more complex images. J. Phys. Conf. Series. IOP Publ. 2020, 1684, 012094. [Google Scholar] [CrossRef]
- Yao, J.; Qi, J.; Zhang, J.; Shao, H.; Yang, J. A real-time detection algorithm for Kiwifruit defects based on YOLOv5. Electronics 2021, 10, 1711. [Google Scholar] [CrossRef]
- Thuan, D. Evolution of Yolo Algorithm and Yolov5: The State-of-the-Art Object Detention Algorithm. Available online: https://urn.fi/URN:NBN:fi:amk-202103042892 (accessed on 1 January 2021).
- Zhao, Y.; Shi, Y.; Wang, Z. The Improved YOLOV5 Algorithm and Its Application in Small Target Detection. In Proceedings of the Intelligent Robotics and Applications: 15th International Conference, ICIRA 2022, Harbin, China, 1–3 August 2022; Proceedings, Part IV. Springer International Publishing: Cham, Switzerland, 2022. [Google Scholar]
- Nepal, U.; Eslamiat, H. Comparing YOLOv3, YOLOv4 and YOLOv5 for autonomous landing spot detection in faulty UAVs. Sensors 2022, 22, 464. [Google Scholar] [CrossRef]
- Wang, M.; Zhu, Y.; Liu, Y.; Deng, H. X-Ray Small Target Security Inspection Based on TB-YOLOv5. Secur. Commun. Netw. 2022, 2022, 1–16. [Google Scholar] [CrossRef]
- Wang, Q.; Ma, Y.; Zhao, K.; Tian, Y. A comprehensive survey of loss functions in machine learning. Ann. Data Sci. 2020, 9, 187–212. [Google Scholar] [CrossRef]
- Zhang, Y.F.; Ren, W.; Zhang, Z. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing 2022, 506, 146–157. [Google Scholar] [CrossRef]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Cambridge, MA, USA, 20–23 June 1995; pp. 1440–1448. [Google Scholar]
- Mantau, A.J.; Widayat, I.W.; Adhitya, Y.; Prakosa, S.W.; Leu, J.S.; Köppen, M. A GA-Based Learning Strategy Applied to YOLOv5 for Human Object Detection in UAV Surveillance System. In 2022 IEEE 17th International Conference on Control & Automation (ICCA); IEEE: Piscataway, NJ, USA, 2022; pp. 9–14. [Google Scholar]
- Zhang, X.; Feng, Y.; Zhang, S.; Wang, N.; Mei, S. Finding Nonrigid Tiny Person with Densely Cropped and Local Attention Object Detector Networks in Low-Altitude Aerial Images. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 4371–4385. [Google Scholar] [CrossRef]
- Padilla, R.; Netto, S.L.; da Silva, E.A.B. A survey on performance metrics for object-detection algorithms. In 2020 International Conference on Systems, Signals and Image Processing (IWSSIP); IEEE: Piscataway, NJ, USA, 2020; pp. 237–242. [Google Scholar]
- Su, F.; Zhao, Y.; Wang, G.; Liu, P.; Yan, Y.; Zu, L. Tomato Maturity Classification Based on SE-YOLOv3-MobileNetV1 Network under Nature Greenhouse Environment. Agronomy 2022, 12, 1638. [Google Scholar] [CrossRef]
Hyperparameter | Value | Hyperparameter | Value | Hyperparameter | Value |
---|---|---|---|---|---|
lr0 | 0.00902 | cls | 0.486 | hsv_s | 0.529 |
lrf | 0.183 | cls_pw | 1.03 | hsv_v | 0.344 |
momentum | 0.98 | obj | 0.421 | translate | 0.102 |
weight_decay | 0.00039 | obj_pw | 0.824 | scale | 0.308 |
warmup_epochs | 2.86 | iou_t | 0.2 | fliplr | 0.5 |
warmup_momentum | 0.899 | anchor_t | 6.99 | mosaic | 1 |
warmup_bias_lr | 0.112 | anchors | 2 | Epochs | 200 |
box | 0.0378 | hsv_h | 0.0186 | Batch Size | 12 |
Models | Precision P (%) | Recall R (%) | Mean Average Precision (%) | Test Time (ms) | Memory (MB) |
---|---|---|---|---|---|
YOLOv5s-tomato | 95.58 | 90.07 | 97.42 | 9.2 | 23.9 |
YOLOv5s | 95.47 | 89.19 | 96.76 | 9.2 | 23.9 |
YOLOv5m | 95.51 | 91 | 96.94 | 12.2 | 68 |
YOLOv5l | 95.56 | 90.84 | 97.33 | 16.9 | 146 |
YOLOv5x | 95.69 | 90.4 | 97.51 | 27.3 | 269 |
Faster RCNN | 86.2 | 80.7 | 83.42 | 13.7 | 116 |
Source | Method | Environment | Maturity Level | mAP | Speed |
---|---|---|---|---|---|
Li Liu [9] | HSV | Laboratory | Three maturity levels | 90.70% | 68.7 ms |
Yuping Huang [12] | SR-SVMDA | Laboratory | Six maturity levels | 98.30% | |
Jiehua Long [14] | Improved Mask R-CNN | Greenhouse | Three maturity levels | 95.45% | 658 ms |
Guoxu Liu [15] | YOLOv3 | Greenhouse | All tomatoes | 96.40% | 54 ms |
Fei Su [38] | SE-YOLOv3-Mobile | Greenhouse | Four maturity levels | 87.70% | 227.1 ms |
Tianhua Li [16] | YOLO v4+HSV | Greenhouse | Ripe tomato | 94.77% | 22.18 ms |
Yuhao Ge [17] | YOLO-Deep-Sort | Greenhouse | Three maturity levels | 95.8% | |
Proposed method | YOLOv5s-tomato | Greenhouse | Four maturity levels | 97.42 | 9.2 ms |
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. |
© 2023 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
Li, R.; Ji, Z.; Hu, S.; Huang, X.; Yang, J.; Li, W. Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse. Agronomy 2023, 13, 603. https://doi.org/10.3390/agronomy13020603
Li R, Ji Z, Hu S, Huang X, Yang J, Li W. Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse. Agronomy. 2023; 13(2):603. https://doi.org/10.3390/agronomy13020603
Chicago/Turabian StyleLi, Renzhi, Zijing Ji, Shikang Hu, Xiaodong Huang, Jiali Yang, and Wenfeng Li. 2023. "Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse" Agronomy 13, no. 2: 603. https://doi.org/10.3390/agronomy13020603
APA StyleLi, R., Ji, Z., Hu, S., Huang, X., Yang, J., & Li, W. (2023). Tomato Maturity Recognition Model Based on Improved YOLOv5 in Greenhouse. Agronomy, 13(2), 603. https://doi.org/10.3390/agronomy13020603