{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/transunet-transformers-make-strong-encoders","title":"TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation","arxiv_id":"2102.04306","date":"2021-02-08","proceeding":null,"authors":["Jieneng Chen","Yongyi Lu","Qihang Yu","Xiangde Luo","Ehsan Adeli","Yan Wang","Le Lu","Alan L. Yuille","Yuyin Zhou"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2102.04306v1","url_pdf":"https://arxiv.org/pdf/2102.04306v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/Beckschen/TransUNet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/04RR/SOTA-Vision","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/KenzaB27/TransUnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/MargeryLab/TransUNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/aris-mukherjee/TransUNet-modified","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/awsaf49/TransUnet-tf","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/ayoub-sudo/Attention-Unet-web-app","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/gail-yxie/adawac","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/hendraet/synthesis-in-style","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/hongkunsun/paratranscnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/jack139/ETH_predictor_keras_unet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/ljollans/trunet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/maloadba/mgenseg_2d","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/mirthai/csa-net","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/mkara44/transunet_pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/simonustc/mcpa-for-2d-medical-image-segmentation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/yingkaisha/keras-unet-collection","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/yykzjh/pmfsnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/Basars/trans-unet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/Elman295/Crowd_Counting_Density_Estimation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"unanswered"}},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/PaddlePaddle/PaddleSeg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":null},{"paper_slug":"transunet-transformers-make-strong-encoders","repo_url":"https://github.com/The-AI-Summer/self-attention-cv","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"cardiac-segmentation","task_name":"Cardiac Segmentation"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"organ-segmentation","task_name":"Organ Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"concatenated-skip-connection","method_name":"Concatenated Skip Connection"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"u-net","method_name":"U-Net"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/medical-image-segmentation-on-acdc","task":"Medical Image Segmentation","dataset":"ACDC","model":"TransUNet","rank_in_archive_order":6,"of":6,"metrics":{"Dice Score":"0.8971"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-automatic","task":"Medical Image Segmentation","dataset":"Automatic Cardiac Diagnosis Challenge (ACDC)","model":"TransUNet","rank_in_archive_order":17,"of":20,"metrics":{"Avg DSC":"89.71"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-automatic","task":"Medical Image Segmentation","dataset":"Automatic Cardiac Diagnosis Challenge (ACDC)","model":"R50-ViT-CUP","rank_in_archive_order":19,"of":20,"metrics":{"Avg DSC":"87.57"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-automatic","task":"Medical Image Segmentation","dataset":"Automatic Cardiac Diagnosis Challenge (ACDC)","model":"R50-AttnUNet","rank_in_archive_order":20,"of":20,"metrics":{"Avg DSC":"86.75"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-synapse-multi","task":"Medical Image Segmentation","dataset":"Synapse multi-organ CT","model":"TransUNet","rank_in_archive_order":23,"of":23,"metrics":{"Avg DSC":"77.48","Avg HD":"31.69"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2102.04306","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2102.04306"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/KenzaB27/TransUnet","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/PaddlePaddle/PaddleSeg","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mirthai/csa-net","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yykzjh/pmfsnet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hongkunsun/paratranscnn","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Elman295/Crowd_Counting_Density_Estimation","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/The-AI-Summer/self-attention-cv","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Basars/trans-unet","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yingkaisha/keras-unet-collection","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/awsaf49/TransUnet-tf","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Beckschen/TransUNet","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gail-yxie/adawac","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ljollans/trunet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/04RR/SOTA-Vision","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aris-mukherjee/TransUNet-modified","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MargeryLab/TransUNet","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ayoub-sudo/Attention-Unet-web-app","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/simonustc/mcpa-for-2d-medical-image-segmentation","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mkara44/transunet_pytorch","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hendraet/synthesis-in-style","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jack139/ETH_predictor_keras_unet","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/maloadba/mgenseg_2d","reach":null}],"summary":{"ran_fixture":1,"ran_draft_wrong":3,"ran_honours":2,"unverified":1},"by_repo_kind":{"listed":{"samples":6,"ran":5,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":7,"samples":[{"code_sha256_prefix":"7d8eaf5537f699e4","entry":"np2th","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"7d8eaf5537f699e4"}},{"code_sha256_prefix":"b0f916df39e78ae5","entry":"conv1x1","repo":"maloadba/mgenseg_2d","repo_kind":"listed","path":"model/configs/mbrats/Transunet.py","file_url":"https://github.com/maloadba/mgenseg_2d/blob/HEAD/model/configs/mbrats/Transunet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b0f916df39e78ae5"}},{"code_sha256_prefix":"4e5bf13dbdc4f008","entry":"conv3x3","repo":"maloadba/mgenseg_2d","repo_kind":"listed","path":"model/configs/mbrats/Transunet.py","file_url":"https://github.com/maloadba/mgenseg_2d/blob/HEAD/model/configs/mbrats/Transunet.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4e5bf13dbdc4f008"}},{"code_sha256_prefix":"991bd6a9b4b39241","entry":"dice_score","repo":"ljollans/trunet","repo_kind":"listed","path":"TRUNet_network/trunet_train.py","file_url":"https://github.com/ljollans/trunet/blob/HEAD/TRUNet_network/trunet_train.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"991bd6a9b4b39241"}},{"code_sha256_prefix":"7e0f38dc41fa04e1","entry":"one_hot_encoder","repo":"ljollans/trunet","repo_kind":"listed","path":"TRUNet_network/trunet_train.py","file_url":"https://github.com/ljollans/trunet/blob/HEAD/TRUNet_network/trunet_train.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7e0f38dc41fa04e1"}},{"code_sha256_prefix":"492de094e1db0458","entry":"to_one_arr_encoding","repo":"ljollans/trunet","repo_kind":"listed","path":"TRUNet_network/trunet_train.py","file_url":"https://github.com/ljollans/trunet/blob/HEAD/TRUNet_network/trunet_train.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"492de094e1db0458"}},{"code_sha256_prefix":"879df9465f2b5e0f","entry":"run","repo":"maloadba/mgenseg_2d","repo_kind":"listed","path":"mbrats_segmentation_transunet.py","file_url":"https://github.com/maloadba/mgenseg_2d/blob/HEAD/mbrats_segmentation_transunet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"879df9465f2b5e0f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}