{"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/adapting-segment-anything-model-for-change","title":"Adapting Segment Anything Model for Change Detection in HR Remote Sensing Images","arxiv_id":"2309.01429","date":"2023-09-04","proceeding":null,"authors":["Lei Ding","Kun Zhu","Daifeng Peng","Hao Tang","Kuiwu Yang","Lorenzo Bruzzone"],"abstract":"Vision Foundation Models (VFMs) such as the Segment Anything Model (SAM) allow zero-shot or interactive segmentation of visual contents, thus they are quickly applied in a variety of visual scenes. However, their direct use in many Remote Sensing (RS) applications is often unsatisfactory due to the special imaging characteristics of RS images. In this work, we aim to utilize the strong visual recognition capabilities of VFMs to improve the change detection of high-resolution Remote Sensing Images (RSIs). We employ the visual encoder of FastSAM, an efficient variant of the SAM, to extract visual representations in RS scenes. To adapt FastSAM to focus on some specific ground objects in the RS scenes, we propose a convolutional adaptor to aggregate the task-oriented change information. Moreover, to utilize the semantic representations that are inherent to SAM features, we introduce a task-agnostic semantic learning branch to model the semantic latent in bi-temporal RSIs. The resulting method, SAMCD, obtains superior accuracy compared to the SOTA methods and exhibits a sample-efficient learning ability that is comparable to semi-supervised CD methods. To the best of our knowledge, this is the first work that adapts VFMs for the CD of HR RSIs.","url_abs":"https://arxiv.org/abs/2309.01429v4","url_pdf":"https://arxiv.org/pdf/2309.01429v4.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":"adapting-segment-anything-model-for-change","repo_url":"https://github.com/ggsding/sam-cd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"change-detection","task_name":"Change Detection"},{"task_slug":"interactive-segmentation","task_name":"Interactive Segmentation"}],"methods":[{"method_slug":"focus","method_name":"Focus"},{"method_slug":"sam","method_name":"SAM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.01429","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.01429"}},"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/ggsding/sam-cd","reach":{"status":"ok"}}],"summary":{"ran":8,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":15,"ran":10,"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":15,"samples":[{"code_sha256_prefix":"835b49cf3fcfb913","entry":"CrossEntropy2d","repo":"ggsding/sam-cd","repo_kind":"official","path":"utils/loss.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/utils/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"835b49cf3fcfb913"}},{"code_sha256_prefix":"fb54140011ecf14b","entry":"Index2Color","repo":"ggsding/sam-cd","repo_kind":"official","path":"vis_latent.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/vis_latent.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fb54140011ecf14b"}},{"code_sha256_prefix":"40313136f7f7b6a5","entry":"calc_TP","repo":"ggsding/sam-cd","repo_kind":"official","path":"eval_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/eval_CD.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"40313136f7f7b6a5"}},{"code_sha256_prefix":"158bf4c3a5f11f04","entry":"conv1x1","repo":"ggsding/sam-cd","repo_kind":"official","path":"models/SAM_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/models/SAM_CD.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"158bf4c3a5f11f04"}},{"code_sha256_prefix":"29df79c9fdb0cee8","entry":"conv3x3","repo":"ggsding/sam-cd","repo_kind":"official","path":"models/SAM_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/models/SAM_CD.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"29df79c9fdb0cee8"}},{"code_sha256_prefix":"c5b0d5d7dc130f50","entry":"conv3x3","repo":"ggsding/sam-cd","repo_kind":"official","path":"models/ResNet_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/models/ResNet_CD.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c5b0d5d7dc130f50"}},{"code_sha256_prefix":"ddbbed5c00eae6dd","entry":"index2int","repo":"ggsding/sam-cd","repo_kind":"official","path":"eval_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/eval_CD.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ddbbed5c00eae6dd"}},{"code_sha256_prefix":"ac96c487a84274f0","entry":"normalize_image","repo":"ggsding/sam-cd","repo_kind":"official","path":"datasets/Levir_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/datasets/Levir_CD.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ac96c487a84274f0"}},{"code_sha256_prefix":"21c11e3818b8cb84","entry":"stitch_pred","repo":"ggsding/sam-cd","repo_kind":"official","path":"pred_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/pred_CD.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"21c11e3818b8cb84"}},{"code_sha256_prefix":"398c860804f42cc3","entry":"weighted_BCE_logits","repo":"ggsding/sam-cd","repo_kind":"official","path":"utils/loss.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/utils/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"398c860804f42cc3"}},{"code_sha256_prefix":"7c26c2529e0e6ff6","entry":"align_dims","repo":"ggsding/sam-cd","repo_kind":"official","path":"eval_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/eval_CD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c26c2529e0e6ff6"}},{"code_sha256_prefix":"e5b4d879d8899c56","entry":"create_crops","repo":"ggsding/sam-cd","repo_kind":"official","path":"pred_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/pred_CD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e5b4d879d8899c56"}},{"code_sha256_prefix":"390aed77f1ae3026","entry":"normalize_images","repo":"ggsding/sam-cd","repo_kind":"official","path":"datasets/Levir_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/datasets/Levir_CD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"390aed77f1ae3026"}},{"code_sha256_prefix":"abcc526d42671ee3","entry":"showIMG","repo":"ggsding/sam-cd","repo_kind":"official","path":"datasets/Levir_CD.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/datasets/Levir_CD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"abcc526d42671ee3"}},{"code_sha256_prefix":"3ebfbe4f2f28b229","entry":"weighted_BCE","repo":"ggsding/sam-cd","repo_kind":"official","path":"utils/loss.py","file_url":"https://github.com/ggsding/sam-cd/blob/HEAD/utils/loss.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3ebfbe4f2f28b229"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}