Weighing Counts: Sequential Crowd Counting by Reinforcement Learning

Liang Liu, Hao Lu, Hongwei Zou, Haipeng Xiong, Zhiguo Cao, Chunhua Shen

Introduction

Crowd counting is a critical task in computer vision with applications ranging from public safety to urban planning. Traditionally, this problem is framed as a single-step regression task where a model maps an input image directly to a density map or a global count. However, these "one-shot" approaches lack a mechanism for self-correction; if the model over- or under-estimates in its initial pass, there is no iterative process to refine the result.

In this paper, the authors propose LibraNet, a novel framework that reformulates crowd counting as a sequential decision-making process. By leveraging Deep Reinforcement Learning (DRL), the model mimics the human process of scanning and refining estimates, treating the counting task as a physical "weighing" process.

The Sequential Weighing Paradigm

The core innovation of LibraNet is the "Counting Scale" analogy. Instead of predicting a number, the model acts as an agent interacting with a balance scale.

The sequential weighing process: the agent iteratively adds and removes weights to balance the crowd density.

The Components of the Scale

  • The Object: Image features extracted from a VGG16 backbone represent the "stuff" to be weighed.
  • The Weights: The agent has access to an action pool of discrete count values: $\{-10, -5, -2, -1, +1, +2, +5, +10, \text{end}\}$.
  • The Logic: A Deep Q-Network (DQN) determines which weight to add or remove based on the current state (image features + current accumulated weight).
  • The Goal: The process terminates when the agent selects the "end" action, ideally when the accumulated weights match the ground-truth crowd density.

Reward Engineering for Convergence

Training an RL agent for regression requires careful reward design. LibraNet uses three distinct rewards:

  1. Guiding Reward: Directs the agent toward the ground truth by rewarding actions that reduce the absolute error.
  2. Squeezing Reward: Specifically penalizes overestimation, encouraging the model to approach the true count cautiously.
  3. Force Ending Reward: Prevents infinite loops by penalizing the agent if it fails to reach a conclusion within a maximum step limit (typically 8 steps).

Experimental Results

LibraNet was evaluated on several benchmark datasets, including ShanghaiTech (Parts A and B), UCF_CC_50, and UCF-QNRF.

State-of-the-Art Performance

The model achieved top-tier results, notably reaching a Mean Absolute Error (MAE) of 55.9 on ShanghaiTech Part A and 181.2 on the highly dense UCF_CC_50 dataset. These results demonstrated that breaking a complex regression into a series of simpler sub-decisions improves overall accuracy.

Generalization and Robustness

Perhaps the most significant finding is LibraNet's superior cross-dataset generalization. When trained on one dataset and tested on another (e.g., training on ShanghaiTech A and testing on B), LibraNet significantly outperformed traditional regression models. While standard models often overfit to specific dataset biases, LibraNet learns the underlying logic of balancing a scale, making it more robust to new environments.

Conclusion

LibraNet demonstrates that framing regression as a sequential RL task provides a powerful mechanism for error correction and generalization. By decomposing the counting problem into a series of "weighing" actions, the model achieves state-of-the-art performance while remaining computationally efficient, adding only minimal latency to the backbone processing time. This paradigm of iterative refinement suggests potential applications in other computer vision tasks where precise estimation is required.

Summary updated

BibTeX
@inproceedings{liu2020weighing,
  author = {Liang Liu and Hao Lu and Hongwei Zou and Haipeng Xiong and Zhiguo Cao and Chunhua Shen},
  title = {{Weighing Counts: Sequential Crowd Counting by Reinforcement Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58607-2\_10},
}
Figure