Abstract:
Dragon fruit (pitaya) is one of the most popular tropical cash crops with high nutritional value and economic benefits in modern agriculture. Accurate fruit counting is often required for yield prediction in orchards. However, manual counting cannot fully meet the needs of large-scale production in recent years, due to high labor intensity, low efficiency, and subjectivity. In this study, a lightweight model, named YOLO11-WDTC (You Only Look Once version 11 with Wave-Depth Convolution for Target Counting), was proposed for dragon fruit counting using an improved YOLO11s for unmanned aerial vehicle (UAV) imagery. Four structural improvements were integrated into the baseline YOLO11s. In the backbone, a wave-depth convolution (WDC) module with discrete wavelet transforms (DWT) and depthwise separable convolution (DWConv) was constructed to replace the standard convolutions in C3k2. The modules were upgraded to C3k2-DWT with reduced parameters. A slice-weighted SimAM (SWS-SimAM) attention was introduced to suppress stem background interference, where energy-based weights were computed in local windows. In the neck, the dynamic upsampling operator (DySample) replaced bilinear interpolation with content-adaptive point sampling, thus alleviating the edge blur of small targets. In the detection head, the P5 layer was removed to add a P2 small-target detection layer, thereby forming a three-scale head more suitable for small aerial objects. Experiments were conducted on the UAV dragon fruit dataset of 2,602 images. The image datasets were first split into training, validation, and test datasets at a ratio of 8:1:1. Data augmentation was applied only to the training set, enlarging it from 2,082 to 3,318 images, while the validation and test sets remained 260 images each, resulting in 3,838 images in total. The experimental results showed that YOLO11-WDTC achieved a precision of 91.1% and a recall of 86.3%, where its mean average precision (mAP) at IoU 0.5 (mAP
50) and over IoU 0.5-0.95 (mAP
50-95) reached 93.4% and 52.2%, which were 2.5, 6.2, 5.6, and 5.9 percentage points higher than those of the baseline YOLO11s, while the number of parameters and the computational cost were reduced by 50.6% and 16.7%, respectively. Ablation experiments confirmed that there were the high contribution rates of each improvement: The P5 layer cut the parameters from 10.26 to 7.44 M with a slight accuracy drop; The P2 layer raised the mAP
50 from 86.1% to 91.4%; the WDC module further reduced the parameters to 5.12 M, while the mAP
50 improved to 92.5%; and the SWS-SimAM and DySample modules increased the mAP
50 to 93.4% without increasing the model complexity. Compared with eight representative lightweight YOLO-series models, YOLO11-WDTC improved the mAP
50 by 5.6-7.9 percentage points with only 31.1%-69.6% of their parameter counts, thus outperforming RT-DETR-L by 6.2 percentage points in mAP
50 with only 15.5% of its parameters. Cross-dataset validation on the public citrus dataset Oranges in the field showed that YOLO11-WDTC achieved an mAP
50 of 85.5% with 49.4% of the parameters of YOLO11s (84.4%), which outperformed NanoDet-Plus-m, SSDLite-MobileNetV2, and EfficientDet-D0 by 6.0, 5.4, and 8.1 percentage points, respectively, indicating excellent cross-crop generalization. In conclusion, there was an excellent balance between detection accuracy and model lightweightness on both the self-built pitaya and public citrus datasets. An efficient technical solution was provided to detect pitaya fruits counting on resource-constrained UAV platforms. Future work can extend the dataset to include more varieties and regions for tree pruning and improve inference speed on low-cost edge devices.