Skip to main content
QUICK REVIEW

[Paper Review] Diffprivlib: The IBM Differential Privacy Library

Naoise Holohan, Stefano Braghin|arXiv (Cornell University)|Jul 4, 2019
Privacy-Preserving Technologies in Data7 references66 citations
TL;DR

This paper introduces Diffprivlib, an open-source Python library that provides differential privacy mechanisms, DP-enabled machine learning models, and data analysis tools, with tight integration to NumPy and scikit-learn.

ABSTRACT

Since its conception in 2006, differential privacy has emerged as the de-facto standard in data privacy, owing to its robust mathematical guarantees, generalised applicability and rich body of literature. Over the years, researchers have studied differential privacy and its applicability to an ever-widening field of topics. Mechanisms have been created to optimise the process of achieving differential privacy, for various data types and scenarios. Until this work however, all previous work on differential privacy has been conducted on a ad-hoc basis, without a single, unifying codebase to implement results. In this work, we present the IBM Differential Privacy Library, a general purpose, open source library for investigating, experimenting and developing differential privacy applications in the Python programming language. The library includes a host of mechanisms, the building blocks of differential privacy, alongside a number of applications to machine learning and other data analytics tasks. Simplicity and accessibility has been prioritised in developing the library, making it suitable to a wide audience of users, from those using the library for their first investigations in data privacy, to the privacy experts looking to contribute their own models and mechanisms for others to use.

Motivation & Objective

  • Motivate the need for a unified, accessible codebase for differential privacy research and applications.
  • Present a general-purpose Python library that implements DP mechanisms and models.
  • Show integration with popular Python data science tools (NumPy and scikit-learn) to ease adoption.
  • Demonstrate usage through examples and tutorials to encourage contribution and exploration.

Proposed method

  • Introduce the Diffprivlib library and its design goals (simplicity, accessibility, open source).
  • Describe the three main modules: mechanisms, models, and tools, and how they interoperate.
  • Explain the API design (e.g., set_epsilon, set_sensitivity, randomise) and the close alignment with NumPy/Scikit-learn conventions.
  • Provide installation details (pip install diffprivlib) and integration with existing Python tooling.
  • Offer a worked example (GaussianNB on Iris) to illustrate DP training and evaluation.

Experimental results

Research questions

  • RQ1What DP mechanisms are implemented in diffprivlib and how are they organized?
  • RQ2How can users train and evaluate differentially private machine learning models with the library?
  • RQ3How does diffprivlib integrate with NumPy and scikit-learn to facilitate DP experimentation?
  • RQ4What guidance does the library provide to prevent privacy leaks and ensure correct configuration?

Key findings

  • Diffprivlib provides a broad collection of DP mechanisms grouped into submodules (e.g., Laplace, Gaussian, Geometric).
  • The library offers DP-enabled machine learning models that mirror scikit-learn APIs, enabling near-one-line model fitting.
  • Tools for differentially private histograms and basic statistics are included and leverage NumPy-equivalent functionality.
  • The package includes warnings (PrivacyLeakWarning, DiffprivlibCompatibilityWarning) to help users avoid privacy leaks and incompatibilities.
  • A worked example demonstrates DP Gaussian Naive Bayes on Iris with an 80/20 train/test split and DP accuracy analysis across varying epsilon values.
  • The library is released under MIT license, designed for broad accessibility, and welcomes community contributions.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.