本仓库包含论文《Certified Unlearning for Neural Networks》(ICML 2025)的实现。
Gradient ClippingModel ClippingOutput Perturbation# Clone the repository
git clone https://github.com/stair-lab/certified-unlearning-neural-networks-icml-2025.git
cd certified-unlearning-neural-networks-icml-2025
# alternatively use conda
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
.
├── src/
│ ├── data/
│ │ ├── base_datamodule.py # Base data loading functionality
│ │ ├── cifar_dataset.py # CIFAR-10/100 data loaders
│ │ ├── mnist_dataset.py # MNIST data loader
│ │ └── datamodule.py # Data module factory
│ ├── models/
│ │ ├── model.py # Model factory
│ │ ├── tiny_net.py
│ │ └── two_layer_net.py
│ ├── training/
│ │ └── trainer.py # Main training/unlearning logic
│ └── utils/
│ ├── dp.py
│ └── utils.py
├── experiment.py # Main experiment runner
├── run_exp.py # Multi-GPU experiment launcher
├── feature_extractor.py # Extract ResNet-18 backbone features
仓库包含以下目录中的预配置实验:
budget_curve_runs/:隐私预算分析实验 - 图 1convergence_curve_runs/:收敛性分析实验 - 图 2dp_sgd_runs/:DP-SGD 和基线实验 - 图 3eps_sweep_runs/:隐私参数(ε)扫描实验 - 图 4(见附录)要使用特定配置运行单个实验:
python experiment.py --config dp_sgd_runs/dp-sgd-cifar10-fc/1tmh6p2f_config.yaml
要在多个 GPU 上并行运行多个实验:
python run_exp.py -n <num_gpus> -e <experiment_dir> [--offset <gpu_offset>] [-j <jobs_per_gpu>]
参数:
-n:要使用的 GPU 数量-e:包含实验配置的目录--offset:GPU 索引偏移量(默认:0)-j:每个 GPU 的并发任务数(默认:1)用于迁移学习实验
python feature_extractor.py
这将从 CIFAR-10/100 中提取 ResNet-18 特征,并将其保存,供 cifar10_feature 和 cifar100_feature 数据集配置使用。
如果您在研究中使用此代码,请引用:
@article{koloskova2025certified,
title={Certified Unlearning for Neural Networks},
author={Koloskova, Anastasia and Allouah, Youssef and Jha, Animesh and Guerraoui, Rachid and Koyejo, Sanmi},
journal={arXiv preprint arXiv:2506.06985},
year={2025}
}