{"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/demystifying-the-adversarial-robustness-of-1","title":"Demystifying the Adversarial Robustness of Random Transformation Defenses","arxiv_id":"2207.03574","date":"2022-06-18","proceeding":"AAAI Workshop AdvML 2022 2","authors":["Chawin Sitawarin","Zachary Golan-Strieb","David Wagner"],"abstract":"Neural networks' lack of robustness against attacks raises concerns in security-sensitive settings such as autonomous vehicles. While many countermeasures may look promising, only a few withstand rigorous evaluation. Defenses using random transformations (RT) have shown impressive results, particularly BaRT (Raff et al., 2019) on ImageNet. However, this type of defense has not been rigorously evaluated, leaving its robustness properties poorly understood. Their stochastic properties make evaluation more challenging and render many proposed attacks on deterministic models inapplicable. First, we show that the BPDA attack (Athalye et al., 2018a) used in BaRT's evaluation is ineffective and likely overestimates its robustness. We then attempt to construct the strongest possible RT defense through the informed selection of transformations and Bayesian optimization for tuning their parameters. Furthermore, we create the strongest possible attack to evaluate our RT defense. Our new attack vastly outperforms the baseline, reducing the accuracy by 83% compared to the 19% reduction by the commonly used EoT attack ($4.3\\times$ improvement). Our result indicates that the RT defense on the Imagenette dataset (a ten-class subset of ImageNet) is not robust against adversarial examples. Extending the study further, we use our new attack to adversarially train RT defense (called AdvRT), resulting in a large robustness gain. Code is available at https://github.com/wagner-group/demystify-random-transform.","url_abs":"https://arxiv.org/abs/2207.03574v2","url_pdf":"https://arxiv.org/pdf/2207.03574v2.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":"demystifying-the-adversarial-robustness-of-1","repo_url":"https://github.com/wagner-group/demystify-random-transform","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"adversarial-robustness","task_name":"Adversarial Robustness"},{"task_slug":"autonomous-vehicles","task_name":"Autonomous Vehicles"},{"task_slug":"bayesian-optimization","task_name":"Bayesian Optimization"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bart","method_name":"BART"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2207.03574","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.03574"}},"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/wagnergroup/demystify-random-transform","reach":{"status":"gone","observed_at":"2026-09-17","how":"tree_404+repo_404"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wagner-group/demystify-random-transform","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":"8b0e794d4d8f9b13","entry":"default_conv","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/models/edsr.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/models/edsr.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":"8b0e794d4d8f9b13"}},{"code_sha256_prefix":"bee25bf71d9c3982","entry":"add_normalization","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/models/model_utils.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/models/model_utils.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":"bee25bf71d9c3982"}},{"code_sha256_prefix":"41b93da2bb253ac1","entry":"apply_module","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/apply_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/apply_transform.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":"41b93da2bb253ac1"}},{"code_sha256_prefix":"569bf6f75b0e7978","entry":"apply_module_normalize","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/apply_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/apply_transform.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":"569bf6f75b0e7978"}},{"code_sha256_prefix":"23bcc5c1f6613e23","entry":"create_model","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/models/model_utils.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/models/model_utils.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":"23bcc5c1f6613e23"}},{"code_sha256_prefix":"8b8ed141e5ac52c7","entry":"diff_round","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/utils.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/utils.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":"8b8ed141e5ac52c7"}},{"code_sha256_prefix":"479519ca1a08f97e","entry":"evaluate","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"train_bpda.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/train_bpda.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":"479519ca1a08f97e"}},{"code_sha256_prefix":"f80a1900ef60f141","entry":"forward","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"train_bpda.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/train_bpda.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":"f80a1900ef60f141"}},{"code_sha256_prefix":"0aff09aba250ae83","entry":"from_numpy","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/utils.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/utils.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":"0aff09aba250ae83"}},{"code_sha256_prefix":"497e85820f3df092","entry":"init_filter_box","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/init_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/init_transform.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":"497e85820f3df092"}},{"code_sha256_prefix":"f88119c6237118b9","entry":"init_horizontal_flip","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/init_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/init_transform.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":"f88119c6237118b9"}},{"code_sha256_prefix":"897337b530ef2ec2","entry":"init_vertical_flip","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/init_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/init_transform.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":"897337b530ef2ec2"}},{"code_sha256_prefix":"4efb1ee9419b32b9","entry":"to_numpy","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/utils.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/utils.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":"4efb1ee9419b32b9"}},{"code_sha256_prefix":"95155e6a7662dd5b","entry":"train","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"train_bpda.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/train_bpda.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":"95155e6a7662dd5b"}},{"code_sha256_prefix":"cab1395888c19cc5","entry":"transform_affine","repo":"wagner-group/demystify-random-transform","repo_kind":"official","path":"adv/wrappers/transform/apply_transform.py","file_url":"https://github.com/wagner-group/demystify-random-transform/blob/HEAD/adv/wrappers/transform/apply_transform.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":"cab1395888c19cc5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}