Papers › Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation

Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation

12 May 2021arXiv:2105.05537archive 2025-07-28

Hu Cao, Yueyue Wang, Joy Chen, Dongsheng Jiang, Xiaopeng Zhang, Qi Tian, Manning Wang

In the past few years, convolutional neural networks (CNNs) have achieved milestones in medical image analysis. Especially, the deep neural networks based on U-shaped architecture and skip-connections have been widely applied in a variety of medical image tasks. However, although CNN has achieved excellent performance, it cannot learn global and long-range semantic information interaction well due to the locality of the convolution operation. In this paper, we propose Swin-Unet, which is an Unet-like pure Transformer for medical image segmentation. The tokenized image patches are fed into the Transformer-based U-shaped Encoder-Decoder architecture with skip-connections for local-global semantic feature learning. Specifically, we use hierarchical Swin Transformer with shifted windows as the encoder to extract context features. And a symmetric Swin Transformer-based decoder with patch expanding layer is designed to perform the up-sampling operation to restore the spatial resolution of the feature maps. Under the direct down-sampling and up-sampling of the inputs and outputs by 4x, experiments on multi-organ and cardiac segmentation tasks demonstrate that the pure Transformer-based U-shaped Encoder-Decoder network outperforms those methods with full-convolution or the combination of transformer and convolution. The codes and trained models will be publicly available at https://github.com/HuCaoFighting/Swin-Unet.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2105.05537")

Code

Syntology Ran 3 of 18 code samples harvested from 2 repositories linked to this paper; 15 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 2 ran · fixture could not drive it.

By repository: community (archive-listed): 18 samples from 2 repositories, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

HuCaoFighting/Swin-Unet officialmentioned in papermentioned on GitHubpytorch report
Arnukk/CASPIAN mentioned on GitHubtfMIT report
WonJunPark/swinUNet_custom_training mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

18 samples harvested; 3 ran; 0 honoured the contract we drafted; 15 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
2ran · fixture could not drive it
15unverified

Licence: 0 of the 18 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

drop_path_ Arnukk/CASPIAN/models/keras_vision_transformer/util_layers.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 4bbaba82e75c9aff · report
window_partition Arnukk/CASPIAN/models/keras_vision_transformer/swin_layers.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · dd1296fb557f6f49 · report
window_reverse Arnukk/CASPIAN/models/keras_vision_transformer/swin_layers.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 24a9365e0448ac64 · report
bce_loss_fn L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py community (archive-listed) unverified MIT (permissive) · dda41d1bd5f7d32e · report
clear_ds Arnukk/CASPIAN/utils.py community (archive-listed) unverified MIT (permissive) · f4820de6705b381d · report
compute_binary_metrics L-A-Sandhu/Swin-Unet-/src/swin_transformer/metrics.py community (archive-listed) unverified MIT (permissive) · d5165a7134b3051a · report
compute_multiclass_metrics L-A-Sandhu/Swin-Unet-/src/swin_transformer/metrics.py community (archive-listed) unverified MIT (permissive) · 14ef6380261ac759 · report
dice_loss_fn L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py community (archive-listed) unverified MIT (permissive) · 9c8302514c4e7b35 · report
dummy_loader Arnukk/CASPIAN/models/keras_vision_transformer/utils.py community (archive-listed) unverified MIT (permissive) · f4c0270069e690f7 · report
dummy_loader L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py community (archive-listed) unverified MIT (permissive) · db4d0a3eecb8e0db · report
find_scenario Arnukk/CASPIAN/utils.py community (archive-listed) unverified MIT (permissive) · 4a0971f8b14ed3d9 · report
focal_loss L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py community (archive-listed) unverified MIT (permissive) · dc39ed696312e230 · report
image_to_array Arnukk/CASPIAN/models/keras_vision_transformer/utils.py community (archive-listed) unverified MIT (permissive) · 49481c5cc405f648 · report
image_to_array L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py community (archive-listed) unverified MIT (permissive) · 8e18cbe83a5ae888 · report
rmv_aug Arnukk/CASPIAN/utils.py community (archive-listed) unverified MIT (permissive) · 17e354bf251f8085 · report
shuffle_ind Arnukk/CASPIAN/models/keras_vision_transformer/utils.py community (archive-listed) unverified MIT (permissive) · 8802de1b1b8688a8 · report
shuffle_ind L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py community (archive-listed) unverified MIT (permissive) · 000032b4e43a1534 · report
split_dataset L-A-Sandhu/Swin-Unet-/src/swin_transformer/split_data.py community (archive-listed) unverified MIT (permissive) · 17f6210c3a9f9f5b · report

Tasks

Cardiac SegmentationDecoderImage SegmentationMedical Image AnalysisMedical Image SegmentationSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Medical Image Segmentation ACDC Swin UNet Dice Score 0.9 #5 of 6 Archive leaderboard report
Medical Image Segmentation Automatic Cardiac Diagnosis Challenge (ACDC) SwinUnet Avg DSC 90.00 #16 of 20 Archive leaderboard report
Medical Image Segmentation Synapse multi-organ CT SwinUnet Avg DSC 79.13 #21 of 23 Archive leaderboard report
Medical Image Segmentation Synapse multi-organ CT SwinUnet Avg HD 21.55 #21 of 23 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections