TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/Represent, Compare, and Learn: A Similarity-Aware Framewor...

Represent, Compare, and Learn: A Similarity-Aware Framework for Class-Agnostic Counting

Min Shi, Hao Lu, Chen Feng, Chengxin Liu, Zhiguo Cao

2022-03-16CVPR 2022 1Object Counting
PaperPDFCode(official)

Abstract

Class-agnostic counting (CAC) aims to count all instances in a query image given few exemplars. A standard pipeline is to extract visual features from exemplars and match them with query images to infer object counts. Two essential components in this pipeline are feature representation and similarity metric. Existing methods either adopt a pretrained network to represent features or learn a new one, while applying a naive similarity metric with fixed inner product. We find this paradigm leads to noisy similarity matching and hence harms counting performance. In this work, we propose a similarity-aware CAC framework that jointly learns representation and similarity metric. We first instantiate our framework with a naive baseline called Bilinear Matching Network (BMNet), whose key component is a learnable bilinear similarity metric. To further embody the core of our framework, we extend BMNet to BMNet+ that models similarity from three aspects: 1) representing the instances via their self-similarity to enhance feature robustness against intra-class variations; 2) comparing the similarity dynamically to focus on the key patterns of each exemplar; 3) learning from a supervision signal to impose explicit constraints on matching results. Extensive experiments on a recent CAC dataset FSC147 show that our models significantly outperform state-of-the-art CAC approaches. In addition, we also validate the cross-dataset generality of BMNet and BMNet+ on a car counting dataset CARPK. Code is at tiny.one/BMNet

Results

TaskDatasetMetricValueModel
Object CountingFSC147MAE(test)14.62BMNet+
Object CountingFSC147MAE(val)15.74BMNet+
Object CountingFSC147RMSE(test)91.83BMNet+
Object CountingFSC147RMSE(val)58.53BMNet+
Object CountingCARPKMAE5.76BMNet+
Object CountingCARPKRMSE7.83BMNet+

Related Papers

Car Object Counting and Position Estimation via Extension of the CLIP-EBC Framework2025-07-11OmniSpatial: Towards Comprehensive Spatial Reasoning Benchmark for Vision Language Models2025-06-03Improving Contrastive Learning for Referring Expression Counting2025-05-28InstructSAM: A Training-Free Framework for Instruction-Oriented Remote Sensing Object Recognition2025-05-21Expanding Zero-Shot Object Counting with Rich Prompts2025-05-21VisionReasoner: Unified Visual Perception and Reasoning via Reinforcement Learning2025-05-17Are Multimodal Large Language Models Ready for Omnidirectional Spatial Reasoning?2025-05-17Learning What NOT to Count2025-04-16