Coder Social home page Coder Social logo

topete-research / bvm-library Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 423 KB

[Mirror Repository] Bayes Vulnerability for Microdata library.

Home Page: https://github.com/nunesgh/bvm-library

License: GNU Lesser General Public License v3.0

Python 100.00%
bayes-vulnerability microdata python qif quantitative-information-flow

bvm-library's Introduction

BVM library

DOI

Quantitative Information Flow assessment of vulnerability for microdata datasets using Bayes Vulnerability.

DOI: 10.5281/zenodo.6533704.

This repository provides an implementation of the paper Flexible and scalable privacy assessment for very large datasets, with an application to official governmental microdata (DOI: 10.56553/popets-2022-0114, arXiv: 2204.13734) that appeared in PoPETs 2022, and of the masters thesis A formal quantitative study of privacy in the publication of official educational censuses in Brazil (DOI: hdl:1843/38085). Please refer to the folder examples for the Notebooks containing the actual results for the experiments performed.

Installation

Use the package manager pip to install bvmlib.

pip install bvmlib

Usage

Warning: Please fill NA and NaN values!

A fix will be provided in a later version.

Meanwhile, consider using the pandas .fillna() method before calling the BVM() class, e.g. when creating the pandas DataFrame, as shown below.

Single-dataset

import pandas
from bvmlib.bvm import BVM

# Create a pandas DataFrame for your data.
# For instance:
df = pandas.read_csv(file.csv).fillna(-1)

# Create an instance.
I = BVM(df)

# Assign quasi-identifying attributes.
I.qids(['attribute_1','attribute_2'])

# Assign sensitive attributes (optional).
I.sensitive(['attribute_2','attribute_3'])

# Perform vulnerability assessment.
I_results = I.assess()

# Print re-identification results.
print(I_results['re_id'])

# Print attribute-inference results (only if computed).
print(I_results['att_inf'])

Additional examples

Please refer to the folder examples for additional usage examples, including attacks on longitudinal collections of datasets.

Note on the results

For privacy assessment of Collective Re-identification (CRS / CRL), for each list of quasi-identifying attributes (QID), the following results are computed:

  • dCR: corresponds to the deterministic metric;
  • pCR: corresponds to the probabilistic metric;
  • Prior: corresponds to the adversary's prior knowledge in a probabilistic attack;
  • Posterior: corresponds to the adversary's posterior knowledge in a probabilistic attack;
  • Histogram: corresponds to the distribution of individuals according to the chance of re-identification.

For privacy assessment of Collective (sensitive) Attribute-inference (CAS / CAL), for each list of quasi-identifying attributes (QID) and for each sensitive attribute (Sensitive), the following results are computed:

  • dCA: corresponds to the deterministic metric;
  • pCA: corresponds to the probabilistic metric;
  • Prior: corresponds to the adversary's prior knowledge in a probabilistic attack;
  • Posterior: corresponds to the adversary's posterior knowledge in a probabilistic attack;
  • Histogram: corresponds to the distribution of individuals according to the chance of attribute-inference.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU LGPLv3 1.

Footnotes

  1. To understand how the various GNU licenses are compatible with each other, please refer to:

    https://www.gnu.org/licenses/gpl-faq.html#AllCompatibility โ†ฉ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.