{"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/attention-consistency-on-visual-corruptions","title":"Attention Consistency on Visual Corruptions for Single-Source Domain Generalization","arxiv_id":"2204.13091","date":"2022-04-27","proceeding":null,"authors":["Ilke Cugu","Massimiliano Mancini","Yanbei Chen","Zeynep Akata"],"abstract":"Generalizing visual recognition models trained on a single distribution to unseen input distributions (i.e. domains) requires making them robust to superfluous correlations in the training set. In this work, we achieve this goal by altering the training images to simulate new domains and imposing consistent visual attention across the different views of the same sample. We discover that the first objective can be simply and effectively met through visual corruptions. Specifically, we alter the content of the training images using the nineteen corruptions of the ImageNet-C benchmark and three additional transformations based on Fourier transform. Since these corruptions preserve object locations, we propose an attention consistency loss to ensure that class activation maps across original and corrupted versions of the same training sample are aligned. We name our model Attention Consistency on Visual Corruptions (ACVC). We show that ACVC consistently achieves the state of the art on three single-source domain generalization benchmarks, PACS, COCO, and the large-scale DomainNet.","url_abs":"https://arxiv.org/abs/2204.13091v1","url_pdf":"https://arxiv.org/pdf/2204.13091v1.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":"attention-consistency-on-visual-corruptions","repo_url":"https://github.com/explainableml/acvc","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"single-source-domain-generalization","task_name":"Single-Source Domain Generalization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2204.13091","atlas_url":"https://app.syntology.ai/?focus=2204.13091","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.13091"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/explainableml/acvc","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran_honours":2,"ran":3,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":8,"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":"d9def42110729a85","entry":"conv1x1","repo":"explainableml/acvc","repo_kind":"official","path":"models/ResNet.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/models/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d9def42110729a85"}},{"code_sha256_prefix":"160bb14bd76201b4","entry":"conv3x3","repo":"explainableml/acvc","repo_kind":"official","path":"models/ResNet.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/models/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"160bb14bd76201b4"}},{"code_sha256_prefix":"9f75cd937e9f1824","entry":"float_parameter","repo":"explainableml/acvc","repo_kind":"official","path":"preprocessing/image/AugMixGenerator.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/preprocessing/image/AugMixGenerator.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9f75cd937e9f1824"}},{"code_sha256_prefix":"fa762f2f1e10f2e4","entry":"int_parameter","repo":"explainableml/acvc","repo_kind":"official","path":"preprocessing/image/AugMixGenerator.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/preprocessing/image/AugMixGenerator.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fa762f2f1e10f2e4"}},{"code_sha256_prefix":"49724493bcf93fbe","entry":"normalize_dataset","repo":"explainableml/acvc","repo_kind":"official","path":"preprocessing/Datasets.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/preprocessing/Datasets.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":"49724493bcf93fbe"}},{"code_sha256_prefix":"23d5781026b28cf9","entry":"preprocess_dataset","repo":"explainableml/acvc","repo_kind":"official","path":"preprocessing/Datasets.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/preprocessing/Datasets.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":"23d5781026b28cf9"}},{"code_sha256_prefix":"5cc8d4764ac07a35","entry":"sample_level","repo":"explainableml/acvc","repo_kind":"official","path":"preprocessing/image/AugMixGenerator.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/preprocessing/image/AugMixGenerator.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5cc8d4764ac07a35"}},{"code_sha256_prefix":"69fd1b13314bea89","entry":"to_scientific","repo":"explainableml/acvc","repo_kind":"official","path":"tools.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/tools.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":"69fd1b13314bea89"}},{"code_sha256_prefix":"ad4fc71a6c6893b8","entry":"get_arch_name","repo":"explainableml/acvc","repo_kind":"official","path":"tools.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/tools.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":"ad4fc71a6c6893b8"}},{"code_sha256_prefix":"af479d88352e71eb","entry":"resize_image","repo":"explainableml/acvc","repo_kind":"official","path":"tools.py","file_url":"https://github.com/explainableml/acvc/blob/HEAD/tools.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":"af479d88352e71eb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}