{"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/attacking-binarized-neural-networks","title":"Attacking Binarized Neural Networks","arxiv_id":"1711.00449","date":"2017-11-01","proceeding":"ICLR 2018 1","authors":["Angus Galloway","Graham W. Taylor","Medhat Moussa"],"abstract":"Neural networks with low-precision weights and activations offer compelling\nefficiency advantages over their full-precision equivalents. The two most\nfrequently discussed benefits of quantization are reduced memory consumption,\nand a faster forward pass when implemented with efficient bitwise operations.\nWe propose a third benefit of very low-precision neural networks: improved\nrobustness against some adversarial attacks, and in the worst case, performance\nthat is on par with full-precision models. We focus on the very low-precision\ncase where weights and activations are both quantized to $\\pm$1, and note that\nstochastically quantizing weights in just one layer can sharply reduce the\nimpact of iterative attacks. We observe that non-scaled binary neural networks\nexhibit a similar effect to the original defensive distillation procedure that\nled to gradient masking, and a false notion of security. We address this by\nconducting both black-box and white-box experiments with binary models that do\nnot artificially mask gradients.","url_abs":"http://arxiv.org/abs/1711.00449v2","url_pdf":"http://arxiv.org/pdf/1711.00449v2.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":"attacking-binarized-neural-networks","repo_url":"https://github.com/AngusG/cleverhans-attacking-bnns","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1711.00449","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1711.00449"}},"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/AngusG/cleverhans-attacking-bnns","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"unverified":17},"by_repo_kind":{"official":{"samples":19,"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":18,"samples":[{"code_sha256_prefix":"96b581b6ac010981","entry":"batch_indices","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"96b581b6ac010981"}},{"code_sha256_prefix":"563a92a1c7232061","entry":"other_classes","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"563a92a1c7232061"}},{"code_sha256_prefix":"9a841e39a73659c0","entry":"batch_norm_relu","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans_tutorials/resnet_model.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans_tutorials/resnet_model.py","link_basis":"plan_row","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":"9a841e39a73659c0"}},{"code_sha256_prefix":"69dbec087f603dc2","entry":"cnn_model","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_keras.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_keras.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":false,"mcp_get_code":{"code_sha256":"69dbec087f603dc2"}},{"code_sha256_prefix":"4e8d1df070cb5f83","entry":"conv_2d","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_keras.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_keras.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":false,"mcp_get_code":{"code_sha256":"4e8d1df070cb5f83"}},{"code_sha256_prefix":"5f6a796fa47c9ff8","entry":"data_mnist","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_mnist.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_mnist.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":false,"mcp_get_code":{"code_sha256":"5f6a796fa47c9ff8"}},{"code_sha256_prefix":"46c4fbb3b28111b4","entry":"fgm","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks_tf.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":false,"mcp_get_code":{"code_sha256":"46c4fbb3b28111b4"}},{"code_sha256_prefix":"669a4a70d107c4a4","entry":"fgsm","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks.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":false,"mcp_get_code":{"code_sha256":"669a4a70d107c4a4"}},{"code_sha256_prefix":"ab300465511282c2","entry":"fgsm","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks_tf.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":false,"mcp_get_code":{"code_sha256":"ab300465511282c2"}},{"code_sha256_prefix":"33ce7291d7174c33","entry":"hard_sigmoid","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans_tutorials/tutorial_models.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans_tutorials/tutorial_models.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":false,"mcp_get_code":{"code_sha256":"33ce7291d7174c33"}},{"code_sha256_prefix":"48e3be63336a0ac5","entry":"jsma","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks.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":false,"mcp_get_code":{"code_sha256":"48e3be63336a0ac5"}},{"code_sha256_prefix":"24e8cacf2e978687","entry":"model_loss","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_tf.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":false,"mcp_get_code":{"code_sha256":"24e8cacf2e978687"}},{"code_sha256_prefix":"457d5efa3991f205","entry":"normalized_sign_changes_op","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_tf.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":false,"mcp_get_code":{"code_sha256":"457d5efa3991f205"}},{"code_sha256_prefix":"fb9a05da9fb0eb6e","entry":"quantize","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans_tutorials/resnet_model.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans_tutorials/resnet_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"fb9a05da9fb0eb6e"}},{"code_sha256_prefix":"88e4e6b729fd7669","entry":"quantize_grad","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans_tutorials/resnet_model.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans_tutorials/resnet_model.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":false,"mcp_get_code":{"code_sha256":"88e4e6b729fd7669"}},{"code_sha256_prefix":"45a3aac96deaa69d","entry":"sign_changes_count_op","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/utils_tf.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":false,"mcp_get_code":{"code_sha256":"45a3aac96deaa69d"}},{"code_sha256_prefix":"436b1ff1875d0cc7","entry":"to_categorical","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/utils.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/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":false,"mcp_get_code":{"code_sha256":"436b1ff1875d0cc7"}},{"code_sha256_prefix":"265a717d9cb4752d","entry":"vatm","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks.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":false,"mcp_get_code":{"code_sha256":"265a717d9cb4752d"}},{"code_sha256_prefix":"1d76eb5891f63a2f","entry":"vatm","repo":"AngusG/cleverhans-attacking-bnns","repo_kind":"official","path":"cleverhans/attacks_tf.py","file_url":"https://github.com/AngusG/cleverhans-attacking-bnns/blob/HEAD/cleverhans/attacks_tf.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":false,"mcp_get_code":{"code_sha256":"1d76eb5891f63a2f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}