Abstract:Aiming to address the challenges of illumination fluctuation, branch and leaf occlusion, and dense fruit distribution in complex greenhouse environments for tomato maturity detection, a lightweight tomato maturity detection method was proposed. Taking YOLO v8n as the baseline model, a C2f-SHAB feature extraction module was constructed to improve the joint modeling of local details and global semantic information. The DySample upsampling module was introduced to optimize high-resolution information recovery during multi-scale feature fusion. A lightweight shared detail-aware detection head, LSDA-DHead, was designed to enhance the feature representation capability for complex boundaries and occluded regions at the detection end. Furthermore, the Focaler-DIoU loss function was incorporated to optimize the bounding box regression process. Experiments were conducted on a self-built tomato maturity dataset, in which tomatoes were classified into four stages: immature, turning-color, turning-ripe, and mature. Experimental results showed that the improved SLD-YOLO v8n model achieved a 7.11 percentage point increase in mAP@0.5 compared with the baseline YOLO v8n, while the number of parameters, floating-point operations, and model memory footprint were reduced by 30.6%, 25.9%, and 15.1%, respectively. While ensuring lightweightness, the proposed method effectively enhanced the accuracy and robustness of tomato maturity detection under complex conditions, providing technical support for intelligent harvesting robots and edge-side visual perception systems.