Submitted:
04 March 2025
Posted:
04 March 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Data Acquisition and Preparation
2.2. Inspection Robot and Sensor system
2.3. Algorithms

2.3.1. Spatiotemporal tuple
2.3.2. Tracking and counting tomatoes with sensor fusion

2.3.3. Ripeness Determination

- R = The red component in the RGB color space
- a = The a component in the Lab color space
- G = The red component in the RGB color space
3. Results and disscusion
- comparison of our counting method with the YOLOv8+DeepSORT method;
- comparison of our counting method with the tomato counting method for density estimation;
- analysis of the compensation processing steps and their impact on tomato detection results.
- evaluation of the current ripeness detection method.
3.1 Experimental setup
| Title 1 | Ridge 1 | Ridge 2 | Ridge 3 |
| Number of tomato clusters | 98 | 105 | 108 |
| Number of mature fruits | 232 | 258 | 251 |
| Number of immature fruits | 778 | 797 | 926 |
| Total | 1010 | 1055 | 1177 |
3.2 Comparison with other approaches
3.2.1 Evaluation indicators
- FNt = Number of target tomato clusters not detected in frame t
- FPt = Number of non-target objects (false positives) detected as tomato clusters in frame t
- IDSWt = Number of identity switches (incorrectly assigned IDs) for tomato clusters in frame t
- GTt = Actual number of target tomato clusters in frame
- EC = Estimated count, or the number that the method has counted
- AC = Actual count, or the ground-truth number we obtained from manual counting as referenced from table 1.
- SSR = Sum of Squares Regression
- SST = Sum of Squares Total
- SSE = Sum of Squares Error
3.3 Tomato counting based on density estimation
3.4 Tomato counting based on YOLOv8 and DeepSORT
| YOLOv8+DeepSORT | Our Method | |||||
| Ridge 1 | Ridge 2 | Ridge 3 | Ridge 1 | Ridge 2 | Ridge 3 | |
| Sum of frames | 2272 | 2254 | 2297 | 2251 | 2191 | 2236 |
| GT | 98 | 105 | 108 | 98 | 105 | 108 |
| FN | 2 | 3 | 2 | 2 | 4 | 3 |
| FP | 29 | 34 | 31 | 0 | 0 | 1 |
| IDSW | 10 | 13 | 9 | 0 | 0 | 1 |
| MOTA | 0.582 | 0.524 | 0.600 | 0.980 | 0.952 | 0.954 |

3.5 Impact of post-processing

3.6 Accuracy of mature and immature fruits counting

3.7 Visualization results of the tomato inspections

4. Conclusion and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zheng, Y.Y.; Kong, J.L.; Jin, X.B.; Wang, X.Y.; Su, T.L.; Zuo, M. CropDeep: The crop vision dataset for deep-learning-based classification and detection in precision agriculture. Sensors 2019, 19, 1058. [Google Scholar] [CrossRef] [PubMed]
- Tian, H.; Wang, T.; Liu, Y.; Qiao, X.; Li, Y. Computer vision technology in agricultural automation—A review. Information Processing in Agriculture 2020, 7, 1–19. [Google Scholar] [CrossRef]
- Redmon, J. You only look once: Unified, real-time object detection. In Proceedings of the Proceedings of the IEEE conference on computer vision and pattern recognition, 2016.
- Faster, R. Towards real-time object detection with region proposal networks. Advances in neural information processing systems 2015, 9199, 2969239–2969250. [Google Scholar]
- He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask r-cnn. In Proceedings of the Proceedings of the IEEE international conference on computer vision, 2017, pp. 2961–2969.
- Bolya, D.; Zhou, C.; Xiao, F.; Lee, Y.J. Yolact: Real-time instance segmentation. In Proceedings of the Proceedings of the IEEE/CVF international conference on computer vision, 2019, pp. 9157–9166.
- 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]
- Suo, R.; Gao, F.; Zhou, Z.; Fu, L.; Song, Z.; Dhupia, J.; Li, R.; Cui, Y. Improved multi-classes kiwifruit detection in orchard to avoid collisions during robotic picking. Computers and Electronics in Agriculture 2021, 182, 106052. [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. Computers and electronics in agriculture 2019, 163, 104846. [Google Scholar] [CrossRef]
- Tian, Y.; Yang, G.; Wang, Z.; Wang, H.; Li, E.; Liang, Z. Apple detection during different growth stages in orchards using the improved YOLO-V3 model. Computers and electronics in agriculture 2019, 157, 417–426. [Google Scholar]
- Afonso, M.; Fonteijn, H.; Fiorentin, F.S.; Lensink, D.; Mooij, M.; Faber, N.; Polder, G.; Wehrens, R. Tomato fruit detection and counting in greenhouses using deep learning. Frontiers in plant science 2020, 11, 571299. [Google Scholar] [PubMed]
- Pei, Y.; Liu, H.; Bei, Q. Collision-Line Counting Method Using DeepSORT to Count Pedestrian Flow Density and Hungary Algorithm. In Proceedings of the 2021 IEEE 3rd International Conference on Civil Aviation Safety and Information Technology (ICCASIT). IEEE, 2021, pp. 621–626. [CrossRef]
- Wojke, N.; Bewley, A.; Paulus, D. Simple online and realtime tracking with a deep association metric. In Proceedings of the 2017 IEEE international conference on image processing (ICIP). IEEE, 2017, pp. 3645–3649. [CrossRef]
- Zhang, Y.; Wang, C.; Wang, X.; Zeng, W.; Liu, W. Fairmot: On the fairness of detection and re-identification in multiple object tracking. International journal of computer vision 2021, 129, 3069–3087. [Google Scholar]
- Jiacheng Rong, Hui Zhou, Fan Zhang, Ting Yuan, Pengbo Wang. Tomato cluster detection and counting using improved YOLOv5 based on RGB-D fusion, Computers and Electronics in Agriculture 2023, 207, 107741.
- Zhongxian Qi, Wenqiang Zhang, Ting Yuan, Jiacheng Rong, Wei Li et al. An improved framework based on tracking-by-detection for simultaneous estimation of yield and maturity level in cherry tomatoes, Measurement 2024, 226, 114117. [CrossRef]
- 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]
- Zan Wang, Yiming Ling, Xuanli Wang, et al. An improved Faster R-CNN model for multi-object tomato maturity detection in complex scenarios, Ecological Informatics 2022, 72, 101886. [CrossRef]
- Parico, A.I.B.; Ahamed, T. Real time pear fruit detection and counting using YOLOv4 models and deep SORT. Sensors 2021, 21, 4803. [Google Scholar] [CrossRef] [PubMed]
- Taixiong Zheng, Mingzhe Jiang, Yongfu Li, Mingchi Feng,Research on tomato detection in natural environment based on RC-YOLOv4, Computers and Electronics in Agriculture 2022, 198, 107029. [CrossRef]
- Zhou, X.; Wang, P.; Dai, G.; Yan, J.; Yang, Z. Tomato fruit maturity detection method based on YOLOV4 and statistical color model. In Proceedings of the 2021 IEEE 11th Annual International Conference on CYBER Technology in Automation, Control, and Intelligent Systems (CYBER). IEEE, 2021, pp. 904–908. [CrossRef]






| Feature | Specification |
| Dimensions | 1.4×0.86×2.2m |
| Weight | 200kg |
| Max Speed | 0.3 m/s |
| Operating Time | 6 hours |
| Camera | RealSense D435i |
| - Resolution | 1080x720 pixels |
| - Field of View (H) | [Insert FOV, 69.4°] |
| - Field of View (V) | [Insert FOV, 42.5°] |
| IMU | [IMU model,] |
| - Accuracy | [IMU accuracy, <1°/hr gyro drift] |
| -Resolution | [0.061(o/s)/(LSB)] |
| Computer | NVIDIA Jetson Nano |
| Our Method | YOLOv8+DeepSORT | Density Estimation | |||||||
| 1st | 2nd | 3rd | 1st | 2nd | 3rd | 1st | 2nd | 3rd | |
| EC | 302 | 300 | 300 | 368 | 371 | 353 | 253(E) * | 231(E) | 277(E) |
| ACC | 97.73% | 97.09% | 97.09% | 80.91% | 79.94% | 85.76% | 81.81% | 74.80% | 83.90% |
| Our Method | Density Estimation | |||||
| 1st | 2nd | 3rd | 1st | 2nd | 3rd | |
| Measured value(mature) | 234 | 231 | 231 | 195(E) * | 161(E) | 201(E) |
| Measured value(mature) | 857 | 850 | 831 | 672(E) | 728(E) | 714(E) |
| ACC(mature) | 93.22% | 92.03% | 92.03% | 77.70% | 64.14% | 80.08% |
| ACC(immature) | 92.55% | 91.79% | 89.74% | 72.57% | 78.62% | 77.10% |
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/).
