Attention-enhanced density regression attention-aware for class-agnostic few-shot object counting with cross-domain generalization

Xinyu Chen, Ziqi Zhang, Yan Ren · Engineering Research Express · 2025

Abstract This study addresses the challenge of Few-Shot Counting (FSC), aiming to count instances in query images using only a limited number of example objects. Previous FSC methods have shown low counting accuracy and depend on manually annotated example boxes, which obstruct the automation of counting. To overcome these issues, we propose a novel FSC method—AFSC-Net, which comprises two key modules: the Exemplar Object Selection Module (EOSM) and the Attention-Enhanced Density Regression Module (AEDRM). The EOSM utilizes a self-attention mechanism to automatically select and annotate exemplar objects, reducing dependence on manual annotations. The AEDRM introduces channel and spatial attention mechanisms to enhance the representation of critical information in feature maps, thereby optimizing counting accuracy and robustness. Additionally, we have improved the FSC-147 dataset and employed data augmentation techniques to enhance the model’s generalization capability. Experimental results show that AFSC-Net performs exceptionally well in complex and dense scenarios, achieving higher counting accuracy and lower error rates.

Read the paper · More papers on PaperTik