{"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/segment-anything-without-supervision","title":"Segment Anything without Supervision","arxiv_id":"2406.20081","date":"2024-06-28","proceeding":null,"authors":["Xudong Wang","Jingfeng Yang","Trevor Darrell"],"abstract":"The Segmentation Anything Model (SAM) requires labor-intensive data labeling. We present Unsupervised SAM (UnSAM) for promptable and automatic whole-image segmentation that does not require human annotations. UnSAM utilizes a divide-and-conquer strategy to \"discover\" the hierarchical structure of visual scenes. We first leverage top-down clustering methods to partition an unlabeled image into instance/semantic level segments. For all pixels within a segment, a bottom-up clustering method is employed to iteratively merge them into larger groups, thereby forming a hierarchical structure. These unsupervised multi-granular masks are then utilized to supervise model training. Evaluated across seven popular datasets, UnSAM achieves competitive results with the supervised counterpart SAM, and surpasses the previous state-of-the-art in unsupervised segmentation by 11% in terms of AR. Moreover, we show that supervised SAM can also benefit from our self-supervised labels. By integrating our unsupervised pseudo masks into SA-1B's ground-truth masks and training UnSAM with only 1% of SA-1B, a lightly semi-supervised UnSAM can often segment entities overlooked by supervised SAM, exceeding SAM's AR by over 6.7% and AP by 3.9% on SA-1B.","url_abs":"https://arxiv.org/abs/2406.20081v1","url_pdf":"https://arxiv.org/pdf/2406.20081v1.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":"segment-anything-without-supervision","repo_url":"https://github.com/frank-xwang/unsam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"sam","method_name":"SAM"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/segmentation-on-sa-1b","task":"Segmentation","dataset":"SA-1B","model":"unSAM+ (Semi-supervised)","rank_in_archive_order":1,"of":2,"metrics":{"AR-large":"76.5","AR-medium":"65.9","AR-small":"36.2","Average Precision":"42.8"},"uses_additional_data":false},{"leaderboard":"/sota/segmentation-on-sa-1b","task":"Segmentation","dataset":"SA-1B","model":"SAM","rank_in_archive_order":2,"of":2,"metrics":{"AR-large":"82.8","AR-medium":"59.9","AR-small":"20.0","Average Precision":"38.9"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.20081","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.20081"}},"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/frank-xwang/unsam","reach":null}],"summary":{"ran_violates":1,"ran_honours":3,"ran_fixture":1},"by_repo_kind":{"official":{"samples":5,"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":5,"samples":[{"code_sha256_prefix":"64d411ff4bb56ed2","entry":"NMS","repo":"frank-xwang/unsam","repo_kind":"official","path":"divide_and_conquer/demo_dico.py","file_url":"https://github.com/frank-xwang/unsam/blob/HEAD/divide_and_conquer/demo_dico.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"64d411ff4bb56ed2"}},{"code_sha256_prefix":"3cc0975ecc69804a","entry":"area","repo":"frank-xwang/unsam","repo_kind":"official","path":"whole_image_segmentation/demo_whole_image.py","file_url":"https://github.com/frank-xwang/unsam/blob/HEAD/whole_image_segmentation/demo_whole_image.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3cc0975ecc69804a"}},{"code_sha256_prefix":"4b8a566549f7d04a","entry":"area","repo":"frank-xwang/unsam","repo_kind":"official","path":"divide_and_conquer/demo_dico.py","file_url":"https://github.com/frank-xwang/unsam/blob/HEAD/divide_and_conquer/demo_dico.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b8a566549f7d04a"}},{"code_sha256_prefix":"8d95cf229932db03","entry":"iou","repo":"frank-xwang/unsam","repo_kind":"official","path":"divide_and_conquer/demo_dico.py","file_url":"https://github.com/frank-xwang/unsam/blob/HEAD/divide_and_conquer/demo_dico.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d95cf229932db03"}},{"code_sha256_prefix":"30764a32a34c9a71","entry":"vis_mask","repo":"frank-xwang/unsam","repo_kind":"official","path":"whole_image_segmentation/demo_whole_image.py","file_url":"https://github.com/frank-xwang/unsam/blob/HEAD/whole_image_segmentation/demo_whole_image.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"30764a32a34c9a71"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}