{"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/data-augmentation-alone-can-improve","title":"Data Augmentation Alone Can Improve Adversarial Training","arxiv_id":"2301.09879","date":"2023-01-24","proceeding":null,"authors":["Lin Li","Michael Spratling"],"abstract":"Adversarial training suffers from the issue of robust overfitting, which seriously impairs its generalization performance. Data augmentation, which is effective at preventing overfitting in standard training, has been observed by many previous works to be ineffective in mitigating overfitting in adversarial training. This work proves that, contrary to previous findings, data augmentation alone can significantly boost accuracy and robustness in adversarial training. We find that the hardness and the diversity of data augmentation are important factors in combating robust overfitting. In general, diversity can improve both accuracy and robustness, while hardness can boost robustness at the cost of accuracy within a certain limit and degrade them both over that limit. To mitigate robust overfitting, we first propose a new crop transformation, Cropshift, which has improved diversity compared to the conventional one (Padcrop). We then propose a new data augmentation scheme, based on Cropshift, with much improved diversity and well-balanced hardness. Empirically, our augmentation method achieves the state-of-the-art accuracy and robustness for data augmentations in adversarial training. Furthermore, when combined with weight averaging it matches, or even exceeds, the performance of the best contemporary regularization methods for alleviating robust overfitting. Code is available at: https://github.com/TreeLLi/DA-Alone-Improves-AT.","url_abs":"https://arxiv.org/abs/2301.09879v1","url_pdf":"https://arxiv.org/pdf/2301.09879v1.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":"data-augmentation-alone-can-improve","repo_url":"https://github.com/treelli/da-alone-improves-at","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"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=2301.09879","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2301.09879"}},"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/da-alone-improves-at","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"unverified":14},"by_repo_kind":{"official":{"samples":15,"ran":1,"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":"583f9780bdd00a45","entry":"conv3x3","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/model/wide_resnet.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/model/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"583f9780bdd00a45"}},{"code_sha256_prefix":"4fd5d1dd1a797d37","entry":"accuracy","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/helper.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/helper.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":"4fd5d1dd1a797d37"}},{"code_sha256_prefix":"37174e6f1756c905","entry":"check_bn","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/swa.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/swa.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":"37174e6f1756c905"}},{"code_sha256_prefix":"4e3bcb7fb6c461e4","entry":"complete_ids","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/log.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/log.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":"4e3bcb7fb6c461e4"}},{"code_sha256_prefix":"e7976a487657389f","entry":"gather_all","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/helper.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/helper.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":"e7976a487657389f"}},{"code_sha256_prefix":"eac0350365e31875","entry":"ids_from_idx","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/log.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/log.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":"eac0350365e31875"}},{"code_sha256_prefix":"c4060e502670b5cb","entry":"idx_from_ids","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/log.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/log.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":"c4060e502670b5cb"}},{"code_sha256_prefix":"b63f8dddc272ba67","entry":"input_grad","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/adversary.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":"b63f8dddc272ba67"}},{"code_sha256_prefix":"c4ff8c6f13f39bc5","entry":"perturb","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/adversary.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":"c4ff8c6f13f39bc5"}},{"code_sha256_prefix":"e36d3bdff03face5","entry":"pgd","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/adversary.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/adversary.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":"e36d3bdff03face5"}},{"code_sha256_prefix":"5d1ae0c45e71f173","entry":"pixel_2_real","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/config/config.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":"5d1ae0c45e71f173"}},{"code_sha256_prefix":"f33bd487ae731b24","entry":"real_2_pixel","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/config/config.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":"f33bd487ae731b24"}},{"code_sha256_prefix":"44448a225e87438a","entry":"reduce_all","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/helper.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/helper.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":"44448a225e87438a"}},{"code_sha256_prefix":"c4a5928bd44f924c","entry":"upper","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/config/config.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/config/config.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":"c4a5928bd44f924c"}},{"code_sha256_prefix":"d49988befbdccf83","entry":"word","repo":"treelli/da-alone-improves-at","repo_kind":"official","path":"src/utils/printer.py","file_url":"https://github.com/treelli/da-alone-improves-at/blob/HEAD/src/utils/printer.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":"d49988befbdccf83"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}