Skip to main content
QUICK REVIEW

[Paper Review] How and When Adversarial Robustness Transfers in Knowledge Distillation?

Rulin Shao, Jinfeng Yi|arXiv (Cornell University)|Oct 22, 2021
Adversarial Robustness in Machine LearningComputer Science30 references5 citations
TL;DR

This paper proposes KDIGA (Knowledge Distillation with Input Gradient Alignment) to transfer adversarial robustness from teacher to student models, which standard KD fails to preserve. By aligning the input gradients of student and teacher networks during distillation, KDIGA ensures the student achieves at least the same certified robustness as the teacher, with empirical gains of up to 17.81% robust accuracy on CIFAR-10 and 37.5% on ImageNet, while maintaining or improving clean accuracy.

ABSTRACT

Knowledge distillation (KD) has been widely used in teacher-student training, with applications to model compression in resource-constrained deep learning. Current works mainly focus on preserving the accuracy of the teacher model. However, other important model properties, such as adversarial robustness, can be lost during distillation. This paper studies how and when the adversarial robustness can be transferred from a teacher model to a student model in KD. We show that standard KD training fails to preserve adversarial robustness, and we propose KD with input gradient alignment (KDIGA) for remedy. Under certain assumptions, we prove that the student model using our proposed KDIGA can achieve at least the same certified robustness as the teacher model. Our experiments of KD contain a diverse set of teacher and student models with varying network architectures and sizes evaluated on ImageNet and CIFAR-10 datasets, including residual neural networks (ResNets) and vision transformers (ViTs). Our comprehensive analysis shows several novel insights that (1) With KDIGA, students can preserve or even exceed the adversarial robustness of the teacher model, even when their models have fundamentally different architectures; (2) KDIGA enables robustness to transfer to pre-trained students, such as KD from an adversarially trained ResNet to a pre-trained ViT, without loss of clean accuracy; and (3) Our derived local linearity bounds for characterizing adversarial robustness in KD are consistent with the empirical results.

Motivation & Objective

  • To investigate why standard knowledge distillation fails to preserve adversarial robustness in student models.
  • To develop a method that enables transfer of adversarial robustness from a teacher to a student model, even across different architectures.
  • To theoretically prove that the student model trained with KDIGA achieves at least the same certified robustness as the teacher under mild assumptions.
  • To analyze the role of local linearity in adversarial robustness transfer during knowledge distillation.
  • To validate the method on diverse models, including ResNets and Vision Transformers, across ImageNet and CIFAR-10.

Proposed method

  • Introduces KDIGA, a knowledge distillation framework that minimizes the L2 norm of the difference between input gradients of the student and teacher models during training.
  • Modifies the standard KD loss to include a gradient alignment regularization term, encouraging the student to mimic the input gradient direction of the teacher.
  • Derives theoretical bounds on certified robustness based on local linearity measures (LLM), cross-entropy loss, and gradient alignment norm.
  • Applies the method to distill from adversarially trained ResNets to smaller models like MobileNetV2 and pre-trained ViTs.
  • Combines KDIGA with adversarial training (ARD) to further improve robustness, achieving lower theoretical bounds and better empirical performance.
  • Uses PGD attacks with varying perturbation radii to evaluate robust accuracy on CIFAR-10 and ImageNet.

Experimental results

Research questions

  • RQ1Why does standard knowledge distillation fail to preserve adversarial robustness from teacher to student models?
  • RQ2Under what conditions can adversarial robustness be successfully transferred from a teacher to a student model in knowledge distillation?
  • RQ3Can adversarial robustness be transferred between fundamentally different architectures, such as ResNets and Vision Transformers?
  • RQ4How does input gradient alignment in KDIGA improve the local linearity and robustness of student models?
  • RQ5Can KDIGA be applied to pre-trained student models without degrading clean accuracy while boosting robustness?

Key findings

  • KDIGA increases the robust accuracy of a MobileNetV2 student model from 5.97% to 17.81% on CIFAR-10 when distilled from an adversarially trained WideResNet, with higher clean accuracy than standard KD.
  • On ImageNet, KDIGA boosts student robust accuracy from 1.5% (standard KD) to 37.5%, significantly outperforming baseline methods.
  • KDIGA enables robustness transfer from an adversarially trained ResNet to a pre-trained Vision Transformer, increasing ViT robust accuracy by 11.1× without sacrificing clean accuracy.
  • Students distilled with KDIGA achieve robustness equal to or exceeding that of the teacher, even when the student has a different architecture (e.g., MobileNetV2 from ResNet).
  • Theoretical bounds based on local linearity measures closely match empirical robustness trends, with KDIGA and ARD achieving lower bounds than standard KD.
  • Combining KDIGA with adversarial distillation (ARD) further reduces the theoretical robustness bound, achieving the lowest bound of 1.081 at ε=4/255 on CIFAR-10.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.