{"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/on-the-efficacy-of-differentially-private-few","title":"On the Efficacy of Differentially Private Few-shot Image Classification","arxiv_id":"2302.01190","date":"2023-02-02","proceeding":null,"authors":["Marlon Tobaben","Aliaksandra Shysheya","John Bronskill","Andrew Paverd","Shruti Tople","Santiago Zanella-Beguelin","Richard E Turner","Antti Honkela"],"abstract":"There has been significant recent progress in training differentially private (DP) models which achieve accuracy that approaches the best non-private models. These DP models are typically pretrained on large public datasets and then fine-tuned on private downstream datasets that are relatively large and similar in distribution to the pretraining data. However, in many applications including personalization and federated learning, it is crucial to perform well (i) in the few-shot setting, as obtaining large amounts of labeled data may be problematic; and (ii) on datasets from a wide variety of domains for use in various specialist settings. To understand under which conditions few-shot DP can be effective, we perform an exhaustive set of experiments that reveals how the accuracy and vulnerability to attack of few-shot DP image classification models are affected as the number of shots per class, privacy level, model architecture, downstream dataset, and subset of learnable parameters in the model vary. We show that to achieve DP accuracy on par with non-private models, the shots per class must be increased as the privacy level increases. We also show that learning parameter-efficient FiLM adapters under DP is competitive with learning just the final classifier layer or learning all of the network parameters. Finally, we evaluate DP federated learning systems and establish state-of-the-art performance on the challenging FLAIR benchmark.","url_abs":"https://arxiv.org/abs/2302.01190v3","url_pdf":"https://arxiv.org/pdf/2302.01190v3.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":"on-the-efficacy-of-differentially-private-few","repo_url":"https://github.com/cambridge-mlg/dp-few-shot","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"federated-learning","task_name":"Federated Learning"},{"task_slug":"few-shot-image-classification","task_name":"Few-Shot Image Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2302.01190","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.01190"}},"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/cambridge-mlg/dp-few-shot","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran_violates":1,"unverified":13},"by_repo_kind":{"official":{"samples":16,"ran":3,"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":"ee80cf467065076b","entry":"conv1x1","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/bit_resnet.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/bit_resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ee80cf467065076b"}},{"code_sha256_prefix":"f01b8d3901f0b289","entry":"conv3x3","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/bit_resnet.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/bit_resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f01b8d3901f0b289"}},{"code_sha256_prefix":"7023eb86801bb3a3","entry":"tf2th","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/bit_resnet.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/bit_resnet.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7023eb86801bb3a3"}},{"code_sha256_prefix":"335818a6c090235f","entry":"compute_accuracy","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/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":"335818a6c090235f"}},{"code_sha256_prefix":"d5709341a0e1b79a","entry":"compute_score_lira","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/lira.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/lira.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":"d5709341a0e1b79a"}},{"code_sha256_prefix":"3e15ee986e0e840a","entry":"conv1x1","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"ml-flair/flair_model.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/ml-flair/flair_model.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":"3e15ee986e0e840a"}},{"code_sha256_prefix":"9ccdf59f83eb0db1","entry":"conv3x3","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"ml-flair/flair_model.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/ml-flair/flair_model.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":"9ccdf59f83eb0db1"}},{"code_sha256_prefix":"a9a48b3a8185da17","entry":"convert_logit_to_prob","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/lira.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/lira.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":"a9a48b3a8185da17"}},{"code_sha256_prefix":"579d94114e5fc672","entry":"create_job_name","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"experiment_management/deploy_few_shot_universial_script.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/experiment_management/deploy_few_shot_universial_script.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":"579d94114e5fc672"}},{"code_sha256_prefix":"a521b8c61c81ecdd","entry":"cross_entropy_loss","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/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":"a521b8c61c81ecdd"}},{"code_sha256_prefix":"10e24f830382cdf6","entry":"get_film_parameters","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/film.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/film.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":"10e24f830382cdf6"}},{"code_sha256_prefix":"57a78e1e2e3d70d2","entry":"get_full_parameter_names","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/film.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/film.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":"57a78e1e2e3d70d2"}},{"code_sha256_prefix":"72f35b8f0306e837","entry":"get_run_option_string","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"experiment_management/deploy_few_shot_universial_script.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/experiment_management/deploy_few_shot_universial_script.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":"72f35b8f0306e837"}},{"code_sha256_prefix":"0e4e4401e5d8b0fe","entry":"log_loss","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/lira.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/lira.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":"0e4e4401e5d8b0fe"}},{"code_sha256_prefix":"d3206fa419093bb3","entry":"parse_job_time","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"experiment_management/deploy_few_shot_universial_script.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/experiment_management/deploy_few_shot_universial_script.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":"d3206fa419093bb3"}},{"code_sha256_prefix":"dcadab8653f1f53a","entry":"predict_by_max_logit","repo":"cambridge-mlg/dp-few-shot","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/cambridge-mlg/dp-few-shot/blob/HEAD/src/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":"dcadab8653f1f53a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}