Multi-Scale Context Aggregation Network with Attention-Guided for Crowd Counting

Xin Wang, Yang Zhao, Tangwen Yang, Qiuqi Ruan · DOI

Abstract

Crowd counting aims to predict the number of people and generate density maps in images, facing challenges like varying head scales, diverse crowd distributions, and cluttered backgrounds. We propose the Multi-Scale Context Aggregation Network (MSCANet), a single-column encoder-decoder architecture. The encoder features a Dense Context-Aware Module (DCAM) to aggregate multi-scale contextual information via densely connected dilated convolutions. The decoder employs a hierarchical attention-guided mechanism with Semantic Attention Modules (SAM) to suppress background noise and integrate useful spatial information. Experiments on ShanghaiTech, UCF-QNRF, and UCF_CC_50 datasets demonstrate that MSCANet achieves state-of-the-art performance. Code: https://github.com/KingMV/MSCANet

Introduction

Crowd counting is a critical task for urban safety and management, yet it remains difficult due to two primary hurdles: extreme scale variation and background clutter. Perspective effects cause heads near the camera to appear much larger than those in the distance. Additionally, high-density areas often contain background elements—such as tree leaves or architectural patterns—that visually mimic human heads, leading to false positives in density estimation.

Previous multi-column networks attempted to address scale variation using parallel branches of different sizes, but these were often redundant and computationally expensive. MSCANet addresses these issues through an efficient single-column design that leverages dense context and hierarchical attention.

Methodology

MSCANet consists of two primary components designed to handle scale and noise:

  1. Dense Context-Aware Module (DCAM): Integrated into the encoder, the DCAM replaces standard parallel branches. It uses densely connected dilated convolution layers with varying rates (2, 4, and 6). This architecture allows the network to sample scales more finely and capture a continuous range of contextual information, which is crucial for handling smooth perspective shifts in real-world photography.
  2. Hierarchical Attention-Guided Decoder (HAGD): Shallow features in CNNs often contain high-resolution spatial noise. The HAGD introduces Semantic Attention Modules (SAM) at multiple stages. These modules generate attention maps that force the network to focus on actual crowd regions while suppressing background noise before feature fusion.
The overall architecture of MSCANet, featuring the DCAM-based encoder and the hierarchical attention-guided decoder.

Experiments and Results

The model was evaluated on major benchmarks including ShanghaiTech (Part A & B), UCF-QNRF, and UCF_CC_50.

Quantitative Performance

MSCANet consistently outperformed previous state-of-the-art methods. On the ShanghaiTech Part A dataset, it achieved a Mean Absolute Error (MAE) of 60.1, a significant improvement over CSRNet's 68.2. On the large-scale UCF-QNRF dataset, it reached an MAE of 100.8, proving its effectiveness on high-resolution, diverse data.

Qualitative Analysis

Visualizations confirm that MSCANet is significantly more effective at suppressing background noise than earlier models. By utilizing the SAM-guided attention maps, the network avoids "hallucinating" people in complex textures like trees or building facades, leading to more reliable density maps.

Qualitative comparison of density map estimation on various datasets, showing ground truth versus model predictions.

Conclusion

MSCANet provides a robust solution for crowd counting by combining dense multi-scale context aggregation with hierarchical attention. The DCAM effectively handles scale variation, while the HAGD ensures high-quality density maps by filtering out background clutter. Future research will explore automated dilation rate selection to further improve scale adaptability.

Summary updated

BibTeX
@misc{wang2021multi,
  author = {Xin Wang and Yang Zhao and Tangwen Yang and Qiuqi Ruan},
  title = {{Multi-Scale Context Aggregation Network with Attention-Guided for Crowd Counting}},
  year = {2021},
  eprint = {2104.02245},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.02245},
}
Figure