{"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/clip-is-also-an-efficient-segmenter-a-text","title":"CLIP is Also an Efficient Segmenter: A Text-Driven Approach for Weakly Supervised Semantic Segmentation","arxiv_id":"2212.09506","date":"2022-12-16","proceeding":"CVPR 2023 1","authors":["Yuqi Lin","Minghao Chen","Wenxiao Wang","Boxi Wu","Ke Li","Binbin Lin","Haifeng Liu","Xiaofei He"],"abstract":"Weakly supervised semantic segmentation (WSSS) with image-level labels is a challenging task. Mainstream approaches follow a multi-stage framework and suffer from high training costs. In this paper, we explore the potential of Contrastive Language-Image Pre-training models (CLIP) to localize different categories with only image-level labels and without further training. To efficiently generate high-quality segmentation masks from CLIP, we propose a novel WSSS framework called CLIP-ES. Our framework improves all three stages of WSSS with special designs for CLIP: 1) We introduce the softmax function into GradCAM and exploit the zero-shot ability of CLIP to suppress the confusion caused by non-target classes and backgrounds. Meanwhile, to take full advantage of CLIP, we re-explore text inputs under the WSSS setting and customize two text-driven strategies: sharpness-based prompt selection and synonym fusion. 2) To simplify the stage of CAM refinement, we propose a real-time class-aware attention-based affinity (CAA) module based on the inherent multi-head self-attention (MHSA) in CLIP-ViTs. 3) When training the final segmentation model with the masks generated by CLIP, we introduced a confidence-guided loss (CGL) focus on confident regions. Our CLIP-ES achieves SOTA performance on Pascal VOC 2012 and MS COCO 2014 while only taking 10% time of previous methods for the pseudo mask generation. Code is available at https://github.com/linyq2117/CLIP-ES.","url_abs":"https://arxiv.org/abs/2212.09506v3","url_pdf":"https://arxiv.org/pdf/2212.09506v3.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":"clip-is-also-an-efficient-segmenter-a-text","repo_url":"https://github.com/linyq2117/clip-es","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"weakly-supervised-semantic-segmentation-1","task_name":"Weakly supervised Semantic Segmentation"},{"task_slug":"weakly-supervised-semantic-segmentation","task_name":"Weakly-Supervised Semantic Segmentation"}],"methods":[{"method_slug":"cam","method_name":"CAM"},{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/weakly-supervised-semantic-segmentation-on-4","task":"Weakly-Supervised Semantic Segmentation","dataset":"COCO 2014 val","model":"CLIP-ES(DeepLabV2-ResNet101)","rank_in_archive_order":13,"of":39,"metrics":{"mIoU":"45.4"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-semantic-segmentation-on-1","task":"Weakly-Supervised Semantic Segmentation","dataset":"PASCAL VOC 2012 test","model":"CLIP-ES(DeepLabV2-ResNet101)","rank_in_archive_order":13,"of":60,"metrics":{"Mean IoU":"73.9"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-semantic-segmentation-on","task":"Weakly-Supervised Semantic Segmentation","dataset":"PASCAL VOC 2012 val","model":"CLIP-ES(DeepLabV2-ResNet101)","rank_in_archive_order":14,"of":73,"metrics":{"Mean IoU":"73.8"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2212.09506","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.09506"}},"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/linyq2117/clip-es","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran_fixture":1},"by_repo_kind":{"official":{"samples":3,"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":"5bd180a934a83565","entry":"reshape_transform","repo":"linyq2117/clip-es","repo_kind":"official","path":"generate_cams_voc12.py","file_url":"https://github.com/linyq2117/clip-es/blob/HEAD/generate_cams_voc12.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5bd180a934a83565"}},{"code_sha256_prefix":"4d8fbe9ff0f1714e","entry":"scores","repo":"linyq2117/clip-es","repo_kind":"official","path":"eval_cam_with_crf.py","file_url":"https://github.com/linyq2117/clip-es/blob/HEAD/eval_cam_with_crf.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d8fbe9ff0f1714e"}},{"code_sha256_prefix":"198c3be080d6e91e","entry":"split_dataset","repo":"linyq2117/clip-es","repo_kind":"official","path":"generate_cams_voc12.py","file_url":"https://github.com/linyq2117/clip-es/blob/HEAD/generate_cams_voc12.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"198c3be080d6e91e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}