{"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/zegclip-towards-adapting-clip-for-zero-shot","title":"ZegCLIP: Towards Adapting CLIP for Zero-shot Semantic Segmentation","arxiv_id":"2212.03588","date":"2022-12-07","proceeding":"CVPR 2023 1","authors":["Ziqin Zhou","BoWen Zhang","Yinjie Lei","Lingqiao Liu","Yifan Liu"],"abstract":"Recently, CLIP has been applied to pixel-level zero-shot learning tasks via a two-stage scheme. The general idea is to first generate class-agnostic region proposals and then feed the cropped proposal regions to CLIP to utilize its image-level zero-shot classification capability. While effective, such a scheme requires two image encoders, one for proposal generation and one for CLIP, leading to a complicated pipeline and high computational cost. In this work, we pursue a simpler-and-efficient one-stage solution that directly extends CLIP's zero-shot prediction capability from image to pixel level. Our investigation starts with a straightforward extension as our baseline that generates semantic masks by comparing the similarity between text and patch embeddings extracted from CLIP. However, such a paradigm could heavily overfit the seen classes and fail to generalize to unseen classes. To handle this issue, we propose three simple-but-effective designs and figure out that they can significantly retain the inherent zero-shot capacity of CLIP and improve pixel-level generalization ability. Incorporating those modifications leads to an efficient zero-shot semantic segmentation system called ZegCLIP. Through extensive experiments on three public benchmarks, ZegCLIP demonstrates superior performance, outperforming the state-of-the-art methods by a large margin under both \"inductive\" and \"transductive\" zero-shot settings. In addition, compared with the two-stage method, our one-stage ZegCLIP achieves a speedup of about 5 times faster during inference. We release the code at https://github.com/ZiqinZhou66/ZegCLIP.git.","url_abs":"https://arxiv.org/abs/2212.03588v3","url_pdf":"https://arxiv.org/pdf/2212.03588v3.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":"zegclip-towards-adapting-clip-for-zero-shot","repo_url":"https://github.com/ZiqinZhou66/ZegCLIP","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"},{"task_slug":"zero-shot-semantic-segmentation","task_name":"Zero-Shot Semantic Segmentation"},{"task_slug":null,"task_name":"zero-shot-classification"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"fail","method_name":"fail"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/zero-shot-semantic-segmentation-on-coco-stuff","task":"Zero-Shot Semantic Segmentation","dataset":"COCO-Stuff","model":"ZegCLIP","rank_in_archive_order":4,"of":15,"metrics":{"Inductive Setting hIoU":"40.8","Transductive Setting hIoU":"48.5"},"uses_additional_data":false},{"leaderboard":"/sota/zero-shot-semantic-segmentation-on-pascal-voc","task":"Zero-Shot Semantic Segmentation","dataset":"PASCAL VOC","model":"ZegCLIP","rank_in_archive_order":4,"of":13,"metrics":{"Inductive Setting hIoU":"84.3","Transductive Setting hIoU":"91.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2212.03588","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.03588"}},"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/ZiqinZhou66/ZegCLIP","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":3,"ran":4,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":"98f385d847636a3e","entry":"basic_clean","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/segmentor/untils.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/segmentor/untils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"864ff812c98727df","entry":"cosine_margin_loss","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/losses/criterion.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/losses/criterion.py","link_basis":"harvester_set","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":"864ff812c98727df"}},{"code_sha256_prefix":"016dba4163da28df","entry":"dice_loss","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/losses/criterion.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/losses/criterion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"016dba4163da28df"}},{"code_sha256_prefix":"7816c6d65ab55d8f","entry":"get_angles","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/decode_heads/utils.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/decode_heads/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7816c6d65ab55d8f"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/segmentor/untils.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/segmentor/untils.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"da3acf7173bd84f0","entry":"positional_encoding","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/decode_heads/utils.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/decode_heads/utils.py","link_basis":"harvester_set","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":"da3acf7173bd84f0"}},{"code_sha256_prefix":"2675e89c94ae08bf","entry":"sigmoid_focal_loss","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/losses/criterion.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/losses/criterion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2675e89c94ae08bf"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/segmentor/untils.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/segmentor/untils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"58cc9ff3bf75e753","entry":"nested_tensor_from_tensor_list","repo":"ZiqinZhou66/ZegCLIP","repo_kind":"official","path":"models/losses/misc.py","file_url":"https://github.com/ZiqinZhou66/ZegCLIP/blob/HEAD/models/losses/misc.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":"58cc9ff3bf75e753"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}