Abstract:To address the numerous challenges faced in tomato harvesting, such as the aging of farmers, labor shortages, and rising labor costs, and resolve issues related to the low maturity detection accuracy and inaccurate instance segmentation of tomato harvesting robots in complex orchard environments, an improved YOLO v8 network-based real-time tomato maturity detection algorithm was proposed. Firstly, by introducing the channel embedded positional attention module and an improved large kernel convolutional block attention module into the YOLO v8n network, the algorithm can effectively retain the positional information of tomato targets in the shallow network layers and establish long-range dependencies between target regions, thereby significantly increasing the attention of the YOLO v8n network to critical tomato features. Then a series of comprehensive and rigorous comparative experiments were conducted on the LaboroTomato dataset, demonstrating that the improved YOLO v8n network achieved 0.4 percentage points, 1.4 percentage points, and 0.3 percentage points, 1.2 percentage points improvements in detection and segmentation mAP@50 and mAP@50-95, respectively, compared with that of the original YOLO v8n network. Finally, the improved YOLO v8n network was lightweight deployed on the low-cost, low-computation, and low-power Jetson Nano platform, successfully reducing memory usage from overflow to 2.4 GB and doubling the inference speed. The research result can provide robust technical support for the real-time and accurate detection of tomato maturity by tomato harvesting robots in complex scenarios, significantly enhancing the overall efficiency and effectiveness of automated tomato harvesting operations.