{"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/feature-distillation-dnn-oriented-jpeg","title":"Feature Distillation: DNN-Oriented JPEG Compression Against Adversarial Examples","arxiv_id":"1803.05787","date":"2018-03-14","proceeding":"CVPR 2019 6","authors":["Zihao Liu","Qi Liu","Tao Liu","Nuo Xu","Xue Lin","Yanzhi Wang","Wujie Wen"],"abstract":"Image compression-based approaches for defending against the\nadversarial-example attacks, which threaten the safety use of deep neural\nnetworks (DNN), have been investigated recently. However, prior works mainly\nrely on directly tuning parameters like compression rate, to blindly reduce\nimage features, thereby lacking guarantee on both defense efficiency (i.e.\naccuracy of polluted images) and classification accuracy of benign images,\nafter applying defense methods. To overcome these limitations, we propose a\nJPEG-based defensive compression framework, namely \"feature distillation\", to\neffectively rectify adversarial examples without impacting classification\naccuracy on benign data. Our framework significantly escalates the defense\nefficiency with marginal accuracy reduction using a two-step method: First, we\nmaximize malicious features filtering of adversarial input perturbations by\ndeveloping defensive quantization in frequency domain of JPEG compression or\ndecompression, guided by a semi-analytical method; Second, we suppress the\ndistortions of benign features to restore classification accuracy through a\nDNN-oriented quantization refine process. Our experimental results show that\nproposed \"feature distillation\" can significantly surpass the latest\ninput-transformation based mitigations such as Quilting and TV Minimization in\nthree aspects, including defense efficiency (improve classification accuracy\nfrom $\\sim20\\%$ to $\\sim90\\%$ on adversarial examples), accuracy of benign\nimages after defense ($\\le1\\%$ accuracy degradation), and processing time per\nimage ($\\sim259\\times$ Speedup). Moreover, our solution can also provide the\nbest defense efficiency ($\\sim60\\%$ accuracy) against the recent adaptive\nattack with least accuracy reduction ($\\sim1\\%$) on benign images when compared\nwith other input-transformation based defense methods.","url_abs":"http://arxiv.org/abs/1803.05787v2","url_pdf":"http://arxiv.org/pdf/1803.05787v2.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":"feature-distillation-dnn-oriented-jpeg","repo_url":"https://github.com/zihaoliu123/DeepN-Jpeg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"feature-distillation-dnn-oriented-jpeg","repo_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"classification","task_name":"General Classification"},{"task_slug":"image-compression","task_name":"Image Compression"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1803.05787","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1803.05787"}},"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/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zihaoliu123/DeepN-Jpeg","reach":null}],"summary":{"ran_honours":3,"unverified":14},"by_repo_kind":{"listed":{"samples":17,"ran":3,"repositories":2}},"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":3,"samples":[{"code_sha256_prefix":"f3d0ff33a5acd9db","entry":"dct2","repo":"zihaoliu123/DeepN-Jpeg","repo_kind":"listed","path":"DeepN.py","file_url":"https://github.com/zihaoliu123/DeepN-Jpeg/blob/HEAD/DeepN.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f3d0ff33a5acd9db"}},{"code_sha256_prefix":"7d7d7dbde209f018","entry":"idct2","repo":"zihaoliu123/DeepN-Jpeg","repo_kind":"listed","path":"DeepN.py","file_url":"https://github.com/zihaoliu123/DeepN-Jpeg/blob/HEAD/DeepN.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7d7d7dbde209f018"}},{"code_sha256_prefix":"b7b553d7b6097fa1","entry":"rfft2","repo":"zihaoliu123/DeepN-Jpeg","repo_kind":"listed","path":"DeepN.py","file_url":"https://github.com/zihaoliu123/DeepN-Jpeg/blob/HEAD/DeepN.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b7b553d7b6097fa1"}},{"code_sha256_prefix":"ef12250921907cf2","entry":"carlini_cifar10_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"models/carlini_models.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/models/carlini_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":true,"mcp_get_code":{"code_sha256":"ef12250921907cf2"}},{"code_sha256_prefix":"f789e91ec8254a1c","entry":"carlini_mnist_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"models/carlini_models.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/models/carlini_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":true,"mcp_get_code":{"code_sha256":"f789e91ec8254a1c"}},{"code_sha256_prefix":"79976c3eaf7aaa7c","entry":"carlini_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"models/carlini_models.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/models/carlini_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":true,"mcp_get_code":{"code_sha256":"79976c3eaf7aaa7c"}},{"code_sha256_prefix":"dce02585e3349215","entry":"convert_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"attacks/carlini_wrapper.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/attacks/carlini_wrapper.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":"dce02585e3349215"}},{"code_sha256_prefix":"590145ff5c062ed7","entry":"data_imagenet","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"datasets/imagenet.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/datasets/imagenet.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":"590145ff5c062ed7"}},{"code_sha256_prefix":"4686f69d35b1edf8","entry":"get_first_n_examples_id_each_class","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"datasets/datasets_utils.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/datasets/datasets_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":true,"mcp_get_code":{"code_sha256":"4686f69d35b1edf8"}},{"code_sha256_prefix":"cd5e76389e4061b6","entry":"get_least_likely_class","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"datasets/datasets_utils.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/datasets/datasets_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":true,"mcp_get_code":{"code_sha256":"cd5e76389e4061b6"}},{"code_sha256_prefix":"f32016fdaf8ee137","entry":"get_next_class","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"datasets/datasets_utils.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/datasets/datasets_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":true,"mcp_get_code":{"code_sha256":"f32016fdaf8ee137"}},{"code_sha256_prefix":"e5d6aed08c580cd2","entry":"load_single_image","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"datasets/imagenet.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/datasets/imagenet.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":"e5d6aed08c580cd2"}},{"code_sha256_prefix":"89dc5724554cf57b","entry":"override_params","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"attacks/cleverhans_wrapper.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/attacks/cleverhans_wrapper.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":"89dc5724554cf57b"}},{"code_sha256_prefix":"05c5269091bda68b","entry":"override_params","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"attacks/deepfool_wrapper.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/attacks/deepfool_wrapper.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":"05c5269091bda68b"}},{"code_sha256_prefix":"9890ea8ff5e16c13","entry":"pgdtrained_mnist_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"models/pgdtrained_models.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/models/pgdtrained_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":true,"mcp_get_code":{"code_sha256":"9890ea8ff5e16c13"}},{"code_sha256_prefix":"a88ae6b0472e0db9","entry":"prepare_attack","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"attacks/deepfool_wrapper.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/attacks/deepfool_wrapper.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":"a88ae6b0472e0db9"}},{"code_sha256_prefix":"a91f7c1babdfb8d5","entry":"wrap_to_carlini_model","repo":"zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples","repo_kind":"listed","path":"attacks/carlini_wrapper.py","file_url":"https://github.com/zihaoliu123/Feature-Distillation-DNN-Oriented-JPEG-Compression-Against-Adversarial-Examples/blob/HEAD/attacks/carlini_wrapper.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":"a91f7c1babdfb8d5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}