{"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/how-sampling-impacts-the-robustness-of","title":"How Sampling Impacts the Robustness of Stochastic Neural Networks","arxiv_id":"2204.10839","date":"2022-04-22","proceeding":null,"authors":["Sina Däubener","Asja Fischer"],"abstract":"Stochastic neural networks (SNNs) are random functions whose predictions are gained by averaging over multiple realizations. Consequently, a gradient-based adversarial example is calculated based on one set of samples and its classification on another set. In this paper, we derive a sufficient condition for such a stochastic prediction to be robust against a given sample-based attack. This allows us to identify the factors that lead to an increased robustness of SNNs and gives theoretical explanations for: (i) the well known observation, that increasing the amount of samples drawn for the estimation of adversarial examples increases the attack's strength, (ii) why increasing the number of samples during an attack can not fully reduce the effect of stochasticity, (iii) why the sample size during inference does not influence the robustness, and (iv) why a higher gradient variance and a shorter expected value of the gradient relates to a higher robustness. Our theoretical findings give a unified view on the mechanisms underlying previously proposed approaches for increasing attack strengths or model robustness and are verified by an extensive empirical analysis.","url_abs":"https://arxiv.org/abs/2204.10839v2","url_pdf":"https://arxiv.org/pdf/2204.10839v2.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":[],"tasks":[{"task_slug":"adversarial-attack","task_name":"Adversarial Attack"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2204.10839","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.10839"}},"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/meliketoy/wide-resnet.pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_honours":1,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":5,"ran":2,"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":"00e569acd6b45ef0","entry":"conv3x3","repo":"meliketoy/wide-resnet.pytorch","repo_kind":"found_in_text","path":"networks/wide_resnet.py","file_url":"https://github.com/meliketoy/wide-resnet.pytorch/blob/HEAD/networks/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":"00e569acd6b45ef0"}},{"code_sha256_prefix":"bb104479d26e39c3","entry":"get_hms","repo":"meliketoy/wide-resnet.pytorch","repo_kind":"found_in_text","path":"config.py","file_url":"https://github.com/meliketoy/wide-resnet.pytorch/blob/HEAD/config.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bb104479d26e39c3"}},{"code_sha256_prefix":"5bf5755e73275b29","entry":"cfg","repo":"meliketoy/wide-resnet.pytorch","repo_kind":"found_in_text","path":"networks/resnet.py","file_url":"https://github.com/meliketoy/wide-resnet.pytorch/blob/HEAD/networks/resnet.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":"5bf5755e73275b29"}},{"code_sha256_prefix":"39ded92dbd260902","entry":"cfg","repo":"meliketoy/wide-resnet.pytorch","repo_kind":"found_in_text","path":"networks/vggnet.py","file_url":"https://github.com/meliketoy/wide-resnet.pytorch/blob/HEAD/networks/vggnet.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":"39ded92dbd260902"}},{"code_sha256_prefix":"947a620765d795b2","entry":"learning_rate","repo":"meliketoy/wide-resnet.pytorch","repo_kind":"found_in_text","path":"config.py","file_url":"https://github.com/meliketoy/wide-resnet.pytorch/blob/HEAD/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":"947a620765d795b2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}