All models

TS2-Net

CLIP ViT-B/32 text-video retrieval model with token shift and token selection in the video encoder, 12 frames.

Multimodal · 1,356 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 (116 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
166.8M
Operations
1,356
Framework
PyTorch
Recurrent
No
Published
ECCV 2022
Cited by
146 (as of 28 October 2026)
Authors
Yuqi Liu, Pengfei Xiong, Luhui Xu 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
m20847
Graph hash
3762037f14c93358e35320c6bf774c6dd672033a087f9dc32bfa30042015ce10
Skeleton hash
0439d5035db00258a646013c9092e674f127bb319665e9a6ffd9d500063468fb
Architecture hash
2ed35de27cc14ca46cb4a79a37b138b5358b991ed33a5634bdbfdfc2e4783279
Diagram SHA-256
53900a75a1da8bf0cd2ac98dda7bd61088af2cef7cb5779cef3f85043f79e40d
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

TS2-Net, the Token Shift and Selection Network, is a text-video retrieval model based on CLIP. Its authors argue that retrieval models usually take a pre-trained vision backbone with its structure fixed, which limits how fine-grained the spatial-temporal video representation can be.

The video encoder adds two modules to change that. The token shift module moves whole token features back and forth between adjacent frames, which keeps each token representation complete and models subtle movements. After ablations, the paper inserts it only in layers 11 and 12 of the ViT. The token selection module then keeps the tokens that contribute most to local spatial semantics. The released code always treats the [CLS] token as the most informative and selects it together with K-1 other tokens.

The text encoder, token shift transformer and token selection transformer have 12, 12 and 4 layers. The paper initializes these transformer layers with pre-trained weights from CLIP (ViT-B/32). Matching compares the query with each frame and combines the frame-level similarities with weights. For MSR-VTT the paper sets a maximum of 32 query tokens and 12 video frames. The repository lists recall at 1 of 47.0 on MSRVTT-1kA for the ViT-B/32 model without inverted softmax.

Key idea. TS2-Net adds a token shift module and a token selection module to the video transformer, adjusting the token sequence and selecting informative tokens temporally and spatially.

  • TS2-Net
  • TS2Net
  • Token Shift and Selection Network
  • token shift and selection transformer
  • text-video retrieval
  • video-text retrieval
  • token shift
  • token selection
  • CLIP video retrieval
  • MSR-VTT retrieval

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

Cite the paper

@misc{liu2022ts2nettokenshiftselection,
      title={TS2-Net: Token Shift and Selection Transformer for Text-Video Retrieval}, 
      author={Yuqi Liu and Pengfei Xiong and Luhui Xu and Shengming Cao and Qin Jin},
      year={2022},
      eprint={2207.07852},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2207.07852}, 
}