Crowd Counting by Adaptively Fusing Predictions from an Image Pyramid

Di Kang, Antoni B. Chan

Introduction

Crowd counting is a critical task in computer vision, yet it remains challenging due to extreme scale variations. In a typical surveillance scene, individuals near the camera appear significantly larger than those in the distance. Traditional approaches, such as Multi-Column CNNs (MCNN), attempt to address this by using parallel branches with varying filter sizes. However, these methods are often computationally expensive and fail to account for local perspective changes within a single frame. Researchers from the City University of Hong Kong propose a more efficient solution: an image pyramid approach combined with a per-pixel attention mechanism.

Proposed Method

The authors introduce a framework that adaptively fuses density map predictions from multiple image scales. The architecture consists of two main components: an image pyramid and an adaptive fusion sub-network.

Architecture of the proposed crowd counting model featuring an image pyramid and shared weights.

Image Pyramid and Shared Weights

Instead of employing multi-column networks with large, fixed filters, the model feeds the input image at multiple resolutions (e.g., original, 70%, and 50%) into a shared Fully Convolutional Network (FCN). This allows the network to use the same optimized filters to detect people at different relative scales, significantly reducing the parameter count and computational overhead.

Adaptive Fusion via Attention

The core innovation is the Attention Sub-net. This small network analyzes features at each scale to generate per-pixel attention maps. These maps serve as weights that determine which scale's prediction should be trusted for a specific region of the image. For instance, high-resolution predictions are prioritized for foreground pixels, while low-resolution predictions are favored for the background.

Visualization of density maps and attention maps across different scales (S1, S2) and the final fused result.

The weighted predictions are normalized using a softmax function and then fused via a $1\times1$ convolution to produce the final, high-fidelity crowd density map.

Experimental Results

The model, specifically the FCN-7c-3s variant (7 layers, 3 scales), was evaluated on major benchmarks including ShanghaiTech, WorldExpo ’10, and UCSD.

  • Accuracy: On the ShanghaiTech Part B dataset, the model achieved a Mean Absolute Error (MAE) of 10.2, significantly outperforming MCNN (26.4) and Switch-CNN (21.6).
  • Efficiency: A standout feature of this approach is its speed. Running on a GTX 1080, the model achieves 158 to 439 FPS, making it suitable for real-time applications. In contrast, high-accuracy models like CP-CNN operate at only 0.11 FPS.
  • Robustness: The adaptive fusion mechanism allows the model to generalize well across different environments, maintaining high performance even in datasets with lower scale variation like UCSD.

Discussion and Conclusion

The research demonstrates that resizing input images (pyramids) is more effective and efficient than resizing filters (columns) for capturing multi-scale features. By incorporating spatial adaptivity through per-pixel attention, the model effectively handles perspective distortion.

While the model is exceptionally fast, it trails slightly behind heavy, VGG-based architectures like CP-CNN in absolute accuracy on highly congested scenes. This is largely because the proposed model is trained from scratch with a lightweight architecture. Future work may involve integrating more powerful backbones or leveraging camera metadata to further refine the attention mechanism.

Summary updated

BibTeX
@inproceedings{kang2018crowd,
  author = {Di Kang and Antoni B. Chan},
  title = {{Crowd Counting by Adaptively Fusing Predictions from an Image Pyramid}},
  booktitle = {BMVC},
  year = {2018},
}
Figure