CountZES: Counting via Zero-Shot Exemplar Discovery and Selection
Organizations: Mohamed Bin Zayed University of Artificial Intelligence, Abu Dhabi, UAE
Abstract
Zero-shot object counting (ZOC) aims to count instances of unseen categories using only a class name. Existing exemplar-based methods discover candidate exemplars through random image patches or open-vocabulary detector proposals. However, random patch sampling often yields poorly delineated instances, while detector-based discovery may produce multi-instance regions and, in dense scenes, provide only a few or even no suitable single-instance candidates. Thus, exemplar selection is constrained by candidate quality and coverage, while counting itself remains highly sensitive to exemplar choice. To this end, we propose CountZES, an inference-only framework that jointly addresses candidate discovery and exemplar selection through density-guided candidate generation and complementary exemplar-selection mechanisms. Starting from a text-grounded anchor, CountZES progressively discovers and refines visual exemplars through three stages: Detection-Anchored Exemplar (DAE), Density-Guided Exemplar (DGE), and Feature-Consensus Exemplar (FCE). DAE establishes a reliable single-instance anchor, DGE leverages density responses to expand candidate discovery beyond the detector-constrained pool and select a statistically consistent exemplar, and FCE promotes representativeness through feature-level consensus. Together, they yield complementary exemplars balancing semantic grounding, count consistency, and feature representativeness. CountZES requires no ZOC-specific optimization and adopts a modular design that supports different pretrained components. Extensive evaluations across natural, aerial, and medical domains demonstrate strong cross-domain generalization and superior performance among inference-only ZOC methods.
Figures & tables
| Method | Venue | Inference | MAE | RMSE |
| only | ||||
| ZSOC † [ 39 ] | CVPR’23 | ✗ | 22.09 | 115.17 |
| CLIP-Count [ 14 ] | ACM’23 | ✗ | 17.78 | 106.62 |
| CounTX [ 1 ] | BMVC’23 | ✗ | 15.88 | 106.29 |
| VLCounter [ 15 ] | AAAI’24 | ✗ | 17.05 | 106.16 |
| PseCo [ 12 ] | CVPR’24 | ✗ | 16.58 | 129.77 |
| Method | Inference-only | MAE | RMSE |
| CLIP-Count [ 14 ] | ✗ | 11.96 | 16.61 |
| CounTX [ 1 ] | ✗ | 8.13 | 10.87 |
| G-DINO [ 22 ] | ✗ | 29.72 | 31.60 |
| VLCounter [ 15 ] | ✗ | 6.46 | 8.68 |
| VA-Count † [ 44 ] | ✗ | 10.63 | 13.20 |
| GeCo [ 29 ] | ✗ | 10.34 | 14.73 |
| Density-based | Class-wise | |||||||
| Method (Inf-only) | Low | Med | High | Overall | ||||
| MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | |
| GeCo (✗) | 11.63 | 17.84 | 10.30 | 20.61 | 12.38 | 24.13 | 13.12 | 28.36 |
| T2ICount (✗) | 30.04 | 122.91 | 25.16 | 76.95 | 20.62 | 52.23 | 24.95 | 88.21 |
| TFOC (✓) | 7.20 | 10.36 | 16.07 | 21.63 | 36.88 | 63.82 | 17.79 | 35.74 |
| CountZES (✓) | 6.86 | 19.22 | 10.26 | 14.44 | 20.36 | 43.65 | 12.29 | 28.32 |
| Method (Inf-only) | VGG | MBM | ||
| MAE | RMSE | MAE | RMSE | |
| GeCo (✗) | 67.32 | 77.53 | 92.59 | 104.52 |
| T2ICount (✗) | 151.35 | 162.81 | 30.01 | 44.44 |
| CountSE (✗) | 64.75 | 74.51 | 61.90 | 69.97 |
| CountGD++ (✗) | 173.70 | 183.74 | 121.50 | 125.76 |
| TFOC (✓) | 144.91 | 158.52 | 64.25 | 75.67 |
| Setting | Parallel | Seq. 1 | Seq. 2 | |||
| MAE | RMSE | MAE | RMSE | MAE | RMSE | |
| In-domain | 17.12 | 92.57 | 16.58 | 91.90 | 15.77 | 91.40 |
| Cross-domain | 22.31 | 112.01 | 21.87 | 111.23 | 21.09 | 110.14 |
| Configuration | MAE | RMSE |
| DAE only | 21.73 | 118.03 |
| DGE only | 17.38 | 108.56 |
| FCE only | 19.42 | 116.53 |
| CountZES | 15.77 | 91.40 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Box Descriptor Definition | FSC-147 (in-domain) | |
| MAE | RMSE | |
| Avg pool + -norm | 15.77 | 91.40 |
| Max pool + -norm | 15.89 | 91.63 |
| In-domain | Cross-domain | |||
| MAE | RMSE | MAE | RMSE | |
| 0.25 | 16.36 | 92.22 | 21.48 | 110.96 |
| 0.5 | 15.77 | 91.40 | 21.09 | 110.14 |
| 0.75 | 16.18 | 92.35 | 21.44 | 111.15 |
| 1 | 17.82 | 94.61 | 22.97 | 113.37 |
Object Counting
Object counting estimates the number and locations of target instances in images or video, from dense crowds to fine-grained categories.
See all 61 papers