{"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/enhancing-adversarial-robustness-for-deep","title":"Enhancing Adversarial Robustness for Deep Metric Learning","arxiv_id":"2203.01439","date":"2022-03-02","proceeding":"CVPR 2022 1","authors":["Mo Zhou","Vishal M. Patel"],"abstract":"Owing to security implications of adversarial vulnerability, adversarial robustness of deep metric learning models has to be improved. In order to avoid model collapse due to excessively hard examples, the existing defenses dismiss the min-max adversarial training, but instead learn from a weak adversary inefficiently. Conversely, we propose Hardness Manipulation to efficiently perturb the training triplet till a specified level of hardness for adversarial training, according to a harder benign triplet or a pseudo-hardness function. It is flexible since regular training and min-max adversarial training are its boundary cases. Besides, Gradual Adversary, a family of pseudo-hardness functions is proposed to gradually increase the specified hardness level during training for a better balance between performance and robustness. Additionally, an Intra-Class Structure loss term among benign and adversarial examples further improves model robustness and efficiency. Comprehensive experimental results suggest that the proposed method, although simple in its form, overwhelmingly outperforms the state-of-the-art defenses in terms of robustness, training efficiency, as well as performance on benign examples.","url_abs":"https://arxiv.org/abs/2203.01439v1","url_pdf":"https://arxiv.org/pdf/2203.01439v1.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":"enhancing-adversarial-robustness-for-deep","repo_url":"https://github.com/cdluminate/robdml","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"enhancing-adversarial-robustness-for-deep","repo_url":"https://github.com/cdluminate/robrank","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"adversarial-robustness","task_name":"Adversarial Robustness"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":null,"task_name":"Triplet"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.01439","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.01439"}},"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/cdluminate/robdml","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cdluminate/robrank","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":6,"ran":0,"repositories":1},"listed":{"samples":2,"ran":0,"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":"d4214dea0b6000f5","entry":"fn__pglift","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/lifted.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/lifted.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d4214dea0b6000f5"}},{"code_sha256_prefix":"ccbd8a3d0a72fca1","entry":"fn__pnpair","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/npair.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/npair.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ccbd8a3d0a72fca1"}},{"code_sha256_prefix":"a9eeff2875e174d7","entry":"fn_infonce","repo":"cdluminate/robrank","repo_kind":"listed","path":"robrank/losses/infonce.py","file_url":"https://github.com/cdluminate/robrank/blob/HEAD/robrank/losses/infonce.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a9eeff2875e174d7"}},{"code_sha256_prefix":"de8e63c8a0865dac","entry":"fn_pcontrast","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/contrastive.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/contrastive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"de8e63c8a0865dac"}},{"code_sha256_prefix":"2e1549b81b32d2d2","entry":"fn_pcontrast_kernel","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/contrastive.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/contrastive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2e1549b81b32d2d2"}},{"code_sha256_prefix":"e1de1afeb7624316","entry":"fn_pmargin_kernel","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/margin.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/margin.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e1de1afeb7624316"}},{"code_sha256_prefix":"1ec1a1d7d7df8c14","entry":"infonce","repo":"cdluminate/robrank","repo_kind":"listed","path":"robrank/losses/infonce.py","file_url":"https://github.com/cdluminate/robrank/blob/HEAD/robrank/losses/infonce.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1ec1a1d7d7df8c14"}},{"code_sha256_prefix":"83ead4c483b7e87f","entry":"miner","repo":"cdluminate/robdml","repo_kind":"official","path":"tex/code/robrank/losses/miner.py","file_url":"https://github.com/cdluminate/robdml/blob/HEAD/tex/code/robrank/losses/miner.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"83ead4c483b7e87f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}