{"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/bagflip-a-certified-defense-against-data","title":"BagFlip: A Certified Defense against Data Poisoning","arxiv_id":"2205.13634","date":"2022-05-26","proceeding":null,"authors":["Yuhao Zhang","Aws Albarghouthi","Loris D'Antoni"],"abstract":"Machine learning models are vulnerable to data-poisoning attacks, in which an attacker maliciously modifies the training set to change the prediction of a learned model. In a trigger-less attack, the attacker can modify the training set but not the test inputs, while in a backdoor attack the attacker can also modify test inputs. Existing model-agnostic defense approaches either cannot handle backdoor attacks or do not provide effective certificates (i.e., a proof of a defense). We present BagFlip, a model-agnostic certified approach that can effectively defend against both trigger-less and backdoor attacks. We evaluate BagFlip on image classification and malware detection datasets. BagFlip is equal to or more effective than the state-of-the-art approaches for trigger-less attacks and more effective than the state-of-the-art approaches for backdoor attacks.","url_abs":"https://arxiv.org/abs/2205.13634v2","url_pdf":"https://arxiv.org/pdf/2205.13634v2.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":"bagflip-a-certified-defense-against-data","repo_url":"https://github.com/foreverzyh/defend_framework","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":null}],"tasks":[{"task_slug":"backdoor-attack","task_name":"Backdoor Attack"},{"task_slug":"data-poisoning","task_name":"Data Poisoning"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"malware-detection","task_name":"Malware Detection"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2205.13634","atlas_url":"https://app.syntology.ai/?focus=2205.13634","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.13634"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/foreverzyh/defend_framework","reach":null}],"summary":{"ran_fixture":1,"ran_draft_wrong":1,"ran_honours":3,"unverified":3},"by_repo_kind":{"official":{"samples":8,"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":0,"samples":[{"code_sha256_prefix":"0375769d8cc30148","entry":"get_abstain_DPA","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"certified_eval.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/certified_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0375769d8cc30148"}},{"code_sha256_prefix":"404cf124c90a1ef3","entry":"get_abstain_bagging_replace","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"certified_eval.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/certified_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"404cf124c90a1ef3"}},{"code_sha256_prefix":"62f8cc312a6e9038","entry":"get_count","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62f8cc312a6e9038"}},{"code_sha256_prefix":"3e9d553c69e15339","entry":"my_comb","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3e9d553c69e15339"}},{"code_sha256_prefix":"97822baffffe7539","entry":"my_powe","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"97822baffffe7539"}},{"code_sha256_prefix":"f0a49775ce104f77","entry":"BoundCalculator","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","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":"f0a49775ce104f77"}},{"code_sha256_prefix":"112c567f6ed569b6","entry":"FlipBoundCalculator","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","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":"112c567f6ed569b6"}},{"code_sha256_prefix":"ee9fe1dbf9fb50bf","entry":"process_count","repo":"foreverzyh/defend_framework","repo_kind":"official","path":"utils/cal_bound.py","file_url":"https://github.com/foreverzyh/defend_framework/blob/HEAD/utils/cal_bound.py","link_basis":"first_harvest_node","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":"ee9fe1dbf9fb50bf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}