Skip to content
Adversarially Robust Transfer Learning with LWF loss applied to the deep feature representation (penultimate) layer
Python Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

Adversarially Robust Transfer Learning

This repo contains parts of the learning without forgetting experiment of the Adversarially Robust Transfer Learning (ICLR 2020) paper. In the paper, we study and identify the source of robustness and use our finding to do robust transfer learning by distilling the robustness of a teacher network on to the student network. Using adversarially robust transfer learning, we can learn a robust model for a target dataset where we have limited number of training data.

Adversarially robust transfer learning with the LwF loss

Adversarially Robust Transfer Learning with a learning without forgetting loss applied to the deep feature representation (penultimate) layer. The idea is to regularize the network to maintain its robustness (using the LwF penalty) but allow it also to adopt itself to the target dataset. Our scripts are inspired by the Madry Lab CIFAR10 Adversarial Example Challenge and we give them credit for that.

running the model from a robust CIFAR-100 to a CIFAR-10 model.

To run the training script, we need to have the target dataset and the source pre-trained model.

Download the dataset you want to transfer to (target) and place it in its corresponding folder. For CIFAR-10 (default), you can run the following to download CIFAR-10 and place it in the correct directory:


Download a pre-trained source model (default is an adversarially trained CIFAR100 model). The robust CIFAR-100 model can be downloaded using

python adv_trained_cifar100 

Given the robust model and the target dataset, you can run the main training script:


Citing the paper

If you liked the paper, please consider citing it.

  title={Adversarially robust transfer learning},
  author={Shafahi, Ali and Saadatpanah, Parsa and Zhu, Chen and Ghiasi, Amin and Studer, Christoph and Jacobs, David and Goldstein, Tom},
  journal={arXiv preprint arXiv:1905.08232},
You can’t perform that action at this time.