{"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/calibration-attack-a-framework-for","title":"Calibration Attacks: A Comprehensive Study of Adversarial Attacks on Model Confidence","arxiv_id":"2401.02718","date":"2024-01-05","proceeding":null,"authors":["Stephen Obadinma","Xiaodan Zhu","Hongyu Guo"],"abstract":"In this work, we highlight and perform a comprehensive study on calibration attacks, a form of adversarial attacks that aim to trap victim models to be heavily miscalibrated without altering their predicted labels, hence endangering the trustworthiness of the models and follow-up decision making based on their confidence. We propose four typical forms of calibration attacks: underconfidence, overconfidence, maximum miscalibration, and random confidence attacks, conducted in both black-box and white-box setups. We demonstrate that the attacks are highly effective on both convolutional and attention-based models: with a small number of queries, they seriously skew confidence without changing the predictive performance. Given the potential danger, we further investigate the effectiveness of a wide range of adversarial defence and recalibration methods, including our proposed defences specifically designed for calibration attacks to mitigate the harm. From the ECE and KS scores, we observe that there are still significant limitations in handling calibration attacks. To the best of our knowledge, this is the first dedicated study that provides a comprehensive investigation on calibration-focused attacks. We hope this study helps attract more attention to these types of attacks and hence hamper their potential serious damages. To this end, this work also provides detailed analyses to understand the characteristics of the attacks. Our code is available at https://github.com/PhenetOs/CalibrationAttack","url_abs":"https://arxiv.org/abs/2401.02718v3","url_pdf":"https://arxiv.org/pdf/2401.02718v3.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":"calibration-attack-a-framework-for","repo_url":"https://github.com/phenetos/calibrationattack","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.02718","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.02718"}},"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/phenetos/calibrationattack","reach":{"status":"ok"}}],"summary":{"ran":7,"ran_honours":4,"unverified":3},"by_repo_kind":{"official":{"samples":14,"ran":11,"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":14,"samples":[{"code_sha256_prefix":"1367aac1053a1fad","entry":"cuda_transfer","repo":"phenetos/calibrationattack","repo_kind":"official","path":"train_models.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/train_models.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":"1367aac1053a1fad"}},{"code_sha256_prefix":"176dfa1e026fb136","entry":"dense_to_onehot","repo":"phenetos/calibrationattack","repo_kind":"official","path":"utils.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/utils.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":"176dfa1e026fb136"}},{"code_sha256_prefix":"2bd69793c2565f55","entry":"ensure_numpy","repo":"phenetos/calibrationattack","repo_kind":"official","path":"recalibration.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/recalibration.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2bd69793c2565f55"}},{"code_sha256_prefix":"a829230c6819d6c9","entry":"get_aug","repo":"phenetos/calibrationattack","repo_kind":"official","path":"get_data.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/get_data.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":"a829230c6819d6c9"}},{"code_sha256_prefix":"b0af5000c1b303cf","entry":"get_transform","repo":"phenetos/calibrationattack","repo_kind":"official","path":"get_data.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/get_data.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":"b0af5000c1b303cf"}},{"code_sha256_prefix":"de59e4240a700352","entry":"get_transform_torchvision","repo":"phenetos/calibrationattack","repo_kind":"official","path":"get_data.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/get_data.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":"de59e4240a700352"}},{"code_sha256_prefix":"b30c11e674538e2f","entry":"len0","repo":"phenetos/calibrationattack","repo_kind":"official","path":"recalibration.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/recalibration.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":"b30c11e674538e2f"}},{"code_sha256_prefix":"4ca7ef6d76dc7319","entry":"meta_pseudo_gaussian_pert","repo":"phenetos/calibrationattack","repo_kind":"official","path":"calibration_attack.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/calibration_attack.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4ca7ef6d76dc7319"}},{"code_sha256_prefix":"0817f8b0f831deaf","entry":"one_hot_encode_v2","repo":"phenetos/calibrationattack","repo_kind":"official","path":"utils.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/utils.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":"0817f8b0f831deaf"}},{"code_sha256_prefix":"053d874dd6c8872d","entry":"p_selection","repo":"phenetos/calibrationattack","repo_kind":"official","path":"calibration_attack.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/calibration_attack.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"053d874dd6c8872d"}},{"code_sha256_prefix":"c7544861060c462d","entry":"pseudo_gaussian_pert_rectangles","repo":"phenetos/calibrationattack","repo_kind":"official","path":"calibration_attack.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/calibration_attack.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c7544861060c462d"}},{"code_sha256_prefix":"f71380bf77811194","entry":"get_model","repo":"phenetos/calibrationattack","repo_kind":"official","path":"train_models.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/train_models.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":"f71380bf77811194"}},{"code_sha256_prefix":"b6f12dce7894cb0e","entry":"is_numpy_object","repo":"phenetos/calibrationattack","repo_kind":"official","path":"recalibration.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/recalibration.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":"b6f12dce7894cb0e"}},{"code_sha256_prefix":"77933604fbca56e7","entry":"one_hot_encode","repo":"phenetos/calibrationattack","repo_kind":"official","path":"utils.py","file_url":"https://github.com/phenetos/calibrationattack/blob/HEAD/utils.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":"77933604fbca56e7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}