{"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/sam2-adapter-evaluating-adapting-segment","title":"SAM2-Adapter: Evaluating & Adapting Segment Anything 2 in Downstream Tasks: Camouflage, Shadow, Medical Image Segmentation, and More","arxiv_id":"2408.04579","date":"2024-08-08","proceeding":null,"authors":["Tianrun Chen","Ankang Lu","Lanyun Zhu","Chaotao Ding","Chunan Yu","Deyi Ji","Zejian Li","Lingyun Sun","Papa Mao","Ying Zang"],"abstract":"The advent of large models, also known as foundation models, has significantly transformed the AI research landscape, with models like Segment Anything (SAM) achieving notable success in diverse image segmentation scenarios. Despite its advancements, SAM encountered limitations in handling some complex low-level segmentation tasks like camouflaged object and medical imaging. In response, in 2023, we introduced SAM-Adapter, which demonstrated improved performance on these challenging tasks. Now, with the release of Segment Anything 2 (SAM2), a successor with enhanced architecture and a larger training corpus, we reassess these challenges. This paper introduces SAM2-Adapter, the first adapter designed to overcome the persistent limitations observed in SAM2 and achieve new state-of-the-art (SOTA) results in specific downstream tasks including medical image segmentation, camouflaged (concealed) object detection, and shadow detection. SAM2-Adapter builds on the SAM-Adapter's strengths, offering enhanced generalizability and composability for diverse applications. We present extensive experimental results demonstrating SAM2-Adapter's effectiveness. We show the potential and encourage the research community to leverage the SAM2 model with our SAM2-Adapter for achieving superior segmentation outcomes. Code, pre-trained models, and data processing protocols are available at http://tianrun-chen.github.io/SAM-Adaptor/","url_abs":"https://arxiv.org/abs/2408.04579v2","url_pdf":"https://arxiv.org/pdf/2408.04579v2.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":"sam2-adapter-evaluating-adapting-segment","repo_url":"https://github.com/tianrun-chen/sam-adapter-pytorch","is_official":0,"mentioned_in_paper":0,"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":"object-detection","task_name":"Object Detection"},{"task_slug":"robot-manipulation-generalization","task_name":"Robot Manipulation Generalization"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"shadow-detection","task_name":"Shadow Detection"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"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=2408.04579","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.04579"}},"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/tianrun-chen/sam-adapter-pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":2,"unverified":2},"by_repo_kind":{"listed":{"samples":5,"ran":3,"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":"44c3aa4c610ea3f7","entry":"register","repo":"tianrun-chen/sam-adapter-pytorch","repo_kind":"listed","path":"models/models.py","file_url":"https://github.com/tianrun-chen/sam-adapter-pytorch/blob/HEAD/models/models.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"44c3aa4c610ea3f7"}},{"code_sha256_prefix":"02566da69866c48c","entry":"trunc_normal_","repo":"tianrun-chen/sam-adapter-pytorch","repo_kind":"listed","path":"models/mmseg/models/sam/image_encoder.py","file_url":"https://github.com/tianrun-chen/sam-adapter-pytorch/blob/HEAD/models/mmseg/models/sam/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":"02566da69866c48c"}},{"code_sha256_prefix":"105fa08885dc36cc","entry":"window_partition","repo":"tianrun-chen/sam-adapter-pytorch","repo_kind":"listed","path":"models/mmseg/models/sam/image_encoder.py","file_url":"https://github.com/tianrun-chen/sam-adapter-pytorch/blob/HEAD/models/mmseg/models/sam/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":"0c6441af780ce58d","entry":"make","repo":"tianrun-chen/sam-adapter-pytorch","repo_kind":"listed","path":"models/models.py","file_url":"https://github.com/tianrun-chen/sam-adapter-pytorch/blob/HEAD/models/models.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":"0c6441af780ce58d"}},{"code_sha256_prefix":"87f16a36e0c0923b","entry":"to_2tuple","repo":"tianrun-chen/sam-adapter-pytorch","repo_kind":"listed","path":"models/mmseg/models/sam/image_encoder.py","file_url":"https://github.com/tianrun-chen/sam-adapter-pytorch/blob/HEAD/models/mmseg/models/sam/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":"87f16a36e0c0923b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}