{"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/a-causal-inspired-early-branching-structure","title":"A Causal Inspired Early-Branching Structure for Domain Generalization","arxiv_id":"2403.08649","date":"2024-03-13","proceeding":null,"authors":["Liang Chen","Yong Zhang","Yibing Song","Zhen Zhang","Lingqiao Liu"],"abstract":"Learning domain-invariant semantic representations is crucial for achieving domain generalization (DG), where a model is required to perform well on unseen target domains. One critical challenge is that standard training often results in entangled semantic and domain-specific features. Previous works suggest formulating the problem from a causal perspective and solving the entanglement problem by enforcing marginal independence between the causal (\\ie semantic) and non-causal (\\ie domain-specific) features. Despite its simplicity, the basic marginal independent-based idea alone may be insufficient to identify the causal feature. By d-separation, we observe that the causal feature can be further characterized by being independent of the domain conditioned on the object, and we propose the following two strategies as complements for the basic framework. First, the observation implicitly implies that for the same object, the causal feature should not be associated with the non-causal feature, revealing that the common practice of obtaining the two features with a shared base feature extractor and two lightweight prediction heads might be inappropriate. To meet the constraint, we propose a simple early-branching structure, where the causal and non-causal feature obtaining branches share the first few blocks while diverging thereafter, for better structure design; Second, the observation implies that the causal feature remains invariant across different domains for the same object. To this end, we suggest that augmentation should be incorporated into the framework to better characterize the causal feature, and we further suggest an effective random domain sampling scheme to fulfill the task. Theoretical and experimental results show that the two strategies are beneficial for the basic marginal independent-based framework. Code is available at \\url{https://github.com/liangchen527/CausEB}.","url_abs":"https://arxiv.org/abs/2403.08649v1","url_pdf":"https://arxiv.org/pdf/2403.08649v1.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":"a-causal-inspired-early-branching-structure","repo_url":"https://github.com/liangchen527/causeb","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"}],"methods":[{"method_slug":"base","method_name":"BASE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.08649","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.08649"}},"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/liangchen527/causeb","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":6,"ran":5,"unverified":4},"by_repo_kind":{"official":{"samples":14,"ran":10,"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":15,"samples":[{"code_sha256_prefix":"00e569acd6b45ef0","entry":"conv3x3","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/wide_resnet.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/wide_resnet.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":"00e569acd6b45ef0"}},{"code_sha256_prefix":"53fac8d8d949e72b","entry":"get_test_records","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/model_selection.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/model_selection.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"53fac8d8d949e72b"}},{"code_sha256_prefix":"71a3a61ceed99bf3","entry":"hashable","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/query.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/query.py","link_basis":"harvester_set","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":"71a3a61ceed99bf3"}},{"code_sha256_prefix":"160bb5f66cd8558e","entry":"kernelMatrixGaussian","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/hsic.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/hsic.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"160bb5f66cd8558e"}},{"code_sha256_prefix":"9ff5c4ac3b4e9b35","entry":"kernelMatrixLinear","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/hsic.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/hsic.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9ff5c4ac3b4e9b35"}},{"code_sha256_prefix":"8ac821ad6e7b6d96","entry":"l2_between_dicts","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/misc.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":"8ac821ad6e7b6d96"}},{"code_sha256_prefix":"2f8af5779e1edcb6","entry":"make_selector_fn","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/query.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/query.py","link_basis":"harvester_set","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":"2f8af5779e1edcb6"}},{"code_sha256_prefix":"5f576ed342c48a0a","entry":"make_weights_for_balanced_classes","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/misc.py","link_basis":"plan_row","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":"5f576ed342c48a0a"}},{"code_sha256_prefix":"21bf8deeec959d90","entry":"pairwise_distances","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/hsic.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/hsic.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"21bf8deeec959d90"}},{"code_sha256_prefix":"196cab71d7129d62","entry":"remove_batch_norm_from_resnet","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/networks.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/networks.py","link_basis":"harvester_set","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":"196cab71d7129d62"}},{"code_sha256_prefix":"c631ff42fed59f21","entry":"stage_path","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"c631ff42fed59f21"}},{"code_sha256_prefix":"9ef5244f56f6348e","entry":"Featurizer_OTHMix","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/networks.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/networks.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":"9ef5244f56f6348e"}},{"code_sha256_prefix":"d0ea85d74c20dea9","entry":"get_dataset_class","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/datasets.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/datasets.py","link_basis":"harvester_set","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":"d0ea85d74c20dea9"}},{"code_sha256_prefix":"73f32252eedba6a4","entry":"num_environments","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/datasets.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/datasets.py","link_basis":"harvester_set","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":"73f32252eedba6a4"}},{"code_sha256_prefix":"af3c9a80c8fd1f7a","entry":"print_row","repo":"liangchen527/causeb","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/liangchen527/causeb/blob/HEAD/domainbed/lib/misc.py","link_basis":"plan_row","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":"af3c9a80c8fd1f7a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}