This repository contains the official code implementation for our paper Towards Adversarial Robustness And Backdoor Mitigation in SSL. If you find this repo useful for your work, please cite our paper.
We implement backdoor-poisoning attacks and evaluate our defense against these attacks on Image Classification Task. Backdoor attacks supported:
Datasets supported:
- CIFAR 10
- CIFAR 100
- IMAGENET 100 (100 class subset of IMAGENET)
- Download the repository from anonymous4openscience.
- Make a virtual environment (optional) (recommended)
virtualenv <env_name> source <env_name>/bin/activate
- Install necessary libraries
pip install -r requirements.txt
We provide a bash script to run our program with appropriate command-line arguments.
- Give permission
chmod +x run.sh
- Call
main_train.py
bash run.sh <--args values>
Call bash run.sh --help
if unsure about the arguments, available options or their meaning.
Results of all experiments are saved in a folder named saves
. Each experiment will create a folder named <job name>
set by run.sh
. Each experiment folder contains model state-dicts and optimizer states saved every 100 epoch, and a tfenvent
file containing tensorboard log. To view training progress and compare training curves:
tensorboard --logdir=saves
When repeating the same experiment with different hyperparameters, use --suffix
option in run.sh
to prevent overwriting log of previous experiment.
- JEPA
- MoCo v2
- ImageNet
- https://robustbench.github.io/
NOTE: This repository uses a lot of base code from CTRL's repository. We refactor their code and implement other models, defenses and attacks. We also completely rewrite the pipeline using lightly for cleaner and shorter code.
This code has a GPL-style license.
@misc{satpathy2024adversarialrobustnessbackdoormitigation,
title={Towards Adversarial Robustness And Backdoor Mitigation in SSL},
author={Aryan Satpathy and Nilaksh Singh and Dhruva Rajwade and Somesh Kumar},
year={2024},
eprint={2403.15918},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2403.15918},
}