Abstract:Aiming at the technical challenges in the robotic harvesting process of asparagus, such as insufficient perception accuracy, high miss rate, adhesion of overlapping instances, and weak cross- domain generalization caused by dense plant distribution and severe occlusion, an in-depth analysis of the slender geometric morphology and spatial features of dense occlusion in asparagus was conducted. An instance segmentation model, dynamic gated attention-detection transformer (DGA-DETR), which integrated dynamic gated attention and edge awareness, was proposed. By designing a dynamic gated attention (DGA) module, an instance-semantic-driven dynamic gating mechanism was utilized to achieve precise feature focusing across space and scales, effectively suppressing background noise interference under dense occlusion at the mechanistic level. Additionally, an edge-aware up-and-down sampling mechanism was constructed to strengthen boundary decoupling capabilities, improving the model’s segmentation modeling accuracy for the slender morphology of asparagus and occlusion boundary regions. To verify the effectiveness of the segmentation model, an asparagus harvesting dataset covering different lighting conditions and occlusion levels was constructed for model training, encompassing multi-level domain shifts in pixels, scenes, and semantics, and a cross-domain dataset was established for testing. Experimental results demonstrated that the proposed DGA-DETR model achieved Mask precision, Mask recall, Mask mAP@ 0. 5, and Mask mAP@ 0. 5:0. 95 of 91. 60% , 67. 24% , 90. 98% , and 59. 13% , respectively, representing improvements of 5. 33, 8. 43, 6. 56, and 9. 51 percentage points over the baseline model, and significantly reducing missed instances and mask discontinuities under dense occlusion conditions. Cross-domain test results indicated that this method exhibited excellent robustness and generalization capabilities for the precise identification of asparagus under occlusion and complex backgrounds. The research results can provide a technical reference for the robotic harvesting of other tender-stem crops in complex environments.