All models

Swin_Unet_Tiny

A U-shaped segmentation network for medical images built entirely from Swin Transformer blocks.

Medical imaging · 645 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
3M
Operations
645
Framework
PyTorch
Recurrent
No
Published
Lecture Notes in Computer Science (arXiv 2021)
Cited by
4,083 (as of 9 October 2026)
Authors
Hu Cao, Yueyue Wang, Joy Chen 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
m2968
Graph hash
8ca7508c0a31528573401998bc43f9ec0825267c07c60464972c0f84c4c73f0c
Skeleton hash
abe88e4073398f7e8942015e9366f6bea973f3652558c4d8364666b35bbe0ff3
Architecture hash
4a8d39be932fc0887cbeb72b682956a41dcb977eab8217fb69320d8631c40d63
Diagram SHA-256
8098d2e3461eca06412f32143b58eec80703d32ec84b51099a7aba260a7ea7f5
TorchLens version
2.35.3
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

menagerie.classics.swin_unet:build_swin_unet_tiny: build({})

What it is

Swin-Unet is a Unet-like pure Transformer for medical image segmentation. The paper's starting point is that convolutional networks cannot learn global and long-range semantic information interaction well, because convolution is a local operation. Swin-Unet keeps the U-shaped layout but builds its encoder, bottleneck and decoder from Swin Transformer blocks.

The input image is split into non-overlapping patches with a patch size of 4 by 4. In the encoder, Swin Transformer blocks learn feature representations while patch merging layers downsample and increase the feature dimension. The bottleneck is two successive Swin Transformer blocks that keep the feature dimension and resolution unchanged. The decoder is symmetric to the encoder and uses a patch expanding layer, developed to up-sample without convolution or interpolation. Skip connections concatenate shallow features with deep features to reduce the loss of spatial information caused by down-sampling. A last patch expanding layer performs 4x up-sampling back to the input resolution, and a linear projection layer outputs the pixel-level segmentation predictions.

On the Synapse multi-organ CT dataset the paper reports a segmentation accuracy of 79.13% (DSC). On the ACDC dataset, with MR images as input, the paper reports an accuracy of 90.00%.

Key idea. Swin-Unet builds a U-shaped encoder-decoder with skip connections entirely from Swin Transformer blocks, using a patch expanding layer to up-sample without convolution or interpolation.

  • Swin-Unet
  • medical image segmentation
  • pure Transformer
  • U-shaped encoder-decoder
  • skip connections
  • patch expanding layer
  • patch merging
  • shifted windows
  • multi-organ segmentation
  • cardiac segmentation

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

Cite the paper

@misc{cao2021swinunetunetlikepuretransformer,
      title={Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation}, 
      author={Hu Cao and Yueyue Wang and Joy Chen and Dongsheng Jiang and Xiaopeng Zhang and Qi Tian and Manning Wang},
      year={2021},
      eprint={2105.05537},
      archivePrefix={arXiv},
      primaryClass={eess.IV},
      url={https://arxiv.org/abs/2105.05537}, 
}