Skip to content
AI360Xpert
Beta

Crowd Counting

Crowd counting estimates how many people fill a scene by predicting a density map and adding it up, which survives overlap that breaks box counting.

A density map that sums to 124 against 118 true heads beats box counting that finds only 71 visible boxes in the same crowd
A density map that sums to 124 against 118 true heads beats box counting that finds only 71 visible boxes in the same crowd

Why Does This Exist?

Boxes fail in crowds: heads overlap, bodies hide, and non maximum suppression deletes neighbors. Event staff, transit hubs, and safety teams still need totals and hot spots. Guessing from one doorway view risks crushes.

Crowd counting exists for dense scenes. Input is an image or frame. Output is a count plus a density map that shows where. Detection skills are object detection; across frames the tracker is multi-object tracking. The video frame is video understanding.

Use it when overlap is heavy and positions can be soft. Use boxes when people are few, separated, and identities matter.

Think of It Like This

Weighing a jar of coins instead of stacking them

You cannot stack glued coins to count them, so you weigh the jar and divide by one coin weight. The scale reading is the total, and shaking the jar shows where weight clusters.

Density is the weight per pixel. The map sum is the scale reading. The analogy stops at identity: weight never tells which coin is which, and density never re identifies a person.

How It Actually Works

Annotate one point per head, blur points into a ground truth density whose sum equals the headcount. Train a fully convolutional net to predict that density with multiscale features for near and far heads. Contract is image in, density plus sum out. Count C=∑pD(p)C = \sum_{p} D(p). A plaza frame with 118118 true heads predicts density summing to 124124, an error of 66. Box counting on the same frame finds 7171 clean boxes and misses the rest to overlap.

Worked example

A platform image holds 118118 heads. The model outputs a 64×6464 \times 64 density map. Corner cells hold 0.10.1 each, center packs 0.80.8 per cell. Summing all 40964096 cells gives 124124. Absolute error =∣124−118∣=6= |124 - 118| = 6. Mean over 1010 such scenes is 7.27.2, which the operator reads as plus or minus a bench row, good enough for gate staffing.

Watch Out For

Scale collapse from door to horizon

Near heads span 4040 pixels, far heads span 66. One fixed blur target teaches the wrong size at one end. The symptom is undercount far plus overcount near. Fix it with perspective aware sigmas or multiscale heads, and validate per depth band.

Background texture counted as heads

Scaffolds and tree blobs mimic head texture at low resolution. The symptom is 2020 phantom counts on empty plazas. Fix it with negative scenes in training and by masking non walkable zones before summing.

The Quick Version

  • Crowd counting predicts density whose sum is the headcount C=∑D(p)C = \sum D(p).
  • Point annotations plus blur make training targets that tolerate overlap.
  • The fixture sums to 124124 against 118118 true while boxes find 7171.
  • Multiscale features span near 4040 pixel heads and far 66 pixel ones.
  • Mask dead zones or texture becomes phantom people.