{"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/aroid-improving-adversarial-robustness","title":"AROID: Improving Adversarial Robustness Through Online Instance-Wise Data Augmentation","arxiv_id":"2306.07197","date":"2023-06-12","proceeding":null,"authors":["Lin Li","Jianing Qiu","Michael Spratling"],"abstract":"Deep neural networks are vulnerable to adversarial examples. Adversarial training (AT) is an effective defense against adversarial examples. However, AT is prone to overfitting which degrades robustness substantially. Recently, data augmentation (DA) was shown to be effective in mitigating robust overfitting if appropriately designed and optimized for AT. This work proposes a new method to automatically learn online, instance-wise, DA policies to improve robust generalization for AT. This is the first automated DA method specific for robustness. A novel policy learning objective, consisting of Vulnerability, Affinity and Diversity, is proposed and shown to be sufficiently effective and efficient to be practical for automatic DA generation during AT. Importantly, our method dramatically reduces the cost of policy search from the 5000 hours of AutoAugment and the 412 hours of IDBH to 9 hours, making automated DA more practical to use for adversarial robustness. This allows our method to efficiently explore a large search space for a more effective DA policy and evolve the policy as training progresses. Empirically, our method is shown to outperform all competitive DA methods across various model architectures and datasets. Our DA policy reinforced vanilla AT to surpass several state-of-the-art AT methods regarding both accuracy and robustness. It can also be combined with those advanced AT methods to further boost robustness. Code and pre-trained models are available at https://github.com/TreeLLi/AROID.","url_abs":"https://arxiv.org/abs/2306.07197v2","url_pdf":"https://arxiv.org/pdf/2306.07197v2.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":"aroid-improving-adversarial-robustness","repo_url":"https://github.com/treelli/aroid","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"adversarial-robustness","task_name":"Adversarial Robustness"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"diversity","task_name":"Diversity"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2306.07197","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.07197"}},"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/treelli/aroid","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":2,"ran_fixture":1,"unverified":8},"by_repo_kind":{"official":{"samples":13,"ran":5,"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":"4170809219439d13","entry":"diff_in_weights","repo":"treelli/aroid","repo_kind":"official","path":"src/utils/awp.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/utils/awp.py","link_basis":"plan_row","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":"4170809219439d13"}},{"code_sha256_prefix":"b2c121009a4b58c4","entry":"input_grad","repo":"treelli/aroid","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/utils/adversary.py","link_basis":"plan_row","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":"b2c121009a4b58c4"}},{"code_sha256_prefix":"109c74bc1997c975","entry":"resize_pos_embed","repo":"treelli/aroid","repo_kind":"official","path":"src/model/vit.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/vit.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":"109c74bc1997c975"}},{"code_sha256_prefix":"80c66c535be6f491","entry":"window_partition","repo":"treelli/aroid","repo_kind":"official","path":"src/model/swin.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/swin.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"80c66c535be6f491"}},{"code_sha256_prefix":"b83f31fb8b7c976a","entry":"window_reverse","repo":"treelli/aroid","repo_kind":"official","path":"src/model/swin.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/swin.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b83f31fb8b7c976a"}},{"code_sha256_prefix":"e8dd07fc6d086c08","entry":"checkpoint_filter_fn","repo":"treelli/aroid","repo_kind":"official","path":"src/model/vit.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/vit.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":"e8dd07fc6d086c08"}},{"code_sha256_prefix":"200044920f544f26","entry":"parse_log_id_from_ck_url","repo":"treelli/aroid","repo_kind":"official","path":"src/model/factory.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/factory.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":"200044920f544f26"}},{"code_sha256_prefix":"2ed1c4f9595c38a6","entry":"perturb","repo":"treelli/aroid","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/utils/adversary.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":"2ed1c4f9595c38a6"}},{"code_sha256_prefix":"2fc76dc36847c6db","entry":"pgd","repo":"treelli/aroid","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/utils/adversary.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":"2fc76dc36847c6db"}},{"code_sha256_prefix":"5d1ae0c45e71f173","entry":"pixel_2_real","repo":"treelli/aroid","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/config/config.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":"5d1ae0c45e71f173"}},{"code_sha256_prefix":"f33bd487ae731b24","entry":"real_2_pixel","repo":"treelli/aroid","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/config/config.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":"f33bd487ae731b24"}},{"code_sha256_prefix":"c4a5928bd44f924c","entry":"upper","repo":"treelli/aroid","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/config/config.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":"c4a5928bd44f924c"}},{"code_sha256_prefix":"8291f5e949c143e7","entry":"vit_base_patch16_224","repo":"treelli/aroid","repo_kind":"official","path":"src/model/vit.py","file_url":"https://github.com/treelli/aroid/blob/HEAD/src/model/vit.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":"8291f5e949c143e7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}