Opacus
A Python library that adds differential privacy to PyTorch training, tracks privacy budgets during runs and supports most PyTorch model types.

Opacus is a Python library for training PyTorch models with differential privacy. It's for machine learning practitioners adapting existing training code and researchers experimenting with private training methods.
- PyTorch integration: Add differential privacy to most types of PyTorch models with limited changes to the neural network and training code.
- Privacy budget tracking: Monitor the privacy budget consumed as training progresses.
- Gradient computation: Compute per-sample gradients in a vectorized form to reduce the overhead compared with microbatching.
- Research extensibility: Use a modular API to experiment with differential privacy methods within a PyTorch workflow.
Opacus is open source under the Apache 2.0 license. It integrates with the model, optimizer and data loader in your training code.