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.3

pip install GeoPrivacy==0.0.3

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.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

GeoPrivacy-0.0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: GeoPrivacy-0.0.3.tar.gz
  • Upload date:
  • Size: 6.2 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.3.tar.gz
Algorithm Hash digest
SHA256 01886f30ba146d03038d207218e0782af637913c988edb6625f14e56457fb869
MD5 4132c43fc0cf2d47db381d9bd62af835
BLAKE2b-256 adc89c30318260fcf9c7cb4d2093f9e90ba1b4fd595618b96e19228b74b6014b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: GeoPrivacy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee192c87ee1922f9df17862583ca9690814aece5c58683a94409404b2a4407b
MD5 4bfe8b761300cbf5ef940d77317fb576
BLAKE2b-256 d4e217d21e7991758d349217043cb4e89f2f7042a4ae6c07437769da7679fa8f

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