ABACUS: Adapting Unified Foundation Model for Bridging Image Count Understanding and Generation

Anindya Mondal, Sauradip Nag, Anjan DuttaarXiv 2026

TL;DR

ABACUS is a unified 3B-parameter vision-language model that bridges the gap between visual count understanding (counting objects) and count-faithful image generation. By introducing density-aware adaptive zooming, attention-based objectness mapping, and a cycle-consistent reinforcement learning strategy via GRPO, ABACUS achieves state-of-the-art performance across seven benchmarks, outperforming both task-specific specialists and much larger generalist models.

What Problem Does This Paper Address?

Despite significant progress in computer vision, a persistent "synergy gap" exists between image understanding and image generation. For instance, a state-of-the-art multimodal model that can accurately count four apples in an image often fails to generate an image containing exactly four apples when prompted.

Fig. 2. Issues in Count Generation and Understanding. (a) Text-to- image diffusion models lack any mechanism to verify output cardinality. (b) VLMs and MLLMs default to coarse magnitude estimates (e.g., “Greater than 100”) on dense scenes. (c) Existing UMMs support both tasks from a single models yet exhibit a synergy gap: the same model that correctly counts 4 apples cannot generate exactly 4.

Standard Multimodal Large Language Models (MLLMs) struggle with counting tasks due to two primary deficiencies:

  1. Lack of Spatial Grounding: Models often memorize token patterns rather than performing true spatial reasoning, leading to catastrophic failures in dense scenes.
  2. Disjoint Architectures: Counting and generation have traditionally relied on separate pipelines, loss formulations, and specialized heads, preventing the two tasks from mutually reinforcing one another.

The authors introduce ABACUS (Adapting Unified Foundation Model for Bridging Image Count Understanding and Generation) to resolve these limitations within a single, unified architecture.

Methods

ABACUS builds upon the UniLIP-3B framework and introduces three core technical contributions:

  1. Density-Aware Adaptive Zooming: To handle highly congested scenes, ABACUS uses a frozen GroundingDINO backbone with a lightweight MLP head to classify image regions as sparse or dense. Dense regions are recursively partitioned into a $2 \times 2$ grid, allowing the MLLM to operate over locally sparse fields where per-instance discrimination is highly reliable.
  2. Decomposed Attention Objectness Maps: Instead of relying on error-prone bounding-box coordinates, ABACUS extracts spatial object evidence directly from the multi-head self-attention (MHSA) layers of the language model. This objectness map is supervised using Gaussian-smoothed point annotations to anchor the model's internal representations to physical object centers.
  3. Boundary-Aware Count Policy via GRPO: Recursive partitioning inevitably cuts objects at crop boundaries. To prevent over- or under-counting, the authors implement Group Relative Policy Optimisation (GRPO) with nested local, boundary, and global rewards to explicitly train the model to resolve boundary ownership.
  4. Cycle-Consistent Generation Training: To close the synergy gap, the frozen understanding branch acts as an internal critic for the generation branch. During training, the generator produces a group of candidate images for a prompt (e.g., "Generate an image of 12 croissants on a tray"). The understanding branch counts the objects in the generated images and provides a count-deviation reward, which—combined with an aesthetic quality reward—updates the generation branch via LoRA.
Fig. 1. ABACUS overview. A single unified model performs count-aware image generation (left), object counting, crowd counting, and referring-expression counting (right) using text-only prompts with no benchmark-specific training.

Datasets

The model was trained and evaluated using several large-scale datasets:

  • Understanding Pre-training: A curated 2M dense-annotated dataset sourced from Objects365, V3Det, and SKU-110K, filtered to retain images with at least five instances.
  • Generation & SFT Training: 1M high-quality images from Pexels, annotated using T-Rex2 for category boxes and human-verified counts, with captions generated by Qwen2.5-VL-7B.
  • Evaluation Benchmarks:
  • Object Counting: FSC-147, CARPK
  • Crowd Counting: ShanghaiTech A/B
  • Referring Expression Counting: REC-8K
  • Count-Faithful Generation: CoCoCount, T2I-CompBench, GenEval
  • Count Reasoning: CountQA

All evaluation splits were strictly excluded from the training data.

Key Insights and Ideas

  • The Counter as the Critic: The most compelling idea in ABACUS is using the model's own frozen understanding capability to train its generative capability. This closed-loop, self-supervised feedback eliminates the need for external reward models or human annotations.
  • Emergent Occlusion Handling: Because the understanding branch is trained to locate visible object centers, the cycle-consistent training naturally incentivizes the generation branch to render realistic multi-instance scenes with natural overlapping and occlusion, rather than rigid, artificial grid layouts.
  • Implicit Spatial Awareness: Decomposing internal attention layers proves that large vision-language models already possess latent spatial grounding. Explicitly regularizing this "objectness" prevents the model from hallucinating or relying on spurious token memorization.

Key Results

ABACUS sets a new state-of-the-art across both understanding and generation tasks:

  • Object & Crowd Counting: On the FSC-147 benchmark, ABACUS achieved a Mean Absolute Error (MAE) of 5.71 (val) and 5.03 (test), outperforming the strongest point-supervised specialist models (like CountGD++) by over 40% without using point annotations at test time. It also halved the error rate on the ShanghaiTech crowd counting dataset compared to previous generalist models.
  • Count-Faithful Image Generation: ABACUS achieved 71% exact-match accuracy on CoCoCount, significantly outperforming the previous best model, CountGen (50%).
  • Aesthetic Excellence: Unlike attention-manipulation baselines that degrade image quality to achieve correct counts, ABACUS achieved the highest aesthetic score on GenEval (89 vs. 61 for the baseline UniLIP-3B).

Limitations and Future Work

Despite its strong performance, the authors note two primary limitations:

  • Low-Resolution Constraints: ABACUS relies on a $14 \times 14$ patch encoding from its visual backbone. If an image is heavily compressed or low-resolution (<224 px), the token grid becomes too coarse to resolve highly dense, individual objects. Integrating resolution-adaptive visual encoders is a proposed fix.
  • Domain Shifts: The current training mixture does not cover highly specialized domains like medical cell counting or satellite imagery. The authors suggest that lightweight domain adaptation of the LoRA adapters could unlock these specialized verticals in future work.

Summary updated

BibTeX
@misc{mondal2026abacus,
  author = {Anindya Mondal and Sauradip Nag and Anjan Dutta},
  title = {{ABACUS: Adapting Unified Foundation Model for Bridging Image Count Understanding and Generation}},
  year = {2026},
  eprint = {2606.23835},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.23835},
}
Figure