Adversarial Fine-tuning of Compressed Neural Networks for Joint Improvement of Robustness and Efficiency

Hallgrimur Thorsteinsson, Valdemar J. Henriksen, Tong Chen, Raghavendra SelvanarXiv 2024 · DOI

Abstract

This paper demonstrates that adversarial robustness and model efficiency are not mutually exclusive. By applying "Adversarial Fine-tuning" (AFT) to pre-compressed models for a minimal duration, the authors achieve robustness levels comparable to full adversarial training while reducing computational costs by nearly 90%. The study investigates the synergy between structured pruning, post-training quantization, and a lightweight training strategy, proving that compressed models can maintain high defense capabilities.

Introduction

Deep Learning (DL) currently faces a significant challenge: models are becoming increasingly massive, leading to high energy consumption, yet they remain fragile to adversarial attacks. Standard solutions like Adversarial Training (AT) are computationally expensive, while model compression techniques like pruning or quantization are often thought to degrade a model's defensive potential. This research asks whether high robustness and high efficiency can be achieved simultaneously without the massive overhead of full adversarial training.

Methods

The authors evaluate the combination of two compression techniques with a lightweight training strategy:

  1. Structured Pruning: Removing filters based on their $\ell_1$-norm to physically reduce model size.
  2. Post-Training Quantization (PTQ): Reducing weight precision (e.g., from 32-bit floats to 8-bit integers) to speed up inference.
  3. Adversarial Fine-tuning (AFT): The core innovation where a pre-compressed model is fine-tuned using Projected Gradient Descent (PGD) attacks for only 3 epochs.

The study utilizes Fashion-MNIST (8-layer CNN) and CIFAR10 (ResNet-18) as benchmark datasets.

Key Results and Insights

The Synergy of Compression and Robustness

Contrary to common assumptions, compression does not inherently destroy a model's potential for robustness. The experimental results across different sparsity levels and quantization bit-widths show that models can retain significant performance and defensibility.

Performance of pruned and quantized models across Fashion-MNIST and CIFAR10 datasets.

The "3-Epoch Miracle"

A striking finding is that just three epochs of adversarial fine-tuning are sufficient to recover most of the robustness lost during compression. This suggests that the features required for robustness are still present in compressed networks and only require a brief "nudge" to be reactivated. On CIFAR10, a pruned model using AFT achieved a robustness of approximately 57%, matching the performance of a full-sized model trained with expensive, full-scale adversarial training.

Detailed performance of $\ell_1$-norm pruning on the CIFAR10 dataset.

Computational Efficiency

The reduction in training time is substantial. For the CIFAR10 dataset, full adversarial training took approximately 118 minutes, whereas AFT of a compressed model took only 14 minutes—a nearly 8.5x reduction. This "double win" provides both faster inference (via compression) and significantly faster training (via AFT).

Quantization vs. Pruning

The authors observed that Post-Training Quantization (PTQ) often yielded better test accuracy and robustness than more complex methods in their setup. However, accuracy drops sharply when quantization goes below 8 bits (e.g., at INT4 and lower).

Conclusion

This work establishes that adversarial robustness and model efficiency can be jointly optimized. By leveraging Adversarial Fine-tuning on compressed architectures, it is possible to deploy resilient models with a fraction of the typical computational and environmental costs. Future work will explore these findings across more diverse architectures like Vision Transformers and a wider array of adversarial attack types.

Summary updated

BibTeX
@misc{thorsteinsson2024adversarial,
  author = {Hallgrimur Thorsteinsson and Valdemar J. Henriksen and Tong Chen and Raghavendra Selvan},
  title = {{Adversarial Fine-tuning of Compressed Neural Networks for Joint Improvement of Robustness and Efficiency}},
  year = {2024},
  eprint = {2403.09441},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.09441},
}
Figure