All models

Video-FocalNet

A video action recognition network that replaces self-attention with spatial and temporal focal modulation.

Video · 1,759 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 (21 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

Task
Video
Parameters
157.4M
Operations
1,759
Framework
PyTorch
Recurrent
No
Published
ICCV 2023
Cited by
46 (as of 29 October 2026)
Authors
Syed Talal Wasim, Muhammad Uzair Khattak, Muzammal Naseer and others
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
m21368
Graph hash
77516c89c3dc287f5f53f76785994e834dd6351a2f5ead65efa71f5809b4e160
Skeleton hash
9d5de2e681f1789fdb8a031d8c9fa66349ceed272e0bfa5f4e72ba455aa3083d
Architecture hash
e35af065600d1ef4ce4912a4e15d9c4ec24e03c8da5630eab446cfa77d2e2f41
Diagram SHA-256
63d280c1f4339a1bd152446a2828b1837c68e03c9bd0b35d14a6f71eabbed74a
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

Video-FocalNet is an architecture for video recognition that models both local and global contexts. Its blocks are similar to transformer blocks, with self-attention replaced by spatio-temporal focal modulation. Focal modulation runs the two steps of self-attention in the opposite order: the surrounding context is aggregated first, and the result then interacts with the queries. Both steps are implemented with convolution and element-wise multiplication, which the paper describes as computationally less expensive than their self-attention counterparts.

To handle video, the block has two streams: one branch learns spatial information and the other models temporal information. The aggregation uses a stack of depthwise convolutions in the spatial branch and pointwise convolutions in the temporal branch, followed by a gated aggregation. The resulting spatial and temporal modulators then interact with the query tokens through element-wise multiplication. The authors compared this parallel design with sequential alternatives and report that it offers the best performance.

The network has four stages, each comprising a patch embedding and a number of Video-FocalNet blocks. The paper defines the base model, Video-FocalNet-B, with C = 128 and block numbers {2, 2, 18, 2}. It reports surpassing comparable methods by 0.6% on Kinetics-400, 1.2% on Kinetics-600 and 0.6% on Something-Something-v2.

Key idea. The paper extends focal modulation to video with a block that aggregates spatial and temporal context in parallel branches and fuses both with the queries by element-wise multiplication.

  • video-focalnet
  • video-focalnets
  • video focalnet
  • spatio-temporal focal modulation
  • focal modulation
  • video action recognition
  • video recognition
  • video classification
  • kinetics-400

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

Cite the paper

@misc{wasim2023videofocalnetsspatiotemporalfocalmodulation,
      title={Video-FocalNets: Spatio-Temporal Focal Modulation for Video Action Recognition}, 
      author={Syed Talal Wasim and Muhammad Uzair Khattak and Muzammal Naseer and Salman Khan and Mubarak Shah and Fahad Shahbaz Khan},
      year={2023},
      eprint={2307.06947},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2307.06947}, 
}