{"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/samus-adapting-segment-anything-model-for","title":"Beyond Adapting SAM: Towards End-to-End Ultrasound Image Segmentation via Auto Prompting","arxiv_id":"2309.06824","date":"2023-09-13","proceeding":null,"authors":["Xian lin","Yangyang Xiang","Li Yu","Zengqiang Yan"],"abstract":"End-to-end medical image segmentation is of great value for computer-aided diagnosis dominated by task-specific models, usually suffering from poor generalization. With recent breakthroughs brought by the segment anything model (SAM) for universal image segmentation, extensive efforts have been made to adapt SAM for medical imaging but still encounter two major issues: 1) severe performance degradation and limited generalization without proper adaptation, and 2) semi-automatic segmentation relying on accurate manual prompts for interaction. In this work, we propose SAMUS as a universal model tailored for ultrasound image segmentation and further enable it to work in an end-to-end manner denoted as AutoSAMUS. Specifically, in SAMUS, a parallel CNN branch is introduced to supplement local information through cross-branch attention, and a feature adapter and a position adapter are jointly used to adapt SAM from natural to ultrasound domains while reducing training complexity. AutoSAMUS is realized by introducing an auto prompt generator (APG) to replace the manual prompt encoder of SAMUS to automatically generate prompt embeddings. A comprehensive ultrasound dataset, comprising about 30k images and 69k masks and covering six object categories, is collected for verification. Extensive comparison experiments demonstrate the superiority of SAMUS and AutoSAMUS against the state-of-the-art task-specific and SAM-based foundation models. We believe the auto-prompted SAM-based model has the potential to become a new paradigm for end-to-end medical image segmentation and deserves more exploration. Code and data are available at https://github.com/xianlin7/SAMUS.","url_abs":"https://arxiv.org/abs/2309.06824v2","url_pdf":"https://arxiv.org/pdf/2309.06824v2.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":"samus-adapting-segment-anything-model-for","repo_url":"https://github.com/xianlin7/samus","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"medical-image-segmentation","task_name":"Medical Image Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"adapter","method_name":"Adapter"},{"method_slug":"sam","method_name":"SAM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.06824","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.06824"}},"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/xianlin7/samus","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"unverified":10},"by_repo_kind":{"official":{"samples":12,"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":"733d7f0bedcb74c2","entry":"get_rel_pos","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/modeling/image_encoder.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/modeling/image_encoder.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"733d7f0bedcb74c2"}},{"code_sha256_prefix":"105fa08885dc36cc","entry":"window_partition","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/modeling/image_encoder.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/modeling/image_encoder.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"105fa08885dc36cc"}},{"code_sha256_prefix":"7069d6e0ba7c409e","entry":"box_xyxy_to_xywh","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/utils/amg.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/utils/amg.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":"7069d6e0ba7c409e"}},{"code_sha256_prefix":"323b6c277ef1f0c7","entry":"build_samus_vit_b","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/build_sam_us.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/build_sam_us.py","link_basis":"first_harvest_node","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":"323b6c277ef1f0c7"}},{"code_sha256_prefix":"fae3cfcfb5c5055d","entry":"build_samus_vit_b","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus_autoprompt/build_samus.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus_autoprompt/build_samus.py","link_basis":"first_harvest_node","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":"fae3cfcfb5c5055d"}},{"code_sha256_prefix":"c04a6a0e93b51922","entry":"build_samus_vit_h","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/build_sam_us.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/build_sam_us.py","link_basis":"first_harvest_node","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":"c04a6a0e93b51922"}},{"code_sha256_prefix":"1764d6f76a634a51","entry":"build_samus_vit_h","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus_autoprompt/build_samus.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus_autoprompt/build_samus.py","link_basis":"first_harvest_node","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":"1764d6f76a634a51"}},{"code_sha256_prefix":"de413424ed30d9c2","entry":"build_samus_vit_l","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/build_sam_us.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/build_sam_us.py","link_basis":"first_harvest_node","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":"de413424ed30d9c2"}},{"code_sha256_prefix":"9ef6289737b3b79b","entry":"build_samus_vit_l","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus_autoprompt/build_samus.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus_autoprompt/build_samus.py","link_basis":"first_harvest_node","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":"9ef6289737b3b79b"}},{"code_sha256_prefix":"114a3e68a54ab16c","entry":"is_box_near_crop_edge","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/utils/amg.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/utils/amg.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":"114a3e68a54ab16c"}},{"code_sha256_prefix":"d59832deec0972a0","entry":"mask_to_rle_pytorch","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/utils/amg.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/utils/amg.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":"d59832deec0972a0"}},{"code_sha256_prefix":"27be441cc8213e52","entry":"window_unpartition","repo":"xianlin7/samus","repo_kind":"official","path":"models/segment_anything_samus/modeling/image_encoder.py","file_url":"https://github.com/xianlin7/samus/blob/HEAD/models/segment_anything_samus/modeling/image_encoder.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":"27be441cc8213e52"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}