Efficient Crowd Counting via Structured Knowledge Transfer

Lingbo Liu, Jiaqi Chen, Hefeng Wu, Tianshui Chen, Guanbin Li, Liang Lin

Abstract

Crowd counting is essential for urban safety and planning but typically requires computationally heavy models unsuitable for edge deployment. This paper introduces Structured Knowledge Transfer (SKT), a framework that distills knowledge from large teacher networks into lightweight student models. By transferring intra-layer patterns, inter-layer relationships, and leveraging teacher-generated soft ground truths, SKT produces models up to 9x faster than predecessors while maintaining state-of-the-art accuracy.

Introduction

Estimating the number of people in a scene is a vital task for public safety. However, the most accurate current models are "heavyweights," relying on massive backbones like VGG-16 that are computationally expensive. For instance, the DISSNet model can take nearly 4 seconds to process a single high-resolution image on a high-end GPU. This creates a significant deployment gap for edge hardware, such as smart surveillance cameras. The challenge is to compress these models without losing the fine-grained spatial information required to count individuals in dense, overlapping crowds.

Methods

The authors propose Structured Knowledge Transfer (SKT), a teacher-student training strategy. A large, pre-trained "teacher" network guides a compact "student" network (with only 1/4th the channels) through three distinct mechanisms:

  1. Intra-Layer Pattern Transfer (Intra-PT): The student is forced to mimic the feature patterns at various intermediate layers of the teacher. The authors use a cosine similarity metric, which focuses on the pattern of the features rather than their exact numerical magnitude, providing the flexibility a smaller network needs.
  2. Inter-Layer Relation Transfer (Inter-RT): This module teaches the student how features evolve. By computing "Flow of Solution Procedure" (FSP) matrices—representing relationships between different layers—the student learns the teacher's internal logic for processing data.
  3. Soft Ground-Truth Learning: Human-annotated "hard" ground truths (dots on heads) can be noisy. The authors use the teacher’s predicted density maps as "soft" ground truths, which often contain more spatially consistent information that helps the student generalize better.
The SKT framework architecture showing the teacher-student distillation process via Intra-PT, Inter-RT, and Soft Ground-Truth learning.

Key Insights

A core philosophy of SKT is teaching the "how" rather than just the "what." By mimicking layer relationships, the student learns the counting procedure rather than just memorizing final outputs. Furthermore, the teacher acts as a refiner; soft ground truths often handle occlusions and tiny heads better than noisy human annotations, creating a complementary effect that boosts student performance.

Comparison of hard ground-truth versus the teacher's soft ground-truth and the resulting student prediction, highlighting the teacher's ability to refine noisy annotations.

Key Results

The framework was evaluated on major benchmarks including Shanghaitech, UCF-QNRF, and WorldExpo’10. The results demonstrate a significant efficiency-accuracy trade-off:

  • Massive Speedup: The distilled models achieved at least a 6.5x speed-up on GPUs and a 9x speed-up on CPUs.
  • Extreme Compression: Student models used only about 6% of the parameters and computation cost (FLOPs) of the original heavy models.
  • Competitive Accuracy: On the Shanghaitech Part-A dataset, the SKT-trained student (MAE 71.55) significantly outperformed other compression methods like pruning (MAE 78.51) or quantization (MAE 75.50), coming remarkably close to the original heavy teacher's performance (MAE 68.43).

Conclusion

SKT bridges the gap between high-performance crowd counting and real-time edge deployment. While the current focus is on similar architectures (e.g., VGG-to-VGG), the authors suggest that this structured transfer could be applied to other dense prediction tasks beyond crowd counting, such as semantic segmentation or depth estimation.

Summary updated

BibTeX
@inproceedings{liu2020efficient,
  author = {Lingbo Liu and Jiaqi Chen and Hefeng Wu and Tianshui Chen and Guanbin Li and Liang Lin},
  title = {{Efficient Crowd Counting via Structured Knowledge Transfer}},
  booktitle = {ACM Multimedia},
  year = {2020},
  url = {https://openreview.net/forum?id=gULb-v6E08L},
}
Figure