Achieving precise fruit localization and fine branch segmentation simultaneously in unstructured orchard environments remains challenging due to variable lighting, occlusion, and complex backgrounds. This study proposed a joint detection–segmentation architecture based on an improved YOLOv11 network for collaborative perception of apples and tree branches. First, a dual-task dataset of spindle-type apple orchards was constructed with bounding-box annotations for fruits and pixel-level polygon masks for branches, encompassing diverse illumination and occlusion conditions. Second, Convolutional Block Attention Modules (CBAMs) are strategically embedded into the YOLOv11 backbone to enhance feature discrimination for slender branch structures while preserving high fruit detection accuracy. The enhanced model achieves precision of 0.981, recall of 0.986, and F1-score of 0.983 for apple detection, and precision of 0.803, recall of 0.715, mAP of 0.698, and IoU of 0.6066 for branch segmentation on the validation set. Comparative experiments against YOLOv8 and baseline YOLOv11 confirm improved segmentation continuity and finer branch delineation. The proposed integrated perception framework provides reliable visual guidance for collision-avoidance robotic harvesting and offers a practical reference for multi-task agricultural vision systems.
Yan et al. (Sat,) studied this question.