Abstract:
Maize tassel detection and counting are often required in unmanned aerial vehicle (UAV) imagery. However, the challenges remain in dense target distributions, pronounced scale variation, overlap, occlusion, and complex field backgrounds. In this study, a lightweight adaptive sparse attention-enhanced detection transformer (AS-DETR) was developed to increase detection and counting accuracy, thus reducing computational demand and real-time inference on embedded hardware. A systematic evaluation was also conducted to determine whether the resulting detector remained reliable under illumination, image degradation, maize growth stages, and flight altitudes. Thereby it was required for the accuracy, robustness, efficiency, and deployment in aerial field monitoring. A dataset of 2,461 red, green, and blue (RGB) UAV images with 110,745 annotated tassel bounding boxes was assembled from four public sources and images collected in Tongliao, Inner Mongolia, China. Region-independent training, validation, and test subsets contained 1,722, 247, and 492 images, respectively. Illumination, occlusion, density, and noise augmentation expanded the training set into 10,332 images. The real-time detection transformer (RT-DETR) neck was modified with lightweight hybrid convolution, cross-scale alignment and concatenation, adaptive sparse self-attention (ASSA), a spatially enhanced feed-forward network (SEFN), and cross-stage multiscale feature aggregation. Comparison models were retrained uniformly. In the unified test, AS-DETR achieved average precision values of 96.3% at an intersection-over-union threshold of 0.50, 74.8% at a threshold of 0.75, and 68.6% over thresholds from 0.50 to 0.95. These values exceeded those of the original RT-DETR by 3.7, 2.6, and 3.3 percentage points, respectively. Small-object average precision increased from 38.5% to 41.8%, while medium- and large-object average precision reached 58.3% and 72.5%. Ablation experiments showed that ASSA and SEFN were combined to raise the average precision at the 0.50 threshold from 92.6% to 94.9%; Lightweight convolution and cross-scale concatenation increased to 95.6%; Cross-stage multiscale aggregation produced the final 96.3%. In counting, AS-DETR yielded a mean absolute error of 2.89 tassels, a root mean square error of 4.35 tassels, a mean absolute percentage error of 6.8%, and a coefficient of determination of 0.966. The mean absolute error was lower than 3.55 tassels by RT-DETR and 3.92 tassels by the best-performing competing one-stage detector. The lightweight redesign reduced computation from 190.2 to 120.1 billion floating-point operations, where the trainable parameters decreased from 38.7 to 35.5 million, while inference speed increased from 56.2 to 62.1 frames per second. Average precision at the 0.50 threshold remained 94.3% and 91.1%, respectively, under morning and nighttime low-illumination. Average precision at the 0.75 threshold reached 69.5% and 68.3% under focus and motion blur, respectively, exceeding the RT-DETR values by 3.2 and 2.9 percentage points. Deployment on an NVIDIA Jetson Xavier NX embedded platform showed F1 scores from 92.4% to 97.4% over the grain-filling and maturity stages, with flight altitudes of 6, 10, and 15 m. Thus, the model maintained stable detection when tassel size decreased, and scene density increased with flight altitude. The coordinated use of sparse spatial attention, local spatial enhancement, lightweight feature mapping, and bidirectional multiscale aggregation improved small and densely distributed tassel representation without imposing excessive computation. AS-DETR simultaneously reduced counting error, whereas detection accuracy and inference increased to retain robustness under illumination, blur, developmental-stage, and altitude changes. The embedded tests confirmed that the high accuracy and efficiency fully met the requirements of edge deployment, reliable maize tassel monitoring, and yield-estimation data acquisition from UAV platforms in complex field environments.