mlsanityData to 7 Oct 2026

Vision Transformer Off-the-Shelf: A Surprising Baseline for Few-Shot Class-Agnostic Counting

arXiv 2305.04440 ↗First posted 8 May 2023cs.CVcited by 25

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
  5. 2021ViLT: Vision-and-Language Transformer Without Convolution or Region Supervisioncited by 1,224
  6. 2022Exploring Plain Vision Transformer Backbones for Object Detectioncited by 723
  7. 2021MetaFormer Is Actually What You Need for Visioncited by 523
  8. 2018Composition Loss for Counting, Density Map Estimation and Localization in Dense Crowdscited by 186
  9. 2017Drone-based Object Counting by Spatially Regularized Regional Proposal Networkcited by 155
  10. 2020NWPU-Crowd: A Large-Scale Benchmark for Crowd Counting and Localizationcited by 151
  11. 2021Learning To Count Everythingcited by 149
  12. 2018Class-Agnostic Countingcited by 85
14 more
  1. 2022Represent, Compare, and Learn: A Similarity-Aware Framework for Class-Agnostic Countingcited by 80
  2. 2022CounTR: Transformer-based Generalised Visual Countingcited by 79
  3. 2022An End-to-End Transformer Model for Crowd Localizationcited by 74
  4. 2022Boosting Crowd Counting via Multifaceted Attentioncited by 73
  5. 2020Localization in the Crowd with Topological Constraintscited by 68
  6. 2022Few-Shot Object Detection with Fully Cross-Transformercited by 64
  7. 2022Few-shot Object Counting with Similarity-Aware Feature Enhancementcited by 62
  8. 2021TransCrowd: weakly-supervised crowd counting with transformerscited by 61
  9. 2018Where are the Blobs: Counting by Localization with Point Supervisioncited by 54
  10. 2022Rethinking Spatial Invariance of Convolutional Networks for Object Countingcited by 54
  11. 2022MixFormer: Mixing Features across Windows and Dimensionscited by 43
  12. 2017TasselNet: Counting maize tassels in the wild via local counts regression networkcited by 26
  13. 2020Efficient Crowd Counting via Structured Knowledge Transfercited by 13
  14. 2021Coarse to Fine: Domain Adaptive Crowd Counting via Adversarial Scoring Networkcited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 1; 2024: 3; 2025: 13; 2026: 8.

25 papers.

Sort:

By area:

  1. 2024Zero-shot Object Counting with Good Exemplarscited by 21
  2. 2024Mind the Prompt: A Novel Benchmark for Prompt-based Class-Agnostic Countingcited by 11
  3. 2025Exploring Contextual Attribute Density in Referring Expression Countingcited by 10
  4. 2025A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approachescited by 7
  5. 2025Can Current AI Models Count What We Mean, Not What They See? A Benchmark and Systematic Evaluationcited by 7
  6. 2025CountingDINO: A Training-free Pipeline for Class-Agnostic Counting using Unsupervised Backbonescited by 6
  7. 2023SQLNet: Scale-Modulated Query and Localization Network for Few-Shot Class-Agnostic Countingcited by 5
  8. 2025Generalized-Scale Object Counting with Gradual Query Aggregationcited by 5
  9. 2025SDVPT: Semantic-Driven Visual Prompt Tuning for Open-World Object Countingcited by 2
  10. 2025Video Individual Counting With Implicit One-to-Many Matchingcited by 2
  11. 2025TasselNetV4: A vision foundation model for cross-scene, cross-scale, and cross-species plant countingcited by 2
  12. 2026Crowded Video Individual Counting Informed by Social Grouping and Spatial-Temporal Displacement Priorscited by 2
13 more
  1. 2026Plant Taxonomy Meets Plant Counting: A Fine-Grained, Taxonomic Dataset for Counting Hundreds of Plant Speciescited by 2
  2. 2025Expanding Zero-Shot Object Counting with Rich Promptscited by 1
  3. 2025Decoupling What to Count and Where to See for Referring Expression Countingcited by 1
  4. 2025Object Counting with GPT-4o and GPT-5: A Comparative Studycited by 1
  5. 2025CoDi -- an exemplar-conditioned diffusion model for low-shot countingcited by 1
  6. 2026CountEx: Fine-Grained Counting via Exemplars and Exclusioncited by 1
  7. 2026Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Countingcited by 1
  8. 2024GCA-SUNet: A Gated Context-Aware Swin-UNet for Exemplar-Free Countingcited by 0
  9. 2025FocalCount: Towards Class-Count Imbalance in Class-Agnostic Countingcited by 0
  10. 2026Object Counting Across Modalities: Taxonomies, Benchmarks, Applications, and Open Challengescited by 0
  11. 2026LookThere! Sparse Vision by Reinforced Selectioncited by 0
  12. 2026Counting Beyond Instances: A Benchmark for Group-Individual Object Countingcited by 0
  13. 2026AgriCountDINO: Parameter-Efficient Exemplar-Guided Counting and Localization in Agriculturecited by 0