Progressive Multi-Resolution Loss for Crowd Counting

Ziheng Yan, Yuankai Qi, Guorong Li, Xinyan Liu, Weigang Zhang, Ming-Hsuan Yang, Qingming Huang

TL;DR

Researchers have developed a new loss function called Progressive Multi-resolution Loss (PML) that significantly improves the accuracy of crowd counting models. By supervising density map predictions at multiple resolutions simultaneously—rather than just at the final output scale—the model learns a better correspondence between pixels and human annotations, outperforming traditional L2 loss methods across several major benchmarks.

What Problem Does This Paper Address?

Crowd counting is typically treated as a density map regression task: a neural network takes an image and predicts a map where each pixel value represents the local density of people. To train these models, researchers usually take "dot annotations" (one pixel per person) and blur them with a Gaussian kernel to create a ground truth density map. They then use a standard L2 loss (mean squared error) to minimize the difference between the prediction and the ground truth.

However, this approach has a major flaw: it’s hard to perfectly associate a predicted pixel with a specific person, especially in highly congested scenes with varying scales and perspectives. While newer methods like Bayesian Inference or Optimal Transport have tried to fix this "matching" problem, they can be computationally heavy or difficult to tune. This paper asks: Can we derive a better loss function by looking at the density map at multiple scales?

Methods

The authors introduce Progressive Multi-resolution Loss (PML). Instead of just comparing the final high-resolution prediction to the ground truth, they downsample both to various lower resolutions (e.g., $1\times1, 2\times2, 4\times4, \dots, 16\times16$).

Key technical highlights include:

  • Probabilistic Framework: The loss is mathematically derived by maximizing the posterior probability of the density maps across all resolutions.
  • Residual Density Maps: They define "residual" maps—the difference between a high-resolution map and an upsampled version of its lower-resolution counterpart. This ensures that the model learns new details at each scale without "forgetting" the global count established at lower scales.
  • Log-Form Loss: The resulting loss function is a summation of log-transformed L2 differences across scales. The authors mathematically prove that this multi-resolution approach is theoretically superior to the traditional single-resolution L2 loss.
  • Plug-and-Play: Because PML is just a loss function, it can be integrated into existing state-of-the-art architectures (like FIDT or FDC) simply by replacing their standard regression loss.

Datasets

The authors evaluated their method on four of the most challenging crowd counting benchmarks:

  1. ShanghaiTech (Part A & B): Standard datasets featuring both highly congested and sparse scenes.
  2. UCF-QNRF: A large-scale dataset with high-resolution images and extremely dense crowds.
  3. JHU-Crowd++: A diverse dataset containing various weather conditions and scene types.

Key Insights and Ideas

  • The "Aha" Moment: The traditional L2 loss is actually just a special, restricted case of the PML framework. By expanding the supervision to multiple resolutions, you provide the model with a "curriculum" of sorts—learning the total count at low resolutions and refining the spatial distribution at higher ones.
  • Natural Weighting: The log-form of the loss naturally balances the importance of different scales. The highest resolution typically has the largest coefficient, focusing the model's effort on fine-grained details once the global structure is settled.
  • Efficiency: Unlike point-based matching methods (like P2PNet), PML doesn't require complex bipartite matching during training, making it faster and more memory-efficient while achieving comparable or better results.

Key Results

The PML loss consistently improved performance across all backbones (VGG16, ResNet, ConvNeXt) and all datasets:

  • State-of-the-Art Performance: On the JHU-Crowd++ dataset, their method achieved a Mean Absolute Error (MAE) of 57.5, a significant improvement over previous density-based methods.
  • Boosting Existing Models: When added to the FIDT framework, PML reduced the MAE on ShanghaiTech A from 57.0 to 54.5.
  • Robustness: Qualitative results show that PML-trained models produce density maps that are much closer to the ground truth in "difficult" regions where standard models often over- or under-estimate.

Limitations and Future Work

  • Density-Map Focus: The paper focuses strictly on density-map regression. It does not include a localization branch (predicting exactly where each person is with a coordinate), though the authors suggest PML could be adapted for localization in the future.
  • Hyperparameter Sensitivity: While the method is robust, the choice of the number of resolutions ($n$) and the regularization terms can affect performance, as shown in their ablation studies.
  • Future Directions: The authors suggest that this multi-resolution approach could be applied to other dense prediction tasks beyond crowd counting, such as object detection or semantic segmentation.

Summary updated

BibTeX
@article{yan2024progressive,
  author = {Ziheng Yan and Yuankai Qi and Guorong Li and Xinyan Liu and Weigang Zhang and Ming-Hsuan Yang and Qingming Huang},
  title = {{Progressive Multi-Resolution Loss for Crowd Counting}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2024},
  url = {https://openreview.net/forum?id=0N213DFuRc},
}
Figure