A Fast and Efficient Conditional Learning for Tunable Trade-Off between Accuracy and Robustness

Souvik Kundu, Sairam Sundaresan, Massoud Pedram, Peter A. BeerelarXiv 2022

Abstract

Existing models that achieve state-of-the-art (SOTA) performance on both clean and adversarially-perturbed images rely on convolution operations conditioned with feature-wise linear modulation (FiLM) layers. These layers require many new parameters and are hyperparameter sensitive. They significantly increase training time, memory cost, and potential latency which can prove costly for resource-limited or real-time applications. In this paper, we present a fast learnable once-for-all adversarial training (FLOAT) algorithm, which instead of the existing FiLM-based conditioning, presents a unique weight conditioned learning that requires no additional layer, thereby incurring no significant increase in parameter count, training time, or network latency compared to standard adversarial training. In particular, we add configurable scaled noise to the weight tensors that enables a trade-off between clean and adversarial performance. Extensive experiments show that FLOAT can yield SOTA performance improving both clean and perturbed image classification by up to ~6% and ~10%, respectively. Moreover, real hardware measurement shows that FLOAT can reduce the training time by up to 1.43x with fewer model parameters of up to 1.47x on iso-hyperparameter settings compared to the FiLM-based alternatives. Additionally, to further improve memory efficiency we introduce FLOAT sparse (FLOATS), a form of non-iterative model pruning and provide detailed empirical analysis to provide a three way accuracy-robustness-complexity trade-off for these new class of pruned conditionally trained models.

Introduction

Deep learning models face a significant trade-off: Adversarial Training (AT) improves resistance to malicious perturbations but typically degrades performance on clean images. To address this, "Once-for-all" (OAT) frameworks were developed to allow a single model to adapt its behavior. However, current OAT methods rely on Feature-wise Linear Modulation (FiLM) layers, which introduce substantial architectural overhead, increasing parameter counts and inference latency. This paper introduces FLOAT (Fast Learnable Once-for-all Adversarial Training), a method that achieves tunable robustness through weight-level conditioning without the need for additional layers.

Methods: Weight Conditioned Learning

The fundamental shift in FLOAT is moving conditioning from the feature space to the weight space. Instead of modulating feature maps using FiLM, FLOAT modifies the existing weights of the model during the forward pass based on a conditioning parameter $\lambda$.

Comparison of (a) FiLM-based OAT architecture and (b) the proposed FLOAT weight-conditioned architecture.

FLOAT employs Weight Conditioned Learning. During training, a binary switch $\lambda$ determines the mode:

  1. Clean Mode ($\lambda=0$): The model uses its base weights $\theta$.
  2. Robust Mode ($\lambda=1$): A learned noise tensor $\eta$ is added to the weights: $\hat{\theta} = \theta + \alpha \cdot \eta$.

To handle the differing statistics of clean and adversarial activations, FLOAT utilizes Dual Batch Normalization (BN), maintaining separate BN sets for each mode. At inference, a continuous hyperparameter $\lambda_n \in [0, 1]$ allows users to scale the noise and smoothly navigate the accuracy-robustness trade-off. Furthermore, FLOATS extends this by incorporating non-iterative pruning, enabling a three-way trade-off between accuracy, robustness, and model complexity.

Experimental Results

The authors evaluated FLOAT and its sparse variant, FLOATS, across benchmarks including CIFAR-10/100, Tiny-ImageNet, SVHN, and STL10 against attacks like PGD and AutoAttack.

Performance comparison of FLOAT and FLOATS against OAT across different datasets, showing improvements in accuracy and memory efficiency.

FLOAT consistently outperforms FiLM-based OAT models. Key findings include:

  • Efficiency: FLOAT achieves up to 1.43x faster training and uses up to 1.47x fewer parameters than OAT.
  • Performance Gains: Clean accuracy improved by up to ~6%, while robust accuracy saw gains of up to ~10%.
  • Hardware Latency: Real hardware measurements indicate that FLOAT's convolutional layers are up to 1.66x faster than OAT due to the absence of sequential modulation layers.
  • Sparsity: The FLOATS-slim variant can reduce model storage by 10x while maintaining competitive robustness, effectively managing the complexity-accuracy-robustness triangle.

Conclusion

FLOAT provides a highly efficient alternative to FiLM-based conditional models by leveraging weight-level noise as a conditioning signal. By eliminating architectural overhead, it enables tunable robustness for resource-constrained environments. Future work will address the transition smoothness between Batch Normalization modes and explore the theoretical underpinnings of why weight-level noise serves as such an effective proxy for adversarial robustness.

Summary updated

BibTeX
@misc{kundu2022fast,
  author = {Souvik Kundu and Sairam Sundaresan and Massoud Pedram and Peter A. Beerel},
  title = {{A Fast and Efficient Conditional Learning for Tunable Trade-Off between Accuracy and Robustness}},
  year = {2022},
  eprint = {2204.00426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.00426},
}
Figure