A Precise Detection Method for Tomato Fruit Ripeness and Picking Points in Complex Environments
Abstract
1. Introduction
2. Materials and Methods
2.1. Data Acquisition
2.2. Annotation of Images and Construction of Datasets
2.3. Data Augmentation
2.4. YOLOv8
2.5. Model Architecture of YOLO-TMPPD
2.5.1. Depthwise Convolution
2.5.2. CARAFE
2.5.3. CBAM
2.6. Evaluation Indicators
2.7. Grad-CAM
3. Results
3.1. Experimental Process
3.1.1. Experimental Environment
3.1.2. Experimental Details
3.2. Model Ablation Studies
3.3. Comparative Experiments with Different Models
3.4. Model Interpretability Analysis
3.5. Inference and Evaluation of Critical Point Detection
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
AP | Average Precision |
CARAFE | Content-Aware ReAssembly of Features |
C2f | CSP Bottleneck with Two Convolutions |
CBAM | Convolutional Block Attention Modul |
DWConv | Depthwise Convolution |
FN | False Negative |
FP | False Positive |
FPS | Frames Per Second |
GFLOPS | Giga Floating-Point Operations Per Second |
Grad-CAM | Gradient-Weighted Class Activation Mapping |
IoU | Intersection over Union |
mAP-kp | Mean Average Precision-Keypoint |
OKS | Object Keypoint Similarity |
TP | True Positive |
YOLO | You Only Look Once |
References
- Hu, C.; Liu, X.; Pan, Z.; Li, P. Automatic Detection of Single Ripe Tomato on Plant Combining Faster R-CNN and Intuitionistic Fuzzy Set. IEEE Access 2019, 7, 154683–154696. [Google Scholar] [CrossRef]
- Kasimatis, C.-N.; Psomakelis, E.; Katsenios, N.; Katsenios, G.; Papatheodorou, M.; Vlachakis, D.; Apostolou, D.; Efthimiadou, A. Implementation of a decision support system for prediction of the total soluble solids of industrial tomato using machine learning models. Comput. Electron. Agric. 2022, 193, 106688. [Google Scholar] [CrossRef]
- Montoya-Cavero, L.-E.; Díaz de León Torres, R.; Gómez-Espinosa, A.; Escobedo Cabello, J.A. Vision systems for harvesting robots: Produce detection and localization. Comput. Electron. Agric. 2022, 192, 106562. [Google Scholar] [CrossRef]
- Moreira, G.; Magalhães, S.A.; Pinho, T.; dos Santos, F.N.; Cunha, M. Benchmark of Deep Learning and a Proposed HSV Colour Space Models for the Detection and Classification of Greenhouse Tomato. Agronomy 2022, 12, 356. [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]
- Zhao, Y.; Gong, L.; Zhou, B.; Huang, Y.; Liu, C. Detecting tomatoes in greenhouse scenes by combining AdaBoost classifier and colour analysis. Biosyst. Eng. 2016, 148, 127–137. [Google Scholar] [CrossRef]
- Qi, D.; Tan, W.; Yao, Q.; Liu, J. YOLO5Face: Why Reinventing a Face Detector. arXiv 2022, arXiv:2105.12931. [Google Scholar]
- Wu, Z.; Wang, X.; Jia, M.; Liu, M.; Sun, C.; Wu, C.; Wang, J. Dense object detection methods in RAW UAV imagery based on YOLOv8. Sci. Rep. 2024, 14, 18019. [Google Scholar] [CrossRef]
- Tang, Y.; Chen, M.; Wang, C.; Luo, L.; Li, J.; Lian, G.; Zou, X. Recognition and Localization Methods for Vision-Based Fruit Picking Robots: A Review. Front. Plant Sci. 2020, 11, 510. [Google Scholar] [CrossRef]
- Koirala, A.; Walsh, K.B.; Wang, Z.; McCarthy, C. Deep learning–Method overview and review of use for fruit detection and yield estimation. Comput. Electron. Agric. 2019, 162, 219–234. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the Computer Vision—ECCV 2016, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [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]
- Liu, Q.; Liu, M.; Jonathan, Q.M.; Shen, W. A real-time anchor-free defect detector with global and local feature enhancement for surface defect detection. Expert Syst. Appl. 2024, 246, 123199. [Google Scholar] [CrossRef]
- Xu, Z.-F.; Jia, R.-S.; Liu, Y.-B.; Zhao, C.-Y.; Sun, H.-M. Fast Method of Detecting Tomatoes in a Complex Scene for Picking Robots. IEEE Access 2020, 8, 55289–55299. [Google Scholar] [CrossRef]
- Xu, P.; Fang, N.; Liu, N.; Lin, F.; Yang, S.; Ning, J. Visual recognition of cherry tomatoes in plant factory based on improved deep instance segmentation. Comput. Electron. Agric. 2022, 197, 106991. [Google Scholar] [CrossRef]
- Yang, H.; Liu, Y.; Wang, S.; Qu, H.; Li, N.; Wu, J.; Yan, Y.; Zhang, H.; Wang, J.; Qiu, J. Improved Apple Fruit Target Recognition Method Based on YOLOv7 Model. Agriculture 2023, 13, 1278. [Google Scholar] [CrossRef]
- Song, C.-Y.; Zhang, F.; Li, J.-S.; Xie, J.-Y.; Yang, C.; Zhou, H.; Zhang, J.-X. Detection of maize tassels for UAV remote sensing image with an improved YOLOX Model. J. Integr. Agric. 2023, 22, 1671–1683. [Google Scholar] [CrossRef]
- Gao, J.; Zhang, J.; Zhang, F.; Gao, J. LACTA: A lightweight and accurate algorithm for cherry tomato detection in unstructured environments. Expert Syst. Appl. 2024, 238, 122073. [Google Scholar] [CrossRef]
- Zhang, J.; Xie, J.; Zhang, F.; Gao, J.; Yang, C.; Song, C.; Rao, W.; Zhang, Y. Greenhouse tomato detection and pose classification algorithm based on improved YOLOv5. Comput. Electron. Agric. 2024, 216, 108519. [Google Scholar] [CrossRef]
- Liu, G.; Hu, Y.; Chen, Z.; Guo, J.; Ni, P. Lightweight object detection algorithm for robots with improved YOLOv5. Eng. Appl. Artif. Intell. 2023, 123, 106217. [Google Scholar] [CrossRef]
- Sun, C.; Zhang, Y.; Ma, S. DFLM-YOLO: A Lightweight YOLO Model with Multiscale Feature Fusion Capabilities for Open Water Aerial Imagery. Drones 2024, 8, 400. [Google Scholar] [CrossRef]
- Wang, Z.; Zhang, S.; Chen, L.; Wu, W.; Wang, H.; Liu, X.; Fan, Z.; Wang, B. Microscopic Insect Pest Detection in Tea Plantations: Improved YOLOv8 Model Based on Deep Learning. Agriculture 2024, 14, 1739. [Google Scholar] [CrossRef]
- Zhu, A.; Zhang, R.; Zhang, L.; Yi, T.; Wang, L.; Zhang, D.; Chen, L. YOLOv5s-CEDB: A robust and efficiency Camellia oleifera fruit detection algorithm in complex natural scenes. Comput. Electron. Agric. 2024, 221, 108984. [Google Scholar] [CrossRef]
- Wang, M.; Li, Y.; Meng, H.; Chen, Z.; Gui, Z.; Li, Y.; Dong, C. Small target tea bud detection based on improved YOLOv5 in complex background. Front. Plant Sci. 2024, 15, 1393138. [Google Scholar] [CrossRef] [PubMed]
- Zhou, X.; Wang, D.; Krähenbühl, P. Objects as Points. arXiv 2019, arXiv:1904.07850. [Google Scholar]
- Vit, A.; Shani, G.; Bar-Hillel, A. Length phenotyping with interest point detection. Comput. Electron. Agric. 2020, 176, 105629. [Google Scholar] [CrossRef]
- Weyler, J.; Milioto, A.; Falck, T.; Behley, J.; Stachniss, C. Joint Plant Instance Detection and Leaf Count Estimation for In-Field Plant Phenotyping. IEEE Robot. Autom. Lett. 2021, 6, 3599–3606. [Google Scholar] [CrossRef]
- Bai, Y.; Mao, S.; Zhou, J.; Zhang, B. Clustered tomato detection and picking point location using machine learning-aided image analysis for automatic robotic harvesting. Precis. Agric. 2022, 24, 727–743. [Google Scholar] [CrossRef]
- Song, Z.; Zhou, Z.; Wang, W.; Gao, F.; Fu, L.; Li, R.; Cui, Y. Canopy segmentation and wire reconstruction for kiwifruit robotic harvesting. Comput. Electron. Agric. 2021, 181, 105933. [Google Scholar] [CrossRef]
- Xiang, R.; Zhang, M.; Zhang, J. Recognition for Stems of Tomato Plants at Night Based on a Hybrid Joint Neural Network. Agriculture 2022, 12, 743. [Google Scholar] [CrossRef]
- Du, X.; Meng, Z.; Ma, Z.; Zhao, L.; Lu, W.; Cheng, H.; Wang, Y. Comprehensive visual information acquisition for tomato picking robot based on multitask convolutional neural network. Biosyst. Eng. 2024, 238, 51–61. [Google Scholar] [CrossRef]
- Li, Y.; Feng, Q.; Liu, C.; Xiong, Z.; Sun, Y.; Xie, F.; Li, T.; Zhao, C. MTA-YOLACT: Multitask-aware network on fruit bunch identification for cherry tomato robotic harvesting. Eur. J. Agron. 2023, 146, 126812. [Google Scholar] [CrossRef]
- Han, C.; Lv, J.; Dong, C.; Li, J.; Luo, Y.; Wu, W.; Abdeen, M.A. Classification, Advanced Technologies, and Typical Applications of End-Effector for Fruit and Vegetable Picking Robots. Agriculture 2024, 14, 1310. [Google Scholar] [CrossRef]
- Yan, F.; Xu, Y. Improved Target Detection Algorithm Based on YOLO. In Proceedings of the 2021 4th International Conference on Robotics, Control and Automation Engineering (RCAE), Wuhan, China, 4–6 November 2021; pp. 21–25. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. arXiv 2016, arXiv:1506.02640. [Google Scholar]
- Varghese, R.; Sambath, M. YOLOv8: A Novel Object Detection Algorithm with Enhanced Performance and Robustness. In Proceedings of the 2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS), Chennai, India, 17–18 April 2024; pp. 1–6. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Proceedings of the Computer Vision–ECCV 2018, Munich, Germany, 8–14 September 2018; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2018; pp. 3–19. [Google Scholar]
- Wang, J.; Chen, K.; Xu, R.; Liu, Z.; Loy, C.C.; Lin, D. CARAFE: Carafe: Content-Aware Reassembly of Features. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 3007–3016. [Google Scholar]
- Wang, G.-Q.; Zhang, C.-Z.; Chen, M.-S.; Lin, Y.C.; Tan, X.-H.; Kang, Y.-X.; Wang, Q.; Zeng, W.-D.; Zhao, W.-W. A high-accuracy and lightweight detector based on a graph convolution network for strip surface defect detection. Adv. Eng. Inform. 2024, 59, 102280. [Google Scholar] [CrossRef]
- Maji, D.; Nagori, S.; Mathew, M.; Poddar, D. YOLO-Pose: Enhancing YOLO for Multi Person Pose Estimation Using Object Keypoint Similarity Loss. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), New Orleans, LA, USA, 21–24 June 2022; pp. 2636–2645. [Google Scholar]
- Selvaraju, R.R.; Das, A.; Vedantam, R.; Cogswell, M.; Parikh, D.; Batra, D. Grad-CAM: Why did you say that? arXiv 2017, arXiv:1611.07450. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLOv8. 2023. Available online: https://github.com/ultralytics/ultralytics (accessed on 14 November 2023).
- Du, X.; Meng, Z.; Ma, Z.; Lu, W.; Cheng, H. Tomato 3D pose detection algorithm based on keypoint detection and point cloud processing. Comput. Electron. Agric. 2023, 212, 108056. [Google Scholar] [CrossRef]
Items | Formulas |
---|---|
Parameters | (Kh × Kw × Cin × Cout) |
GFLOPs | (Kh × Kw × Cin × Cout × H × W)/109 |
Weights | Model Size |
P | TP − (TP + FP) |
R | TP/(TP + FN) |
F1 | (2 × P × R)/(P + R) |
FPS | 1/Processing time per frame |
Accessories | Model |
---|---|
Operating system | Ubuntu 20.04.6 LTS |
CPU | Intel (R) Core (TM) i7-13700K |
RAM | 128 G |
GRAM | 24 GB |
GPU | NVIDIA GeForce RTX 4090 |
Development environments | Python3.9.18, torch2.0.1 + cu117 |
Model | Parameters (M) | GFLOPs | Weights (MB) | mAP-kp@0.5 (%) |
---|---|---|---|---|
YOLOv8 | 11.42 | 29.6 | 22 | 93.12 |
YOLO-DWConv | 9.87 | 25.9 | 19 | 92.57 |
YOLO-DSConv | 11.38 | 107.7 | 22.1 | 81.73 |
YOLO-AKConv | 10.95 | 28.7 | 21.88 | 90.67 |
YOLO-GhostConv | 10.65 | 27.8 | 20.5 | 92.44 |
YOLO-GSConv | 11.28 | 29.2 | 21.7 | 90.68 |
Model | +DWConv | +CBAM | +CARAFE | Parameters (M) | GFLOPs | Weights (MB) | mAP-kp@0.5 (%) |
---|---|---|---|---|---|---|---|
YOLOv8 | - | - | - | 11.42 | 29.6 | 22 | 93.12 |
YOLO-TMPPD(v1) | ✓ | - | - | 9.86 | 25.9 | 19 | 92.57 |
YOLO-TMPPD(v2) | ✓ | ✓ | - | 10.27 | 26.3 | 19.8 | 95.84 |
YOLO-TMPPD(v3) | ✓ | - | ✓ | 10.03 | 26.2 | 19.3 | 94.73 |
YOLO-TMPPD(v4) | ✓ | ✓ | ✓ | 10.44 | 26.6 | 20.1 | 97.55 |
YOLO Model | Parameters (M) | GFLOPs | Weights (MB) | P (%) | R (%) | F1 (%) | mAP-kp@0.5 (%) | FPS |
---|---|---|---|---|---|---|---|---|
YOLOv3-pose | 104.8 | 286.9 | 200 | 92.63 | 87.11 | 89.79 | 92.89 | 129.8 |
YOLOv5-pose(s) | 9.41 | 25 | 18.2 | 88.93 | 93.36 | 91.09 | 93.45 | 355.4 |
YOLOv6-pose(s) | 16.37 | 44.5 | 31.4 | 93.21 | 87.48 | 90.25 | 93.04 | 229.1 |
YOLOv8-pose(s) | 11.42 | 29.6 | 22 | 88.36 | 90.74 | 89.54 | 93.12 | 298.2 |
YOLOv9-pose(s) | 18.51 | 69.4 | 37.6 | 88.78 | 89.19 | 88.98 | 91.06 | 244.5 |
YOLOv10-pose(s) | 9.2 | 26.1 | 21.9 | 87.73 | 89.19 | 88.45 | 92.47 | 371.1 |
YOLO-TMPPD | 10.44 | 26.6 | 20.1 | 97.26 | 93.89 | 94.02 | 97.55 | 336.2 |
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
Wang, X.; Wen, X.; Li, Y.; Du, C.; Zhang, D.; Sun, C.; Chen, B. A Precise Detection Method for Tomato Fruit Ripeness and Picking Points in Complex Environments. Horticulturae 2025, 11, 585. https://doi.org/10.3390/horticulturae11060585
Wang X, Wen X, Li Y, Du C, Zhang D, Sun C, Chen B. A Precise Detection Method for Tomato Fruit Ripeness and Picking Points in Complex Environments. Horticulturae. 2025; 11(6):585. https://doi.org/10.3390/horticulturae11060585
Chicago/Turabian StyleWang, Xinfa, Xuan Wen, Yi Li, Chenfan Du, Duokuo Zhang, Chengxiu Sun, and Bihua Chen. 2025. "A Precise Detection Method for Tomato Fruit Ripeness and Picking Points in Complex Environments" Horticulturae 11, no. 6: 585. https://doi.org/10.3390/horticulturae11060585
APA StyleWang, X., Wen, X., Li, Y., Du, C., Zhang, D., Sun, C., & Chen, B. (2025). A Precise Detection Method for Tomato Fruit Ripeness and Picking Points in Complex Environments. Horticulturae, 11(6), 585. https://doi.org/10.3390/horticulturae11060585