Robust Zero-Shot Crowd Counting and Localization With Adaptive Resolution SAM

Jia Wan, Qiangqiang Wu, Wei Lin, Antoni B. Chan

Introduction

Crowd counting is essential for urban planning and public safety, but training effective models typically requires thousands of images where every individual is manually annotated with a point. In high-density scenes, this task is exhausting and expensive. While foundation models like the Segment Anything Model (SAM) have revolutionized computer vision, they struggle with dense crowds due to occlusions and the small scale of individuals relative to image resolution. This paper introduces a framework to leverage these models for zero-shot crowd counting without human labels.

The Robust AdaSEEM Framework

The proposed Robust AdaSEEM framework addresses the limitations of foundation models by using the Segment-Everything-Everywhere Model (SEEM) to generate high-quality training data (pseudo-labels) automatically.

Overview of the Robust AdaSEEM framework, illustrating the two-stage pseudo-label generation and robust localization process.

Adaptive Resolution SEEM (AdaSEEM)

The primary reason foundation models fail in crowds is often a lack of resolution rather than a lack of knowledge. AdaSEEM introduces an iterative "zoom-in" strategy. If a patch contains a high ratio of "uncertain" pixels (areas the model cannot clearly label), the system doubles the resolution of that patch and re-runs the model. This allows it to "see" individuals that were previously indistinguishable from the background.

The adaptive resolution strategy zooms into dense patches (from 1024x1024 down to 256x256) to improve the recall of small individuals.

Robust Localization and Iterative Training

To convert SEEM's segmentation masks into point annotations, the authors model the mask distribution using a Gaussian Mixture Model (GMM), specifically selecting the component representing the head.

The training process is governed by a robust loss function that ignores uncertain regions to prevent noisy data from corrupting the model. It employs an "individual loss" to ensure each mask contains exactly one person and a "background loss" to suppress false positives. Furthermore, an iterative self-improvement loop uses the network’s own predictions as prompts to refine the pseudo-labels, creating a virtuous cycle of data improvement.

Key Results and Insights

The method was evaluated on major benchmarks including JHU-CROWD, UCF-QNRF, and ShanghaiTech. Robust AdaSEEM significantly outperformed previous unsupervised methods:

  • UCF-QNRF: Achieved an MAE of 181.2, a massive improvement over the previous state-of-the-art (283.3).
  • ShanghaiTech A: Reduced MAE from 146.1 to 102.6.

These results demonstrate that specialized models can be trained entirely by general-purpose foundation models, provided they are supported by mechanisms like iterative loops and adaptive resolution. Surprisingly, the unsupervised results were comparable to classic fully supervised methods like MCNN and Switch-CNN.

Limitations and Future Work

The main drawback is the high computational cost associated with the iterative zooming process and multiple training passes. Future work will focus on improving efficiency and handling extreme occlusions where even zooming does not reveal enough detail to distinguish individual bodies.

Summary updated

BibTeX
@inproceedings{wan2024robust,
  author = {Jia Wan and Qiangqiang Wu and Wei Lin and Antoni B. Chan},
  title = {{Robust Zero-Shot Crowd Counting and Localization With Adaptive Resolution SAM}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72998-0\_27},
}
Figure