Parameterizing Activation Functions for Adversarial Robustness

Sihui Dai, Saeed Mahloujifar, Prateek Mittal

TL;DR

This paper demonstrates that we can significantly boost a neural network's resistance to adversarial attacks by replacing standard ReLU activations with learnable, parametric activation functions (PAFs). By introducing just 1-2 extra parameters per network, the authors' proposed PSSiLU activation achieves state-of-the-art robust accuracy on benchmarks like RobustBench, bridging the performance gap between small and large models.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are notoriously fragile; tiny, invisible perturbations to an input (adversarial attacks) can flip a model's prediction. The gold standard for defense is Adversarial Training (AT), which essentially involves training the model on these "hard" examples.

However, AT is "capacity-hungry." Previous research shows that larger models (wider and deeper) perform better under AT. But scaling up models is computationally expensive. The authors ask a clever question: Instead of adding millions of parameters by making the network bigger, can we add just a few parameters to the activation functions to achieve the same robustness?

Methods

The authors investigate how the shape of an activation function influences robustness. They break their approach into three steps:

  1. The Search: They tested six existing parametric activations (like PReLU and PSoftplus) on standard models using "weak" adversaries. This allowed them to isolate the effect of the activation shape from the complexities of adversarial training.
  2. The Discovery: They identified two key "robust" traits:
  3. Positive outputs for negative inputs: Unlike ReLU, which zeros out negative values, robust functions tend to have a slight positive slope or curve for $x < 0$.
  4. High finite curvature: Smooth transitions (curvature) near zero are better than the sharp "kink" found in ReLU.
  5. The Innovation (PSSiLU): They combined these traits into a new function: the Parametric Shifted Sigmoidal Linear Unit (PSSiLU).
  6. It uses two parameters: $\alpha$ (controls curvature) and $\beta$ (controls the behavior on negative inputs).
  7. Formula: $PSSiLU_{\alpha,\beta}(x) = x(\sigma(\alpha x) - \beta) / (1 - \beta)$

Finally, they integrated these PAFs into the Adversarial Training pipeline, allowing the network to "learn" its own optimal activation shape during training.

Datasets

The models were evaluated on standard computer vision benchmarks:

  • CIFAR-10 & CIFAR-100: The primary testing grounds.
  • ImageNette: A 10-class subset of ImageNet.
  • Synthetic Data (DDPM-6M & TI-500K): Crucially, the authors found that learnable activations can overfit. Using 6 million synthetic images generated by a Denoising Diffusion Probabilistic Model (DDPM) acted as a powerful regularizer, allowing the PAFs to reach their full potential.

Key Insights and Ideas

  • Shape Over Size: You don't always need a bigger "brain" (more neurons); sometimes you just need better "filters" (activations). Adding 2 parameters to the whole network provided a boost equivalent to adding millions of parameters via model widening.
  • Natural Convergence: When the researchers let the models learn their own activation parameters, the models naturally "chose" the shapes that the researchers had identified as robust (positive negative-slope and high curvature). This validates that these geometric properties are fundamentally linked to robustness.
  • The Data Dependency: Learnable activations are a double-edged sword. Without enough data, they can overfit to the training set's noise. The massive success of this paper relies heavily on the use of high-quality synthetic data to "anchor" the learnable parameters.
  • Smoothness is Safety: Smooth functions (like PSoftplus and PSSiLU) consistently outperformed "kinked" functions (like ReLU or PReLU) in adversarial settings.

Key Results

  • State-of-the-Art: A WideResNet-28-10 model using PSSiLU achieved 61.96% AutoAttack accuracy on CIFAR-10, topping the RobustBench leaderboard at the time of the study.
  • Efficiency Gains: On a ResNet-18, PSSiLU improved robust accuracy by 4.54% over standard ReLU while adding only two parameters to the entire architecture.
  • Bridging the Gap: A smaller ResNet-18 with PSSiLU was able to close 5.6% of the performance gap between itself and a much larger WideResNet model using standard ReLU.

Limitations and Future Work

  • Overfitting Risk: The performance of PAFs drops if additional synthetic data or strong regularization isn't used. They are not a "drop-in" fix for low-data regimes.
  • Regularization Sensitivity: The authors had to use L1 regularization on the $\beta$ parameter to keep the activation shape stable.
  • Future Directions: The authors suggest exploring other forms of regularization, such as directly penalizing the Lipschitz constant or the curvature of the network, to further stabilize the learning of these functions. They also aim to combine PSSiLU with other advanced training pipelines.

Summary updated

BibTeX
@inproceedings{dai2022parameterizing,
  author = {Sihui Dai and Saeed Mahloujifar and Prateek Mittal},
  title = {{Parameterizing Activation Functions for Adversarial Robustness}},
  booktitle = {SP (Workshops)},
  year = {2022},
  doi = {10.1109/spw54247.2022.9833884},
}
Figure