{"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/domain-generalization-using-causal-matching-1","title":"Domain Generalization using Causal Matching","arxiv_id":"2006.07500","date":"2020-06-12","proceeding":"arXiv 2020 6","authors":["Divyat Mahajan","Shruti Tople","Amit Sharma"],"abstract":"In the domain generalization literature, a common objective is to learn representations independent of the domain after conditioning on the class label. We show that this objective is not sufficient: there exist counter-examples where a model fails to generalize to unseen domains even after satisfying class-conditional domain invariance. We formalize this observation through a structural causal model and show the importance of modeling within-class variations for generalization. Specifically, classes contain objects that characterize specific causal features, and domains can be interpreted as interventions on these objects that change non-causal features. We highlight an alternative condition: inputs across domains should have the same representation if they are derived from the same object. Based on this objective, we propose matching-based algorithms when base objects are observed (e.g., through data augmentation) and approximate the objective when objects are not observed (MatchDG). Our simple matching-based algorithms are competitive to prior work on out-of-domain accuracy for rotated MNIST, Fashion-MNIST, PACS, and Chest-Xray datasets. Our method MatchDG also recovers ground-truth object matches: on MNIST and Fashion-MNIST, top-10 matches from MatchDG have over 50% overlap with ground-truth matches.","url_abs":"https://arxiv.org/abs/2006.07500v3","url_pdf":"https://arxiv.org/pdf/2006.07500v3.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":"domain-generalization-using-causal-matching-1","repo_url":"https://github.com/microsoft/robustdg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"rotated-mnist","task_name":"Rotated MNIST"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/domain-generalization-on-pacs-2","task":"Domain Generalization","dataset":"PACS","model":"MDG-Hybrid (ResNet-50)","rank_in_archive_order":37,"of":133,"metrics":{"Average Accuracy":"87.52"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-pacs-2","task":"Domain Generalization","dataset":"PACS","model":"MDG-Hybrid (Resnet-18)","rank_in_archive_order":62,"of":133,"metrics":{"Average Accuracy":"84.35"},"uses_additional_data":false},{"leaderboard":"/sota/domain-generalization-on-rotated-fashion","task":"Domain Generalization","dataset":"Rotated Fashion-MNIST","model":"MatchDG","rank_in_archive_order":1,"of":2,"metrics":{"Accuracy":"82.8"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2006.07500","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2006.07500"}},"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":"deterministic:regex_extraction","url":"https://github.com/microsoft/robustdg","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/vihari/CSD","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/biomedia-mira/masf","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/facebookresearch/InvariantRiskMinimization","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_fixture":3,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":9,"ran":4,"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":0,"samples":[{"code_sha256_prefix":"d7335824a1d78b44","entry":"conv_block","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7335824a1d78b44"}},{"code_sha256_prefix":"2ff962d151152c2e","entry":"dropout","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2ff962d151152c2e"}},{"code_sha256_prefix":"99c3561f7772f982","entry":"lrn","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"99c3561f7772f982"}},{"code_sha256_prefix":"8621037738dc0c34","entry":"max_pool","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8621037738dc0c34"}},{"code_sha256_prefix":"65a7aed081f03f65","entry":"MASF","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.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":"65a7aed081f03f65"}},{"code_sha256_prefix":"8ff91b49667f3978","entry":"ResNetCSD","repo":"vihari/CSD","repo_kind":"found_in_text","path":"pacs/models/resnet_csd.py","file_url":"https://github.com/vihari/CSD/blob/HEAD/pacs/models/resnet_csd.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":"8ff91b49667f3978"}},{"code_sha256_prefix":"eac7e24272801635","entry":"fc","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.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":"eac7e24272801635"}},{"code_sha256_prefix":"62dd1a96ab6840ef","entry":"kd","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.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":"62dd1a96ab6840ef"}},{"code_sha256_prefix":"0bf65cfc625e3b75","entry":"xent","repo":"biomedia-mira/masf","repo_kind":"found_in_text","path":"masf_func.py","file_url":"https://github.com/biomedia-mira/masf/blob/HEAD/masf_func.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":"0bf65cfc625e3b75"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}