Skip to content
AI360Xpert
Beta

Swin UNETR for 3D Medical Volumes

Swin UNETR slides shifted 3D windows through volumes so long-range context stays affordable for whole-brain masks.

Swin UNETR shifts 3D windows to mix global context into volume masks
Swin UNETR shifts 3D windows to mix global context into volume masks

Why Does This Exist?

3D volumes explode attention: 96396^3 voxels cannot all attend. TransUNet handles slices; brains need 3D. Swin UNETR (2022) partitions volumes into 737^3 windows, shifts them per layer for cross-talk, and decodes with U-Net skips. Pretraining on unlabeled CT and MRI warms the encoder.

Think of It Like This

Apartment census with shifting block teams

Census teams each cover one block, then shift half a block next round to compare notes across borders. After rounds, every apartment's count reflects neighbors without one giant meeting.

Windows are blocks and shifts are reassignments. The analogy stops at pretraining: teams also practice on empty buildings first.

How It Actually Works

Patch 96396^3 embeds to tokens, then four stages halve resolution while doubling channels 4848 to 384384. Shifted windows alternate 737^3 grids offset by 33. Decoder upsamples with skips to full mask. Loss is Dice plus cross-entropy over whole, core, enhancing zones.

Worked example

A brain volume 2403240^3 tiles into 1515 patches of 96396^3 with overlap. A 22 cm enhancing core spans 2020 voxels; window attention links it to edema 4040 voxels away, lifting enhancing Dice 0.780.78 to 0.840.84 over CNN-only. Pretraining on 5,0005{,}000 unlabeled volumes adds 0.030.03 more on small sets.

Watch Out For

Patch seams splitting tumors

Tiling without overlap cuts a core across patches and halves its score. The symptom is straight-line mask cuts. Overlap 5050 percent plus Gaussian blending before thresholding.

The Quick Version

  • Swin UNETR brings shifted windows to 3D medical volumes.
  • Four stages balance local detail against whole-brain context.
  • Skips restore voxel edges after window mixing.
  • Do not tile without overlap; seams cut tumors in half.
  • Unlabeled pretraining helps most on small labeled sets.