Home

Awesome

Efficient Crowd Counting via Structured Knowledge Transfer (ACM MM 2020)

Crowd counting is an application-oriented task and its inference efficiency is crucial for real-world applications. However, most previous works relied on heavy backbone networks and required prohibitive run-time consumption, which would seriously restrict their deployment scopes and cause poor scalability. To liberate these crowd counting models, we propose a novel Structured Knowledge Transfer (SKT) framework, which fully exploits the structured knowledge of a well-trained teacher network to generate a lightweight but still highly effective student network.

Extensive evaluations on three benchmarks well demonstrate the effectiveness of our SKT for extensive crowd counting models. In this project, the well-trained teacher networks and the distilled student networks have been released at GoogleDrive and BaiduYun (extract code: srpl). If you use this code and the released models for your research, please cite our paper:

@inproceedings{liu2020efficient,
  title={Efficient Crowd Counting via Structured Knowledge Transfer},
  author={Liu, Lingbo and Chen, Jiaqi and Wu, Hefeng and Chen, Tianshui and Li, Guanbin and Lin, Liang},
  booktitle={ACM International Conference on Multimedia},
  year={2020}
}

Datasets

ShanghaiTech: Google Drive

UCF-QNRF: Link

Prerequisites

We strongly recommend Anaconda as the environment.

Python: 2.7

PyTorch: 0.4.0

Preprocessing

  1. Generation the ground-truth density maps for training
# ShanghaiTech
python preprocess/ShanghaiTech_GT_generation.py

# UCF-QNRF
python preprocess/UCF_GT_generation.py --mode train
python preprocess/UCF_GT_generation.py --mode test
  1. Make data path files and edit this file to change the path to your original datasets.
python preprocess/make_json.py

Training

Edit this file for distillation training

bash SKT_distill.sh

Testing

Edit this file for testing models

bash test.sh

Models

The well-trained teacher networks and the distilled student networks are released at have been released at GoogleDrive and BaiduYun (extract code: srpl ). In particular, only using around 6% of the parameters and computation cost of original models, our distilled VGG-based models obtain at least 6.5× speed-up on an Nvidia 1080 GPU and even achieve state-of-the-art performance.

Shanghaitech A (576×864)

MethodMAERMSE#Param (M)FLOPs (G)GPU (ms)CPU (s)Comment
CSRNet68.43105.9916.26205.8866.587.85teacher model, trained with CSRNet-pytorch
1/4-CSRNet + SKT71.55114.401.0213.098.880.87--
BL61.46103.1721.50205.3247.898.84teacher model
1/4-BL + SKT62.73102.331.3513.067.400.88--

UCF-QNRF (2032×2912)

MethodMAERMSE#Param (M)FLOPs (G)GPU (ms)CPU (s)Comment
CSRNet145.54233.3216.262447.91823.84119.67teacher model, trained with CSRNet-pytorch
1/4-CSRNet + SKT144.36234.641.02155.69106.089.71--
BL87.70158.0921.502441.23595.72130.76teacher model
1/4-BL + SKT96.24156.821.35155.3090.969.78The released model is much better.