All models

CAN (Context-Aware Crowd Counting)

A crowd counter that weights pooled context at several scales per location before decoding a density map.

Detection and tracking · 80 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (8 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
18.1M
Operations
80
Framework
PyTorch
Recurrent
No
Published
CVPR 2019
Cited by
783 (as of 28 October 2026)
Authors
Weizhe Liu, Mathieu Salzmann, Pascal Fua
License
GPL-3.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m15031
Graph hash
e44795efbbaee75941bbfd28f2598f223a1ae976949fd43306e94d102e5b8ce4
Skeleton hash
c0fd717a1ddc26ed85e8e0735dd0aeee31ebdc962ece4435409ad37d7ba228ca
Architecture hash
27d712ea6e5aed0e5b2927c00852e679685a1a45a4389ac5178a810c158794ed
Diagram SHA-256
781ae06403b562484e800ceb10aae9527c2739dc608b63149f4959226faa20da
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

CAN, the Context-Aware Network, counts people in crowded scenes by regressing a people density map from an image. The paper starts from perspective distortion: standard convolutions use the same receptive field everywhere, while the suitable size changes across the image.

The front end is the first ten layers of a pretrained VGG-16. Its features are average-pooled into blocks at four scales, with block sizes 1, 2, 3 and 6, passed through a 1×1 convolution and upsampled by bilinear interpolation to give scale-aware features. The difference between each scale-aware feature and the VGG features, which the paper calls contrast features, feeds a 1×1 convolution and a sigmoid that output one weight map per scale. The weighted features are concatenated with the VGG features and passed to a decoder of dilated convolutions that produces the density map.

The design trains end to end, where earlier methods trained an extra classifier to assign a receptive field to each image patch. The paper also describes an extended network with a second branch that takes a perspective map as input when camera calibration is available. It reports results on ShanghaiTech, WorldExpo'10, UCF CC 50 and UCF QNRF, and on Venice, a dataset the authors built that features strong perspective distortion.

Key idea. The paper built an end-to-end trainable crowd counter that extracts features over multiple receptive field sizes and learns the importance of each at every image location.

  • CAN
  • Context-Aware Network
  • Context-Aware Crowd Counting
  • crowd counting
  • crowd density estimation
  • density map
  • perspective distortion
  • scale-aware features

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{liu2019contextawarecrowdcounting,
      title={Context-Aware Crowd Counting}, 
      author={Weizhe Liu and Mathieu Salzmann and Pascal Fua},
      year={2019},
      eprint={1811.10452},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1811.10452}, 
}