Cucumber Robotic Continuous Harvesting: Enhanced YOLOv8n Detection and Dynamic Bézier Curve-Assisted Collision-Free Path Generation
Abstract
1. Introduction
- (a)
- A dedicated robotic body for continuous cucumber harvesting with an end-effector mechanical structure designed according to continuous harvesting principles;
- (b)
- An enhanced YOLOv8n object detection algorithm for visual perception, which includes a lightweight GhostNet architecture, a CGFM feature fusion module, and an MPDIoU loss function. The optimal model configuration was determined through multiple rounds of ablation experiments. This model accurately identifies cucumbers in complex dense environments, providing precise picking positions for the robot; it has the advantages of fewer parameters and low computational complexity, enabling practical engineering deployment.
- (c)
- A collision-free trajectory generation technique based on continuous harvesting pathways is proposed for path planning. This method combines a cubic Bézier curve obstacle avoidance technique with fruit-picking sequence planning. This approach first identifies local fruit clusters via the DBSCAN clustering algorithm, and then uses a 3D Gaussian kernel function to calculate the distance-weighted index j for each cluster. After allocating pathways among fruits in clusters, it optimizes trajectories by avoiding obstacles. Enhanced Bézier Continuous Picking, or EBCP, is the name of this path generation technique.
2. Materials and Methods
2.1. Harvesting Pathways and Strategies
2.1.1. Continuous Harvesting Pathway Model
2.1.2. Cucumber Harvesting Robot
2.1.3. Planning Collision-Free Harvesting Sequences for Cucumbers
2.2. Machine Vision Inspection Models
2.2.1. Data Collection and Construction
2.2.2. Improve the Overall Structure of the YOLO v8 Model
2.2.3. Optimization of the Backbone Network
2.2.4. CGFM Feature Fusion Module
2.2.5. MPDIoU Loss Function
2.2.6. Model Training and Evaluation Metrics
3. Experiments and Results
3.1. Machine Vision Inspection Results
3.1.1. Loss Function Performance Validation
3.1.2. Ablation Experiment
3.1.3. Comparison of Detection Capabilities Across Different Algorithms
3.1.4. Visual Analysis of Detection Results
3.2. Experimental Results of Collision-Free Continuous Harvesting of Cucumbers
3.2.1. Simulation Experiments
3.2.2. Practical Experiments
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Yang, Q.-H.; Qi, L.-Y.; Bao, G.-J.; Gao, F.; Zhang, L.-B. Cucumber Image Segmentation Algorithm Based on Rough Set Theory. N. Z. J. Agric. Res. 2007, 50, 989–996. [Google Scholar] [CrossRef]
- El-Ansary, D.O. Smart Farming and Orchard Management: Insights and Innovations. Curr. Food Sci. Technol. Rep. 2025, 3, 10. [Google Scholar] [CrossRef]
- Paul, A.; Machavaram, R.; Ambuj; Kumar, D.; Nagar, H. Smart Solutions for Capsicum Harvesting: Unleashing the Power of YOLO for Detection, Segmentation, Growth Stage Classification, Counting, and Real-Time Mobile Identification. Comput. Electron. Agric. 2024, 219, 108832. [Google Scholar] [CrossRef]
- Wang, L.; Hou, Y.; He, J. Target recognition and detection of Camellia oleifera fruit in natural scene based on Mask-RCNN. J. Chin. Agric. Mech. 2022, 43, 148–154, 189. [Google Scholar] [CrossRef]
- Zhang, W.; Wang, Y.; Shen, G.; Li, C.; Li, M.; Guo, Y. Tobacco Leaf Segmentation Based on Improved MASK RCNN Algorithm and SAM Model. IEEE Access 2023, 11, 103102–103114. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- 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. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
- Wang, C.-Y.; Yeh, I.-H.; Mark Liao, H.-Y. YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information. In Proceedings of the Computer Vision—ECCV 2024; Springer: Cham, Switzerland, 2025; pp. 1–21. [Google Scholar]
- 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; Leibe, B., Matas, J., Sebe, N., Welling, M., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 21–37. [Google Scholar]
- Chang, W.; Tan, Y.; Zhou, L.; Yang, Q. Tomato Ripening Detection in Natural Environment Based on Improved YOLOv5s. Acta Agric. Univ. Jiangxiensis 2024, 46, 1025–1036. [Google Scholar] [CrossRef]
- Pan, Y.; Zhu, N.; Ding, L.; Li, X.; Goh, H.-H.; Han, C.; Zhang, M. Identification and Counting of Sugarcane Seedlings in the Field Using Improved Faster R-CNN. Remote Sens. 2022, 14, 5846. [Google Scholar] [CrossRef]
- Li, M.; Xiao, Y.; Zong, W.; Song, B. Detecting chestnuts using improved lightweight YOLOv8. Trans. Chin. Soc. Agric. Eng. 2024, 40, 201–209. [Google Scholar]
- Xu, D.; Ren, R.; Zhao, H.; Zhang, S. Intelligent Detection of Muskmelon Ripeness in Greenhouse Environment Based on YOLO-RFEW. Agronomy 2024, 14, 1091. [Google Scholar] [CrossRef]
- Luo, Q.; Wu, C.; Wu, G.; Li, W. A Small Target Strawberry Recognition Method Based on Improved YOLOv8n Model. IEEE Access 2024, 12, 14987–14995. [Google Scholar] [CrossRef]
- Li, Y.; Wang, Y.; Xu, D.; Zhang, J.; Wen, J. An Improved Mask RCNN Model for Segmentation of ‘Kyoho’ (Vitis labruscana) Grape Bunch and Detection of Its Maturity Level. Agriculture 2023, 13, 914. [Google Scholar] [CrossRef]
- Zhong, Z.; Yun, L.; Cheng, F.; Chen, Z.; Zhang, C. Light-YOLO: A Lightweight and Efficient YOLO-Based Deep Learning Model for Mango Detection. Agriculture 2024, 14, 140. [Google Scholar] [CrossRef]
- Wang, Q.; Xu, F.; Chen, Q.; Mi, Z.; Fan, Y.; Su, B. Detection and Location of Wine Grape (Cabernet Sauvignon) Picking Points by Using a Dual-Stage Deep Learning Method. Comput. Electron. Agric. 2025, 237, 110637. [Google Scholar] [CrossRef]
- Li, Y.; Feng, Q.; Zhang, Y.; Peng, C.; Ma, Y.; Liu, C.; Ru, M.; Sun, J.; Zhao, C. Peduncle Collision-Free Grasping Based on Deep Reinforcement Learning for Tomato Harvesting Robot. Comput. Electron. Agric. 2024, 216, 108488. [Google Scholar] [CrossRef]
- Wang, D.; Dong, Y.; Lian, J.; Gu, D. Adaptive End-Effector Pose Control for Tomato Harvesting Robots. J. Field Robot. 2023, 40, 535–551. [Google Scholar] [CrossRef]
- Ye, L.; Duan, J.; Yang, Z.; Zou, X.; Chen, M.; Zhang, S. Collision-Free Motion Planning for the Litchi-Picking Robot. Comput. Electron. Agric. 2021, 185, 106151. [Google Scholar] [CrossRef]
- Li, T.; Xie, F.; Zhao, Z.; Zhao, H.; Guo, X.; Feng, Q. A Multi-Arm Robot System for Efficient Apple Harvesting: Perception, Task Plan and Control. Comput. Electron. Agric. 2023, 211, 107979. [Google Scholar] [CrossRef]
- Zhang, H.; Li, X.; Wang, L.; Liu, D.; Wang, S. Construction and Optimization of a Collaborative Harvesting System for Multiple Robotic Arms and an End-Picker in a Trellised Pear Orchard Environment. Agronomy 2024, 14, 80. [Google Scholar] [CrossRef]
- Xiong, C.; Xiong, J.; Yang, Z.; Hu, W. Path planning method for citrus picking manipulator based on deep reinforcement learning. J. South China Agric. Univ. 2023, 44, 473–483. [Google Scholar] [CrossRef]
- Hou, G.; Chen, H.; Niu, R.; Li, T.; Ma, Y.; Zhang, Y. Research on Multi-Layer Model Attitude Recognition and Picking Strategy of Small Tomato Picking Robot. Comput. Electron. Agric. 2025, 232, 110125. [Google Scholar] [CrossRef]
- Riboli, M.; Jaccard, M.; Silvestri, M.; Manconi, E.; Aimi, A.; Garziera, R. Collision-Free Motion Generation for Dual-Gantry Robotic Systems. Robot. Auton. Syst. 2025, 192, 105031. [Google Scholar] [CrossRef]
- Kramer, O.; Danielsiek, H. DBSCAN-Based Multi-Objective Niching to Approximate Equivalent Pareto-Subsets. In Proceedings of the 12th Annual Conference on Genetic and Evolutionary Computation; Association for Computing Machinery: New York, NY, USA, 2010; pp. 503–510. [Google Scholar]
- Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. GhostNet: More Features from Cheap Operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 14–19 June 2020. [Google Scholar]
- Wang, J.; Gao, J.; Zhang, B. A Small Object Detection Model in Aerial Images Based on CPDD-YOLOv8. Sci. Rep. 2025, 15, 770. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- Tang, L.; Yan, Q.; Xiang, X.; Fang, L.; Ma, J. C2RF: Bridging Multi-Modal Image Registration and Fusion via Commonality Mining and Contrastive Learning. Int. J. Comput. Vis. 2025, 133, 5262–5280. [Google Scholar] [CrossRef]
- Ma, X.; Dai, X.; Bai, Y.; Wang, Y.; Fu, Y. Rewrite the Stars. In Proceedings of the CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 17–21 June 2024; pp. 5694–5703. [Google Scholar]
- Ma, S.; Xu, Y. MPDIoU: A Loss for Efficient and Accurate Bounding Box Regression. arXiv 2023, arXiv:2307.07662. [Google Scholar] [CrossRef]
- Ning, Z.; Luo, L.; Ding, X.; Dong, Z.; Yang, B.; Cai, J.; Chen, W.; Lu, Q. Recognition of Sweet Peppers and Planning the Robotic Picking Sequence in High-Density Orchards. Comput. Electron. Agric. 2022, 196, 106878. [Google Scholar] [CrossRef]
- Wang, K.; Yang, S.; Liu, X.; Song, J.; Li, Y.; Xie, F. Research on Target Recognition, Localization, and Picking Sequence Planning for Tomato-Picking Robots in Greenhouse Environments. Smart Agric. Technol. 2025, 12, 101628. [Google Scholar] [CrossRef]















| Loss | P/% | R/% | mAP@50/% | mAP@50:95/% |
|---|---|---|---|---|
| CIoU | 86.8 | 77.9 | 83.6 | 57.8 |
| DIoU | 87.9 | 76.4 | 83 | 56.2 |
| GIoU | 86.9 | 77.3 | 83.4 | 55.4 |
| EIoU | 85 | 75.3 | 80.4 | 55 |
| SIoU | 85.1 | 75.1 | 81.8 | 55.8 |
| MPDIoU | 87.7 | 78.5 | 84.2 | 59.7 |
| Scheme | GHOST | CGFM | MPDIoU | P/% | R/% | FLOPs/G | mAP@50/% | Model Size/MB |
|---|---|---|---|---|---|---|---|---|
| 1 | × | × | × | 85.8 | 75.7 | 8.1 | 81.7 | 6.3 |
| 2 | √ | × | × | 82.8 | 73.5 | 6.5 | 81.2 | 5.1 |
| 3 | × | √ | × | 86.5 | 77.9 | 8.2 | 82.9 | 6.5 |
| 4 | × | × | √ | 86.6 | 77.3 | 8.1 | 82.9 | 6.3 |
| 5 | √ | √ | × | 86.8 | 77.9 | 6.6 | 83.6 | 5.3 |
| 6 | √ | × | √ | 84.7 | 73.2 | 6.5 | 81.8 | 5.1 |
| 7 | × | √ | √ | 87.6 | 74.0 | 8.2 | 83.4 | 6.5 |
| 8 | √ | √ | √ | 87.7 | 78.5 | 6.6 | 84.2 | 5.3 |
| Model | P/% | R/% | mAP@50/% | FLOPs/G | Model Size/MB | Inference Time/ms | Training Time/min |
|---|---|---|---|---|---|---|---|
| Faster R-CNN | 73.2 | 73.5 | 70.5 | 140.1 | 108.2 | 18.9 | 385 |
| SSD | 87.1 | 67.4 | 78.4 | 75.2 | 70.6 | 8.7 | 182 |
| YOLOv5n | 85.0 | 72.9 | 78.6 | 4.2 | 3.9 | 2.2 | 75 |
| YOLOv7-tiny | 87.6 | 74.0 | 80.3 | 13.0 | 12.3 | 2.5 | 95 |
| YOLOv8n | 85.8 | 75.7 | 81.7 | 8.1 | 6.3 | 1.9 | 78 |
| YOLOv10n | 85.7 | 75.5 | 81.9 | 8.4 | 6.7 | 2.0 | 80 |
| YOLOv11n | 86.1 | 76.3 | 82.1 | 6.5 | 5.5 | 1.8 | 72 |
| YOLOv8-GCM | 87.7 | 78.5 | 84.2 | 6.6 | 5.3 | 1.7 | 69 |
| Number of Cucumbers | Algorithm | Value of Traversal Path (m) | Number of Collisions | Collision-Free Picking Rate (%) |
|---|---|---|---|---|
| 10 | EBCP | 10.16 | 0 | 100 |
| RRT-CP | 10.02 | 1 | 90 | |
| CP | 9.77 | 1 | 90 | |
| RP | 31.52 | 2 | 80 | |
| AYDY | 31.52 | 0 | 100 | |
| K-G Method | 10.13 | 1 | 90 | |
| 14 | EBCP | 15.55 | 1 | 92.86 |
| RRT-CP | 13.72 | 3 | 78.57 | |
| CP | 11.81 | 3 | 78.57 | |
| RP | 44.11 | 4 | 71.43 | |
| AYDY | 44.11 | 0 | 100 | |
| K-G Method | 16.34 | 2 | 85.71 | |
| 18 | EBCP | 18.96 | 1 | 94.44 |
| RRT-CP | 17.66 | 3 | 83.33 | |
| CP | 13.01 | 2 | 88.89 | |
| RP | 58.10 | 4 | 77.78 | |
| AYDY | 58.10 | 2 | 88.89 | |
| K-G Method | 18.57 | 3 | 83.33 | |
| 22 | EBCP | 19.40 | 0 | 100 |
| RRT-CP | 18.21 | 4 | 81.82 | |
| CP | 13.67 | 4 | 81.82 | |
| RP | 68.55 | 8 | 63.61 | |
| AYDY | 68.55 | 2 | 90.91 | |
| K-G Method | 18.86 | 3 | 82.61 | |
| 26 | EBCP | 24.17 | 1 | 96.15 |
| RRT-CP | 22.69 | 4 | 84.62 | |
| CP | 17.83 | 6 | 76.92 | |
| RP | 81.23 | 12 | 53.85 | |
| AYDY | 81.23 | 2 | 92.31 | |
| K-G Method | 24.51 | 4 | 84.62 | |
| average | EBCP | 17.65 | 0.6 | 96.69 |
| RRT-CP | 16.46 | 3.0 | 83.67 | |
| CP | 13.22 | 3.2 | 83.24 | |
| RP | 56.70 | 6 | 69.33 | |
| AYDY | 56.70 | 1.2 | 94.42 | |
| K-G Method | 17.68 | 2.6 | 85.25 |
| Number of Cucumbers | Algorithm | Simulate Collision-Free Pickup Rates (%) | Actual Number of Collisions | Actual Collision-Free Pickup Rate (%) |
|---|---|---|---|---|
| 10 | EBCP | 100 | 0 | 100 |
| RRT-CP | 100 | 0 | 100 | |
| CP | 90 | 1 | 90 | |
| RP | 90 | 2 | 80 | |
| AYDY | 100 | 0 | 100 | |
| K-G Method | 100 | 1 | 90 | |
| 14 | EBCP | 92.9 | 1 | 92.9 |
| RRT-CP | 71.4 | 4 | 71.4 | |
| CP | 71.4 | 4 | 71.4 | |
| RP | 64.3 | 5 | 64.3 | |
| AYDY | 92.9 | 1 | 92.9 | |
| K-G Method | 78.6 | 3 | 78.6 | |
| 18 | EBCP | 94.4 | 2 | 88.9 |
| RRT-CP | 88.9 | 4 | 77.8 | |
| CP | 83.3 | 4 | 77.8 | |
| RP | 77.8 | 6 | 66.7 | |
| AYDY | 94.4 | 2 | 88.9 | |
| K-G Method | 88.3 | 3 | 88.3 | |
| 22 | EBCP | 95.5 | 2 | 90.9 |
| RRT-CP | 77.3 | 5 | 77.3 | |
| CP | 77.3 | 6 | 72.7 | |
| RP | 68.2 | 9 | 59.1 | |
| AYDY | 90.9 | 3 | 86.4 | |
| K-G Method | 81.8 | 5 | 77.3 | |
| 26 | EBCP | 88.5 | 3 | 88.5 |
| RRT-CP | 73.1 | 8 | 69.2 | |
| CP | 73.1 | 8 | 69.2 | |
| RP | 57.7 | 13 | 50 | |
| AYDY | 88.5 | 3 | 88.5 | |
| K-G Method | 88.5 | 6 | 76.9 | |
| average | EBCP | 94.26 | 1.6 | 92.24 |
| RRT-CP | 82.14 | 4.2 | 79.14 | |
| CP | 79.02 | 4.6 | 76.22 | |
| RP | 71.6 | 7 | 64.02 | |
| AYDY | 93.34 | 1.8 | 91.34 | |
| K-G Method | 87.44 | 3.6 | 82.22 |
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. |
© 2026 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.
Share and Cite
Zhao, C.; Wang, H.; Li, W.; Zheng, H.; Zhou, L.; Qian, M. Cucumber Robotic Continuous Harvesting: Enhanced YOLOv8n Detection and Dynamic Bézier Curve-Assisted Collision-Free Path Generation. Agriculture 2026, 16, 888. https://doi.org/10.3390/agriculture16080888
Zhao C, Wang H, Li W, Zheng H, Zhou L, Qian M. Cucumber Robotic Continuous Harvesting: Enhanced YOLOv8n Detection and Dynamic Bézier Curve-Assisted Collision-Free Path Generation. Agriculture. 2026; 16(8):888. https://doi.org/10.3390/agriculture16080888
Chicago/Turabian StyleZhao, Chengheng, Huan Wang, Wenhao Li, Hengyi Zheng, Le Zhou, and Mengbo Qian. 2026. "Cucumber Robotic Continuous Harvesting: Enhanced YOLOv8n Detection and Dynamic Bézier Curve-Assisted Collision-Free Path Generation" Agriculture 16, no. 8: 888. https://doi.org/10.3390/agriculture16080888
APA StyleZhao, C., Wang, H., Li, W., Zheng, H., Zhou, L., & Qian, M. (2026). Cucumber Robotic Continuous Harvesting: Enhanced YOLOv8n Detection and Dynamic Bézier Curve-Assisted Collision-Free Path Generation. Agriculture, 16(8), 888. https://doi.org/10.3390/agriculture16080888

