{"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/adversarial-training-on-purification-atop","title":"Adversarial Training on Purification (AToP): Advancing Both Robustness and Generalization","arxiv_id":"2401.16352","date":"2024-01-29","proceeding":null,"authors":["Guang Lin","Chao Li","Jianhai Zhang","Toshihisa Tanaka","Qibin Zhao"],"abstract":"The deep neural networks are known to be vulnerable to well-designed adversarial attacks. The most successful defense technique based on adversarial training (AT) can achieve optimal robustness against particular attacks but cannot generalize well to unseen attacks. Another effective defense technique based on adversarial purification (AP) can enhance generalization but cannot achieve optimal robustness. Meanwhile, both methods share one common limitation on the degraded standard accuracy. To mitigate these issues, we propose a novel pipeline to acquire the robust purifier model, named Adversarial Training on Purification (AToP), which comprises two components: perturbation destruction by random transforms (RT) and purifier model fine-tuned (FT) by adversarial loss. RT is essential to avoid overlearning to known attacks, resulting in the robustness generalization to unseen attacks, and FT is essential for the improvement of robustness. To evaluate our method in an efficient and scalable way, we conduct extensive experiments on CIFAR-10, CIFAR-100, and ImageNette to demonstrate that our method achieves optimal robustness and exhibits generalization ability against unseen attacks.","url_abs":"https://arxiv.org/abs/2401.16352v4","url_pdf":"https://arxiv.org/pdf/2401.16352v4.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":"adversarial-training-on-purification-atop","repo_url":"https://github.com/glin2022/atop","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"adversarial-purification","task_name":"Adversarial Purification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.16352","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.16352"}},"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/glin2022/atop","reach":{"status":"ok"}}],"summary":{"ran":10,"ran_fixture":2,"ran_honours":1,"ran_draft_wrong":1,"unverified":4},"by_repo_kind":{"official":{"samples":18,"ran":14,"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":18,"samples":[{"code_sha256_prefix":"101946f394ff2d40","entry":"adv_loss","repo":"glin2022/atop","repo_kind":"official","path":"torchattacks_local/stadv.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/torchattacks_local/stadv.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"101946f394ff2d40"}},{"code_sha256_prefix":"fb78a77b5eb800b5","entry":"compute_color","repo":"glin2022/atop","repo_kind":"official","path":"model/networks.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/networks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fb78a77b5eb800b5"}},{"code_sha256_prefix":"a56784666af5bd6d","entry":"downsample","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_classifier.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_classifier.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a56784666af5bd6d"}},{"code_sha256_prefix":"1704d0e302cf4139","entry":"flow_loss","repo":"glin2022/atop","repo_kind":"official","path":"torchattacks_local/stadv.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/torchattacks_local/stadv.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1704d0e302cf4139"}},{"code_sha256_prefix":"e82ba5f570765085","entry":"flow_to_image","repo":"glin2022/atop","repo_kind":"official","path":"model/networks.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/networks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e82ba5f570765085"}},{"code_sha256_prefix":"a59556109795f95c","entry":"get_logit","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_classifier.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_classifier.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a59556109795f95c"}},{"code_sha256_prefix":"137ebcbb6c6379a2","entry":"hinge_loss_d","repo":"glin2022/atop","repo_kind":"official","path":"model/losses.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"137ebcbb6c6379a2"}},{"code_sha256_prefix":"1fabc732ffcd8750","entry":"is_image_file","repo":"glin2022/atop","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/utils/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1fabc732ffcd8750"}},{"code_sha256_prefix":"195d635db8eb778b","entry":"lerp_clip","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_net.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_net.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"195d635db8eb778b"}},{"code_sha256_prefix":"e18af9981db25101","entry":"ls_loss_d","repo":"glin2022/atop","repo_kind":"official","path":"model/losses.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e18af9981db25101"}},{"code_sha256_prefix":"24947afc30d8acc3","entry":"ls_loss_g","repo":"glin2022/atop","repo_kind":"official","path":"model/losses.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"24947afc30d8acc3"}},{"code_sha256_prefix":"d5eb57879ef1704e","entry":"max_res_from_state_dict","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_net.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_net.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d5eb57879ef1704e"}},{"code_sha256_prefix":"f321f54723433661","entry":"pil_loader","repo":"glin2022/atop","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/utils/data.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f321f54723433661"}},{"code_sha256_prefix":"9b45cb80d93fe980","entry":"wrapper_method","repo":"glin2022/atop","repo_kind":"official","path":"torchattacks_local/attack.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/torchattacks_local/attack.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9b45cb80d93fe980"}},{"code_sha256_prefix":"1beef8065a504d20","entry":"flow_st","repo":"glin2022/atop","repo_kind":"official","path":"torchattacks_local/stadv.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/torchattacks_local/stadv.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":"1beef8065a504d20"}},{"code_sha256_prefix":"0dd156dfa78cac88","entry":"from_state_dict","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_net.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_net.py","link_basis":"harvester_set","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":"0dd156dfa78cac88"}},{"code_sha256_prefix":"6a3bd6aafe71b50e","entry":"get_softmaxed","repo":"glin2022/atop","repo_kind":"official","path":"classifiers/attribute_classifier.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/classifiers/attribute_classifier.py","link_basis":"plan_row","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":"6a3bd6aafe71b50e"}},{"code_sha256_prefix":"0303f947b7d3c5d4","entry":"output_to_image","repo":"glin2022/atop","repo_kind":"official","path":"model/networks.py","file_url":"https://github.com/glin2022/atop/blob/HEAD/model/networks.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":"0303f947b7d3c5d4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}