It’s late, you’re tired, and you’ve got a thousand images of migratory birds or microscopic cells to count. Usually, this means one of two things: either you spend hours drawing precise bounding boxes around "exemplars" to teach an AI what to look for, or you use a text-based AI that might get the category right but misses the specific visual nuances of your data.
A new paper, "Click and Count: Multimodal Prototype Adaptation for Class-Agnostic Object Counting," offers a "have your cake and eat it too" solution. It suggests that a single click and a short text description are all you need to count practically anything.
TL;DR
The authors introduce C&C (Click-and-Count), a framework that turns a simple mouse click into a rich, multi-layered "prototype" of an object. By combining these click-derived visual cues with text descriptions through an iterative refinement process, the model achieves state-of-the-art accuracy while being roughly eight times faster to "train" at inference time than traditional box-based methods.
What Problem Does This Paper Address?
Object counting is easy when you’re counting cats and dogs—we have millions of labeled images for those. It gets hard when you need to count something niche, like a specific type of industrial component or a rare plankton. This is class-agnostic counting: the AI must count objects it has never seen before, guided only by a few examples (exemplars) provided by the user.
The current state-of-the-art usually requires users to draw bounding boxes. As anyone who has done data labeling knows, drawing tight boxes is tedious. Clicks are much faster, but they are "information-poor"—a single pixel doesn't tell the AI how big the object is or where its edges are.
Methods
The C&C framework bridges the gap between the "lazy" click and the "rich" bounding box using a clever multi-stage pipeline:
- Click-to-Mask: When you click an object, the system uses a frozen Segment Anything Model (SAM) to automatically grow that click into a precise mask. This recovers the object's shape and scale without you having to draw a thing.
- Prototype Construction: From this mask, the model extracts two things: a Shape Prototype (geometry) and an Appearance Prototype (visual features).
- Multimodal Fusion: This is the "Multimodal" part of the title. The model takes a text prompt (e.g., "hot air balloon") and injects that semantic knowledge into the visual prototypes using gated cross-attention. This helps the model understand that it's looking for a "balloon" category, not just "this specific red blob."
- Iterative Adaptation: The model doesn't just take one guess. It iteratively refines these prototypes, looking back at the image context to sharpen its "mental image" of what it's counting.
Datasets
The authors evaluated their work on:
- FSC-147: The gold standard for class-agnostic counting, containing 147 different object categories.
- COCO-derived benchmark: A new, more rigorous benchmark the authors created from the COCO dataset. Crucially, they used a "category-disjoint" setup, meaning the model was tested on categories it never saw during its training phase to truly test its "agnostic" capabilities.
Key Insights and Ideas
- The Power of the "Frozen" Expert: By using a pre-trained, frozen segmentation model (SAM), the authors decoupled the localization of the object from the counting task. This allows the counting model to focus on matching features rather than learning how to see edges.
- Text as a Stabilizer: Visual exemplars can be tricky—maybe your example balloon is slightly occluded. Text provides a "semantic anchor" that reminds the model what the essence of the object is, regardless of the specific quirks of the clicked example.
- Gated Fusion is Key: Instead of just shoving text and vision together, the "gated" mechanism allows the model to decide how much to trust the text versus the visual click. If the text is vague, the gate stays mostly closed; if the text is helpful, it opens up.
Key Results
The results are impressive, especially considering the reduced user effort:
- Better than Boxes: On the FSC-147 test set, C&C (using point + text) achieved a Mean Absolute Error (MAE) of 9.77, outperforming the previous best box-based method, LOCA, which scored 10.79.
- Efficiency: As shown in Figure 1, C&C requires only ~1 second of user interaction per three exemplars, compared to ~8.5 seconds for box-based methods.
- Click-Only Superiority: Even without text, the click-based C&C (MAE 12.31) significantly outperformed other point-based methods like UPBC (MAE 15.86).
Limitations and Future Work
While C&C wins on average error (MAE), its RMSE (Root Mean Squared Error) is still slightly higher than some box-based methods in certain scenarios (68.69 vs 56.97). This suggests that while it's more accurate most of the time, it might still make larger "outlier" mistakes on particularly challenging images where a single click isn't enough to capture extreme scale variations.
The authors suggest that future work could involve even more "adaptive" multimodal learning—perhaps a system that asks the user for a text description only when the visual click is ambiguous.
Summary updated