Abstract:
Green small fruit detection during the orchard thinning stage poses significant challenges due to high color similarity between target fruits and background foliage, small physical dimensions, low image contrast, and frequent dense occlusion. These characteristics caused existing detection frameworks to suffer from shallow feature loss through repeated backbone downsampling, insufficient saliency modeling under low-contrast conditions, and semantic misalignment across feature pyramid levels. An improved detection model, AFS-DETR (Adaptive Fusion and Sensitivity-aware Real-Time DEtection TRansformer), was proposed based on Real-Time DEtection TRansformer (RT-DETR) to improve detection accuracy for green small fruits in complex orchard environments. Three targeted modules were incorporated into the RT-DETR architecture. The C2f_AdaptiveFusion (C2AF) module was designed to replace the standard backbone block with a multi-branch dynamic convolution structure combined with an Adaptive Kernel Weights (AKW) mechanism, enhancing shallow-layer detail feature representation for tiny-target localization. The HyperACE (HACE) module was introduced into the feature pyramid neck to model high-order semantic dependencies across multi-scale features via dynamic hyperedge construction, improving adaptive fusion under low-contrast conditions. The FullPAD_Tunnel (FPADT) gated alignment module was introduced to apply a learnable scalar gate to suppress cross-level semantic misalignment at the feature-pyramid-to-decoder interface with minimal computational overhead. Experiments were conducted on three datasets spanning different fruit species and scene conditions. On the self-built Golden Pear dataset comprising 2,438 high-resolution images captured under diverse orchard conditions including top-view, upward-view, front-lighting, back-lighting, occlusion, and stacking scenarios, AFS-DETR achieved an average precision at intersection-over-union threshold 0.5 (AP
50) of 90.4%, AP at threshold 0.75 (AP
75) of 78.4%, recall of 84.5%, and F1-score of 86.9%. Small-object average precision (AP
S) reached 56.8%, representing improvements of 1.1, 1.9, and 1.0 percentage points over the RT-DETR-R18 baseline in AP
50, AP
75, and AP
S, respectively. AFS-DETR recorded the highest AP
S and medium-object average precision (AP
M) of 85.7% among all compared methods, including YOLOv8-n, YOLOv11-n, YOLOv13-n, Faster R-CNN (Region-based Convolutional Neural Network), Deformable DETR (DEtection TRansformer), RTMDet-Tiny(Real-Time Models for Object Detection), and Dynamic R-CNN. On the public MinneApple benchmark comprising 1,001 images with mixed red and green apple instances at dense small-scale distributions, AFS-DETR achieved a mean average precision (AP) of 40.9% and AP
S of 27.1%, with the AP ranking first among all compared models; the AP of 40.9% exceeded Deformable DETR (18.7%) by more than a factor of two and surpassed the latest lightweight detectors YOLOv12-n (39.9%) and YOLOv13-n (36.2%). On the self-built Crabapple dataset comprising 1,057 images including nighttime low-illumination scenes, AFS-DETR achieved an AP
50 of 89.6%, AP of 65.6%, and AP
S of 52.0%, outperforming YOLOv11-n (AP
S of 49.2%), YOLOv13-n (AP
S of 45.6%), and Faster R-CNN (AP
S of 35.1%). Ablation experiments on the Golden Pear dataset confirmed that C2AF provided the largest individual performance gain as the feature-extraction foundation; the C2AF and FPADT combination achieved the highest recall of 84.3% and F1-score of 87.5% among all dual-module configurations; and the complete AFS-DETR attained the optimal AP
75 of 78.4%, with superior AP
S verified consistently across all three datasets. Regarding model efficiency, AFS-DETR contained 15.2 M parameters and 46.8 giga floating-point operations (GFLOPs), representing reductions of 23.2% and 17.8% relative to the RT-DETR-R18 baseline, respectively. End-to-end processing speed on an NVIDIA RTX
3090 graphics processing unit (GPU) reached 65.5 frames per second (FPS), satisfying quasi-real-time requirements for field deployment. AFS-DETR effectively addressed the core detection difficulties of green small fruits in complex orchard environments—low foreground-background contrast, fine-scale target dimensions, and dense occlusion—through three complementary and modular structural improvements. The model demonstrated consistent performance advantages across self-built and public benchmark datasets, confirming generalization capability across fruit species and scene variations. The proposed framework provides a reliable and deployable technical solution for precision orchard management, with direct applicability to yield estimation, growth monitoring, and intelligent robotic fruit-thinning operations.