Abstract
Zero-shot Object Counting (ZOC) enables the counting of arbitrary object categories using only natural language prompts, bypassing the need for manual annotations at test time. A significant challenge in ZOC is the automatic discovery of high-quality visual exemplars that accurately represent the target class. We introduce VA-Count, a novel framework that utilizes a detection-driven exemplar discovery module to bridge the gap between text and vision. By incorporating a single-object exemplar filter and a noise suppression strategy based on contrastive learning, VA-Count effectively identifies clean visual prototypes and mitigates the impact of background clutter. Our approach achieves state-of-the-art results on the FSC-147 and CARPK datasets, demonstrating robust generalization across diverse unseen categories.
Introduction
Object counting is a fundamental computer vision task with applications ranging from urban planning to biological research. While traditional models are often restricted to specific domains (e.g., crowd counting), recent research has pivoted toward class-agnostic counting. Few-shot methods have shown promise but require users to provide manual bounding boxes for each new class at inference time. Zero-shot methods aim to automate this by using text prompts, yet they frequently struggle with "noisy" exemplars—patches that contain multiple objects or irrelevant background—which degrade counting accuracy.
Methodology
The VA-Count framework addresses the exemplar quality issue through two primary innovations designed to refine the visual representation of the target class:
- Exemplar Enhancement Module (EEM): VA-Count employs Grounding DINO as a proposal generator to find candidate boxes matching the text prompt. To ensure these boxes contain exactly one object, a Single Object Exemplar Filter—comprising a frozen CLIP-ViT backbone and a trainable head—is used to prune multi-object or poorly framed patches. This ensures the "one box = one object" principle, which is vital for accurate counting.
- Noise Suppression Module (NSM): To enhance robustness against distractors, the model identifies "negative exemplars" (objects not belonging to the target class). Through contrastive learning, the system is trained to minimize the influence of these negative samples on the final density map, helping the model distinguish between the target objects and visually similar background noise.
The core counting engine is a transformer-based architecture that integrates the refined visual exemplars with the input image to produce a density map, the integral of which provides the final count.
Experimental Evaluation
VA-Count was evaluated on the FSC-147 dataset, a diverse benchmark with 147 categories ranging from kitchen utensils to animals. It achieved a Mean Absolute Error (MAE) of 17.87, surpassing previous zero-shot state-of-the-art methods like CLIP-Count (18.28) and ZSC (24.51).
On the CARPK dataset, VA-Count demonstrated strong cross-domain generalization. When trained on FSC-147 and tested on CARPK without further fine-tuning, it achieved an MAE of 10.63. This performance is remarkably close to that of few-shot models that utilize manual supervision, highlighting the effectiveness of the detection-driven discovery process.
Discussion and Conclusion
Qualitative analysis indicates that the "single object" constraint is critical; ensuring exemplars are clean prevents the model from over- or under-counting in dense scenes. Furthermore, the noise suppression strategy allows the model to better distinguish between target objects and visually similar background elements, such as distinguishing a specific fruit from a mixed bowl.
VA-Count represents a significant step forward in zero-shot object counting by treating detection as a bridge between language and vision. By focusing on exemplar quality and noise suppression, it achieves high accuracy without manual intervention. Future work will focus on improving the model's handling of extremely dense clusters and complex object boundaries where segmentation remains challenging.
Summary updated