{"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/contrastive-embedding-for-generalized-zero","title":"Contrastive Embedding for Generalized Zero-Shot Learning","arxiv_id":"2103.16173","date":"2021-03-30","proceeding":"CVPR 2021 1","authors":["Zongyan Han","ZhenYong Fu","Shuo Chen","Jian Yang"],"abstract":"Generalized zero-shot learning (GZSL) aims to recognize objects from both seen and unseen classes, when only the labeled examples from seen classes are provided. Recent feature generation methods learn a generative model that can synthesize the missing visual features of unseen classes to mitigate the data-imbalance problem in GZSL. However, the original visual feature space is suboptimal for GZSL classification since it lacks discriminative information. To tackle this issue, we propose to integrate the generation model with the embedding model, yielding a hybrid GZSL framework. The hybrid GZSL approach maps both the real and the synthetic samples produced by the generation model into an embedding space, where we perform the final GZSL classification. Specifically, we propose a contrastive embedding (CE) for our hybrid GZSL framework. The proposed contrastive embedding can leverage not only the class-wise supervision but also the instance-wise supervision, where the latter is usually neglected by existing GZSL researches. We evaluate our proposed hybrid GZSL framework with contrastive embedding, named CE-GZSL, on five benchmark datasets. The results show that our CEGZSL method can outperform the state-of-the-arts by a significant margin on three datasets. Our codes are available on https://github.com/Hanzy1996/CE-GZSL.","url_abs":"https://arxiv.org/abs/2103.16173v1","url_pdf":"https://arxiv.org/pdf/2103.16173v1.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":"contrastive-embedding-for-generalized-zero","repo_url":"https://github.com/Hanzy1996/CE-GZSL","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"contrastive-embedding-for-generalized-zero","repo_url":"https://github.com/CristianoPatricio/zsl-methods","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"contrastive-embedding-for-generalized-zero","repo_url":"https://github.com/Huihui-z/CE-GZSL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"generalized-zero-shot-learning","task_name":"Generalized Zero-Shot Learning"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2103.16173","atlas_url":"https://app.syntology.ai/?focus=2103.16173","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2103.16173"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/Huihui-z/CE-GZSL","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/CristianoPatricio/zsl-methods","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Hanzy1996/CE-GZSL","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"ran_violates":1,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":1,"ran":0,"repositories":1},"listed":{"samples":4,"ran":3,"repositories":2}},"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":2,"samples":[{"code_sha256_prefix":"741735399d42d232","entry":"LINEAR_LOGSOFTMAX","repo":"CristianoPatricio/zsl-methods","repo_kind":"listed","path":"CE-GSZL/CE-GZSL-adapted/classifier_embed_contras.py","file_url":"https://github.com/CristianoPatricio/zsl-methods/blob/HEAD/CE-GSZL/CE-GZSL-adapted/classifier_embed_contras.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":"741735399d42d232"}},{"code_sha256_prefix":"7ac965f971d0020b","entry":"map_label","repo":"Huihui-z/CE-GZSL","repo_kind":"listed","path":"util.py","file_url":"https://github.com/Huihui-z/CE-GZSL/blob/HEAD/util.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ac965f971d0020b"}},{"code_sha256_prefix":"81abc9d73e3da3e6","entry":"reparameter","repo":"Huihui-z/CE-GZSL","repo_kind":"listed","path":"model.py","file_url":"https://github.com/Huihui-z/CE-GZSL/blob/HEAD/model.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"81abc9d73e3da3e6"}},{"code_sha256_prefix":"84573808f233b8cb","entry":"CLASSIFIER","repo":"CristianoPatricio/zsl-methods","repo_kind":"listed","path":"CE-GSZL/CE-GZSL-adapted/classifier_embed_contras.py","file_url":"https://github.com/CristianoPatricio/zsl-methods/blob/HEAD/CE-GSZL/CE-GZSL-adapted/classifier_embed_contras.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":"84573808f233b8cb"}},{"code_sha256_prefix":"6435a81f35d7cc50","entry":"create_logger","repo":"Hanzy1996/CE-GZSL","repo_kind":"official","path":"logger.py","file_url":"https://github.com/Hanzy1996/CE-GZSL/blob/HEAD/logger.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":"6435a81f35d7cc50"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}