Giter Site home page Giter Site logo

tinfoilhat0 / memberinference-by-lossthreshold Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 19 KB

An implementation of loss thresholding attack to infer membership status as described in paper "Privacy Risk in Machine Learning: Analyzing the Connection to Overfitting" (CSF 18) in PyTorch.

Home Page: https://arxiv.org/abs/1709.01604

License: MIT License

Jupyter Notebook 11.69% Python 86.98% Shell 1.33%
adversarial-machine-learning deep-learning membership-inference-attack privacy pytorch

memberinference-by-lossthreshold's Introduction

MemberInference-by-LossThreshold

This is a minimal implementation (in Pytorch 1.11) of loss thresholding attack to infer membership status (i.e., part of training data or not) of data samples. Briefly, we have a threshold T (e.g., avg. training loss), and we predict a sample 'member' if sample loss < T.

Attack code is in src/attacks.py and some results on common image datasets (averaged over 5 runs) are as follows. Note that, baseline balanced acc. is 50% for MIA.

Dataset Model Test Acc (%) Generalization Gap (%) MIA Balanced Acc. (%)
MNIST LeNet 99.2 ± 0.05 0.76 ± 0.04 50.34% ± 0.1
Fashion-MNIST LeNet 90.77 ± 0.11 5.02 ± 0.63 51.85 ± 0.16
CIFAR-10 ResNet20 87.25 ± 0.39 6.8 ± 0.8 52.47 ± 0.42

Simply run src/runner.sh to generate logs, and then run notebooks/tensorboard_log_reader.ipynb to average the results of logs.

memberinference-by-lossthreshold's People

Contributors

tinfoilhat0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.