Density Guided Query Allocation in RT-DETR for Orchard Blossom Density Mapping
Authors
Tadas Mikalauskas, Arnas Butkus, Ramūnas ŠležasFiles
Abstract
Orchard blossom mapping requires the localization of individual flowers and preservation of spatial variation in densely flowering regions. A fixed decoder query budget can allocate excessive capacity to background while leaving crowded regions underrepresented. This paper proposes a density-guided query allocation framework within a real-time detection transformer for blossom detection and image-plane density mapping. A lightweight density branch estimates regional blossom abundance, while a budget-conserving allocation rule distributes spatial queries and retains a global exploration reserve. Boundary-aware selection and count-consistent supervision connect object detection with normalized spatial maps. Evaluation uses orchard-block partitions to examine detection and mapping errors and allocation stability under varying density, illumination, and visibility conditions. The evaluation set contains 2,400 images, including a held-out partition of 480 images. The complete model achieves an average precision of 0.516 and a mean absolute count error of 8.6 blossoms per image. Normalized density map error decreases from 0.218 to 0.151, while inference latency increases from 18.4 to 20.1 ms. These metrics jointly characterize detection accuracy, spatial mapping error, and computational cost. The framework allocates finite decoder capacity according to regional abundance while incorporating safeguards against density estimation errors. Evaluation across operating conditions connects local query coverage with counting accuracy and spatial map agreement.
References
Lv, M., Xu, Y.-X., Miao, Y.-H., & Su, W.-H. (2025). A comprehensive review of deep learning in computer vision for monitoring apple tree growth and fruit production. Sensors, 25(8), Article 2433. https://doi.org/10.3390/s25082433
Shang, Y., Geng, M., Fang, H., Cai, M., Wang, J., & Song, H. (2024). Using unmanned aerial vehicle acquired RGB images and Density-Cluster-Count model for tree-level apple flower quantification. Computers and Electronics in Agriculture, 226, Article 109389. https://doi.org/10.1016/j.compag.2024.109389
Yan, J., Duan, H., Xu, R., Sun, M., Yang, L., & Jia, W. (2026). DyRFA-Net: Apple flower blooming stage detection based on anther color features. Computers and Electronics in Agriculture, 248, Article 111772. https://doi.org/10.1016/j.compag.2026.111772
Vitousek, M., Vrba, J., Cejnek, M., Jura, J., & Schankova, K. (2026). Dual-view weakly-supervised learning for apple tree flower counting. Frontiers in Plant Science, 17, Article 1869941. https://doi.org/10.3389/fpls.2026.1869941
Geng, M., Shang, Y., Xiang, S., Wang, J., Wang, L., & Song, H. (2025). Using improved density peak clustering algorithm for flower cluster identification and apple central and peripheral flower detection. Computers and Electronics in Agriculture, 232, Article 110095. https://doi.org/10.1016/j.compag.2025.110095
Wang, D., Song, H., & Wang, B. (2025). YO-AFD: An improved YOLOv8-based deep learning approach for rapid and accurate apple flower detection. Frontiers in Plant Science, 16, Article 1541266. https://doi.org/10.3389/fpls.2025.1541266
Yang, Y., Li, Y., Cao, K., Chen, X., & Jia, W. (2025). LEAF-Net: A multi-scale frequency-aware framework for automated apple blossom monitoring in complex orchard. Horticulturae, 11(11), Article 1382. https://doi.org/10.3390/horticulturae11111382
Bhattarai, U., Bhusal, S., Zhang, Q., & Karkee, M. (2024). AgRegNet: A deep regression network for flower and fruit density estimation, localization, and counting in orchards. Computers and Electronics in Agriculture, 227, Article 109534. https://doi.org/10.1016/j.compag.2024.109534
Huang, Y.-X., Liu, H.-I., Shuai, H.-H., & Cheng, W.-H. (2025). DQ-DETR: DETR with dynamic query for tiny object detection. In A. Leonardis, E. Ricci, S. Roth, O. Russakovsky, T. Sattler, & G. Varol (Eds.), Computer vision – ECCV 2024 (Lecture Notes in Computer Science, Vol. 15134, pp. 290–305). Springer. https://doi.org/10.1007/978-3-031-73116-7_17
Wang, S., Liu, M., Dong, S., & Chen, S. (2025). ERL-RTDETR: A lightweight transformer-based framework for high-accuracy apple disease detection in precision agriculture. Concurrency and Computation: Practice and Experience, 37(23–24), Article e70276. https://doi.org/10.1002/cpe.70276
Wang, D., & Wang, B. (2026). A high-quality apple flower detection dataset for precision agriculture. Frontiers in Plant Science, 17, Article 1927541. https://doi.org/10.3389/fpls.2026.1927541
Li, T., Zhang, Z., Zhu, M., Cui, Z., & Wei, D. (2024). Combining transformer global and local feature extraction for object detection. Complex & Intelligent Systems, 10(4), 4897–4920. https://doi.org/10.1007/s40747-024-01409-z
Koldasbayeva, D., Tregubova, P., Gasanov, M., Zaytsev, A., Petrovskaia, A., & Burnaev, E. (2024). Challenges in data-driven geospatial modeling for environmental research and practice. Nature Communications, 15(1), Article 10700. https://doi.org/10.1038/s41467-024-55240-8
Zhou, L., Rao, S., Li, W., Hu, B., & Sun, B. (2024). Multi-branch progressive embedding network for crowd counting. Image and Vision Computing, 148, Article 105140. https://doi.org/10.1016/j.imavis.2024.105140
Phan, D. T., Gao, J., Lu, Y., Yap, K.-H., Garg, K., & Han, B. S. (2024). DEO-Net: Joint density estimation and object detection for crowd counting. IEEE Transactions on Instrumentation and Measurement, 73, 1–11. https://doi.org/10.1109/tim.2024.3441018
Yuan, M., Zhang, W., Yan, C., Gong, T., Zhang, Y., & Ying, J. (2024). Adaptive token selection for efficient detection transformer with dual teacher supervision. Knowledge-Based Systems, 300, Article 112036. https://doi.org/10.1016/j.knosys.2024.112036
Senthivel, T., & Vu, N.-S. (2025). QR-DETR: Query routing for detection transformer. In M. Cho, I. Laptev, D. Tran, A. Yao, & H. Zha (Eds.), Computer vision – ACCV 2024 (Lecture Notes in Computer Science, Vol. 15477, pp. 395–412). Springer. https://doi.org/10.1007/978-981-96-0960-4_24
Huseljic, D., Herde, M., Hahn, P., Müjde, M., & Sick, B. (2025). Systematic evaluation of uncertainty calibration in pretrained object detectors. International Journal of Computer Vision, 133(3), 1033–1047. https://doi.org/10.1007/s11263-024-02219-z
John, K., Saurette, D. D., & Heung, B. (2025). The problematic case of data leakage: A case for leave-profile-out cross-validation in 3-dimensional digital soil mapping. Geoderma, 455, Article 117223. https://doi.org/10.1016/j.geoderma.2025.117223
Li, Z., Dong, Y., Shen, L., Liu, Y., Pei, Y., Yang, H., Zheng, L., & Ma, J. (2024). Development and challenges of object detection: A survey. Neurocomputing, 598, Article 128102. https://doi.org/10.1016/j.neucom.2024.128102
Zhang, Z., Zhang, L., Zhang, H., Guo, Y., Wang, H., & Lu, X. (2024). AMSA-CAFF Net: Counting and high-quality density map estimation from X-ray images of electronic components. Expert Systems with Applications, 237, Article 121602. https://doi.org/10.1016/j.eswa.2023.121602
Kong, C., Li, F., Yan, X., Yang, J., Mo, P., Luo, Q., & Mao, R. (2026). Object detection on low-compute edge SoCs: A reproducible benchmark and deployment guidelines. Scientific Reports, 16(1), Article 5875. https://doi.org/10.1038/s41598-026-36862-y
Kapoor, S., Cantrell, E. M., Peng, K., Pham, T. H., Bail, C. A., Gundersen, O. E., Hofman, J. M., Hullman, J., Lones, M. A., Malik, M. M., Nanayakkara, P., Poldrack, R. A., Raji, I. D., Roberts, M., Salganik, M. J., Serra-Garcia, M., Stewart, B. M., Vandewiele, G., & Narayanan, A. (2024). REFORMS: Consensus-based recommendations for machine-learning-based science. Science Advances, 10(18), Article eadk3452. https://doi.org/10.1126/sciadv.adk3452
Pawikhum, K., Yang, Y., He, L., & Heinemann, P. (2025). Development of a machine vision system for apple bud thinning in precision crop load management. Computers and Electronics in Agriculture, 236, Article 110479. https://doi.org/10.1016/j.compag.2025.110479
Raiaan, M. A. K., Sakib, S., Fahad, N. M., Mamun, A. A., Rahman, M. A., Shatabda, S., & Mukta, M. S. H. (2024). A systematic review of hyperparameter optimization techniques in convolutional neural networks. Decision Analytics Journal, 11, Article 100470. https://doi.org/10.1016/j.dajour.2024.100470
Hozhabr, S. H., & Giorgi, R. (2025). A survey on real-time object detection on FPGAs. IEEE Access, 13, 38195–38238. https://doi.org/10.1109/access.2025.3544515
Checola, G., Moser, D., Sonego, P., Iob, C., Micheli, F., & Franceschi, P. (2025). Apple phenotyping using deep learning and 3D depth analysis: An experimental study on fruitlet sizing during early development. Smart Agricultural Technology, 11, Article 100964. https://doi.org/10.1016/j.atech.2025.100964
Nikouei, M., Baroutian, B., Nabavi, S., Taraghi, F., Aghaei, A., Sajedi, A., & Moghaddam, M. E. (2025). Small object detection: A comprehensive survey on challenges, techniques and real-world applications. Intelligent Systems with Applications, 27, Article 200561. https://doi.org/10.1016/j.iswa.2025.200561
Liu, C., Li, X., Xiao, W., & Xie, S. (2024). CCDet: Confidence-consistent learning for dense object detection. IEEE Transactions on Image Processing, 33, 2746–2758. https://doi.org/10.1109/tip.2024.3378457
Reluga, K., Lombardía, M.-J., & Sperlich, S. (2024). Bootstrap-based statistical inference for linear mixed effects under misspecifications. Computational Statistics & Data Analysis, 199, Article 108014. https://doi.org/10.1016/j.csda.2024.108014
Semmelrock, H., Ross-Hellauer, T., Kopeinik, S., Theiler, D., Haberl, A., Thalmann, S., & Kowald, D. (2025). Reproducibility in machine-learning-based research: Overview, barriers, and drivers. AI Magazine, 46(2), Article e70002. https://doi.org/10.1002/aaai.70002