{"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/fastsam3d-an-efficient-segment-anything-model","title":"FastSAM3D: An Efficient Segment Anything Model for 3D Volumetric Medical Images","arxiv_id":"2403.09827","date":"2024-03-14","proceeding":null,"authors":["Yiqing Shen","Jingxing Li","Xinyuan Shao","Blanca Inigo Romillo","Ankush Jindal","David Dreizin","Mathias Unberath"],"abstract":"Segment anything models (SAMs) are gaining attention for their zero-shot generalization capability in segmenting objects of unseen classes and in unseen domains when properly prompted. Interactivity is a key strength of SAMs, allowing users to iteratively provide prompts that specify objects of interest to refine outputs. However, to realize the interactive use of SAMs for 3D medical imaging tasks, rapid inference times are necessary. High memory requirements and long processing delays remain constraints that hinder the adoption of SAMs for this purpose. Specifically, while 2D SAMs applied to 3D volumes contend with repetitive computation to process all slices independently, 3D SAMs suffer from an exponential increase in model parameters and FLOPS. To address these challenges, we present FastSAM3D which accelerates SAM inference to 8 milliseconds per 128*128*128 3D volumetric image on an NVIDIA A100 GPU. This speedup is accomplished through 1) a novel layer-wise progressive distillation scheme that enables knowledge transfer from a complex 12-layer ViT-B to a lightweight 6-layer ViT-Tiny variant encoder without training from scratch; and 2) a novel 3D sparse flash attention to replace vanilla attention operators, substantially reducing memory needs and improving parallelization. Experiments on three diverse datasets reveal that FastSAM3D achieves a remarkable speedup of 527.38x compared to 2D SAMs and 8.75x compared to 3D SAMs on the same volumes without significant performance decline. Thus, FastSAM3D opens the door for low-cost truly interactive SAM-based 3D medical imaging segmentation with commonly used GPU hardware. Code is available at https://github.com/arcadelab/FastSAM3D.","url_abs":"https://arxiv.org/abs/2403.09827v1","url_pdf":"https://arxiv.org/pdf/2403.09827v1.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":"fastsam3d-an-efficient-segment-anything-model","repo_url":"https://github.com/arcadelab/fastsam3d","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"fastsam3d-an-efficient-segment-anything-model","repo_url":"https://github.com/arcadelab/fastsam3d_slicer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"3d-medical-imaging-segmentation","task_name":"3D Medical Imaging Segmentation"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"},{"task_slug":"zero-shot-generalization","task_name":"Zero-shot Generalization"}],"methods":[{"method_slug":"sam","method_name":"SAM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.09827","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.09827"}},"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/arcadelab/fastsam3d","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/arcadelab/fastsam3d_slicer","reach":{"status":"ok"}}],"summary":{"ran":5,"unverified":7},"by_repo_kind":{"official":{"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":"77e28e9382f984ce","entry":"batch_forward","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"val_2d.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/val_2d.py","link_basis":"first_harvest_node","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":"77e28e9382f984ce"}},{"code_sha256_prefix":"615905eb1431bc23","entry":"compute_dice","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"validation_student.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/validation_student.py","link_basis":"first_harvest_node","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":"615905eb1431bc23"}},{"code_sha256_prefix":"04b1148082a2d310","entry":"compute_iou","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"val_2d.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/val_2d.py","link_basis":"first_harvest_node","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":"04b1148082a2d310"}},{"code_sha256_prefix":"5319e20cdab18b32","entry":"get_next_click3D_torch","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"utils/click_method.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/utils/click_method.py","link_basis":"first_harvest_node","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":"5319e20cdab18b32"}},{"code_sha256_prefix":"6a7640b1cb51d789","entry":"get_next_click3D_torch_2","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"utils/click_method.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/utils/click_method.py","link_basis":"first_harvest_node","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":"6a7640b1cb51d789"}},{"code_sha256_prefix":"509d016b2e10d39d","entry":"build_sam3D_vit_b","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_ls_sam3d.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_ls_sam3d.py","link_basis":"first_harvest_node","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":"509d016b2e10d39d"}},{"code_sha256_prefix":"794cf331a94c228b","entry":"build_sam3D_vit_h","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_ls_sam3d.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_ls_sam3d.py","link_basis":"first_harvest_node","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":"794cf331a94c228b"}},{"code_sha256_prefix":"a4b3c8964f3dca03","entry":"build_sam3D_vit_l","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_ls_sam3d.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_ls_sam3d.py","link_basis":"first_harvest_node","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":"a4b3c8964f3dca03"}},{"code_sha256_prefix":"8ceb13577d0726d6","entry":"build_sam_vit_b","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_sam.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_sam.py","link_basis":"first_harvest_node","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":"8ceb13577d0726d6"}},{"code_sha256_prefix":"49ef6e492e9adbf9","entry":"build_sam_vit_h","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_sam.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_sam.py","link_basis":"first_harvest_node","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":"49ef6e492e9adbf9"}},{"code_sha256_prefix":"3cd7bd07d3ca22b8","entry":"build_sam_vit_l","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"segment_anything/build_sam.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/segment_anything/build_sam.py","link_basis":"first_harvest_node","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":"3cd7bd07d3ca22b8"}},{"code_sha256_prefix":"1116cff8750c3e55","entry":"postprocess_masks","repo":"arcadelab/fastsam3d","repo_kind":"official","path":"validation_student.py","file_url":"https://github.com/arcadelab/fastsam3d/blob/HEAD/validation_student.py","link_basis":"first_harvest_node","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":"1116cff8750c3e55"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}