{"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/robustsam-segment-anything-robustly-on-1","title":"RobustSAM: Segment Anything Robustly on Degraded Images","arxiv_id":"2406.09627","date":"2024-06-13","proceeding":"CVPR 2024 1","authors":["Wei-Ting Chen","Yu-Jiet Vong","Sy-Yen Kuo","Sizhuo Ma","Jian Wang"],"abstract":"Segment Anything Model (SAM) has emerged as a transformative approach in image segmentation, acclaimed for its robust zero-shot segmentation capabilities and flexible prompting system. Nonetheless, its performance is challenged by images with degraded quality. Addressing this limitation, we propose the Robust Segment Anything Model (RobustSAM), which enhances SAM's performance on low-quality images while preserving its promptability and zero-shot generalization. Our method leverages the pre-trained SAM model with only marginal parameter increments and computational requirements. The additional parameters of RobustSAM can be optimized within 30 hours on eight GPUs, demonstrating its feasibility and practicality for typical research laboratories. We also introduce the Robust-Seg dataset, a collection of 688K image-mask pairs with different degradations designed to train and evaluate our model optimally. Extensive experiments across various segmentation tasks and datasets confirm RobustSAM's superior performance, especially under zero-shot conditions, underscoring its potential for extensive real-world application. Additionally, our method has been shown to effectively improve the performance of SAM-based downstream tasks such as single image dehazing and deblurring.","url_abs":"https://arxiv.org/abs/2406.09627v1","url_pdf":"https://arxiv.org/pdf/2406.09627v1.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":"robustsam-segment-anything-robustly-on-1","repo_url":"https://github.com/robustsam/RobustSAM","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"deblurring","task_name":"Deblurring"},{"task_slug":"image-dehazing","task_name":"Image Dehazing"},{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"single-image-dehazing","task_name":"Single Image Dehazing"},{"task_slug":"zero-shot-segmentation","task_name":"Zero Shot Segmentation"},{"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=2406.09627","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.09627"}},"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/robustsam/RobustSAM","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"ran_fixture":2,"unverified":5},"by_repo_kind":{"official":{"samples":8,"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":"ddc4752f7f12d6e1","entry":"apply_mask","repo":"robustsam/RobustSAM","repo_kind":"official","path":"gradio_app.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/gradio_app.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ddc4752f7f12d6e1"}},{"code_sha256_prefix":"733d7f0bedcb74c2","entry":"get_rel_pos","repo":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/modeling/image_encoder.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_segment_anything/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":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/modeling/image_encoder.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_segment_anything/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":"60c42ca7b4262c76","entry":"build_sam_vit_b","repo":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/build_sam.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"60c42ca7b4262c76"}},{"code_sha256_prefix":"7cdabae075eaf6a3","entry":"build_sam_vit_h","repo":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/build_sam.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7cdabae075eaf6a3"}},{"code_sha256_prefix":"7a8e9e7c345832ad","entry":"build_sam_vit_l","repo":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/build_sam.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7a8e9e7c345832ad"}},{"code_sha256_prefix":"ad6e07d14b734254","entry":"validate","repo":"robustsam/RobustSAM","repo_kind":"official","path":"engine.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/engine.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":"ad6e07d14b734254"}},{"code_sha256_prefix":"27be441cc8213e52","entry":"window_unpartition","repo":"robustsam/RobustSAM","repo_kind":"official","path":"robust_segment_anything/modeling/image_encoder.py","file_url":"https://github.com/robustsam/RobustSAM/blob/HEAD/robust_segment_anything/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}