GCA-SUNet: A Gated Context-Aware Swin-UNet for Exemplar-Free Counting
Yuzhe Wu, Yipeng Xu, Tianyu Xu, Jialu Zhang, Jianfeng Ren, Xudong Jiang
TL;DR
GCA-SUNet tackles the challenge of exemplar-free counting by mapping images directly to object density maps using a Swin-UNet backbone augmented with gated context-aware modules. The GCAM module leverages a self-similarity matrix to identify and emphasize tokens corresponding to countable objects while suppressing background; GEFS and GAFU gate features at the bottleneck and during decoding to further focus on relevant information. Empirical results on FSC-147 and CARPK demonstrate superior accuracy and strong cross-domain generalization compared with prior exemplar-free and CAC methods, with ablation confirming the additive value of GCAM, GEFS, and GAFU. This approach reduces annotation burdens and enhances robustness, offering practical benefits for real-world counting tasks across diverse scenes.
Abstract
Exemplar-Free Counting aims to count objects of interest without intensive annotations of objects or exemplars. To achieve this, we propose a Gated Context-Aware Swin-UNet (GCA-SUNet) to directly map an input image to the density map of countable objects. Specifically, a set of Swin transformers form an encoder to derive a robust feature representation, and a Gated Context-Aware Modulation block is designed to suppress irrelevant objects or background through a gate mechanism and exploit the attentive support of objects of interest through a self-similarity matrix. The gate strategy is also incorporated into the bottleneck network and the decoder of the Swin-UNet to highlight the features most relevant to objects of interest. By explicitly exploiting the attentive support among countable objects and eliminating irrelevant features through the gate mechanisms, the proposed GCA-SUNet focuses on and counts objects of interest without relying on predefined categories or exemplars. Experimental results on the real-world datasets such as FSC-147 and CARPK demonstrate that GCA-SUNet significantly and consistently outperforms state-of-the-art methods. The code is available at https://github.com/Amordia/GCA-SUNet.
