Papers › TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation

TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation

8 Feb 2021arXiv:2102.04306archive 2025-07-28

Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, Le Lu, Alan L. Yuille, Yuyin Zhou

Medical image segmentation is an essential prerequisite for developing healthcare systems, especially for disease diagnosis and treatment planning. On various medical image segmentation tasks, the u-shaped architecture, also known as U-Net, has become the de-facto standard and achieved tremendous success. However, due to the intrinsic locality of convolution operations, U-Net generally demonstrates limitations in explicitly modeling long-range dependency. Transformers, designed for sequence-to-sequence prediction, have emerged as alternative architectures with innate global self-attention mechanisms, but can result in limited localization abilities due to insufficient low-level details. In this paper, we propose TransUNet, which merits both Transformers and U-Net, as a strong alternative for medical image segmentation. On one hand, the Transformer encodes tokenized image patches from a convolution neural network (CNN) feature map as the input sequence for extracting global contexts. On the other hand, the decoder upsamples the encoded features which are then combined with the high-resolution CNN feature maps to enable precise localization. We argue that Transformers can serve as strong encoders for medical image segmentation tasks, with the combination of U-Net to enhance finer details by recovering localized spatial information. TransUNet achieves superior performances to various competing methods on different medical applications including multi-organ segmentation and cardiac segmentation. Code and models are available at https://github.com/Beckschen/TransUNet.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

The archive's official repository (Beckschen/TransUNet) was not harvested; the 6 samples below come from 2 community repositories, and 1 more is identical to code Syntology harvested from another paper's repository.

Syntology 7 code samples: 6 from 2 repositories linked to this paper, 1 identical to code harvested from another paper's repository. Across all 7: 6 ran (of which 0 constructed an object rather than computing a result; 2 with no instrument failure: 2 honoured, 0 violated, 0 with no contract checked; 4 where Syntology's instrument failed) · 1 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 6 samples from 2 repositories, 5 ran (2 with no instrument failure; 3 where Syntology's instrument failed); 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 6 of its repositories that Syntology harvested for other papers:

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 6 samples that ran has no recorded date.

22 repositories listed; official and paper-mentioned ones first.

Beckschen/TransUNet officialmentioned in papermentioned on GitHubpytorchSyntology: not harvested report
04RR/SOTA-Vision mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (arXiv:2010.11929; that paper's own run record: 307 ran (of which 165 constructed an object rather than computing a result; 286 with no instrument failure: 8 honoured, 2 violated, 276 with no contract checked; 21 where Syntology's instrument failed) · 112 unverified) and MLP-Mixer: An all-MLP Architecture for Vision (arXiv:2105.01601; that paper's own run record: 114 ran (of which 77 constructed an object rather than computing a result; 104 with no instrument failure: 2 honoured, 1 violated, 101 with no contract checked; 10 where Syntology's instrument failed) · 20 unverified); nothing checks that they implement this paper's method. report
KenzaB27/TransUnet mentioned on GitHubtfSyntology: not harvested report
MargeryLab/TransUNet mentioned on GitHubpytorchSyntology: not harvested report
aris-mukherjee/TransUNet-modified mentioned on GitHubpytorchSyntology: not harvested report
awsaf49/TransUnet-tf mentioned on GitHubtfSyntology: not harvested report
ayoub-sudo/Attention-Unet-web-app mentioned on GitHubSyntology: not harvested report
gail-yxie/adawac mentioned on GitHubpytorchSyntology: not harvested report
hendraet/synthesis-in-style mentioned on GitHubpytorchSyntology: not harvested report
hongkunsun/paratranscnn mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Deep Residual Learning for Image Recognition (arXiv:1512.03385; that paper's own run record: 254 ran (of which 108 constructed an object rather than computing a result; 163 with no instrument failure: 3 honoured, 1 violated, 159 with no contract checked; 91 where Syntology's instrument failed) · 123 unverified); nothing checks that they implement this paper's method. report
jack139/ETH_predictor_keras_unet mentioned on GitHubSyntology: not harvested report
ljollans/trunet mentioned on GitHubpytorchSyntology: 3 samples, 3 ran (1 instrument-failed) · 0 unverified report
maloadba/mgenseg_2d mentioned on GitHubjaxSyntology: 3 samples, 2 ran (2 instrument-failed) · 1 unverified report
mirthai/csa-net mentioned on GitHubpytorchSyntology: not harvested report
mkara44/transunet_pytorch mentioned on GitHubpytorchSyntology: not harvested report
simonustc/mcpa-for-2d-medical-image-segmentation mentioned on GitHubpytorchSyntology: not harvested report
yingkaisha/keras-unet-collection mentioned on GitHubtfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Recurrent Residual Convolutional Neural Network based on U-Net (R2U-Net) for Medical... (arXiv:1802.06955; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 5 where Syntology's instrument failed) · 3 unverified), Attention U-Net: Learning Where to Look for the Pancreas (arXiv:1804.03999; that paper's own run record: 23 ran (of which 0 constructed an object rather than computing a result; 15 with no instrument failure: 0 honoured, 0 violated, 15 with no contract checked; 8 where Syntology's instrument failed) · 5 unverified), ResUNet-a: a deep learning framework for semantic segmentation of remotely sensed data (arXiv:1904.00592; that paper's own run record: 7 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 1 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 6 unverified) and 2 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report
yykzjh/pmfsnet mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to 3D UX-Net: A Large Kernel Volumetric ConvNet Modernizing Hierarchical Transformer for... (arXiv:2209.15076; that paper's own run record: 5 ran (of which 3 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
Basars/trans-unet tfSyntology: not harvested report
PaddlePaddle/PaddleSeg paddleSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to EdgeFlow: Achieving Practical Interactive Segmentation with Edge-Guided Flow (arXiv:2109.09406; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
The-AI-Summer/self-attention-cv pytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Self-Attention with Relative Position Representations (arXiv:1803.02155; that paper's own run record: 13 ran (of which 4 constructed an object rather than computing a result; 8 with no instrument failure: 2 honoured, 0 violated, 6 with no contract checked; 5 where Syntology's instrument failed) · 10 unverified) and Is Space-Time Attention All You Need for Video Understanding? (arXiv:2102.05095; that paper's own run record: 35 ran (of which 17 constructed an object rather than computing a result; 21 with no instrument failure: 0 honoured, 1 violated, 20 with no contract checked; 14 where Syntology's instrument failed) · 8 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

7 samples harvested: 6 ran (of which 0 constructed an object rather than computing a result; 2 with no instrument failure: 2 honoured, 0 violated, 0 with no contract checked; 4 where Syntology's instrument failed) · 1 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · honoured contract
3ran · our draft was wrong
1ran; the contract check could not run
1unverified

Licence: 7 of the 7 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. 1 sample is listed last, in a group without a repository. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

ljollans/trunet community (archive-listed) 3 samples, 3 ran (1 instrument-failed) · 0 unverified
dice_score in 10 papers TRUNet_network/trunet_train.py ran · honoured contract fingerprinted GPL-3.0 (copyleft) · pointer only · 991bd6a9b4b39241 · report fixture: signature pred:ndarray/4/float, gt:ndarray/4/int · returned float · level recorded 2026-09-22
one_hot_encoder in 7 papers TRUNet_network/trunet_train.py ran · our draft was wrong fingerprinted GPL-3.0 (copyleft) · pointer only · 7e0f38dc41fa04e1 · report fixture: signature input_tensor:Tensor/3/int, n_classes:int/0/int · returned Tensor · level recorded 2026-09-22
to_one_arr_encoding TRUNet_network/trunet_train.py ran · honoured contract fingerprinted GPL-3.0 (copyleft) · pointer only · 492de094e1db0458 · report fixture: signature input_tensor:Tensor/2/float · returned Tensor · level recorded 2026-09-22
maloadba/mgenseg_2d community (archive-listed) 3 samples, 2 ran (2 instrument-failed) · 1 unverified
conv1x1 in 691 papers model/configs/mbrats/Transunet.py ran · our draft was wrong no licence file found · pointer only · b0f916df39e78ae5 · report fixture: signature cin:int/0/int, cout:int/0/int, stride:int/0/int, bias:bool/0/bool · returned StdConv2d · level recorded 2026-09-22
conv3x3 in 1,376 papers model/configs/mbrats/Transunet.py ran · our draft was wrong no licence file found · pointer only · 4e5bf13dbdc4f008 · report fixture: signature cin:int/0/int, cout:int/0/int, stride:int/0/int, groups:int/0/int, bias:bool/0/bool · returned StdConv2d · level recorded 2026-09-22
run in 143 papers mbrats_segmentation_transunet.py unverified no licence file found · pointer only · 879df9465f2b5e0f · report
Repository not located 1 sample, 1 ran (1 instrument-failed) · 0 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
np2th in 31 papers
census: 2 implementations from 9 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32
repository not located ran; the contract check could not run (RAISES) · metamorphic tier: invariant licence of this copy not recorded · 7d8eaf5537f699e4 · report fixture: signature weights:ndarray/4/float, conv:bool/0/bool · returned Tensor · level recorded, date not recorded

Tasks

Cardiac SegmentationDecoderImage SegmentationMedical Image SegmentationOrgan SegmentationSegmentationSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Medical Image Segmentation ACDC TransUNet Dice Score 0.8971 #6 of 6 Archive leaderboard report
Medical Image Segmentation Automatic Cardiac Diagnosis Challenge (ACDC) TransUNet Avg DSC 89.71 #17 of 20 Archive leaderboard report
Medical Image Segmentation Automatic Cardiac Diagnosis Challenge (ACDC) R50-ViT-CUP Avg DSC 87.57 #19 of 20 Archive leaderboard report
Medical Image Segmentation Automatic Cardiac Diagnosis Challenge (ACDC) R50-AttnUNet Avg DSC 86.75 #20 of 20 Archive leaderboard report
Medical Image Segmentation Synapse multi-organ CT TransUNet Avg DSC 77.48 #23 of 23 Archive leaderboard report
Medical Image Segmentation Synapse multi-organ CT TransUNet Avg HD 31.69 #23 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 EncodingsAdamAttentionBPEConcatenated Skip ConnectionConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMax PoolingMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResidual ConnectionSoftmaxTransformerU-Net

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