CountGD: Multi-Modal Open-World Counting

Niki Amini-Naieni, Tengda Han, Andrew Zisserman

Abstract

CountGD is the first open-world object counting model that enables users to specify counting targets through text descriptions, visual exemplars, or a multi-modal combination of both. By extending the GroundingDINO detection framework, CountGD achieves state-of-the-art performance across major benchmarks. Its unique multi-modal fusion allows for complex queries, such as using text to refine visual exemplars (e.g., spatial filtering), effectively bridging the gap between precise but rigid exemplar-based methods and flexible but less accurate text-only approaches.

Introduction

Object counting has traditionally been divided into two paradigms: class-specific models, which are limited to predefined categories, and class-agnostic models, which rely on visual exemplars. While exemplar-based methods are effective at capturing specific object appearances in context, they lack flexibility. For instance, a user cannot easily specify a subset of objects (e.g., "only ripe fruit") if the provided exemplars are mixed. Conversely, text-only counting offers flexibility but often lacks the precision of visual cues. CountGD addresses these limitations by introducing a multi-modal system that leverages both text and vision for robust open-world counting.

Methods

CountGD is built upon the GroundingDINO open-vocabulary detection foundation model. The architecture incorporates several key enhancements to support multi-modal counting:

  1. Visual Exemplar Embedding: Features are extracted from user-provided bounding boxes using RoIAlign directly from the image's feature map.
  2. Multi-Modal Fusion: Visual exemplars are treated as additional "tokens," analogous to words in a sentence. These are fused with text tokens via self-attention, enabling the model to interpret the relationship between visual examples and textual descriptions.
  3. Single-Stage Architecture: CountGD operates in a single pass, calculating a similarity map between multi-modal queries and image features to identify and count objects.

Key Insights: Text as a Logical Filter

A significant contribution of CountGD is the use of text as a logical filter for visual exemplars. This allows for fine-grained control that neither modality can achieve alone. For example, providing a visual exemplar of a pig and adding the text "left" allows the model to filter the count to only include pigs on the left side of the image.

Text descriptions can refine visual exemplars, allowing for spatial filtering (e.g., "left" vs "right") and more precise counting.

This synergy between modalities significantly improves accuracy. On the FSC-147 test set, the Mean Absolute Error (MAE) dropped from 12.98 (text-only) to 5.74 (multi-modal), demonstrating that the combination of text and vision is more than the sum of its parts.

Key Results

CountGD establishes new state-of-the-art benchmarks for open-world counting:

  • State-of-the-Art Performance: On the FSC-147 dataset, it achieved an MAE of 5.74, a major improvement over previous leaders like LOCA (10.79).
  • Zero-Shot Generalization: On the CARPK dataset (overhead drone imagery), CountGD achieved an MAE of 3.68 without any domain-specific fine-tuning, outperforming models specifically trained for that task.
  • Qualitative Precision: Qualitative analysis confirms the model's precision in distinguishing between similar objects in cluttered scenes, such as counting strawberries while ignoring other items on a plate.
Qualitative results across various categories (apples, elephants, strawberries, cats, and people) showing high-accuracy predictions and multi-modal flexibility.

Limitations and Future Work

The model currently faces a query limit of 900, necessitating adaptive cropping for extremely dense scenes. Future work may focus on uncertainty quantification and scaling training with larger synthetic datasets to improve performance on rare or highly cluttered categories.

Summary updated

BibTeX
@inproceedings{amininaieni2024countgd,
  author = {Niki Amini-Naieni and Tengda Han and Andrew Zisserman},
  title = {{CountGD: Multi-Modal Open-World Counting}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=eUg64OsGDE},
}
Figure