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

pip install GeoPrivacy==0.0.4

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: GeoPrivacy-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 e51b4adfe189f8a6ea2e66e3f937d9dfe1e17bd22d4ceff6320a92dc574fef71
MD5 1d028385c1dccb21c86931d63e7a681e
BLAKE2b-256 7ff784f0e07ce895d92df6621cfc11ae28bc99a2a7e9df375d7c01edae3b3be4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: GeoPrivacy-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3cc2cf37c7b8bc692fb919f3ee9fa7aafb60947d8aa84d27d660e2020357b10
MD5 9ab4f7d183a6011579880d5cd8612ea4
BLAKE2b-256 fd7c955ceb96cc45d3c8d7506b06b150d7c8ce9caddcdf40f93dd581a2bd8513

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