MaxViT-UNet
A U-shaped medical image segmenter whose encoder and decoder both pair convolution with multi-axis attention.
Medical imaging · 1,493 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
- 27.3M
- Operations
- 1,493
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2023
- Cited by
- 37 (as of 17 November 2026)
- Authors
- Abdul Rehman Khan, Asifullah Khan
- Source
- GitHub: PRLAB21/MaxViT-UNet
- 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
- m18358
- Graph hash
- 6c067e91c2554c1e3aaaa2ddfeeff202dd926e793a8a741bf849365783311888
- Skeleton hash
- b696ae428a3f3c82522d52ce4f8e70bc929405082731d704b668b488467a86d7
- Architecture hash
- a60a87ad70bd2e26d6530a5fe0993fa96d4bc6f85c6e51a6ad50d88eb86f6283
- Diagram SHA-256
- b879a0631f4767251014041aa126c0c2eb7f17d12f0a1994a957d74345e92cc3
- 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
MaxViT-UNet is a U-shaped encoder-decoder network for medical image segmentation that combines convolution and self-attention in a single design. The paper's starting point is that earlier hybrid models used convolution alongside attention only in the encoder, and either kept the quadratic cost of self-attention or decoded with convolutions alone. Here both halves are hybrid, and the attention used scales linearly with image size.
The same MaxViT block appears throughout: an MBConv convolution sub-block, then block (local window) attention and grid (sparse global) attention stacked one after the other. The encoder has four stages that double the channels (64, 128, 256, 512) while halving the spatial size. The decoder has three stages, connected to the top three stages of the encoder. Each decoder stage starts with a transposed convolution for upsampling and then stacks MaxViT blocks. Window and grid sizes are fixed to 8 to suit 256 × 256 images, and every attention block uses 32 heads.
The paper evaluates the model on nuclei segmentation with the MoNuSeg18 and MoNuSAC20 datasets. On MoNuSeg18 it reports 0.8378 Dice and 0.7208 IoU for MaxViT-UNet. The two baselines trained for comparison, a CNN-based UNet and the Transformer-based Swin-Unet, scored 0.8185 and 0.7956 Dice there. The paper reports 24.72 million parameters for MaxViT-UNet, compared with 29.06 million for UNet and 27.29 million for Swin-UNet.
Key idea. MaxViT-UNet builds a U-shaped segmentation network whose decoder, like its encoder, uses hybrid MaxViT blocks, so convolution and multi-axis attention operate at every decoding stage.
- MaxViT-UNet
- multi-axis attention
- Max-SA
- medical image segmentation
- nuclei segmentation
- hybrid vision transformer
- hybrid decoder
- MoNuSeg18
- MoNuSAC20
- histopathology
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{khan2024maxvitunetmultiaxisattentionmedical,
title={MaxViT-UNet: Multi-Axis Attention for Medical Image Segmentation},
author={Abdul Rehman Khan and Asifullah Khan},
year={2024},
eprint={2305.08396},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2305.08396},
}