{"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/any-target-can-be-offense-adversarial-example","title":"Any Target Can be Offense: Adversarial Example Generation via Generalized Latent Infection","arxiv_id":"2407.12292","date":"2024-07-17","proceeding":null,"authors":["Youheng Sun","Shengming Yuan","Xuanhan Wang","Lianli Gao","Jingkuan Song"],"abstract":"Targeted adversarial attack, which aims to mislead a model to recognize any image as a target object by imperceptible perturbations, has become a mainstream tool for vulnerability assessment of deep neural networks (DNNs). Since existing targeted attackers only learn to attack known target classes, they cannot generalize well to unknown classes. To tackle this issue, we propose $\\bf{G}$eneralized $\\bf{A}$dversarial attac$\\bf{KER}$ ($\\bf{GAKer}$), which is able to construct adversarial examples to any target class. The core idea behind GAKer is to craft a latently infected representation during adversarial example generation. To this end, the extracted latent representations of the target object are first injected into intermediate features of an input image in an adversarial generator. Then, the generator is optimized to ensure visual consistency with the input image while being close to the target object in the feature space. Since the GAKer is class-agnostic yet model-agnostic, it can be regarded as a general tool that not only reveals the vulnerability of more DNNs but also identifies deficiencies of DNNs in a wider range of classes. Extensive experiments have demonstrated the effectiveness of our proposed method in generating adversarial examples for both known and unknown classes. Notably, compared with other generative methods, our method achieves an approximately $14.13\\%$ higher attack success rate for unknown classes and an approximately $4.23\\%$ higher success rate for known classes. Our code is available in https://github.com/VL-Group/GAKer.","url_abs":"https://arxiv.org/abs/2407.12292v1","url_pdf":"https://arxiv.org/pdf/2407.12292v1.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":"any-target-can-be-offense-adversarial-example","repo_url":"https://github.com/vl-group/gaker","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"adversarial-attack","task_name":"Adversarial Attack"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.12292","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.12292"}},"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/vl-group/gaker","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/VL-Group/GAKer","reach":{"status":"ok"}}],"summary":{"ran":4,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":7,"ran":5,"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":7,"samples":[{"code_sha256_prefix":"0daa5f9fe5b85ae3","entry":"CE","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/metrics.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":"0daa5f9fe5b85ae3"}},{"code_sha256_prefix":"fb0541d3902f7b0c","entry":"KL","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/metrics.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":"fb0541d3902f7b0c"}},{"code_sha256_prefix":"2d69878edb36c4fa","entry":"get_gaussian_kernel","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/gaussian_smoothing.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/gaussian_smoothing.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":"2d69878edb36c4fa"}},{"code_sha256_prefix":"5d099047f4eacfa2","entry":"normalize","repo":"VL-Group/GAKer","repo_kind":"official","path":"Generator/craftadv.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/Generator/craftadv.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":"5d099047f4eacfa2"}},{"code_sha256_prefix":"55f1419d4d8c483c","entry":"transpose","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/nce.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/nce.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"55f1419d4d8c483c"}},{"code_sha256_prefix":"2c4ef32312957719","entry":"algorithm2","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/metrics.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":"2c4ef32312957719"}},{"code_sha256_prefix":"54b175c46812e410","entry":"info_nce","repo":"VL-Group/GAKer","repo_kind":"official","path":"utils/nce.py","file_url":"https://github.com/VL-Group/GAKer/blob/HEAD/utils/nce.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":"54b175c46812e410"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}