{"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-domain-generalization-via-logit","title":"Consistency Regularization for Domain Generalization with Logit Attribution Matching","arxiv_id":"2305.07888","date":"2023-05-13","proceeding":null,"authors":["Han Gao","Kaican Li","Weiyan Xie","Zhi Lin","Yongxiang Huang","Luning Wang","Caleb Chen Cao","Nevin L. Zhang"],"abstract":"Domain generalization (DG) is about training models that generalize well under domain shift. Previous research on DG has been conducted mostly in single-source or multi-source settings. In this paper, we consider a third, lesser-known setting where a training domain is endowed with a collection of pairs of examples that share the same semantic information. Such semantic sharing (SS) pairs can be created via data augmentation and then utilized for consistency regularization (CR). We present a theory showing CR is conducive to DG and propose a novel CR method called Logit Attribution Matching (LAM). We conduct experiments on five DG benchmarks and four pretrained models with SS pairs created by both generic and targeted data augmentation methods. LAM outperforms representative single/multi-source DG methods and various CR methods that leverage SS pairs. The code and data of this project are available at https://github.com/Gaohan123/LAM","url_abs":"https://arxiv.org/abs/2305.07888v2","url_pdf":"https://arxiv.org/pdf/2305.07888v2.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-domain-generalization-via-logit","repo_url":"https://github.com/gaohan123/lam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.07888","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.07888"}},"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/gaohan123/lam","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":11},"by_repo_kind":{"official":{"samples":11,"ran":0,"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":"2004e8d9ede9e29c","entry":"build_model","repo":"gaohan123/lam","repo_kind":"official","path":"src/models/model_utils.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/src/models/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2004e8d9ede9e29c"}},{"code_sha256_prefix":"8d54de902865d503","entry":"copy_paste_augmentation","repo":"gaohan123/lam","repo_kind":"official","path":"train_lam.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/train_lam.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8d54de902865d503"}},{"code_sha256_prefix":"bada690a17a379cb","entry":"get_argmax_valid","repo":"gaohan123/lam","repo_kind":"official","path":"utils.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bada690a17a379cb"}},{"code_sha256_prefix":"7a5537948fe58d0d","entry":"get_bbox","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/wild_mask_bbox.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/wild_mask_bbox.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7a5537948fe58d0d"}},{"code_sha256_prefix":"8861e302edc9b24c","entry":"get_empty_img_by_y","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/select_bg.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/select_bg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8861e302edc9b24c"}},{"code_sha256_prefix":"05ae9c1f9ae97e0b","entry":"get_mask","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/wild_mask_bbox.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/wild_mask_bbox.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"05ae9c1f9ae97e0b"}},{"code_sha256_prefix":"d13d13177ef6bd70","entry":"get_param_weights_counts","repo":"gaohan123/lam","repo_kind":"official","path":"src/models/model_utils.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/src/models/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d13d13177ef6bd70"}},{"code_sha256_prefix":"b34edff3ffec4fa0","entry":"isin","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/select_bg.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/select_bg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b34edff3ffec4fa0"}},{"code_sha256_prefix":"0de6908df376c724","entry":"make_checkpoints_dir","repo":"gaohan123/lam","repo_kind":"official","path":"utils.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0de6908df376c724"}},{"code_sha256_prefix":"0e2fc0ac5d13251f","entry":"sample_empty_img_given_mask","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/select_bg.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/select_bg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0e2fc0ac5d13251f"}},{"code_sha256_prefix":"427485a15e05cc2c","entry":"xywh_to_xyxy","repo":"gaohan123/lam","repo_kind":"official","path":"copy_paste_aug/wild_mask_bbox.py","file_url":"https://github.com/gaohan123/lam/blob/HEAD/copy_paste_aug/wild_mask_bbox.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"427485a15e05cc2c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}