Empirical Privacy Estimates
Project description
Empirical Estimation of Differential Privacy
This repository provides utilities for estimating DP-$\varepsilon$ from the confusion matrix of a membership inference attack based on the paper Bayesian Estimation of Differential Privacy.
Installation
Simply run the following command to install the privacy-estimates python package. It should install all the relevant dependencies as well.
pip install privacy-estimates
Example
The 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.
For example, we can post-proces the attack outputs of a CNN trained on CIFAR10 with $(\varepsilon = 10, \delta = 10^{-5})$ by running
python scripts/estimate-epsilon.py --alpha 0.1 --delta 1e-5 --TP 487 --TN 1 --FP 512 --FN 0
This should take approximately 5 minutes and produce the following output
Method Interval Significance level eps_lo eps_hi
Joint beta (ours) two-sided equal-tailed 0.100 0.145 6.399
Joint beta (ours) one-sided 0.050 0.145 inf
Clopper Pearson two-sided equal-tailed 0.100 0.000 inf
Clopper Pearson one-sided 0.050 0.000 inf
Jeffreys two-sided equal-tailed 0.100 0.000 inf
Jeffreys one-sided 0.050 0.000 inf
Tests
We provide a few test cases which can be run by
pytest .
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file privacy-estimates-0.1.0.post1.tar.gz
.
File metadata
- Download URL: privacy-estimates-0.1.0.post1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9798d528382f728ab522a3e71fc8c407444f846fb034397d11db29bd2e0d3172 |
|
MD5 | 590326311e57bae09e6f7f584daa532d |
|
BLAKE2b-256 | 11eff41e41da4d597d83a0a2146652cc8df19488f10c3875f1fe898628238bdc |
File details
Details for the file privacy_estimates-0.1.0.post1-py3-none-any.whl
.
File metadata
- Download URL: privacy_estimates-0.1.0.post1-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b81244787a74f07534d208ef89475207d8ee01013d505dc191f0266d26e5f0e4 |
|
MD5 | 6189cee899ba70312b00dd35490a3644 |
|
BLAKE2b-256 | d88eb7604fb880fbb823303650bc8a4891b256b7ce675e7d3f1e074251247adf |