UNETR_2D
UNETR in 2D: a ViT encoder feeding a U-Net style convolutional decoder for medical image segmentation.
Medical imaging · 387 operations Checked
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
- Medical imaging
- Parameters
- 119M
- Operations
- 387
- Framework
- PyTorch
- Recurrent
- No
- Published
- WACV 2022
- Cited by
- 3,548 (as of 19 October 2026)
- Authors
- Ali Hatamizadeh, Yucheng Tang, Vishwesh Nath and others
- Source
- monai 1.5.2
- 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 file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3223
- Graph hash
- 6d6e67d1987f8e0ce9bfd7fc01b43f6e3a6344116aa919362a0ad6e66aa179b2
- Skeleton hash
- ab9475aebef896892beeea2f8475d528319071bc34777af48e70b22b0719813e
- Architecture hash
- ace9c95feb7bbc704d6b1883d6e9c4073e8fd7a98405f99e314f94c688f9a456
- Diagram SHA-256
- e069b12890640d39265d4fd3665edb0110ad081c258d7c2d4c6e65e714e33928
- 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.UNETR(in_channels=1, out_channels=4, img_size=96, feature_size=32, hidden_size=768, mlp_dim=3072, num_heads=12, norm_name='batch', spatial_dims=2)
What it is
UNETR, short for UNEt TRansformers, is a segmentation network that uses a transformer as the encoder to learn sequence representations of the input. The paper reformulates volumetric medical image segmentation as a sequence-to-sequence prediction problem. The input is cut into uniform patches that a linear layer projects into an embedding space, which stays the same size through all transformer layers. The transformer encoder connects directly to a decoder through skip connections at several resolutions, which produce the final segmentation. The decoder is convolutional rather than transformer-based.
The paper's encoder follows the ViT-B16 architecture with 12 layers and an embedding size of 768, with a 16x16x16 patch. The authors did not use pre-trained ViT weights, having found no performance improvement from them. The loss combines soft Dice and cross-entropy. On the BTCV multi-organ CT benchmark the paper reports an overall average Dice score of 0.899 in the Free Competition. On the MSD brain tumor and spleen tasks the paper reports UNETR outperforming the methods it compared against.
The network on this page is the 2D form: MONAI's UNETR takes a spatial_dims argument that defaults to 3, and setting it to 2 builds the same design over 2D images. The patch size is fixed at 16 along each spatial axis. This build uses a single input channel, four output channels, 96x96 images, a feature size of 32 and batch normalization.
Key idea. UNETR uses a transformer encoder on embedded image patches and a skip-connected CNN decoder to segment medical images as a sequence-to-sequence problem.
- unetr
- unet transformers
- unetr 2d
- medical image segmentation
- transformer segmentation
- monai
- vit encoder
- u-net
- btcv
- organ segmentation
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{hatamizadeh2021unetrtransformers3dmedical,
title={UNETR: Transformers for 3D Medical Image Segmentation},
author={Ali Hatamizadeh and Yucheng Tang and Vishwesh Nath and Dong Yang and Andriy Myronenko and Bennett Landman and Holger Roth and Daguang Xu},
year={2021},
eprint={2103.10504},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2103.10504},
}