Bidirectional Cross-Level Feature Interaction and Context-Aware Multi-Scale Attention for Crowd Counting
Zhifan Jin, Lin Zhou, He Wang, Sijia Chen, Liman Liu, Wenbing TaoCrowd counting estimates the number and spatial distribution of people in images and videos, supporting smart city management and public safety. Existing methods often rely on intra-level feature refinement and simple cross-scale fusion, such as concatenation or addition, which limits interaction between fine-grained spatial details and high-level semantic representations. In addition, the limited receptive field of convolutional networks restricts global context modeling in scenes with heavy occlusion and extreme scale variation. To address these challenges, we propose a Hierarchical Context-Aware Multi-Scale Attention Network (HCMA). Its bidirectional cross-level interaction is realized through two complementary top-down decoding streams, where an attention-gating stream provides spatial guidance for the counting-oriented representations carried by a density-feature stream. HCMA includes three modules: the Selective Context-Aware Attention Module (SCAM), which performs context-dependent multi-scale filtering; Dynamic Positional Pooling (DPP), which introduces an image-level mean token and stochastic global-relation aggregation; and the Multi-Scale Enhancement Attention Module (MSEA), which refines high-level semantic features under scale variation. Experiments on ShanghaiTech, UCF-QNRF, and NWPU-Crowd show competitive counting accuracy across scenes with different density ranges, scale variation, and occlusion. In particular, HCMA achieves an MAE of 73.2 on NWPU-Crowd, 17.2% lower than that of DM-Count.