Local Information Matters: A Rethink of Crowd Counting

Tianhang Pan, Xiuyi Jia

Introduction: The Scale Mismatch in Crowd Counting

In standard computer vision tasks like image classification, the objects of interest—such as a bird or a car—typically occupy a significant portion of the frame. Consequently, modern neural network architectures (e.g., VGG, ResNet, ViT) are designed with a large Effective Receptive Field (ERF) to capture these global structures.

However, crowd counting is fundamentally different. In a dense crowd, a single human head may be only a few pixels wide. This paper argues that there is a critical mismatch in current research: models are using "wide-angle" backbones and expanding receptive fields to count objects that are inherently local. This global focus is not only computationally expensive but counterproductive, as it introduces noise and obscures subtle local density variations.

Comparison of recognition requirements: a bird requires global context, while a person in a dense crowd is identifiable through local features.

The Local Information Matters Model (LIMM)

To address this mismatch, the authors propose LIMM, a model built on the principle of prioritizing local modeling capability. LIMM introduces three core innovations:

  1. Window Partitioning with Shifted Windows: Instead of processing the entire image globally, LIMM divides the input into small 128x128 grid windows. To mitigate "boundary effects" where a head might be bisected by a grid line, it employs a shift-window mechanism (similar to Swin Transformers) to capture information across edges.
  2. Window-wise Contrastive Learning (WWCL): LIMM treats each window as an individual sample. It uses contrastive learning to group windows with similar crowd densities in the feature space. A unique Class Distance Weighting function is introduced, acknowledging that density is a spectrum; for example, a window with 5 people is semantically closer to one with 6 people than one with 50.
  3. Global Sub-sampled Attention (GSA): To maintain versatility, a lightweight global attention layer is added at the end. This ensures the model can still accurately count larger individuals who appear closer to the camera.

The ERF Paradox

A key insight of this research is the ERF Paradox. By calculating the Effective Receptive Field of various models, the authors found that even when a model has the capacity to see the whole image, it naturally "shrinks" its focus to a small area when trained on crowd counting tasks. LIMM essentially formalizes this natural tendency within the architecture itself, reducing the redundancy of scale.

Visualizing the Effective Receptive Field (ERF) across different scenes, demonstrating how models naturally focus on local areas for small object detection.

Experimental Results

LIMM was evaluated on major benchmarks including JHU-Crowd++, UCF-QNRF, and ShanghaiTech. It achieved state-of-the-art (SOTA) performance, particularly in high-density scenarios:

  • JHU-Crowd++: Achieved a Mean Absolute Error (MAE) of 53.0, a 10.5% reduction in error compared to the baseline ConvNeXt-T.
  • UCF-QNRF: Achieved an MAE of 76.4, outperforming recent models like Gramformer.
  • Efficiency: During inference, LIMM adds only 0.5 GFLOPs and 1M parameters over its baseline, proving that local focus is both accurate and efficient.

Conclusion

LIMM demonstrates that for small-object tasks like crowd counting, "seeing the big picture" can be a disadvantage. By emphasizing local modeling through window partitioning and density-aware contrastive learning, LIMM sets a new standard for accuracy in dense environments. Future work will look toward a universal paradigm that can adapt its modeling focus dynamically based on the scale of individuals in any given scene.

Summary updated

Abstract

The motivation of this paper originates from rethinking an essential characteristic of crowd counting: individuals (heads of humans) in the crowd counting task typically occupy a very small portion of the image. This characteristic has never been the focus of existing works: they typically use the same backbone as other visual tasks and pursue a large receptive field. This drives us to propose a new model design principle of crowd counting: emphasizing local modeling capability of the model. We follow the principle and design a crowd counting model named Local Information Matters Model (LIMM). The main innovation lies in two strategies: a window partitioning design that applies grid windows to the model input, and a window-wise contrastive learning design to enhance the model's ability to distinguish between local density levels. Moreover, a global attention module is applied to the end of the model to handle the occasionally occurring large-sized individuals. Extensive experiments on multiple public datasets illustrate that the proposed model shows a significant improvement in local modeling capability (8.7\% in MAE on the JHU-Crowd++ high-density subset for example), without compromising its ability to count large-sized ones, which achieves state-of-the-art performance. Code is available at: https://github.com/tianhangpan/LIMM.
BibTeX
@misc{pan2025local,
  author = {Tianhang Pan and Xiuyi Jia},
  title = {{Local Information Matters: A Rethink of Crowd Counting}},
  year = {2025},
  eprint = {2508.16970},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.16970},
}
Figure