All models

monai.ViTAutoEnc

A Vision Transformer with a transposed-convolution tail that reconstructs 3D volumes at input size.

Medical imaging · 298 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 (24 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
117.5M
Operations
298
Framework
PyTorch
Recurrent
No
Published
ICLR 2021
Cited by
21,319 (as of 19 October 2026)
Authors
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov 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
m7478
Graph hash
db14ea09776edc4c239a14fb7f2ae6a490a504de508186caf070ad24f52c017d
Skeleton hash
f4b0052111a63aa866d688168402481678fad2941efca1756ad32e31f390350f
Architecture hash
17ca1d38301e705f8a07b0d2deb6ea6ce9400fbcaebc88f6583d9d1ab730a19d
Diagram SHA-256
4350fc19bc42f4b3ca36729390158b3519bbf0f1b0411e4bae570b53b349ca92
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

How this diagram was made

monai.networks.nets.vitautoenc.ViTAutoEnc(in_channels=1, img_size=[96, 96, 96], patch_size=[16, 16, 16], proj_type='conv')

What it is

ViTAutoEnc is a Vision Transformer modified to also give outputs with the same dimensions as the input image. Its transformer follows the Vision Transformer of An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. That paper showed that reliance on convolutional networks is not necessary, and that a pure transformer applied directly to sequences of image patches performs very well on image classification.

In the Vision Transformer an image is split into fixed-size patches, each is linearly embedded, position embeddings are added, and the sequence is fed to a standard Transformer encoder. The paper notes that only the MLP layers are local and translationally equivariant, while the self-attention layers are global. It reports its best model reaching 88.55% accuracy on ImageNet, 90.72% on ImageNet-ReaL, 94.55% on CIFAR-100 and 77.63% on the 19-task VTAB suite.

ViTAutoEnc has no classification head: after the transformer blocks, two transposed convolution layers upsample the token grid back to an image. Each transposed convolution uses a kernel and stride equal to the square root of the patch size. By default it stacks 12 transformer blocks. The forward pass returns the reconstructed image together with the hidden states of every transformer block.

Key idea. ViTAutoEnc modifies the Vision Transformer to also give outputs with the same dimensions as the input image, making it usable as an autoencoder.

  • vitautoenc
  • vit autoencoder
  • vision transformer autoencoder
  • monai
  • self-supervised pretraining
  • 3d medical imaging
  • reconstruction
  • vit

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

Cite the paper

@misc{dosovitskiy2021imageworth16x16words,
      title={An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale}, 
      author={Alexey Dosovitskiy and Lucas Beyer and Alexander Kolesnikov and Dirk Weissenborn and Xiaohua Zhai and Thomas Unterthiner and Mostafa Dehghani and Matthias Minderer and Georg Heigold and Sylvain Gelly and Jakob Uszkoreit and Neil Houlsby},
      year={2021},
      eprint={2010.11929},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2010.11929}, 
}