Learning to Count without Annotations
Lukas Knobel, Tengda Han, Yuki M. Asano
TL;DR
This work tackles reference-based counting without manual annotations by generating Self-Collages from unlabeled data and training a transformer-based counting model with pseudo-density supervision derived from segmentation. It leverages a frozen DINO-based ViT backbone for both image and exemplar encoding and a cross-attention-based interaction module to produce a density map $\hat{\mathbf{y}}$ conditioned on exemplars $\mathcal{S}$. Across FSC-147, CARPK, and MSO, UnCounTR outperforms simple baselines and, in several settings, matches supervised counting models, demonstrating strong generalization and robustness to domain shift. By enabling counting without labeled data and even permitting self-supervised semantic counting, this approach reduces annotation costs and opens avenues for scalable visual counting across diverse domains.
Abstract
While recent supervised methods for reference-based object counting continue to improve the performance on benchmark datasets, they have to rely on small datasets due to the cost associated with manually annotating dozens of objects in images. We propose UnCounTR, a model that can learn this task without requiring any manual annotations. To this end, we construct "Self-Collages", images with various pasted objects as training samples, that provide a rich learning signal covering arbitrary object types and counts. Our method builds on existing unsupervised representations and segmentation techniques to successfully demonstrate for the first time the ability of reference-based counting without manual supervision. Our experiments show that our method not only outperforms simple baselines and generic models such as FasterRCNN and DETR, but also matches the performance of supervised counting models in some domains.
