Towards using count-level weak supervision for crowd counting

Yinjie Lei, Yan Liu, Pingping Zhang, Lingqiao Liu

TL;DR

Crowd counting typically requires labor-intensive "dot-level" annotations for every person in an image. This paper introduces Multiple Auxiliary Tasks Training (MATT), a framework that allows models to learn effectively using only a handful of fully annotated images combined with a large volume of "count-level" labels (just the total number of people), significantly reducing the human effort required to train accurate counters.

What Problem Does This Paper Address?

The state-of-the-art in crowd counting relies on regressing a density map, where the integral of the map equals the total count. To train these models, humans usually have to place a dot on the head of every single person in a training image. In a dense crowd of thousands, this is a nightmare for annotators.

While "weak" supervision—knowing only the total count—is much easier to obtain (e.g., by counting a "seed" image and then tracking additions/removals), it provides a very loose constraint. A model can easily cheat by predicting a blurry, homogeneous blob that happens to sum up to the correct total count without actually "locating" the people. The authors aim to bridge this gap: how can we force a model to learn precise spatial features when we only give it the final sum?

Figure 1: Comparison between traditional full supervision (dots for everyone) and the proposed weak supervision (dots for a few, counts for the rest).

Methods

The authors propose a strategy called Multiple Auxiliary Tasks Training (MATT). The core idea is to restrict the "freedom" of the generated density maps by forcing the model to satisfy multiple constraints simultaneously.

  1. Multiple Auxiliary Branches: The model uses a shared feature extractor but branches out into one primary branch and several auxiliary branches. Each branch is tasked with predicting a density map.
  2. Consistency via Convolution: These maps are designed to be "diverse but equivalent." The authors enforce a consistency loss: if you take an auxiliary map and convolve it with a specific Gaussian kernel, it should match the primary map. This forces the underlying feature extractor to encode accurate location information to satisfy these different "smoothness" requirements.
  3. Asymmetry Training: This is a clever optimization trick. The authors realized that if the primary and auxiliary branches learn from each other equally, they might both collapse into a noisy, incorrect state. Instead, they use "asymmetry": the auxiliary branches learn from the primary branch, but the primary branch only learns from the ground-truth labels (dots or counts). This ensures the primary branch remains a "credible source" of information.
Figure 2: The MATT architecture overview, showing how auxiliary branches and consistency losses are used during training.

Datasets

The researchers evaluated their method on three standard benchmarks: ShanghaiTech (Parts A and B), UCF_CC_50, and WorldExpo’10.

Crucially, they introduced a new dataset: the Multi-Shot Crowd Counting (MSCC) dataset. Unlike standard datasets where counts are derived from dots, MSCC was built using a "progressive" strategy. They took 15 categories of objects (like M&M beans, tomatoes, and capacitors), annotated one "seed image" with dots, and then sequentially added or removed objects to infer the counts for hundreds of other images effortlessly.

Key Insights and Ideas

  • The Power of Consistency: The most important takeaway is that a single scalar (the total count) isn't enough to train a deep spatial regressor. However, by requiring the model to produce multiple spatially consistent realizations of that count, you implicitly force it to find the objects' actual locations.
  • Feature Extractor Robustness: The authors postulate that the feature extractor is less sensitive to noisy signals than the regressor. By using auxiliary tasks to "pressure" the feature extractor, it learns more robust representations that generalize better to unseen images.
  • Asymmetry is Essential: Without the asymmetry training strategy, the model's performance drops significantly (e.g., MAE on ShanghaiTech Part A rises from 80.1 to 89.0). You cannot let the "blind lead the blind" in weakly supervised learning.

Key Results

MATT consistently outperformed "Baseline2" (a naive approach that just regresses the total count).

  • ShanghaiTech Part A: MATT achieved a Mean Absolute Error (MAE) of 80.1, compared to 89.3 for the naive baseline. For context, the fully supervised version of the same network gets around 68.2.
  • UCF_CC_50: In this extremely dense dataset, MATT improved the MAE by nearly 50 heads over the naive method (355.0 vs 405.0).
  • MSCC Dataset: On the new dataset, MATT reduced the average MAE to 6.8, a massive 63.8% improvement over training on just the few fully-labeled images (Baseline1).

Qualitatively, the density maps generated by MATT are much sharper and more closely resemble the ground truth than the blurry outputs of the naive baseline.

Limitations and Future Work

While MATT significantly narrows the gap between weak and full supervision, a gap still exists. The method relies on having at least some location-level data (the "seed" images).

The authors suggest that future work could explore how to choose the "best" auxiliary tasks or kernels automatically. Additionally, while this paper focuses on count-level supervision, the principles of MATT and asymmetry training could potentially be applied to other weakly-supervised tasks in computer vision where spatial distribution matters.

Summary updated

BibTeX
@article{lei2021towards,
  author = {Yinjie Lei and Yan Liu and Pingping Zhang and Lingqiao Liu},
  title = {{Towards using count-level weak supervision for crowd counting}},
  journal = {Pattern Recognition},
  year = {2021},
  doi = {10.1016/j.patcog.2020.107616},
}
Figure