Abstract
Semi-supervised approaches for crowd counting attract attention, as the fully supervised paradigm is expensive and laborious due to its request for a large number of images of dense crowd scenarios and their annotations. This paper proposes a spatial uncertainty-aware semi-supervised approach via regularized surrogate task (binary segmentation) for crowd counting problems. Different from existing semi-supervised learning-based crowd counting methods, to exploit the unlabeled data, our proposed spatial uncertainty-aware teacher-student framework focuses on high confident regions’ information while addressing the noisy supervision from the unlabeled data in an end-to-end manner. Specifically, we estimate the spatial uncertainty maps from the teacher model’s surrogate task to guide the feature learning of the main task (density regression) and the surrogate task of the student model at the same time. Besides, we introduce a simple yet effective differential transformation layer to enforce the inherent spatial consistency regularization between the main task and the surrogate task in the student model, which helps the surrogate task to yield more reliable predictions and generates high-quality uncertainty maps. Thus, our model can also address the task-level perturbation problems that occur spatial inconsistency between the primary and surrogate tasks in the student model. Experimental results on four challenging crowd counting datasets demonstrate that our method achieves superior performance to the state-of-the-art semi-supervised methods.
Introduction
Crowd counting—estimating the number of people in dense images—is vital for public safety and urban planning. However, the current "gold standard" involves training deep neural networks on millions of manually annotated head-centers, a process that is incredibly labor-intensive (e.g., the NWPU-Crowd dataset took roughly 3,000 human hours to annotate).
Semi-supervised learning (SSL) aims to solve this by using a small amount of labeled data alongside a large pool of unlabeled images. The challenge is that unlabeled data is inherently "noisy," often leading to a feedback loop of errors if a model treats its own incorrect guesses as ground truth. This paper specifically tackles aleatoric uncertainty—the noise caused by complex backgrounds, occlusions, and lighting variations—by introducing a Spatial Uncertainty-Aware (SUA) framework.
Methodology
The SUA framework is built upon the Mean-Teacher paradigm, where a "Student" model learns from labeled data and a "Teacher" model (an exponential moving average of the student) generates pseudo-targets for unlabeled data.
Key Components
- Surrogate Task (Binary Segmentation): Alongside the main task of density regression (counting), the model performs binary segmentation (identifying crowd vs. background). This surrogate task helps the model focus on relevant regions of interest and provides a more stable learning signal.
- Spatial Uncertainty Estimation: The Teacher model estimates uncertainty using Shannon Entropy across multiple stochastic forward passes. This produces "Hard" uncertainty maps to filter out unreliable regions and "Soft" uncertainty maps to weight pixel-wise importance, ensuring the Student only learns from high-confidence areas.
- Differentiable Transformation Layer: To ensure the counting and segmentation tasks are logically consistent, the authors introduced a layer that approximates a segmentation map directly from the density map. This enforces "spatial consistency" across different tasks within the model, preventing task-level contradictions.
Experimental Results
The model was evaluated on four major crowd-counting benchmarks: ShanghaiTech (Part A & B), UCF-QNRF, JHU-Crowd, and NWPU-Crowd.
- Efficiency: On the ShanghaiTech Part A and JHU-Crowd datasets, the model achieved performance comparable to fully supervised state-of-the-art methods while using only 50% of the labeled data.
- Accuracy: Compared to a standard Mean-Teacher baseline, the SUA method reduced the Mean Absolute Error (MAE) by an average of 25.1% across the four datasets.
- Ablation Success: Removing the uncertainty maps led to a significant drop in performance (e.g., MAE rose from 68.5 to 81.1 on ShanghaiTech A), proving that uncertainty awareness is the critical component of the architecture.
Conclusion
The SUA framework effectively utilizes unlabeled data by quantifying spatial uncertainty and enforcing task-level consistency. While the current implementation relies on a truncated VGG-16 backbone and involves computational overhead during training due to stochastic forward passes, it significantly reduces the manual annotation burden. Future work may explore more modern backbones like Transformers and integrate domain adaptation techniques to improve model portability across different environments.
Code is available at: https://github.com/smallmax00/SUA_crowd_counting
Summary updated