DOI: 10.3390/agriculture16131395 ISSN: 2077-0472

YOLO-SPM: Lightweight Apple Detection Algorithm in Complex Orchard Environments

Jingyue Li, Hongfei Yang, Guangchuan Hou, Junqi Xu, Jinyong Zhu, Zhiyuan Zhang, Jingbin Li, Shuanming Li

Under the dwarf-rootstock dense planting method, existing apple detection models for intelligent harvesting suffer from excessive parameter counts that hinder deployment on resource-constrained devices, while lightweight alternatives often sacrifice detection accuracy. To address this dilemma, this paper proposes YOLO-SPM, a lightweight apple detection model based on the YOLOv12n architecture, specifically designed for complex orchard environments. The core innovation lies in a problem-driven, three-stage collaborative optimization strategy: first, PConv is introduced to replace standard convolutions in the A2C2f module, reducing computational redundancy by exploiting channel-wise feature similarity of apple targets; second, the parameter-free SimAM attention mechanism is embedded in the neck network to enhance the model’s focus on occluded fruit features without increasing model size, while MBConv is integrated into the detection head to further reduce computational cost; third, WIoU v3 is adopted as the loss function to compensate for the accuracy loss incurred by lightweight design through its dynamic focusing mechanism on difficult samples. This complementary design ensures that each module addresses a distinct bottleneck of the native YOLOv12n in orchard scenarios, achieving a balance between efficiency and accuracy rather than simple module stacking. Experimental results demonstrate that YOLO-SPM achieves a precision of 92.8% and mAP@0.5 of 93.1%, outperforming the baseline by 4.8 and 5.3 percentage points, respectively, while reducing parameter count, FLOPs, and memory footprint by 40.2%, 35.4%, and 41.8%. This study provides a feasible solution for high-precision apple identification in dwarf-rootstock dense planting orchard environments, with the potential for integration into automated harvesting systems upon future on-device validation.

More from our Archive