
Code for the paper Certified Unlearning for Neural Networks, ICML 2025
Este repositório contém a implementação do artigo "Certified Unlearning for Neural Networks" (ICML 2025).
Gradient Clipping no artigoModel Clipping no artigoOutput Perturbation no artigo# 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
O repositório inclui experimentos pré-configurados nos seguintes diretórios:
budget_curve_runs/: Experimentos de análise de orçamento de privacidade - Figura 1convergence_curve_runs/: Experimentos de análise de convergência - Figura 2dp_sgd_runs/: Experimentos DP-SGD e baseline - Figura 3eps_sweep_runs/: Experimentos de varredura do parâmetro de privacidade (ε) - Figura 4 (no Apêndice)Para executar um único experimento com uma configuração específica:
python experiment.py --config dp_sgd_runs/dp-sgd-cifar10-fc/1tmh6p2f_config.yaml
Para executar múltiplos experimentos em paralelo em GPUs:
python run_exp.py -n <num_gpus> -e <experiment_dir> [--offset <gpu_offset>] [-j <jobs_per_gpu>]
Parâmetros:
-n: Número de GPUs a usar-e: Diretório contendo configurações de experimento--offset: Deslocamento do índice da GPU (padrão: 0)-j: Número de trabalhos simultâneos por GPU (padrão: 1)Para experimentos de aprendizado por transferência
python feature_extractor.py
Isso extrai características do ResNet-18 dos CIFAR-10/100 e as salva para uso com as configurações de dataset cifar10_feature e cifar100_feature.
Se você usar este código em sua pesquisa, por favor cite:
@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}
}