{"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/a-new-defense-against-adversarial-images","title":"A New Defense Against Adversarial Images: Turning a Weakness into a Strength","arxiv_id":"1910.07629","date":"2019-10-16","proceeding":"NeurIPS 2019 12","authors":["Tao Yu","Shengyuan Hu","Chuan Guo","Wei-Lun Chao","Kilian Q. Weinberger"],"abstract":"Natural images are virtually surrounded by low-density misclassified regions that can be efficiently discovered by gradient-guided search --- enabling the generation of adversarial images. While many techniques for detecting these attacks have been proposed, they are easily bypassed when the adversary has full knowledge of the detection mechanism and adapts the attack strategy accordingly. In this paper, we adopt a novel perspective and regard the omnipresence of adversarial perturbations as a strength rather than a weakness. We postulate that if an image has been tampered with, these adversarial directions either become harder to find with gradient methods or have substantially higher density than for natural images. We develop a practical test for this signature characteristic to successfully detect adversarial attacks, achieving unprecedented accuracy under the white-box setting where the adversary is given full knowledge of our detection mechanism.","url_abs":"https://arxiv.org/abs/1910.07629v2","url_pdf":"https://arxiv.org/pdf/1910.07629v2.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":"a-new-defense-against-adversarial-images","repo_url":"https://github.com/s-huu/TurningWeaknessIntoStrength","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"adversarial-defense","task_name":"Adversarial Defense"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1910.07629","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1910.07629"}},"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/s-huu/TurningWeaknessIntoStrength","reach":null}],"summary":{"ran_draft_wrong":2,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":3,"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":4,"samples":[{"code_sha256_prefix":"eba3f5bcc6a06d36","entry":"make_layers","repo":"s-huu/TurningWeaknessIntoStrength","repo_kind":"official","path":"train_vgg19.py","file_url":"https://github.com/s-huu/TurningWeaknessIntoStrength/blob/HEAD/train_vgg19.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eba3f5bcc6a06d36"}},{"code_sha256_prefix":"cc139577c19c19d8","entry":"noisy_img","repo":"s-huu/TurningWeaknessIntoStrength","repo_kind":"official","path":"attack.py","file_url":"https://github.com/s-huu/TurningWeaknessIntoStrength/blob/HEAD/attack.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc139577c19c19d8"}},{"code_sha256_prefix":"39f1fb45db2aa5b0","entry":"validate","repo":"s-huu/TurningWeaknessIntoStrength","repo_kind":"official","path":"train_vgg19.py","file_url":"https://github.com/s-huu/TurningWeaknessIntoStrength/blob/HEAD/train_vgg19.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"39f1fb45db2aa5b0"}},{"code_sha256_prefix":"f0c9a29156911331","entry":"accuracy","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f0c9a29156911331"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}