{"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/scaleformer-revisiting-the-transformer-based","title":"ScaleFormer: Revisiting the Transformer-based Backbones from a Scale-wise Perspective for Medical Image Segmentation","arxiv_id":"2207.14552","date":"2022-07-29","proceeding":null,"authors":["Huimin Huang","Shiao Xie1","Lanfen Lin","Yutaro Iwamoto","Xianhua Han","Yen-Wei Chen","Ruofeng Tong"],"abstract":"Recently, a variety of vision transformers have been developed as their capability of modeling long-range dependency. In current transformer-based backbones for medical image segmentation, convolutional layers were replaced with pure transformers, or transformers were added to the deepest encoder to learn global context. However, there are mainly two challenges in a scale-wise perspective: (1) intra-scale problem: the existing methods lacked in extracting local-global cues in each scale, which may impact the signal propagation of small objects; (2) inter-scale problem: the existing methods failed to explore distinctive information from multiple scales, which may hinder the representation learning from objects with widely variable size, shape and location. To address these limitations, we propose a novel backbone, namely ScaleFormer, with two appealing designs: (1) A scale-wise intra-scale transformer is designed to couple the CNN-based local features with the transformer-based global cues in each scale, where the row-wise and column-wise global dependencies can be extracted by a lightweight Dual-Axis MSA. (2) A simple and effective spatial-aware inter-scale transformer is designed to interact among consensual regions in multiple scales, which can highlight the cross-scale dependency and resolve the complex scale variations. Experimental results on different benchmarks demonstrate that our Scale-Former outperforms the current state-of-the-art methods. The code is publicly available at: https://github.com/ZJUGiveLab/ScaleFormer.","url_abs":"https://arxiv.org/abs/2207.14552v1","url_pdf":"https://arxiv.org/pdf/2207.14552v1.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":"scaleformer-revisiting-the-transformer-based","repo_url":"https://github.com/zjugivelab/scaleformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.14552","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.14552"}},"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":"deterministic:regex_extraction","url":"https://github.com/ZJUGiveLab/ScaleFormer","reach":null}],"summary":{"ran":12,"unverified":5},"by_repo_kind":{"official":{"samples":17,"ran":12,"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":17,"samples":[{"code_sha256_prefix":"b32997d863417867","entry":"Conv2dReLU","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b32997d863417867"}},{"code_sha256_prefix":"5b7ed766c1872be5","entry":"ConvBNReLU","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5b7ed766c1872be5"}},{"code_sha256_prefix":"f3ffe41a2bb9750f","entry":"DWCONV","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f3ffe41a2bb9750f"}},{"code_sha256_prefix":"824ad75d27fd24b2","entry":"DecoderBlock","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"824ad75d27fd24b2"}},{"code_sha256_prefix":"f797d98272125478","entry":"DoubleConv","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f797d98272125478"}},{"code_sha256_prefix":"82acbff60eba40ee","entry":"Dual_axis","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"82acbff60eba40ee"}},{"code_sha256_prefix":"38be558bda45b6d4","entry":"FFN_MultiLN","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"38be558bda45b6d4"}},{"code_sha256_prefix":"79c975e1e840ee7a","entry":"InterTransBlock","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"79c975e1e840ee7a"}},{"code_sha256_prefix":"82b09a53b9ae6618","entry":"MLP","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"82b09a53b9ae6618"}},{"code_sha256_prefix":"a5d7b0385917c845","entry":"MultiScaleAtten","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a5d7b0385917c845"}},{"code_sha256_prefix":"2a297e1ad30636e4","entry":"SegmentationHead","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a297e1ad30636e4"}},{"code_sha256_prefix":"441206dd814e13bc","entry":"UEncoder","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"441206dd814e13bc"}},{"code_sha256_prefix":"39fe15611e255e98","entry":"IntraTransBlock","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.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":"39fe15611e255e98"}},{"code_sha256_prefix":"77851c6793e41f9f","entry":"ParallEncoder","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.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":"77851c6793e41f9f"}},{"code_sha256_prefix":"20ac81fcaad0de8b","entry":"ScaleFormer","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.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":"20ac81fcaad0de8b"}},{"code_sha256_prefix":"1dafad4d64fa61ca","entry":"SpatialAwareTrans","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.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":"1dafad4d64fa61ca"}},{"code_sha256_prefix":"7a059da3c2fc9d89","entry":"TransEncoder","repo":"ZJUGiveLab/ScaleFormer","repo_kind":"official","path":"networks/ScaleFormer.py","file_url":"https://github.com/ZJUGiveLab/ScaleFormer/blob/HEAD/networks/ScaleFormer.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":"7a059da3c2fc9d89"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}