# Learning to Count Anything: Reference-less Class-agnostic Counting with Weak Supervision

arXiv: https://arxiv.org/abs/2205.10203 · HTML: https://mlsanity.com/paper/2205.10203/

## Key facts

- Cited by 41 papers in the map (data through 14 Oct 2026).
- Builds on 30 of its 54 references that are in the map.
- First posted on arXiv 20 May 2022.

## Builds on (most cited first, 30 of 30)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [Deep Residual Learning for Image Recognition](https://mlsanity.com/paper/1512.03385/) (2015)
- [Microsoft COCO: Common Objects in Context](https://mlsanity.com/paper/1405.0312/) (2014)
- [Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks](https://mlsanity.com/paper/1506.01497/) (2015)
- [End-to-End Object Detection with Transformers](https://mlsanity.com/paper/2005.12872/) (2020)
- [Emerging Properties in Self-Supervised Vision Transformers](https://mlsanity.com/paper/2104.14294/) (2021)
- [Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks](https://mlsanity.com/paper/1703.03400/) (2017)
- [You Only Look Once: Unified, Real-Time Object Detection](https://mlsanity.com/paper/1506.02640/) (2015)
- [Training data-efficient image transformers & distillation through attention](https://mlsanity.com/paper/2012.12877/) (2020)
- [A ConvNet for the 2020s](https://mlsanity.com/paper/2201.03545/) (2022)
- [CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes](https://mlsanity.com/paper/1802.10062/) (2018)
- [Few-shot Object Detection via Feature Reweighting](https://mlsanity.com/paper/1812.01866/) (2018)
- [Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector](https://mlsanity.com/paper/1908.01998/) (2019)
- [Drone-based Object Counting by Spatially Regularized Regional Proposal Network](https://mlsanity.com/paper/1707.05972/) (2017)
- [Learning To Count Everything](https://mlsanity.com/paper/2104.08391/) (2021)
- [A Large Contextual Dataset for Classification, Detection and Counting of Cars with Deep Learning](https://mlsanity.com/paper/1609.04453/) (2016)
- [Class-Agnostic Counting](https://mlsanity.com/paper/1811.00472/) (2018)
- [Represent, Compare, and Learn: A Similarity-Aware Framework for Class-Agnostic Counting](https://mlsanity.com/paper/2203.08354/) (2022)
- [An End-to-End Transformer Model for Crowd Localization](https://mlsanity.com/paper/2202.13065/) (2022)
- [TransCrowd: weakly-supervised crowd counting with transformers](https://mlsanity.com/paper/2104.09116/) (2021)
- [Leveraging Unlabeled Data for Crowd Counting by Learning to Rank](https://mlsanity.com/paper/1803.03095/) (2018)
- [One-Shot Instance Segmentation](https://mlsanity.com/paper/1811.11507/) (2018)
- [Towards Using Count-level Weak Supervision for Crowd Counting](https://mlsanity.com/paper/2003.00164/) (2020)
- [HA-CCN: Hierarchical Attention-based Crowd Counting Network](https://mlsanity.com/paper/1907.10255/) (2019)
- [Object Counting: You Only Need to Look at One](https://mlsanity.com/paper/2112.05993/) (2021)
- [Dilated-Scale-Aware Attention ConvNet For Multi-Class Object Counting](https://mlsanity.com/paper/2012.08149/) (2020)
- [Towards Partial Supervision for Generic Object Counting in Natural Scenes](https://mlsanity.com/paper/1912.06448/) (2019)
- [CrowdFormer: Weakly-supervised Crowd counting with Improved Generalizability](https://mlsanity.com/paper/2203.03768/) (2022)
- [Joint CNN and Transformer Network via weakly supervised Learning for efficient crowd counting](https://mlsanity.com/paper/2203.06388/) (2022)
- [A Few-Shot Sequential Approach for Object Counting](https://mlsanity.com/paper/2007.01899/) (2020)

## Built on by (most cited first, 30 of 41)

- [CLIP-Count: Towards Text-Guided Zero-Shot Object Counting](https://mlsanity.com/paper/2305.07304/) (2023)
- [CounTR: Transformer-based Generalised Visual Counting](https://mlsanity.com/paper/2208.13721/) (2022)
- [A Low-Shot Object Counting Network With Iterative Prototype Adaptation](https://mlsanity.com/paper/2211.08217/) (2022)
- [CountGD: Multi-Modal Open-World Counting](https://mlsanity.com/paper/2407.04619/) (2024)
- [DAVE -- A Detect-and-Verify Paradigm for Low-Shot Counting](https://mlsanity.com/paper/2404.16622/) (2024)
- [Open-world Text-specified Object Counting](https://mlsanity.com/paper/2306.01851/) (2023)
- [Counting Guidance for High Fidelity Text-to-Image Synthesis](https://mlsanity.com/paper/2306.17567/) (2023)
- [Zero-shot Object Counting with Good Exemplars](https://mlsanity.com/paper/2407.04948/) (2024)
- [A Novel Unified Architecture for Low-Shot Counting by Detection and Segmentation](https://mlsanity.com/paper/2409.18686/) (2024)
- [T2ICount: Enhancing Cross-modal Understanding for Zero-Shot Counting](https://mlsanity.com/paper/2502.20625/) (2025)
- [ABC Easy as 123: A Blind Counter for Exemplar-Free Multi-Class Class-agnostic Counting](https://mlsanity.com/paper/2309.04820/) (2023)
- [YOLO-Count: Differentiable Object Counting for Text-to-Image Generation](https://mlsanity.com/paper/2508.00728/) (2025)
- [A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approaches](https://mlsanity.com/paper/2501.19184/) (2025)
- [Single Domain Generalization for Few-Shot Counting via Universal Representation Matching](https://mlsanity.com/paper/2505.16778/) (2025)
- [Learning to Count without Annotations](https://mlsanity.com/paper/2307.08727/) (2023)
- [Robust Zero-Shot Crowd Counting and Localization With Adaptive Resolution SAM](https://mlsanity.com/paper/2402.17514/) (2024)
- [VAQUUM: Are Vague Quantifiers Grounded in Visual Data?](https://mlsanity.com/paper/2502.11874/) (2025)
- [SFOOD: A Multimodal Benchmark for Comprehensive Food Attribute Analysis Beyond RGB with Spectral Insights](https://mlsanity.com/paper/2507.04412/) (2025)
- [Text-promptable Object Counting via Quantity Awareness Enhancement](https://mlsanity.com/paper/2507.06679/) (2025)
- [Bootstrapping MLLM for Weakly-Supervised Class-Agnostic Object Counting](https://mlsanity.com/paper/2602.12774/) (2026)
- [Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Counting](https://mlsanity.com/paper/2605.02752/) (2026)
- [Novel 3D Scene Understanding Applications From Recurrence in a Single Image](https://mlsanity.com/paper/2210.07991/) (2022)
- [Enhancing Zero-shot Counting via Language-guided Exemplar Learning](https://mlsanity.com/paper/2402.05394/) (2024)
- [Expanding Zero-Shot Object Counting with Rich Prompts](https://mlsanity.com/paper/2505.15398/) (2025)
- [D2D: Detector-to-Differentiable Critic for Improved Numeracy in Text-to-Image Generation](https://mlsanity.com/paper/2510.19278/) (2025)
- [Object Counting with GPT-4o and GPT-5: A Comparative Study](https://mlsanity.com/paper/2512.03233/) (2025)
- [CoDi -- an exemplar-conditioned diffusion model for low-shot counting](https://mlsanity.com/paper/2512.20153/) (2025)
- [OCCAM: Class-Agnostic, Training-Free, Prior-Free and Multi-Class Object Counting](https://mlsanity.com/paper/2601.13871/) (2026)
- [CountEx: Fine-Grained Counting via Exemplars and Exclusion](https://mlsanity.com/paper/2602.19432/) (2026)
- [AdaCount: Training-Free Similarity-Guided Spatial and Feature Adaptation for Zero-Shot Object Counting](https://mlsanity.com/paper/2607.02139/) (2026)

## Abstract (arXiv)

Current class-agnostic counting methods can generalise to unseen classes but usually require reference images to define the type of object to be counted, as well as instance annotations during training. Reference-less class-agnostic counting is an emerging field that identifies counting as, at its core, a repetition-recognition task. Such methods facilitate counting on a changing set composition. We show that a general feature space with global context can enumerate instances in an image without a prior on the object type present. Specifically, we demonstrate that regression from vision transformer features without point-level supervision or reference images is superior to other reference-less methods and is competitive with methods that use reference images. We show this on the current standard few-shot counting dataset FSC-147. We also propose an improved dataset, FSC-133, which removes errors, ambiguities, and repeated images from FSC-147 and demonstrate similar performance on it. To the best of our knowledge, we are the first weakly-supervised reference-less class-agnostic counting method.
