{"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/shuffle-transformer-rethinking-spatial","title":"Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer","arxiv_id":"2106.03650","date":"2021-06-07","proceeding":null,"authors":["Zilong Huang","Youcheng Ben","Guozhong Luo","Pei Cheng","Gang Yu","Bin Fu"],"abstract":"Very recently, Window-based Transformers, which computed self-attention within non-overlapping local windows, demonstrated promising results on image classification, semantic segmentation, and object detection. However, less study has been devoted to the cross-window connection which is the key element to improve the representation ability. In this work, we revisit the spatial shuffle as an efficient way to build connections among windows. As a result, we propose a new vision transformer, named Shuffle Transformer, which is highly efficient and easy to implement by modifying two lines of code. Furthermore, the depth-wise convolution is introduced to complement the spatial shuffle for enhancing neighbor-window connections. The proposed architectures achieve excellent performance on a wide range of visual tasks including image-level classification, object detection, and semantic segmentation. Code will be released for reproduction.","url_abs":"https://arxiv.org/abs/2106.03650v1","url_pdf":"https://arxiv.org/pdf/2106.03650v1.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":"shuffle-transformer-rethinking-spatial","repo_url":"https://github.com/mulinmeng/Shuffle-Transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"shuffle-transformer-rethinking-spatial","repo_url":"https://github.com/BR-IDL/PaddleViT/blob/main/image_classification/Shuffle_Transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":null},{"paper_slug":"shuffle-transformer-rethinking-spatial","repo_url":"https://github.com/alibaba/EasyCV","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"shuffle-transformer-rethinking-spatial","repo_url":"https://github.com/mindspore-courses/External-Attention-MindSpore/blob/main/model/backbone/ShuffleTransformer.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"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":"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":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"shuffle-t","method_name":"Shuffle-T"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[{"slug":"shuffle-t","name":"Shuffle-T","full_name":"Shuffle Transformer"}],"results":[{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"UperNet Shuffle-B","rank_in_archive_order":111,"of":235,"metrics":{"Validation mIoU":"50.5"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"UperNet Shuffle-T","rank_in_archive_order":161,"of":235,"metrics":{"Validation mIoU":"47.6"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k-val","task":"Semantic Segmentation","dataset":"ADE20K val","model":"UperNet Shuffle-B","rank_in_archive_order":49,"of":95,"metrics":{"mIoU":"50.5"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k-val","task":"Semantic Segmentation","dataset":"ADE20K val","model":"UperNet Shuffle-S","rank_in_archive_order":57,"of":95,"metrics":{"mIoU":"49.6"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k-val","task":"Semantic Segmentation","dataset":"ADE20K val","model":"UperNet Shuffle-T","rank_in_archive_order":66,"of":95,"metrics":{"mIoU":"47.6"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.03650","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.03650"}},"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/alibaba/EasyCV","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mulinmeng/Shuffle-Transformer","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/BR-IDL/PaddleViT/blob/main/image_classification/Shuffle_Transformer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mindspore-courses/External-Attention-MindSpore/blob/main/model/backbone/ShuffleTransformer.py","reach":null}],"summary":{"ran_fixture":1,"ran":2,"ran_honours":1,"ran_draft_wrong":1,"unverified":7},"by_repo_kind":{"listed":{"samples":12,"ran":5,"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":"144d10b49baeb8a6","entry":"window_partition","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"models/swin_transformer.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/models/swin_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"144d10b49baeb8a6"}},{"code_sha256_prefix":"e35a4b2e4114b1a5","entry":"build_optimizer","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"optimizer.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/optimizer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e35a4b2e4114b1a5"}},{"code_sha256_prefix":"eec1e7cba51d5e8e","entry":"get_grad_norm","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eec1e7cba51d5e8e"}},{"code_sha256_prefix":"b33222a09fc93bec","entry":"set_weight_decay","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"optimizer.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/optimizer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b33222a09fc93bec"}},{"code_sha256_prefix":"61bf152e6a42a184","entry":"window_reverse","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"models/swin_transformer.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/models/swin_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"61bf152e6a42a184"}},{"code_sha256_prefix":"0c32459bef92ff8c","entry":"auto_resume_helper","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0c32459bef92ff8c"}},{"code_sha256_prefix":"2448a1ccdc5ce4aa","entry":"build_model","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"models/build.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/models/build.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2448a1ccdc5ce4aa"}},{"code_sha256_prefix":"c02cc4e0b5720211","entry":"build_scheduler","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"lr_scheduler.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/lr_scheduler.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c02cc4e0b5720211"}},{"code_sha256_prefix":"b0a5beb34716d5a6","entry":"check_keywords_in_name","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"optimizer.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/optimizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b0a5beb34716d5a6"}},{"code_sha256_prefix":"80450600f7f09b0a","entry":"create_logger","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"logger.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"80450600f7f09b0a"}},{"code_sha256_prefix":"02a9e80c2bb81815","entry":"get_config","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"config.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/config.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"02a9e80c2bb81815"}},{"code_sha256_prefix":"640408a0715e42c2","entry":"load_checkpoint","repo":"mulinmeng/Shuffle-Transformer","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/mulinmeng/Shuffle-Transformer/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"640408a0715e42c2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}