{"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/nnformer-interleaved-transformer-for","title":"nnFormer: Interleaved Transformer for Volumetric Segmentation","arxiv_id":"2109.03201","date":"2021-09-07","proceeding":null,"authors":["Hong-Yu Zhou","Jiansen Guo","Yinghao Zhang","Lequan Yu","Liansheng Wang","Yizhou Yu"],"abstract":"Transformer, the model of choice for natural language processing, has drawn scant attention from the medical imaging community. Given the ability to exploit long-term dependencies, transformers are promising to help atypical convolutional neural networks to overcome their inherent shortcomings of spatial inductive bias. However, most of recently proposed transformer-based segmentation approaches simply treated transformers as assisted modules to help encode global context into convolutional representations. To address this issue, we introduce nnFormer, a 3D transformer for volumetric medical image segmentation. nnFormer not only exploits the combination of interleaved convolution and self-attention operations, but also introduces local and global volume-based self-attention mechanism to learn volume representations. Moreover, nnFormer proposes to use skip attention to replace the traditional concatenation/summation operations in skip connections in U-Net like architecture. Experiments show that nnFormer significantly outperforms previous transformer-based counterparts by large margins on three public datasets. Compared to nnUNet, nnFormer produces significantly lower HD95 and comparable DSC results. Furthermore, we show that nnFormer and nnUNet are highly complementary to each other in model ensembling.","url_abs":"https://arxiv.org/abs/2109.03201v6","url_pdf":"https://arxiv.org/pdf/2109.03201v6.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":"nnformer-interleaved-transformer-for","repo_url":"https://github.com/282857341/nnformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"nnformer-interleaved-transformer-for","repo_url":"https://github.com/PaddlePaddle/PaddleSeg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":null}],"tasks":[{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"inductive-bias","task_name":"Inductive Bias"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"volumetric-medical-image-segmentation","task_name":"Volumetric Medical Image 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"},{"method_slug":"nnformer","method_name":"nnFormer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/medical-image-segmentation-on-automatic","task":"Medical Image Segmentation","dataset":"Automatic Cardiac Diagnosis Challenge (ACDC)","model":"nnFormer","rank_in_archive_order":9,"of":20,"metrics":{"Avg DSC":"92.06"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-synapse","task":"Medical Image Segmentation","dataset":"Synapse","model":"nnFormer","rank_in_archive_order":1,"of":1,"metrics":{"Dice score":"0.874"},"uses_additional_data":false},{"leaderboard":"/sota/medical-image-segmentation-on-synapse-multi","task":"Medical Image Segmentation","dataset":"Synapse multi-organ CT","model":"nnFormer","rank_in_archive_order":7,"of":23,"metrics":{"Avg DSC":"86.57","Avg HD":"10.63"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2109.03201","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.03201"}},"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/PaddlePaddle/PaddleSeg","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/282857341/nnformer","reach":null}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1}},"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":0,"samples":[{"code_sha256_prefix":"e7033836f7ce1958","entry":"run_evaluation","repo":"282857341/nnformer","repo_kind":"official","path":"nnformer/evaluation/evaluator.py","file_url":"https://github.com/282857341/nnformer/blob/HEAD/nnformer/evaluation/evaluator.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7033836f7ce1958"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}