Multi-scale Feature Aggregation for Crowd Counting

Xiaoheng Jiang, Xinyi Wu, Hisham Cholakkal, Rao Muhammad Anwer, Jiale Cao, Mingliang Xu, Bing Zhou, Yanwei Pang, Fahad Shahbaz KhanarXiv 2022

Abstract

Convolutional Neural Network (CNN) based crowd counting methods have achieved promising results in the past few years. However, the scale variation problem remains a significant challenge for accurate count estimation. In this paper, we propose a multi-scale feature aggregation network (MSFANet) that alleviates this problem through two novel feature aggregation modules: Short Aggregation (ShortAgg) and Skip Aggregation (SkipAgg). ShortAgg fuses features of adjacent convolution blocks gradually, while SkipAgg propagates features with small receptive fields directly to deeper layers, enhanced by Swin Transformer blocks to incorporate rich spatial information. Furthermore, we introduce a local-and-global based pooling loss to account for non-uniform crowd distributions. Extensive experiments on challenging datasets like ShanghaiTech, UCF_CC_50, UCF-QNRF, and WorldExpo'10 demonstrate that MSFANet achieves state-of-the-art performance.

Addressing the Scale Variation Challenge

Crowd counting is typically framed as a density regression task where a network predicts a density map from an input image. The total count is then derived by integrating the density map. The primary obstacle in this field is scale variation: due to perspective effects, individuals near the camera appear large, while those in the distance may occupy only a few pixels.

Standard hierarchical CNNs often lose the high-resolution, low-level details (such as edges and textures) necessary to identify tiny heads in the distance as they progress into deeper layers. Consequently, many models struggle to maintain accuracy in high-density regions far from the camera.

The MSFANet Architecture

To combat scale variation, the proposed Multi-scale Feature Aggregation Network (MSFANet) utilizes a VGG-16 backbone enhanced by two specific aggregation strategies and a transformer-based enhancement.

The MSFANet architecture, illustrating the ShortAgg and SkipAgg modules alongside the integration of Swin Transformer blocks.

Core Modules

  1. Short Aggregation (ShortAgg): This module links adjacent convolution blocks. It ensures that features with different receptive fields are fused gradually as information flows through the network, preserving a continuum of scale information.
  2. Skip Aggregation (SkipAgg): This serves as an "express lane," directly propagating low-level features from early layers to the end of the network. To refine these features, the authors integrate Swin Transformer blocks, which utilize local self-attention to capture spatial context that standard convolutions might overlook.
  3. Pooling Loss (PLoss): Moving beyond standard Euclidean loss (MSE), the authors propose a "locality-aware" loss. It calculates errors within small windows (pooling) and normalizes them by the local population count, preventing the model from being biased toward either extremely sparse or extremely dense regions.

Experimental Results and Insights

MSFANet was evaluated on four major benchmarks, demonstrating superior performance in Mean Absolute Error (MAE). A key insight from the ablation studies is the effectiveness of the dual-path fusion; by combining gradual (ShortAgg) and direct (SkipAgg) fusion, the network simultaneously captures broad scene context and minute head details.

Comparison of Mean Absolute Error (MAE) between the baseline and MSFANet across far, mid, and near views, showing consistent improvement across all scales.

Key Performance Metrics

  • ShanghaiTech Part A: Achieved an MAE of 54.67, a 1.3% improvement over previous leaders.
  • UCF_CC_50: Reached an MAE of 159.1, representing a significant 9.0% improvement over the next best model (ASNet).
  • WorldExpo’10: Ranked 1st in average ranking across five distinct test scenes.

Conclusion

MSFANet effectively addresses the scale variation problem in crowd counting by densely aggregating features across different scales and leveraging the spatial modeling power of Transformers. While the model achieves state-of-the-art accuracy, future work may focus on optimizing the computational overhead of the Transformer components for real-time applications and exploring weakly supervised training methods to reduce annotation labor.

Summary updated

BibTeX
@misc{jiang2022multi,
  author = {Xiaoheng Jiang and Xinyi Wu and Hisham Cholakkal and Rao Muhammad Anwer and Jiale Cao and Mingliang Xu and Bing Zhou and Yanwei Pang and Fahad Shahbaz Khan},
  title = {{Multi-scale Feature Aggregation for Crowd Counting}},
  year = {2022},
  eprint = {2208.05256},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.05256},
}
Figure