Vision Transformer Off-the-Shelf: A Surprising Baseline for Few-Shot Class-Agnostic Counting
Not on the map. Why?
Abstract (arXiv)
Class-agnostic counting (CAC) aims to count objects of interest from a query image given few exemplars. This task is typically addressed by extracting the features of query image and exemplars respectively and then matching their feature similarity, leading to an extract-then-match paradigm. In this work, we show that CAC can be simplified in an extract-and-match manner, particularly using a vision transformer (ViT) where feature extraction and similarity matching are executed simultaneously within the self-attention. We reveal the rationale of such simplification from a decoupled view of the self-attention. The resulting model, termed CACViT, simplifies the CAC pipeline into a single pretrained plain ViT. Further, to compensate the loss of the scale and the order-of-magnitude information due to resizing and normalization in plain ViT, we present two effective strategies for scale and magnitude embedding. Extensive experiments on the FSC147 and the CARPK datasets show that CACViT significantly outperforms state-of-the art CAC approaches in both effectiveness (23.60% error reduction) and generalization, which suggests CACViT provides a concise and strong baseline for CAC. Code will be available.
Key facts. Cited by 25 papers in the map (data through 7 Oct 2026). Builds on 26 of its 41 references that are in the map. First posted on arXiv 8 May 2023.
Builds on
26 of 41 references.
References · 26
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
- 2021ViLT: Vision-and-Language Transformer Without Convolution or Region Supervisioncited by 1,224
- 2022Exploring Plain Vision Transformer Backbones for Object Detectioncited by 723
- 2021MetaFormer Is Actually What You Need for Visioncited by 523
- 2018Composition Loss for Counting, Density Map Estimation and Localization in Dense Crowdscited by 186
- 2017Drone-based Object Counting by Spatially Regularized Regional Proposal Networkcited by 155
- 2020NWPU-Crowd: A Large-Scale Benchmark for Crowd Counting and Localizationcited by 151
- 2021Learning To Count Everythingcited by 149
- 2018Class-Agnostic Countingcited by 85
14 more
- 2022Represent, Compare, and Learn: A Similarity-Aware Framework for Class-Agnostic Countingcited by 80
- 2022CounTR: Transformer-based Generalised Visual Countingcited by 79
- 2022An End-to-End Transformer Model for Crowd Localizationcited by 74
- 2022Boosting Crowd Counting via Multifaceted Attentioncited by 73
- 2020Localization in the Crowd with Topological Constraintscited by 68
- 2022Few-Shot Object Detection with Fully Cross-Transformercited by 64
- 2022Few-shot Object Counting with Similarity-Aware Feature Enhancementcited by 62
- 2021TransCrowd: weakly-supervised crowd counting with transformerscited by 61
- 2018Where are the Blobs: Counting by Localization with Point Supervisioncited by 54
- 2022Rethinking Spatial Invariance of Convolutional Networks for Object Countingcited by 54
- 2022MixFormer: Mixing Features across Windows and Dimensionscited by 43
- 2017TasselNet: Counting maize tassels in the wild via local counts regression networkcited by 26
- 2020Efficient Crowd Counting via Structured Knowledge Transfercited by 13
- 2021Coarse to Fine: Domain Adaptive Crowd Counting via Adversarial Scoring Networkcited by 10
Built on by
Citing papers per year: 2023: 1; 2024: 3; 2025: 13; 2026: 8.
25 papers.
Sort:
By area:
- 2024Zero-shot Object Counting with Good Exemplarscited by 21
- 2024Mind the Prompt: A Novel Benchmark for Prompt-based Class-Agnostic Countingcited by 11
- 2025Exploring Contextual Attribute Density in Referring Expression Countingcited by 10
- 2025A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approachescited by 7
- 2025Can Current AI Models Count What We Mean, Not What They See? A Benchmark and Systematic Evaluationcited by 7
- 2025CountingDINO: A Training-free Pipeline for Class-Agnostic Counting using Unsupervised Backbonescited by 6
- 2023SQLNet: Scale-Modulated Query and Localization Network for Few-Shot Class-Agnostic Countingcited by 5
- 2025Generalized-Scale Object Counting with Gradual Query Aggregationcited by 5
- 2025SDVPT: Semantic-Driven Visual Prompt Tuning for Open-World Object Countingcited by 2
- 2025Video Individual Counting With Implicit One-to-Many Matchingcited by 2
- 2025TasselNetV4: A vision foundation model for cross-scene, cross-scale, and cross-species plant countingcited by 2
- 2026Crowded Video Individual Counting Informed by Social Grouping and Spatial-Temporal Displacement Priorscited by 2
13 more
- 2026Plant Taxonomy Meets Plant Counting: A Fine-Grained, Taxonomic Dataset for Counting Hundreds of Plant Speciescited by 2
- 2025Expanding Zero-Shot Object Counting with Rich Promptscited by 1
- 2025Decoupling What to Count and Where to See for Referring Expression Countingcited by 1
- 2025Object Counting with GPT-4o and GPT-5: A Comparative Studycited by 1
- 2025CoDi -- an exemplar-conditioned diffusion model for low-shot countingcited by 1
- 2026CountEx: Fine-Grained Counting via Exemplars and Exclusioncited by 1
- 2026Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Countingcited by 1
- 2024GCA-SUNet: A Gated Context-Aware Swin-UNet for Exemplar-Free Countingcited by 0
- 2025FocalCount: Towards Class-Count Imbalance in Class-Agnostic Countingcited by 0
- 2026Object Counting Across Modalities: Taxonomies, Benchmarks, Applications, and Open Challengescited by 0
- 2026LookThere! Sparse Vision by Reinforced Selectioncited by 0
- 2026Counting Beyond Instances: A Benchmark for Group-Individual Object Countingcited by 0
- 2026AgriCountDINO: Parameter-Efficient Exemplar-Guided Counting and Localization in Agriculturecited by 0
- 2026AgriCountDINO: Parameter-Efficient Exemplar-Guided Counting and Localization in Agriculture24 Sep 2026
- 2026Counting Beyond Instances: A Benchmark for Group-Individual Object Counting4 Sep 2026
- 2026LookThere! Sparse Vision by Reinforced Selection4 Sep 2026
- 2026Object Counting Across Modalities: Taxonomies, Benchmarks, Applications, and Open Challenges24 Aug 2026
- 2026Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Counting4 May 2026
- 2026Plant Taxonomy Meets Plant Counting: A Fine-Grained, Taxonomic Dataset for Counting Hundreds of Plant Species22 Mar 2026
- 2026CountEx: Fine-Grained Counting via Exemplars and Exclusion23 Feb 2026
- 2026Crowded Video Individual Counting Informed by Social Grouping and Spatial-Temporal Displacement Priors3 Jan 2026
- 2025CoDi -- an exemplar-conditioned diffusion model for low-shot counting23 Dec 2025
- 2025Object Counting with GPT-4o and GPT-5: A Comparative Study2 Dec 2025
- 2025Generalized-Scale Object Counting with Gradual Query Aggregation11 Nov 2025
- 2025Decoupling What to Count and Where to See for Referring Expression Counting28 Oct 2025
13 more
- 2025TasselNetV4: A vision foundation model for cross-scene, cross-scale, and cross-species plant counting25 Sep 2025
- 2025Can Current AI Models Count What We Mean, Not What They See? A Benchmark and Systematic Evaluation17 Sep 2025
- 2025Video Individual Counting With Implicit One-to-Many Matching16 Jun 2025
- 2025Expanding Zero-Shot Object Counting with Rich Prompts21 May 2025
- 2025SDVPT: Semantic-Driven Visual Prompt Tuning for Open-World Object Counting24 Apr 2025
- 2025CountingDINO: A Training-free Pipeline for Class-Agnostic Counting using Unsupervised Backbones23 Apr 2025
- 2025Exploring Contextual Attribute Density in Referring Expression Counting16 Mar 2025
- 2025FocalCount: Towards Class-Count Imbalance in Class-Agnostic Counting15 Feb 2025
- 2025A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approaches31 Jan 2025
- 2024Mind the Prompt: A Novel Benchmark for Prompt-based Class-Agnostic Counting24 Sep 2024
- 2024GCA-SUNet: A Gated Context-Aware Swin-UNet for Exemplar-Free Counting18 Sep 2024
- 2024Zero-shot Object Counting with Good Exemplars6 Jul 2024
- 2023SQLNet: Scale-Modulated Query and Localization Network for Few-Shot Class-Agnostic Counting16 Nov 2023
- 2024Zero-shot Object Counting with Good Exemplarscited by 21
- 2024Mind the Prompt: A Novel Benchmark for Prompt-based Class-Agnostic Countingcited by 11
- 2025Exploring Contextual Attribute Density in Referring Expression Countingcited by 10
- 2025A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approachescited by 7
- 2025Can Current AI Models Count What We Mean, Not What They See? A Benchmark and Systematic Evaluationcited by 7
- 2025CountingDINO: A Training-free Pipeline for Class-Agnostic Counting using Unsupervised Backbonescited by 6
- 2023SQLNet: Scale-Modulated Query and Localization Network for Few-Shot Class-Agnostic Countingcited by 5
- 2025Generalized-Scale Object Counting with Gradual Query Aggregationcited by 5
- 2025Video Individual Counting With Implicit One-to-Many Matchingcited by 2
- 2025TasselNetV4: A vision foundation model for cross-scene, cross-scale, and cross-species plant countingcited by 2
- 2026Crowded Video Individual Counting Informed by Social Grouping and Spatial-Temporal Displacement Priorscited by 2
- 2026Plant Taxonomy Meets Plant Counting: A Fine-Grained, Taxonomic Dataset for Counting Hundreds of Plant Speciescited by 2
12 most cited of 23 All 23 (JSON)
- 2026AgriCountDINO: Parameter-Efficient Exemplar-Guided Counting and Localization in Agriculture24 Sep 2026
- 2026Counting Beyond Instances: A Benchmark for Group-Individual Object Counting4 Sep 2026
- 2026LookThere! Sparse Vision by Reinforced Selection4 Sep 2026
- 2026Object Counting Across Modalities: Taxonomies, Benchmarks, Applications, and Open Challenges24 Aug 2026
- 2026Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Counting4 May 2026
- 2026Plant Taxonomy Meets Plant Counting: A Fine-Grained, Taxonomic Dataset for Counting Hundreds of Plant Species22 Mar 2026
- 2026CountEx: Fine-Grained Counting via Exemplars and Exclusion23 Feb 2026
- 2026Crowded Video Individual Counting Informed by Social Grouping and Spatial-Temporal Displacement Priors3 Jan 2026
- 2025Object Counting with GPT-4o and GPT-5: A Comparative Study2 Dec 2025
- 2025Generalized-Scale Object Counting with Gradual Query Aggregation11 Nov 2025
- 2025Decoupling What to Count and Where to See for Referring Expression Counting28 Oct 2025
- 2025TasselNetV4: A vision foundation model for cross-scene, cross-scale, and cross-species plant counting25 Sep 2025
12 newest of 23 All 23 (JSON)