{"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/rethinking-the-effect-of-data-augmentation-in","title":"Rethinking the Effect of Data Augmentation in Adversarial Contrastive Learning","arxiv_id":"2303.01289","date":"2023-03-02","proceeding":null,"authors":["Rundong Luo","Yifei Wang","Yisen Wang"],"abstract":"Recent works have shown that self-supervised learning can achieve remarkable robustness when integrated with adversarial training (AT). However, the robustness gap between supervised AT (sup-AT) and self-supervised AT (self-AT) remains significant. Motivated by this observation, we revisit existing self-AT methods and discover an inherent dilemma that affects self-AT robustness: either strong or weak data augmentations are harmful to self-AT, and a medium strength is insufficient to bridge the gap. To resolve this dilemma, we propose a simple remedy named DYNACL (Dynamic Adversarial Contrastive Learning). In particular, we propose an augmentation schedule that gradually anneals from a strong augmentation to a weak one to benefit from both extreme cases. Besides, we adopt a fast post-processing stage for adapting it to downstream tasks. Through extensive experiments, we show that DYNACL can improve state-of-the-art self-AT robustness by 8.84% under Auto-Attack on the CIFAR-10 dataset, and can even outperform vanilla supervised adversarial training for the first time. Our code is available at \\url{https://github.com/PKU-ML/DYNACL}.","url_abs":"https://arxiv.org/abs/2303.01289v2","url_pdf":"https://arxiv.org/pdf/2303.01289v2.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":"rethinking-the-effect-of-data-augmentation-in","repo_url":"https://github.com/pku-ml/dynacl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.01289","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.01289"}},"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/PKU-ML/DYNACL","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pku-ml/dynacl","reach":{"status":"ok"}}],"summary":{"unverified":10},"by_repo_kind":{"official":{"samples":10,"ran":0,"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":10,"samples":[{"code_sha256_prefix":"eab4871a4e41ef63","entry":"PGD_contrastive","repo":"pku-ml/dynacl","repo_kind":"official","path":"train_DynACL.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/train_DynACL.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":"eab4871a4e41ef63"}},{"code_sha256_prefix":"f9aee0a7d5571cc8","entry":"PGD_contrastive","repo":"pku-ml/dynacl","repo_kind":"official","path":"train_DynACL.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/train_DynACL.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":"f9aee0a7d5571cc8"}},{"code_sha256_prefix":"71d7a5fe7208bd5b","entry":"train","repo":"pku-ml/dynacl","repo_kind":"official","path":"train_DynACL.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/train_DynACL.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":"71d7a5fe7208bd5b"}},{"code_sha256_prefix":"21ded214fa0c58f4","entry":"train","repo":"pku-ml/dynacl","repo_kind":"official","path":"LPAFT.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/LPAFT.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":"21ded214fa0c58f4"}},{"code_sha256_prefix":"adfc6498df48c365","entry":"train","repo":"pku-ml/dynacl","repo_kind":"official","path":"LPAFT_AFF.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/LPAFT_AFF.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":"adfc6498df48c365"}},{"code_sha256_prefix":"86a8813c1ea89045","entry":"train","repo":"pku-ml/dynacl","repo_kind":"official","path":"train_DynACL.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/train_DynACL.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":"86a8813c1ea89045"}},{"code_sha256_prefix":"ce621e27660c3383","entry":"train_head","repo":"pku-ml/dynacl","repo_kind":"official","path":"LPAFT.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/LPAFT.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":"ce621e27660c3383"}},{"code_sha256_prefix":"f7e78f7868dd48c7","entry":"train_head","repo":"pku-ml/dynacl","repo_kind":"official","path":"LPAFT_AFF.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/LPAFT_AFF.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":"f7e78f7868dd48c7"}},{"code_sha256_prefix":"9040321f6a02a4c0","entry":"validate","repo":"pku-ml/dynacl","repo_kind":"official","path":"train_DynACL.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/train_DynACL.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":"9040321f6a02a4c0"}},{"code_sha256_prefix":"8c927972c0406923","entry":"validate","repo":"pku-ml/dynacl","repo_kind":"official","path":"LPAFT_AFF.py","file_url":"https://github.com/pku-ml/dynacl/blob/HEAD/LPAFT_AFF.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":"8c927972c0406923"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}