Skip to main content
QUICK REVIEW

[Paper Review] CrowdCLIP: Unsupervised Crowd Counting via Vision-Language Model

Dingkang Liang, Jiahao Xie|arXiv (Cornell University)|Apr 9, 2023
Video Surveillance and Tracking MethodsComputer Science4 citations
TL;DR

CrowdCLIP proposes an unsupervised crowd counting framework that leverages contrastive pre-trained vision-language models (CLIP) by fine-tuning the image encoder via multi-modal ranking loss on size-sorted crowd patches and employing a progressive filtering strategy during inference. It achieves state-of-the-art performance, outperforming unsupervised methods by 35.2% in MAE on UCF-QNRF and surpassing some fully supervised models under cross-dataset settings.

ABSTRACT

Supervised crowd counting relies heavily on costly manual labeling, which is difficult and expensive, especially in dense scenes. To alleviate the problem, we propose a novel unsupervised framework for crowd counting, named CrowdCLIP. The core idea is built on two observations: 1) the recent contrastive pre-trained vision-language model (CLIP) has presented impressive performance on various downstream tasks; 2) there is a natural mapping between crowd patches and count text. To the best of our knowledge, CrowdCLIP is the first to investigate the vision language knowledge to solve the counting problem. Specifically, in the training stage, we exploit the multi-modal ranking loss by constructing ranking text prompts to match the size-sorted crowd patches to guide the image encoder learning. In the testing stage, to deal with the diversity of image patches, we propose a simple yet effective progressive filtering strategy to first select the highly potential crowd patches and then map them into the language space with various counting intervals. Extensive experiments on five challenging datasets demonstrate that the proposed CrowdCLIP achieves superior performance compared to previous unsupervised state-of-the-art counting methods. Notably, CrowdCLIP even surpasses some popular fully-supervised methods under the cross-dataset setting. The source code will be available at https://github.com/dk-liang/CrowdCLIP.

Motivation & Objective

  • Address the high annotation cost of supervised crowd counting methods that require expensive point-level annotations.
  • Overcome the limitations of existing weakly- and semi-supervised methods by eliminating all human-annotated supervision.
  • Explore the potential of vision-language pre-trained models like CLIP for unsupervised crowd counting, where no count-level or point-level labels are used.
  • Improve zero-shot CLIP performance on crowd counting by adapting it to the task through fine-tuning and structured inference.
  • Develop a robust, scalable method that generalizes well across diverse crowd scenes without relying on labeled data.

Proposed method

  • Construct ranking text prompts (e.g., '20', '55', '90', '125', '160', '195') to describe size-sorted crowd patches, forming a multi-modal ranking loss for fine-tuning the image encoder.
  • Fine-tune only the image encoder of CLIP using the ranking loss to enhance its understanding of crowd semantics and density patterns.
  • Apply a three-stage progressive filtering strategy during inference: (1) coarse classification to select candidate patches, (2) fine classification to refine selection, and (3) mapping to count intervals via text embedding similarity.
  • Fix the text encoder during inference to preserve pre-trained language priors and ensure stable alignment between image features and count descriptions.
  • Use the CLIP image encoder to embed patches and compute cosine similarity with text embeddings of count intervals to predict the final count.
  • Design patch number and prompt configuration to balance performance and robustness, with optimal performance at 4–5 patches per image.

Experimental results

Research questions

  • RQ1Can vision-language pre-trained models like CLIP be effectively adapted to unsupervised crowd counting without any human-annotated data?
  • RQ2Why does zero-shot CLIP fail on crowd counting, and what are the key limitations in applying it directly to this task?
  • RQ3How can a multi-modal ranking loss improve the image encoder’s ability to distinguish between crowd patches of varying densities?
  • RQ4Does a progressive filtering strategy during inference reduce the impact of ambiguous patches (e.g., those without visible heads) and improve final count accuracy?
  • RQ5Can fine-tuning the image encoder while keeping the text encoder fixed yield better performance than using the original CLIP model?

Key findings

  • CrowdCLIP achieves a 35.2% relative improvement in MAE over the previous unsupervised SOTA method, CSS-CCNN, on the UCF-QNRF dataset, with an MAE of 283.3 compared to CSS-CCNN’s 441.0.
  • Under cross-dataset evaluation, CrowdCLIP surpasses several fully supervised state-of-the-art methods, including CSRNet and SANet, demonstrating strong generalization without any labeled data.
  • Fixing the text encoder while fine-tuning only the image encoder yields the best performance (MAE = 283.3), while fine-tuning the text encoder leads to a significant drop in accuracy.
  • The optimal patch number for inference is 4 or 5, with MAE dropping to 283.3 and 305.2 respectively, outperforming both zero-shot CLIP (MAE = 414.7) and the baseline with 3 patches.
  • Performance improves steadily with more training data, and using additional data like ShanghaiTech Part A further boosts accuracy, highlighting the scalability of the unsupervised approach.
  • The method generalizes well across diverse datasets, achieving consistent improvements on five challenging benchmarks, including UCF-QNRF, ShanghaiTech, and NWPU-Crowd.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.