Opacus Library for Training PyTorch Models

Opacus is an AI launched by Facebook AI. It is a new high-speed library for training PyTorch models with differential privacy.

Differential privacy is a system for publicly sharing information about a dataset by describing the patterns of groups within the dataset while withholding information about individuals in the dataset.”

Opacus, being open-source, is available for public use and is licensed under Apache-2.0. To install the latest version of Opacus, you can use pip: pip install opacus. The library has also been open-sourced on GitHub.

Github: https://github.com/pytorch/opacus?

Other features that Opacus have to offer are listed by Marktechpost as the following:

  • “Opacus can compute batched per-sample gradients (By leveraging Autograd hooks in PyTorch), resulting in a speedup by order of magnitude compared to existing differential privacy libraries that rely on micro-batching.

The library is meant to support training and has minimal impact on training performance. In machine learning and boost research this can make it easier to work with these solutions.

The goal is apparently to preserve the privacy of each training sample and keep in view that it doesn’t have much impact on the accuracy of the final model.

Facebook AI wrote about it in a recent blog post:

This is #500daysofAI and you are reading article 463. I am writing one new article about or related to artificial intelligence every day for 500 days.

AI Policy and Ethics at www.nora.ai. Student at University of Copenhagen MSc in Social Data Science. All views are my own. twitter.com/AlexMoltzau