{"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/plainmamba-improving-non-hierarchical-mamba","title":"PlainMamba: Improving Non-Hierarchical Mamba in Visual Recognition","arxiv_id":"2403.17695","date":"2024-03-26","proceeding":null,"authors":["Chenhongyi Yang","Zehui Chen","Miguel Espinosa","Linus Ericsson","Zhenyu Wang","Jiaming Liu","Elliot J. Crowley"],"abstract":"We present PlainMamba: a simple non-hierarchical state space model (SSM) designed for general visual recognition. The recent Mamba model has shown how SSMs can be highly competitive with other architectures on sequential data and initial attempts have been made to apply it to images. In this paper, we further adapt the selective scanning process of Mamba to the visual domain, enhancing its ability to learn features from two-dimensional images by (i) a continuous 2D scanning process that improves spatial continuity by ensuring adjacency of tokens in the scanning sequence, and (ii) direction-aware updating which enables the model to discern the spatial relations of tokens by encoding directional information. Our architecture is designed to be easy to use and easy to scale, formed by stacking identical PlainMamba blocks, resulting in a model with constant width throughout all layers. The architecture is further simplified by removing the need for special tokens. We evaluate PlainMamba on a variety of visual recognition tasks, achieving performance gains over previous non-hierarchical models and is competitive with hierarchical alternatives. For tasks requiring high-resolution inputs, in particular, PlainMamba requires much less computing while maintaining high performance. Code and models are available at: https://github.com/ChenhongyiYang/PlainMamba .","url_abs":"https://arxiv.org/abs/2403.17695v2","url_pdf":"https://arxiv.org/pdf/2403.17695v2.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":"plainmamba-improving-non-hierarchical-mamba","repo_url":"https://github.com/chenhongyiyang/plainmamba","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"plainmamba-improving-non-hierarchical-mamba","repo_url":"https://github.com/karl1109/scsegamba","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"mamba","task_name":"Mamba"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.17695","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.17695"}},"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/karl1109/scsegamba","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/chenhongyiyang/plainmamba","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"ran_violates":1,"unverified":9},"by_repo_kind":{"listed":{"samples":11,"ran":2,"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":"ac269a0e4b8d946e","entry":"default_loader","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/image_folder.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/image_folder.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ac269a0e4b8d946e"}},{"code_sha256_prefix":"ab4109634b75ef8b","entry":"is_image_file","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/image_folder.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/image_folder.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab4109634b75ef8b"}},{"code_sha256_prefix":"6085526f725c95b0","entry":"affine_transform","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/utils.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6085526f725c95b0"}},{"code_sha256_prefix":"4316491d01eeb636","entry":"convert_from_color_annotation","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/utils.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4316491d01eeb636"}},{"code_sha256_prefix":"58b7470d999eee39","entry":"get_image_pairs","repo":"karl1109/scsegamba","repo_kind":"listed","path":"eval/data_io.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/eval/data_io.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"58b7470d999eee39"}},{"code_sha256_prefix":"734e6a1b32744f08","entry":"get_norm_layer","repo":"karl1109/scsegamba","repo_kind":"listed","path":"models/GBC.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/models/GBC.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"734e6a1b32744f08"}},{"code_sha256_prefix":"c46f5dafa31a96bf","entry":"get_params","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/base_dataset.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/base_dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c46f5dafa31a96bf"}},{"code_sha256_prefix":"4956e4440feb1f58","entry":"get_params","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/utils.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4956e4440feb1f58"}},{"code_sha256_prefix":"2bc89c63fcdec2e2","entry":"get_transform","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/base_dataset.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/base_dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2bc89c63fcdec2e2"}},{"code_sha256_prefix":"102d0ddbe3018538","entry":"imread","repo":"karl1109/scsegamba","repo_kind":"listed","path":"eval/data_io.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/eval/data_io.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"102d0ddbe3018538"}},{"code_sha256_prefix":"557c2837469ac41d","entry":"make_dataset","repo":"karl1109/scsegamba","repo_kind":"listed","path":"datasets/image_folder.py","file_url":"https://github.com/karl1109/scsegamba/blob/HEAD/datasets/image_folder.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"557c2837469ac41d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}