{"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/learning-attention-as-disentangler-for","title":"Learning Attention as Disentangler for Compositional Zero-shot Learning","arxiv_id":"2303.15111","date":"2023-03-27","proceeding":"CVPR 2023 1","authors":["Shaozhe Hao","Kai Han","Kwan-Yee K. Wong"],"abstract":"Compositional zero-shot learning (CZSL) aims at learning visual concepts (i.e., attributes and objects) from seen compositions and combining concept knowledge into unseen compositions. The key to CZSL is learning the disentanglement of the attribute-object composition. To this end, we propose to exploit cross-attentions as compositional disentanglers to learn disentangled concept embeddings. For example, if we want to recognize an unseen composition \"yellow flower\", we can learn the attribute concept \"yellow\" and object concept \"flower\" from different yellow objects and different flowers respectively. To further constrain the disentanglers to learn the concept of interest, we employ a regularization at the attention level. Specifically, we adapt the earth mover's distance (EMD) as a feature similarity metric in the cross-attention module. Moreover, benefiting from concept disentanglement, we improve the inference process and tune the prediction score by combining multiple concept probabilities. Comprehensive experiments on three CZSL benchmark datasets demonstrate that our method significantly outperforms previous works in both closed- and open-world settings, establishing a new state-of-the-art.","url_abs":"https://arxiv.org/abs/2303.15111v1","url_pdf":"https://arxiv.org/pdf/2303.15111v1.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":"learning-attention-as-disentangler-for","repo_url":"https://github.com/haoosz/ade-czsl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"compositional-zero-shot-learning","task_name":"Compositional Zero-Shot Learning"},{"task_slug":"disentanglement","task_name":"Disentanglement"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.15111","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.15111"}},"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/haoosz/ade-czsl","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_fixture":3,"unverified":6},"by_repo_kind":{"official":{"samples":11,"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":0,"samples":[{"code_sha256_prefix":"e1f2aca5ffc5a9b3","entry":"calculate_margines","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/common.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/common.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":"e1f2aca5ffc5a9b3"}},{"code_sha256_prefix":"7388b930197b0c81","entry":"compute_cosine_similarity","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/ade.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/ade.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":"7388b930197b0c81"}},{"code_sha256_prefix":"55120f2026b56aa2","entry":"drop_path","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/multi_head_attention.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/multi_head_attention.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"55120f2026b56aa2"}},{"code_sha256_prefix":"59725ffc3ce58459","entry":"same_domain_triplet_loss","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/common.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/common.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":"59725ffc3ce58459"}},{"code_sha256_prefix":"915b71e73a54fc97","entry":"trunc_normal_","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/vision_transformer.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/vision_transformer.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":"915b71e73a54fc97"}},{"code_sha256_prefix":"7f600db4d6fef4ee","entry":"cos_logits","repo":"haoosz/ade-czsl","repo_kind":"official","path":"visual_concept_retrieval.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/visual_concept_retrieval.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":"7f600db4d6fef4ee"}},{"code_sha256_prefix":"829d4aa345489492","entry":"emd_inference_opencv","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/emd_utils.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/emd_utils.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":"829d4aa345489492"}},{"code_sha256_prefix":"4d2e05bc40a813cc","entry":"emd_inference_opencv_test","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/emd_utils.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/emd_utils.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":"4d2e05bc40a813cc"}},{"code_sha256_prefix":"7dacb21751b86b46","entry":"get_image_extractor","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/image_extractor.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/image_extractor.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":"7dacb21751b86b46"}},{"code_sha256_prefix":"2a1c66c4d01008db","entry":"l2_all_batched","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/common.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/common.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":"2a1c66c4d01008db"}},{"code_sha256_prefix":"f7bba5d7d89fc9dc","entry":"vit_tiny","repo":"haoosz/ade-czsl","repo_kind":"official","path":"models/vision_transformer.py","file_url":"https://github.com/haoosz/ade-czsl/blob/HEAD/models/vision_transformer.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":"f7bba5d7d89fc9dc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}