All models

LV-ViT (Label Variety ViT)

LV-ViT-S, a vision transformer for image classification trained with dense token labeling.

Image classification · 489 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 (22 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
26.2M
Operations
489
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2021
Cited by
158 (as of 28 October 2026)
Authors
Zihang Jiang, Qibin Hou, Li Yuan and others
License
Apache-2.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
m17833
Graph hash
26344f84c7f5a1bd9cb69dbebf1b680010e99483981bf82e7c53c2cd961439fb
Skeleton hash
d6c114deb720c163e11b31c2fb8f7bae3f14f705ae5c3386961b04127c580d91
Architecture hash
65328c42b617843e90e24536f9527ed8ef3fe9480e64ff73d33309748adda4ce
Diagram SHA-256
d9510e8640e000781ba59e4651c482133e16822ac6bac020c671e948d4a4584e
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

LV-ViT is a vision transformer for image classification trained with token labeling, a training objective that computes the loss on all the image patch tokens instead of only on the class token. Token labeling turns image classification into many token-level recognition problems, giving each patch token its own location-specific label produced by a machine annotator.

The annotator in the paper is an NFNet-F6 trained on ImageNet, and its dense score maps can be generated in advance. The architecture makes a slight modification to ViT: the patch embedding module is replaced with a 4-layer convolution. Training also uses MixToken, a modified version of CutMix that operates on the tokens after patch embedding.

This model is LV-ViT-S, which the repository's table lists at 224 resolution with 16 layers, an embedding dimension of 384, 26.15M parameters and a top-1 score of 83.3. The paper reports 84.4% top-1 accuracy on ImageNet for a vision transformer with 26M parameters trained with token labeling, rising to 86.4% when the model is scaled up to 150M. It also reports that token labeling improves how the pre-trained models generalize to dense prediction tasks such as semantic segmentation.

Key idea. The paper introduces token labeling, a training objective that supervises every image patch token of a vision transformer with location-specific labels generated by a machine annotator.

  • lv-vit
  • lvvit
  • lv-vit-s
  • token labeling
  • all tokens matter
  • vision transformer
  • image classification
  • mixtoken
  • imagenet

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

Cite the paper

@misc{jiang2021tokensmattertokenlabeling,
      title={All Tokens Matter: Token Labeling for Training Better Vision Transformers}, 
      author={Zihang Jiang and Qibin Hou and Li Yuan and Daquan Zhou and Yujun Shi and Xiaojie Jin and Anran Wang and Jiashi Feng},
      year={2021},
      eprint={2104.10858},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2104.10858}, 
}