Papers › CLIP-EBC: CLIP Can Count Accurately through Enhanced Blockwise Classification

CLIP-EBC: CLIP Can Count Accurately through Enhanced Blockwise Classification

14 Mar 2024arXiv:2403.09281archive 2025-07-28

Yiming Ma, Victor Sanchez, Tanaya Guha

We propose CLIP-EBC, the first fully CLIP-based model for accurate crowd density estimation. While the CLIP model has demonstrated remarkable success in addressing recognition tasks such as zero-shot image classification, its potential for counting has been largely unexplored due to the inherent challenges in transforming a regression problem, such as counting, into a recognition task. In this work, we investigate and enhance CLIP's ability to count, focusing specifically on the task of estimating crowd sizes from images. Existing classification-based crowd-counting frameworks have significant limitations, including the quantization of count values into bordering real-valued bins and the sole focus on classification errors. These practices result in label ambiguity near the shared borders and inaccurate prediction of count values. Hence, directly applying CLIP within these frameworks may yield suboptimal performance. To address these challenges, we first propose the Enhanced Blockwise Classification (EBC) framework. Unlike previous methods, EBC utilizes integer-valued bins, effectively reducing ambiguity near bin boundaries. Additionally, it incorporates a regression loss based on density maps to improve the prediction of count values. Within our backbone-agnostic EBC framework, we then introduce CLIP-EBC to fully leverage CLIP's recognition capabilities for this task. Extensive experiments demonstrate the effectiveness of EBC and the competitive performance of CLIP-EBC. Specifically, our EBC framework can improve existing classification-based methods by up to 44.5% on the UCF-QNRF dataset, and CLIP-EBC achieves state-of-the-art performance on the NWPU-Crowd test set, with an MAE of 58.2 and an RMSE of 268.5, representing improvements of 8.6% and 13.3% over the previous best method, STEERER. The code and weights are available at https://github.com/Yiming-M/CLIP-EBC.

PaperPDFCode

Code

Yiming-M/CLIP-EBC officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

ClassificationCrowd CountingDensity EstimationQuantizationimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ViT-L/14) MAE 32.3 #2 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ViT-L/14) RMSE 79.7 #2 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ViT-B/16) MAE 36.6 #3 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ViT-B/16) RMSE 81.7 #3 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ResNet50) MAE 38.6 #4 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CLIP-EBC (ResNet50) RMSE 90.3 #4 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) DMCount-EBC MAE 39.6 #5 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) DMCount-EBC RMSE 95.8 #5 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CSRNet-EBC MAE 42.9 #6 of 6 Archive leaderboard report
Crowd Counting NWPU-Crowd (Val) CSRNet-EBC RMSE 100.1 #6 of 6 Archive leaderboard report
Crowd Counting ShanghaiTech A CLIP-EBC (ViT-B/16) MAE 52.5 #6 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A CLIP-EBC (ViT-B/16) RMSE 85.9 #6 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A CLIP-EBC (ResNet50) MAE 54.0 #8 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A CLIP-EBC (ResNet50) RMSE 83.2 #8 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A DMCount-EBC MAE 62.3 #18 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A DMCount-EBC RMSE 98.9 #18 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A CSRNet-EBC MAE 66.3 #21 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech A CSRNet-EBC RMSE 105.0 #21 of 35 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ViT-L/14) MAE 5.9 #3 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ViT-L/14) RMSE 9.2 #3 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ResNet50) MAE 6.0 #4 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ResNet50) RMSE 10.1 #4 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ViT-B/16) MAE 6.6 #9 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CLIP-EBC (ViT-B/16) RMSE 10.5 #9 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CSRNet-EBC MAE 6.9 #13 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B CSRNet-EBC RMSE 11.3 #13 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B DMCount-EBC MAE 7.0 #14 of 32 Archive leaderboard report
Crowd Counting ShanghaiTech B DMCount-EBC RMSE 10.9 #14 of 32 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC (16, dynamic) MAE 75.90 #2 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC (16, dynamic) RMSE 130.48 #2 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC (32, dynamic) MAE 76.06 #3 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC (32, dynamic) RMSE 127.72 #3 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC MAE 77.2 #4 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF DMCount-EBC RMSE 130.4 #4 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CSRNet-EBC MAE 79.3 #5 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CSRNet-EBC RMSE 135.8 #5 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CLIP-EBC (ViT-B/16) MAE 80.3 #7 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CLIP-EBC (ViT-B/16) RMSE 139.3 #7 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CLIP-EBC (ResNet50) MAE 80.5 #8 of 23 Archive leaderboard report
Crowd Counting UCF-QNRF CLIP-EBC (ResNet50) RMSE 136.6 #8 of 23 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: EBC

CLIPEBCFocusMAE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections