Skip to content

zhenlong-liu/BMIA

Repository files navigation

How does Bayesian Sampling help Membership Inference Attacks?

This repository is the official implementation for the paper: How does Bayesian Sampling help Membership Inference Attacks? at ICML 2026.

This codebase has been tested on Ubuntu 22.04.5 LTS with Python 3.9. Follow the steps below to set up the environment and install dependencies.

Setup

It is recommended to use a Conda environment for setup.

1. Create and Activate Conda Environment

conda create -y -n bmia python=3.9

conda activate bmia

2. Install PyTorch and Related Libraries

Install PyTorch (version >= 1.8.1 required) along with torchvision and torchaudio. The example below uses CUDA 11.8; adjust as needed based on your system.

pip3 install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118

3. Install Additional Project Dependencies

Install the remaining dependencies listed in requirements.txt:

pip install -r requirements.txt

4. Download Model Parameters

Run the provided script to download model parameter files:

bash download_parameter.sh

Optionally, you can train reference and target models using python scripts/train_reference.py and python scripts/train_target.py if needed.

5. Download CIFAR-10 Dataset

Run the script to download the CIFAR-10 dataset:

bash download_cifar10.sh

Perform MIA

Once the setup is complete, execute the MIA script:

python scripts/bmia.py

Citation

If you find this useful in your research, please consider citing:

  @inproceedings{liu2026how,
    title     = {How Does Bayesian Sampling Help Membership Inference Attacks?},
    author    = {Zhenlong Liu and Wenyu Jiang and Feng Zhou and Hongxin Wei},
    booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
    year      = {2026},
    url       = {https://arxiv.org/abs/2503.07482}
  }

About

[ICML'26] How does Bayesian Sampling help Membership Inference Attacks?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors