All models

Torchreid-HACNN

HA-CNN matches people across cameras with jointly learned soft and hard attention in a compact network.

Detection and tracking · 564 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 (569 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
3.7M
Operations
564
Framework
PyTorch
Recurrent
Yes
Published
CVPR 2018
Cited by
1,501 (as of 22 October 2026)
Authors
Wei Li, Xiatian Zhu, Shaogang Gong
License
MIT
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
m3126
Graph hash
40ff9ea8b39e5bcc69cda7dc9cbee1fe8f17b4c79b4d5309dc000f8825113fe7
Skeleton hash
7443231cf633a16ce071c1a772811983e24db815c228ad48a19d116a62aaa05c
Architecture hash
c5c1651cc486779a8cfd0ec5770fb57f7fb5914d4545cade65a0052a4702ff6c
Diagram SHA-256
4bd94757d90c1a99a27823bb4be266b83f00efd585286976188e5322af3996ec
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

HA-CNN, the Harmonious Attention CNN, is a model for person re-identification, the task of matching images of the same person across non-overlapping surveillance cameras. It matters because it is dedicated to uncontrolled, misaligned person images, learning where to look at the same time as it learns the matching features.

The network has a global branch built from Inception-A and Inception-B blocks and a set of local streams, each built from Inception-B blocks. Its harmonious attention combines hard regional attention with soft spatial and channel attention. Hard attention selects T = 4 regions, giving a total of 4 local streams. The final descriptor is a 1,024-D vector formed by concatenating the 512-D local and 512-D global features. Input person images are resized to 160×64.

The paper reports that HA-CNN has only 2.7 million parameters, trained with no data augmentation. On the Market-1501 benchmark the paper reports single-query Rank-1 at 91.2 and mAP at 75.7, as results at the time. These results come without model pre-training or any data augmentation such as scaling, rotation, flipping or color distortion.

Key idea. HA-CNN jointly learns soft pixel attention and hard regional attention together with the re-identification features in a single lightweight network.

  • person re-identification
  • harmonious attention
  • soft attention
  • hard regional attention
  • channel attention
  • inception blocks
  • feature embedding
  • surveillance

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

Cite the paper

@misc{li2018harmoniousattentionnetworkperson,
      title={Harmonious Attention Network for Person Re-Identification}, 
      author={Wei Li and Xiatian Zhu and Shaogang Gong},
      year={2018},
      eprint={1802.08122},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1802.08122}, 
}