SPLASH: Learnable activation functions for improving accuracy and adversarial robustness

Mohammadamin Tavakoli, Forest Agostinelli, Pierre Baldi

Abstract

We introduce SPLASH (Simple Piecewise Linear and Adaptive with Symmetric Hinges), a new class of learnable activation functions designed to simultaneously enhance a neural network's accuracy and its resistance to adversarial attacks. By employing a simple, data-driven parameterization, SPLASH units outperform standard fixed activations like ReLU and Swish across multiple benchmarks. Our evaluation shows that SPLASH offers up to a 31% increase in adversarial robustness while maintaining superior classification performance.

Introduction

Most contemporary deep learning models rely on fixed activation functions, most notably the Rectified Linear Unit (ReLU). While effective, these fixed functions limit the expressive capacity of individual neurons. Previous attempts at "learnable" activations, such as PReLU or APL, often struggle with a trade-off between complexity and optimization efficiency. Furthermore, deep networks remain highly vulnerable to adversarial attacks—small, intentional input perturbations that can lead to incorrect classifications. This work proposes SPLASH as a "best of both worlds" solution: an activation function that is easy to learn, highly expressive, and inherently robust.

The SPLASH Framework

The SPLASH unit is a piecewise linear function defined by four key architectural constraints designed to simplify the search space and ensure stability:

  1. Continuity: The function is continuous to ensure stable gradients during backpropagation.
  2. Groundedness: The function is forced through the origin ($f(0) = 0$).
  3. Symmetric Hinges: Hinges are placed symmetrically on the positive and negative x-axis, providing equal expressive power for both input polarities.
  4. Fixed Hinge Locations: Instead of learning hinge positions, SPLASH fixes them based on the standard deviation of the input data, typically leveraging Batch Normalization statistics.

By fixing hinge locations, the model only needs to learn the slopes ($a_s$) of the segments, reducing the parameter count to $S+1$ per layer (where $S$ is the number of hinges).

The hierarchy of constraints leading to the SPLASH activation function, showing the reduction in parameters.

Experimental Results

We evaluated SPLASH across standard computer vision benchmarks (MNIST, CIFAR-10, CIFAR-100) using various architectures including ResNet-20 and All-CNN.

Accuracy Gains

SPLASH consistently achieved lower error rates than nine other activation functions. For instance, on CIFAR-10 with ResNet-20, SPLASH reduced the error rate to 8.18%, compared to 8.71% for ReLU.

Adversarial Robustness

The models were subjected to both black-box (One-Pixel, Boundary) and open-box (FGSM, CW-L2) attacks. SPLASH-based models demonstrated massive robustness gains:

  • One-Pixel attacks: Up to 31% more robust than ReLU models.
  • FGSM attacks: Consistent improvements of up to 28.5%.
  • Confidence: SPLASH units assigned higher confidence to correct labels for perturbed images compared to ReLU.

Analysis and Insights

A key finding is the dynamic evolution of the activation functions. During training, SPLASH units often start with a ReLU-like profile but evolve into complex, frequently symmetric "V" or "W" shapes. This evolution is critical; experiments showed that a fixed activation mimicking the final shape of a trained SPLASH unit does not perform as well as one that learns its shape during training.

Evolution of SPLASH activation shapes across different layers and training epochs.

The symmetry of the final learned shapes appears to act as a shield against adversarial noise by suppressing unusual signals of exceptional magnitude. Furthermore, t-SNE visualizations indicate that SPLASH facilitates better feature separation in the pre-softmax layer, contributing to its higher classification accuracy.

Conclusion and Limitations

SPLASH provides a significant step forward in designing robust and accurate neural networks through learnable activations. While it introduces a computational overhead—training can be 1.2x to 3x slower due to the summation of multiple max functions—the gains in performance and security are substantial. Future work will explore the application of SPLASH in other domains like NLP and further investigate the theoretical properties of the resulting loss landscapes.

Summary updated

BibTeX
@inproceedings{tavakoli2021splash,
  author = {Mohammadamin Tavakoli and Forest Agostinelli and Pierre Baldi},
  title = {{SPLASH: Learnable activation functions for improving accuracy and adversarial robustness}},
  booktitle = {Neural Networks},
  year = {2021},
  url = {https://openreview.net/forum?id=ouPScAfJljS},
}
Figure