{"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/triple-wins-boosting-accuracy-robustness-and-1","title":"Triple Wins: Boosting Accuracy, Robustness and Efficiency Together by Enabling Input-Adaptive Inference","arxiv_id":"2002.10025","date":"2020-02-24","proceeding":"ICLR 2020 1","authors":["Ting-Kuei Hu","Tianlong Chen","Haotao Wang","Zhangyang Wang"],"abstract":"Deep networks were recently suggested to face the odds between accuracy (on clean natural images) and robustness (on adversarially perturbed images) (Tsipras et al., 2019). Such a dilemma is shown to be rooted in the inherently higher sample complexity (Schmidt et al., 2018) and/or model capacity (Nakkiran, 2019), for learning a high-accuracy and robust classifier. In view of that, give a classification task, growing the model capacity appears to help draw a win-win between accuracy and robustness, yet at the expense of model size and latency, therefore posing challenges for resource-constrained applications. Is it possible to co-design model accuracy, robustness and efficiency to achieve their triple wins? This paper studies multi-exit networks associated with input-adaptive efficient inference, showing their strong promise in achieving a \"sweet point\" in cooptimizing model accuracy, robustness and efficiency. Our proposed solution, dubbed Robust Dynamic Inference Networks (RDI-Nets), allows for each input (either clean or adversarial) to adaptively choose one of the multiple output layers (early branches or the final one) to output its prediction. That multi-loss adaptivity adds new variations and flexibility to adversarial attacks and defenses, on which we present a systematical investigation. We show experimentally that by equipping existing backbones with such robust adaptive inference, the resulting RDI-Nets can achieve better accuracy and robustness, yet with over 30% computational savings, compared to the defended original models.","url_abs":"https://arxiv.org/abs/2002.10025v2","url_pdf":"https://arxiv.org/pdf/2002.10025v2.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":"triple-wins-boosting-accuracy-robustness-and-1","repo_url":"https://github.com/TAMU-VITA/triple-wins","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"triple-wins-boosting-accuracy-robustness-and-1","repo_url":"https://github.com/gorakraj/earlyexit_onnx","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2002.10025","atlas_url":"https://app.syntology.ai/?focus=2002.10025","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.10025"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/TAMU-VITA/triple-wins","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gorakraj/earlyexit_onnx","reach":null}],"summary":{"ran":6,"ran_honours":4,"ran_draft_wrong":2,"unverified":6},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1},"listed":{"samples":15,"ran":9,"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":"f4f526cd0c092320","entry":"Block_V3","repo":"TAMU-VITA/triple-wins","repo_kind":"official","path":"cifar/models_baseline.py","file_url":"https://github.com/TAMU-VITA/triple-wins/blob/HEAD/cifar/models_baseline.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f4f526cd0c092320"}},{"code_sha256_prefix":"b6b875971ee15fe6","entry":"ChannelScalerLayer","repo":"TAMU-VITA/triple-wins","repo_kind":"official","path":"cifar/models_baseline.py","file_url":"https://github.com/TAMU-VITA/triple-wins/blob/HEAD/cifar/models_baseline.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b6b875971ee15fe6"}},{"code_sha256_prefix":"4b34fc3c728d64ca","entry":"InternalClassifier","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b34fc3c728d64ca"}},{"code_sha256_prefix":"ec6ecae0e14e3a1c","entry":"MobileNetV2_CP","repo":"TAMU-VITA/triple-wins","repo_kind":"official","path":"cifar/models_baseline.py","file_url":"https://github.com/TAMU-VITA/triple-wins/blob/HEAD/cifar/models_baseline.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ec6ecae0e14e3a1c"}},{"code_sha256_prefix":"f79d8861a3c36477","entry":"feature_reduction_formula","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f79d8861a3c36477"}},{"code_sha256_prefix":"f5036fe874e2e4de","entry":"get_loader","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"f5036fe874e2e4de"}},{"code_sha256_prefix":"ff3039ef77961436","entry":"get_loss_criterion","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"ff3039ef77961436"}},{"code_sha256_prefix":"1aca7be4e59a01a0","entry":"get_lr","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"1aca7be4e59a01a0"}},{"code_sha256_prefix":"84f507ee66e79376","entry":"sdn_ic_only_step","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"84f507ee66e79376"}},{"code_sha256_prefix":"6f65a35f5e8d93bc","entry":"sdn_ic_only_step_DS","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"6f65a35f5e8d93bc"}},{"code_sha256_prefix":"0f6294604cc0a722","entry":"sdn_training_step","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f6294604cc0a722"}},{"code_sha256_prefix":"d0092b78fbcce2b3","entry":"sdn_training_step_DS","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d0092b78fbcce2b3"}},{"code_sha256_prefix":"bc9d472adc5e3a89","entry":"BasicBlockWOutput","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"bc9d472adc5e3a89"}},{"code_sha256_prefix":"e62a922e2ca01bbe","entry":"ResNet_SDN","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"e62a922e2ca01bbe"}},{"code_sha256_prefix":"0ae2381aa39b7e94","entry":"accuracy","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"0ae2381aa39b7e94"}},{"code_sha256_prefix":"2cca158ee7052b0e","entry":"sdn_get_detailed_results","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"2cca158ee7052b0e"}},{"code_sha256_prefix":"2e45239eb5fb93a7","entry":"sdn_test","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"2e45239eb5fb93a7"}},{"code_sha256_prefix":"e7ce5602ca2a2ea8","entry":"sdn_train","repo":"gorakraj/earlyexit_onnx","repo_kind":"listed","path":"Networks/8. L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.py","file_url":"https://github.com/gorakraj/earlyexit_onnx/blob/HEAD/Networks/8.%20L2Stop/l2stop-master/sdn_stop/architectures/SDNs/ResNet_SDN.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":"e7ce5602ca2a2ea8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}