Towards Locally Consistent Object Counting with Constrained Multi-stage Convolutional Neural Networks

Muming Zhao, Jian Zhang, Chongyang Zhang, Wenjun Zhang

TL;DR

This paper tackles the issue of "local inconsistency" in object counting, where global counts are accurate but density maps show errors in specific regions. They propose a novel "constrained multi-stage Convolutional Neural Network (CMS-CNN)" that refines density maps through sequential processing and a new "grid loss" function to enforce local accuracy, leading to improved overall counting performance.

What Problem Does This Paper Address?

High-density object counting, especially in surveillance scenes, is challenging due to drastic variations in object scales and severe occlusions. While deep learning has significantly improved counting accuracy, this paper highlights a subtle but important problem: "local inconsistency." This means that even if the total count of objects in an image is accurate (matching the ground truth), the predicted density map might be flawed in specific subregions. This can manifest as undercounting objects in certain areas or incorrectly assigning density to background regions. The authors argue that this local inaccuracy can undermine the reliability of the overall count and limit the usefulness of the predicted density distribution. They aim to address this by ensuring that the density map is not only globally accurate but also locally consistent.

Methods

The core of the proposed method is a Constrained Multi-stage Convolutional Neural Network (CMS-CNN). Instead of relying on complex multi-column architectures, they adopt a simpler stacking formulation of plain CNNs. This multi-stage approach allows for repeated refinement of feature maps throughout the network. Each stage processes the features from the previous one, progressively refining the density map prediction.

To further enforce local consistency, they introduce a novel grid loss function. This loss function operates on subregions (grids) of the image, penalizing inconsistencies in object counts within these local areas. This complements the standard pixel-wise loss (like L2 loss) by providing finer, region-based supervisions. The overall loss is a weighted combination of the pixel-wise loss and the grid loss, allowing the model to balance global and local accuracy. The multi-stage architecture also enables intermediate supervisions at each stage, which helps in training deeper networks.

Datasets

The paper evaluates their method on two widely-used object counting benchmarks:

  • ShanghaiTech dataset: This dataset is large-scale and contains images collected from both the internet and urban surveillance scenes. It's divided into two parts (Part-A and Part-B) with different characteristics regarding object scale and density.
  • TRANCOS dataset: This dataset focuses on car counting in traffic scenes, presenting a different domain for evaluating the method's generalizability.

Key Insights and Ideas

  • Global counts can be misleading: The paper convincingly argues that high global accuracy doesn't guarantee good local predictions, which is a critical observation for many real-world applications.
  • Multi-stage refinement is key: Stacking plain CNNs sequentially allows for iterative refinement of feature maps, leading to a more accurate density map. This is a simpler yet effective alternative to complex multi-column designs.
  • Grid loss for local accountability: The grid loss is a crucial innovation that directly penalizes local counting errors, forcing the model to learn more spatially consistent density distributions.
  • Local consistency improves global accuracy: The paper mathematically demonstrates that reducing local counting errors can lead to an upper bound on global counting errors, providing a theoretical basis for their approach.

Key Results

The proposed CMS-CNN method achieves state-of-the-art results on both the ShanghaiTech and TRANCOS datasets.

  • On ShanghaiTech Part-B, their CMS-CNN-3 model achieves a 40% improvement in MAE over the previous best method (CP-CNN).
  • On the TRANCOS dataset, their CMS-CNN-3 model achieves the best GAME-0 results (7.2), outperforming other methods across all GAME levels.
  • Ablation studies show that both the multi-stage formulation and the grid loss individually contribute to improved performance, with their combination yielding the best results.
  • Qualitative results (Figure 4) visually demonstrate how the density map predictions gradually improve and become more consistent with the ground truth as the input image progresses through the stages, with errors in background regions being refined.

Limitations and Future Work

  • Model Optimization: The authors note that for deeper multi-stage models (like MS-CNN-3), the MSE performance can sometimes degrade, suggesting that optimizing deeper networks can be challenging. This hints at potential areas for future research in network optimization strategies.
  • Hyperparameter Sensitivity: While they identify optimal settings for grid size and weighting, the paper mentions that certain hyperparameter choices (e.g., a large weighting scaler for the grid loss) can degrade performance, indicating a need for careful tuning.
  • Generalization to Extreme Scales: While the method handles scale variations, extremely challenging scenarios with vastly different object scales might still pose difficulties.

Future work could explore more advanced optimization techniques for deeper multi-stage networks and investigate more adaptive ways to set hyperparameters for the grid loss function.

Summary updated

BibTeX
@inproceedings{zhao2018towards,
  author = {Muming Zhao and Jian Zhang and Chongyang Zhang and Wenjun Zhang},
  title = {{Towards Locally Consistent Object Counting with Constrained Multi-stage Convolutional Neural Networks}},
  booktitle = {Accv},
  year = {2018},
  doi = {10.1007/978-3-030-20876-9\_16},
}
Figure