Skip to main content

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

  1. Differentially Private GAN (DP-GAN) for image synthesis

🥯 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

  1. Clone the repository:

    git clone https://github.com/your-username/PPML.git
    cd PPML
    
  2. Install dependencies:

    pip install -e .
    

🥯 Usage

DP-GAN for Image Synthesis

  1. Place your dataset in the data folder. The default configuration expects a folder structure similar to the CelebA dataset.

  2. Open dp.py and set the dataroot variable to point to your dataset folder:

    dataroot = "path/to/your/dataset"
    
  3. (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)
  4. Run the training script:

    python dp.py
    
  5. Monitor the training progress. The script will print loss values and privacy guarantees every few iterations.

  6. After training, find the trained Generator model saved as netG_dpgan.pth in the project directory.

  7. 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:

Sample Generated Image

🥯 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:

  1. Fork the repository and create your branch from main.
  2. If you've added code that should be tested, add tests.
  3. Ensure your code passes all tests.
  4. Make sure your code lints.
  5. Issue a pull request with a comprehensive description of changes.

For more detailed information, please read our Contribution Guidelines.

🥯 License

MIT License

🥯 Acknowledgements

🥯 Contact

Open an issue or email [team@bagel.net].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ppml-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

ppml-0.1.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file ppml-0.1.2.tar.gz.

File metadata

  • Download URL: ppml-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for ppml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d6b28bc200cfab8fe82a6c619fce6e014de73baacabab59d084f8689e2b281cd
MD5 70aac0df78f89d877df5e02afde83b46
BLAKE2b-256 79b5cf1d7d032a2c4df5d1e3117b40692255062e88aa45482b3b428f40e591c7

See more details on using hashes here.

File details

Details for the file ppml-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ppml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for ppml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 21aeaf7bc63057d0f215016c10c8189a40492e84f733125dabf6e7b9d86cbe01
MD5 a545f985ad32155493998ad550dcbeb4
BLAKE2b-256 cf6500930d0888cfebf0030341bc80cd4f7a2867e8e97f998ba328c6411f26fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page