• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PipelineDP is a Python framework for applying differentially private aggregations to large datasets using batch processing systems such as Apache Spark, Apache Beam, and more.

PipelineDP

PipelineDP is a framework for applying differentially private aggregations to large datasets using batch processing systems such as Apache Spark, Apache Beam, and more.

To make differential privacy accessible to non-experts, PipelineDP:

  • Provides a convenient API familiar to Spark or Beam developers.
  • Encapsulates the complexities of differential privacy, such as:
    • protecting outliers and rare categories,
    • generating safe noise,
    • privacy budget accounting.
  • Supports many standard computations, such as count, sum, and average.

Additional information can be found at pipelinedp.io.

Note that this project is still experimental and is subject to change. At the moment we don't recommend its usage in production systems as it's not thoroughly tested yet. You can learn more in the Roadmap section.

The project is a collaboration between OpenMined and Google in an effort to bring Differential Privacy to production.

Getting started

Here are some examples of how to use PipelineDP:

Please check out the codelab for a more detailed demonstration of the API functionality and usage.

Code sample showing private processing on Spark:

# Define the privacy budget available for our computation.
budget_accountant = pipeline_dp.NaiveBudgetAccountant(total_epsilon=1,
                                                      total_delta=1e-6)

# Wrap Spark's RDD into its private version. You will use this private wrapper
# for all further processing instead of the Spark's RDD. Using the wrapper ensures
# that only private statistics can be released.
private_movie_views = \
    make_private(movie_views, budget_accountant, lambda mv: mv.user_id)

# Calculate the private sum of ratings per movie
dp_result = private_movie_views.sum(
    SumParams(
              # The aggregation key: we're grouping data by movies
              partition_extractor=lambda mv: mv.movie_id,
              # The value we're aggregating: we're summing up ratings
              value_extractor=lambda mv: mv.rating,

              # Limits to how much one user can contribute:
              # .. at most two movies rated per user
              #    (if there's more, randomly choose two)
              max_partitions_contributed=2,
              # .. at most one ratings for each movie
              max_contributions_per_partition=1,
              # .. with minimal rating of "1"
              #    (automatically clip the lesser values to "1")
              min_value=1,
              # .. and maximum rating of "5"
              #    (automatically clip the greater values to "5")
              max_value=5)
              )
budget_accountant.compute_budgets()

# Save the results
dp_result.saveAsTextFile(FLAGS.output_file)

Installation

PipelineDP without any frameworks:

pip install pipeline-dp

If you like to run PipelineDP on Apache Spark:

pip install pipeline-dp pyspark

on Apache Beam:

pip install pipeline-dp apache-beam.

Supported Python version >= 3.7.

Note for Apple Silicon users: PipelineDP pip package is currently available only for x86 architecture. The reason is that PyDP does not have pip pacakge. It might be possible to compile it from sources for Apple Silicon.

Development

To setup a local environment and contribute with the development of PipelineDP, please see our guidelines in CONTRIBUTING.

Support and Community on Slack

If you have questions about the PipelineDP, join OpenMined's Slack and check the #differential-privacy channel.

More Repositories

1

PySyft

Perform data science on data that remains in someone else's server
Python
9,477
star
2

TenSEAL

A library for doing homomorphic encryption operations on tensors
C++
790
star
3

PyGrid-deprecated---see-PySyft-

A Peer-to-peer Platform for Secure, Privacy-preserving, Decentralized Data Science
Python
614
star
4

PyDP

The Python Differential Privacy Library. Built on top of: https://github.com/google/differential-privacy
Python
486
star
5

private-ai-resources

SOON TO BE DEPRECATED - Private machine learning progress
469
star
6

PyVertical

Privacy Preserving Vertical Federated Learning
Python
213
star
7

SyferText

A privacy preserving NLP framework
Python
196
star
8

courses

A place where our community can discuss OpenMined Courses, including posting questions, sharing feedback, or providing comments for discussion!
168
star
9

syft.js

The official Syft worker for Web and Node, built in Javascript
JavaScript
147
star
10

Roadmap

This repository contains OpenMined's official development and community roadmap.
131
star
11

PSI

Private Set Intersection Cardinality protocol based on ECDH and Bloom Filters
C++
128
star
12

SyMPC

A SMPC companion library for Syft
Python
96
star
13

KotlinSyft

The official Syft worker for secure on-device machine learning
Kotlin
83
star
14

PyDentity

A repository for leveraging Self-Sovereign Identity in applications
Jupyter Notebook
65
star
15

PySyft-TensorFlow

SOON TO BE DEPRECATED - The TensorFlow bindings for PySyft
Python
57
star
16

Threepio

A multi-language library for translating commands between PyTorch, TensorFlow, and TensorFlow.js
Python
56
star
17

sycret

Function Secret Sharing library for Python and Rust with hardware acceleration
Rust
50
star
18

SwiftSyft

The official Syft worker for iOS, built in Swift
Swift
47
star
19

openmined-website

The OpenMined website...
JavaScript
43
star
20

covid-alert

A privacy-preserving app for comparing last-known locations of coronavirus patients
JavaScript
43
star
21

PyFE

A library for running Functional Encryption on tensors
Python
41
star
22

PIR

Private Information Retrieval protocol
C++
41
star
23

PyZPK

Python wrapper for open source Zero Proof Knowledge Library
C++
27
star
24

openmined

OpenMined courses application
TypeScript
25
star
25

opus

Python
22
star
26

PyAriesFL

Federated Learning on HyperLedger Aries
Python
21
star
27

syft-proto

Defines types for all Serde encoding across languages
JavaScript
20
star
28

datasets

Jupyter Notebook
16
star
29

pygrid-admin

The user interface for PyGrid!
TypeScript
13
star
30

JavaDP

Differential privacy implementation in the Java family of languages (Java, Kotlin, Scala etc...)
11
star
31

aries-did.js

A repo for exploring the use of Hyperledger Aries to facilitate decentralised identity services.
TypeScript
11
star
32

syft_experimental

Deliberate experimental Rust implementation of Syft
Rust
11
star
33

SwiftDP

Swift wrapper for Google's Differential Privacy Project
Objective-C++
11
star
34

writing

11
star
35

sgx-experiments

Trusted execution experiments with Intel SGX
Makefile
11
star
36

omui

The OpenMined UI component system for usage in all our web applications and Framer prototyping
TypeScript
10
star
37

design

This is the main hub for those interested in design in the OpenMined community
Jupyter Notebook
10
star
38

CampX

Tensor Based Environment Framework for Training RL Agents - Pre Alpha
Python
8
star
39

.github

All our community health files
7
star
40

design-assets

All OpenMined design assets
7
star
41

Bootcamps

7
star
42

serverless-website-api

SOON TO BE DEPRECATED - A Github statistics fetcher, running on a cron job, with permanent storage to DynamoDB, for the OpenMined community.
JavaScript
7
star
43

privacy-conference

The website for our 2020 privacy conference
JavaScript
6
star
44

PyDPValidator

Validation assets for core OpenMined libraries
Jupyter Notebook
6
star
45

X-PenTest

Repository for carrying out Pentesting on OM Infrastructure
6
star
46

NetworkRegistry

5
star
47

miner

A collection of web scraping technologies focused around making it easy for users to download their data.
5
star
48

paillier.js

A pure javascript implementation of paillier - runnable in browser, node, or react native
TypeScript
5
star
49

research

5
star
50

Hackathon-DSA

Jupyter Notebook
4
star
51

openmined-ghost-theme

SOON TO BE DEPRECATED - The theme for the OpenMined and Weekly Digs blogs.
SCSS
4
star
52

GridMonitor

SOON TO BE DEPRECATED - A user interface for monitoring a network router for PyGrid Platform
CSS
3
star
53

daa.js

A javascript wrapper around https://github.com/xaptum/ecdaa
3
star
54

diffPrivR

R implementation of google's differential privacy library
3
star
55

syft-enclave

Python
3
star
56

syft.cpp

SOON TO BE DEPRECATED - A library for encrypted, privacy preserving machine learning
C++
3
star
57

OpenGridNodes

1
star
58

KotlinPSI

A Kotlin library for private set intersection
1
star
59

clojure-dp

Clojure
1
star
60

trasterisk

kwarger is a Flake8 plugin which enforces named kwargs or trasterisks in your function arguments
Python
1
star
61

SwiftPSI

A Swift library for private set intersection
1
star