A privacy-preserving machine learning package
Project description
🥯 Privacy-Preserving Machine Learning (PPML)
This repository implements privacy-preserving machine learning techniques, starting with a differentially private GAN for image generation. Our goal is to develop and showcase various PPML methods that enable data analysis and model training while protecting individual privacy.
Our blog post explains the importance of privacy in machine learning and introduces our first implementation. 🥯
🥯 Features
- Privacy-preserving machine learning techniques
- Differential privacy implementations
- PyTorch and Opacus integration
🥯 Current Implementations
- Differentially Private GAN (DP-GAN) for image synthesis
- Based on Radford et al. (2015) and Xie et al. (2018)
- Convolutional GAN architecture
- Customizable privacy budget (ε)
🥯 Applications
Our PPML techniques can be applied to various scenarios:
- Secure data sharing for research
- Privacy-preserving model training
- Confidential data analysis in sensitive domains (e.g., healthcare, finance)
- Building privacy-respecting AI systems
🥯 Setup
-
Clone the repository:
git clone https://github.com/your-username/PPML.git cd PPML
-
Install dependencies:
pip install -e .
🥯 Usage
DP-GAN for Image Synthesis
-
Place your dataset in the
data
folder. The default configuration expects a folder structure similar to the CelebA dataset. -
Open
dp.py
and set thedataroot
variable to point to your dataset folder:dataroot = "path/to/your/dataset"
-
(Optional) Adjust hyperparameters in
dp.py
:EPSILON
: Privacy budget (default: 50.0)batch_size
: Number of images per batch (default: 128)num_epochs
: Number of training epochs (default: 5)lr
: Learning rate (default: 0.0002)
-
Run the training script:
python dp.py
-
Monitor the training progress. The script will print loss values and privacy guarantees every few iterations.
-
After training, find the trained Generator model saved as
netG_dpgan.pth
in the project directory. -
To generate new images using the trained model, create a new script that loads the saved model and feeds random noise through it.
🥯 Example
We trained the DP-GAN on CelebA with ε=50. Results:
🥯 Roadmap
We plan to expand this repository with more PPML techniques, including:
- Federated Learning implementations
- Secure Multi-Party Computation (SMPC) for distributed machine learning
- Homomorphic Encryption-based machine learning models
- Privacy-preserving data analysis tools
Stay tuned for updates!
🥯 Contributing
We welcome contributions to improve and expand this project! Here are some guidelines to get started:
- Fork the repository and create your branch from
main
. - If you've added code that should be tested, add tests.
- Ensure your code passes all tests.
- Make sure your code lints.
- Issue a pull request with a comprehensive description of changes.
For more detailed information, please read our Contribution Guidelines.
🥯 License
🥯 Acknowledgements
- Radford et al. (2015): DCGAN architecture
- Xie et al. (2018): Differentially private GAN
- Opacus: Differential privacy library
🥯 Contact
Open an issue or email [team@bagel.net].
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 ppml-0.1.0.tar.gz
.
File metadata
- Download URL: ppml-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4815458dec0eb242d9e9b159ed1eb3ae9694dd6228daa1bcde750886e12f967d |
|
MD5 | ee45325e0142d9f27ee65b29a33eac1e |
|
BLAKE2b-256 | 188b90b9f368c3bb918e95c802f7ac846739314c9383f4d7fd086082220dbf85 |
File details
Details for the file ppml-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ppml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b06191c5e4cd7b32b3cfe6e9b0a4b984c1071b7423077f3b8356afdc4cbdbf |
|
MD5 | 09094d20333573032af50035279216a8 |
|
BLAKE2b-256 | 6630ca902a243421f0d28e4cbf268ca74444e4dd32162e52a0447f13f65ca42b |