Abstract:Automated harvesting of ginkgo fruits is beneficial for prolonging post-harvest freshness and maintaining quality during storage. Accurate identification of fruit stems is essential for the precise operation of end-effectors in robotic harvesting systems. However, the complexity of the working environment, coupled with the slender and variable morphology of ginkgo stems, poses significant challenges to reliable detection and recognition. To address this issue, a real-time detection method was proposed based on the FGP-YOLO 11n architecture. The FasterNeXt and GELAN modules were integrated into the backbone and neck networks of YOLO 11n, respectively, while the CIoU loss function was replaced with the PIoU loss function. These enhancements were designed to enable accurate and real-time detection of ginkgo stems. Meanwhile, to comprehensively evaluate the performance of the FGP-YOLO 11n model, a series of validation techniques, including Grad-CAM visualization, ablation experiments, and performance analyses were conducted. Furthermore, the model's detection performance was benchmarked against classical models across various scenarios. Experimental results demonstrated that the FGP-YOLO 11n model achieved a precision of 93.80%, a recall of 90.50%, and a mean average precision (mAP) of 93.10% in detecting ginkgo stems. Compared with the classical YOLO 11n model, the proposed approach achieved improvements of 5.60 percentage points, 5.60 percentage points, and 3.50 percentage points in respective evaluation metrics, while maintaining real-time processing at 72.73 frames per second (FPS). Overall, it outperformed the established object detection frameworks such as DETR, EfficientDet, RetinaNet, and SSD, effectively meeting the demands of real-world agricultural operations. These findings can support the advancement of smart agriculture and facilitate the practical integration of machine vision technologies in intelligent harvesting systems.