{"id":24905929,"url":"https://github.com/microsoft/responsible-ai-toolbox-privacy","last_synced_at":"2025-10-16T17:30:23.329Z","repository":{"id":57750515,"uuid":"520874244","full_name":"microsoft/responsible-ai-toolbox-privacy","owner":"microsoft","description":"A library for statistically estimating the privacy of ML pipelines from membership inference attacks ","archived":false,"fork":false,"pushed_at":"2025-01-24T17:28:44.000Z","size":505,"stargazers_count":34,"open_issues_count":6,"forks_count":7,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-01-31T16:24:33.440Z","etag":null,"topics":["machine-learning","privacy-preserving-machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-03T12:36:52.000Z","updated_at":"2024-11-23T06:46:45.000Z","dependencies_parsed_at":"2024-02-23T12:31:28.252Z","dependency_job_id":"480de105-55cb-492b-9480-4c5792813fbc","html_url":"https://github.com/microsoft/responsible-ai-toolbox-privacy","commit_stats":null,"previous_names":["microsoft/privacy-estimates"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fresponsible-ai-toolbox-privacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fresponsible-ai-toolbox-privacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fresponsible-ai-toolbox-privacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fresponsible-ai-toolbox-privacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/responsible-ai-toolbox-privacy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236737392,"owners_count":19196792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","privacy-preserving-machine-learning"],"created_at":"2025-02-02T00:26:04.045Z","updated_at":"2025-10-16T17:30:17.990Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Empirical Estimation of Differential Privacy\r\n\r\nThis repository provides utilities for estimating DP-$\\varepsilon$ from the confusion matrix of a membership inference attack based on the paper \u003ca href=\"https://arxiv.org/abs/2206.05199\"\u003eBayesian Estimation of Differential Privacy\u003c/a\u003e.\r\n\r\n## Installation\r\n\r\nSimply run the following command to install the privacy-estimates python package. It should install all the relevant dependencies as well.\r\n\r\n``` bash\r\npip install privacy-estimates\r\n```\r\n\r\n\r\n## Example\r\n\r\nThe following command takes the output of a membership inference attack on a target model or multiples models in the form of true positives (TP), true negatives (TN), false positives (FP) and false negatives (FN). It also requires the value for  $\\alpha$ which states the significance level of the estimate for two sided intervals of the estimated $\\varepsilon$ value.\r\n\r\nFor example, we can post-proces the attack outputs of a CNN trained on CIFAR10 with $(\\varepsilon = 10, \\delta = 10^{-5})$ by running\r\n\r\n``` bash\r\npython scripts/estimate-epsilon.py --alpha 0.1 --delta 1e-5 --TP 487 --TN 1 --FP 512 --FN 0 \r\n```\r\n\r\nThis should take approximately 5 minutes and produce the following output\r\n\r\n``` bash\r\nMethod             Interval                Significance level  eps_lo  eps_hi\r\nJoint beta (ours)  two-sided equal-tailed  0.100               0.145   6.399\r\nJoint beta (ours)  one-sided               0.050               0.145   inf\r\nClopper Pearson    two-sided equal-tailed  0.100               0.000   inf\r\nClopper Pearson    one-sided               0.050               0.000   inf\r\nJeffreys           two-sided equal-tailed  0.100               0.000   inf\r\nJeffreys           one-sided               0.050               0.000   inf\r\n```\r\n\r\n\r\n## Tests\r\n\r\nWe provide a few test cases which can be run by\r\n\r\n``` bash\r\npytest .\r\n```\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions. Most contributions require you to\r\nagree to a Contributor License Agreement (CLA) declaring that you have the right to,\r\nand actually do, grant us the rights to use your contribution. For details, visit\r\nhttps://cla.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need\r\nto provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the\r\ninstructions provided by the bot. You will only need to do this once across all repositories using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\r\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fresponsible-ai-toolbox-privacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fresponsible-ai-toolbox-privacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fresponsible-ai-toolbox-privacy/lists"}