{"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/hierarchical-visual-primitive-experts-for","title":"Hierarchical Visual Primitive Experts for Compositional Zero-Shot Learning","arxiv_id":"2308.04016","date":"2023-08-08","proceeding":"ICCV 2023 1","authors":["Hanjae Kim","Jiyoung Lee","Seongheon Park","Kwanghoon Sohn"],"abstract":"Compositional zero-shot learning (CZSL) aims to recognize unseen compositions with prior knowledge of known primitives (attribute and object). Previous works for CZSL often suffer from grasping the contextuality between attribute and object, as well as the discriminability of visual features, and the long-tailed distribution of real-world compositional data. We propose a simple and scalable framework called Composition Transformer (CoT) to address these issues. CoT employs object and attribute experts in distinctive manners to generate representative embeddings, using the visual network hierarchically. The object expert extracts representative object embeddings from the final layer in a bottom-up manner, while the attribute expert makes attribute embeddings in a top-down manner with a proposed object-guided attention module that models contextuality explicitly. To remedy biased prediction caused by imbalanced data distribution, we develop a simple minority attribute augmentation (MAA) that synthesizes virtual samples by mixing two images and oversampling minority attribute classes. Our method achieves SoTA performance on several benchmarks, including MIT-States, C-GQA, and VAW-CZSL. We also demonstrate the effectiveness of CoT in improving visual discrimination and addressing the model bias from the imbalanced data distribution. The code is available at https://github.com/HanjaeKim98/CoT.","url_abs":"https://arxiv.org/abs/2308.04016v1","url_pdf":"https://arxiv.org/pdf/2308.04016v1.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":"hierarchical-visual-primitive-experts-for","repo_url":"https://github.com/hanjaekim98/cot","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"compositional-zero-shot-learning","task_name":"Compositional Zero-Shot Learning"},{"task_slug":"object","task_name":"Object"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.04016","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.04016"}},"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/hanjaekim98/cot","reach":{"status":"ok"}}],"summary":{"ran_honours":1,"ran":7,"ran_draft_wrong":1,"ran_fixture":2,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"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":12,"samples":[{"code_sha256_prefix":"91d26d98a8c2bcac","entry":"as_tuple","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/vit_utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/vit_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"91d26d98a8c2bcac"}},{"code_sha256_prefix":"77dc755eec4b339c","entry":"calculate_mean_std","repo":"hanjaekim98/cot","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"77dc755eec4b339c"}},{"code_sha256_prefix":"86116ff1c363bbaf","entry":"cross_entropy_loss","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/cot.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/cot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"86116ff1c363bbaf"}},{"code_sha256_prefix":"940661961d8b8781","entry":"drop_head_variant","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/configs.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/configs.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"940661961d8b8781"}},{"code_sha256_prefix":"808faf881ac6c7d4","entry":"imagenet_transform","repo":"hanjaekim98/cot","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/dataset.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":"808faf881ac6c7d4"}},{"code_sha256_prefix":"c6872fbfb83dc783","entry":"imagenet_transform_zappos","repo":"hanjaekim98/cot","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/dataset.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":"c6872fbfb83dc783"}},{"code_sha256_prefix":"4cb49866c5980797","entry":"load_pretrained_weights","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/vit_utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/vit_utils.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":"4cb49866c5980797"}},{"code_sha256_prefix":"d5e69fc7b0ee7c8c","entry":"merge_last","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/vit_transformer.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/vit_transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d5e69fc7b0ee7c8c"}},{"code_sha256_prefix":"68994a7ec705cdf0","entry":"reshape_text_features_to_concat","repo":"hanjaekim98/cot","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/utils/utils.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":"68994a7ec705cdf0"}},{"code_sha256_prefix":"6996b83764f078e7","entry":"resize_positional_embedding_","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/vit_utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/vit_utils.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":"6996b83764f078e7"}},{"code_sha256_prefix":"a4a5354a3138c8ef","entry":"split_last","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/vit_transformer.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/vit_transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4a5354a3138c8ef"}},{"code_sha256_prefix":"020abdfee6c97495","entry":"load_word_embeddings","repo":"hanjaekim98/cot","repo_kind":"official","path":"models/word_embedding_utils.py","file_url":"https://github.com/hanjaekim98/cot/blob/HEAD/models/word_embedding_utils.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":"020abdfee6c97495"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}