Skip to main content

A python package for implementing geo-indistinguishability privacy mechanisms

Project description

GeoPrivacy

This is a python package for implementing geo-indistinguishability privacy mechanism. The methods can be applied to various location privacy tasks. So far, we implemented two privacy mechanisms for the sporadic case as described in the paper Geo-indistinguishability: A Principled Approach to Location Privacy. In the exemple notebook, we demonstrated the mechanisms using NYC taxi trip data for sporadic case.

Installation

Please run the following command in terminal to install the package and other dependencies.

$ pip install GeoPrivacy==0.0.1

pip install GeoPrivacy==0.0.1

Example Usage

To generate a random laplace noise and add it to a location:

from GeoPrivacy.mechanism import random_laplace_noise
eps = 0.1
location = (3, 5)
noise = random_laplace_noise(eps)
new_location = location + noise

Given a list of representative locations and their corresponding weights, you can use the geo-indistinguishable mechanism of optimal utility as following:

from GeoPrivacy import mechanism, metrics
x_list = [(1, 2), (3, 2), (4, 1)]
pi_list = [3, 2, 5]
dQ = metrics.euclidean
epsilon = 0.5

p_matrix, pre_prob, post_prob = optql(x_list, pi_list, dQ, epsilon=0.5)

For more examples, please see example.ipynb. Other information can be found in the docstring.

Theory

The planar laplace mechanism can be used to add laplace noise to any given 2d-coordinates. It's worth noting that polar coordinates are used to generate random laplace noise. In order to randomly draw r, we use the inverse CDF of r which is as calculated in https://hal.inria.fr/hal-01114241/file/paper.pdf.

The optimal utility mechanism divides the region of interest into subregions and builds a linear program using representative points chosen from each subregion. Then, by solving the linear program, a stochastic transition matrix is obtained which can be used to transform any other data from the same region. The linear program takes the following form: img

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

GeoPrivacy-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

GeoPrivacy-0.0.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file GeoPrivacy-0.0.2.tar.gz.

File metadata

  • Download URL: GeoPrivacy-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for GeoPrivacy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3155232a3c87e37b15345cbc5ca20b3e5e49ede18d5f28122681dbd7807b0783
MD5 11dfd5ce3be56390c1d7e059ab6ce340
BLAKE2b-256 50406511d47a8104b2ee0506f7f6c7416123eebfb8bffa183f1e00bf28326d85

See more details on using hashes here.

File details

Details for the file GeoPrivacy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: GeoPrivacy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for GeoPrivacy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c81535dbdc5731f7d93ec08c78c3a3e96e6b6ec2849080fa94e8ce225847428
MD5 e47e1f601c708a3e6347b29383db3b0b
BLAKE2b-256 3423a3e81c5d58009ebeb43cd9c35dd7e7b38f5a0d809f9e7b27b4cd3d4d46f2

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