Toward Robust Spiking Neural Network Against Adversarial Perturbation

Ling Liang, Kaidi Xu, Xing Hu, Lei Deng, Yuan Xie

Abstract

As spiking neural networks (SNNs) are increasingly deployed in efficiency-critical applications, their security against adversarial perturbations has become a significant concern. While adversarial training and certification have matured for artificial neural networks (ANNs), these techniques do not directly translate to SNNs due to their discrete spike-based communication and complex temporal dynamics. This paper presents the first comprehensive framework for robust SNN training. We introduce S-IBP and S-CROWN, methods designed to handle the non-linearities of Leaky Integrated-and-Fire (LIF) neurons. By formalizing boundaries for both digital and spike-based inputs, we demonstrate a significant reduction in adversarial vulnerability. Our experiments show up to a 37.7% reduction in attack error with a minimal 3.7% loss in clean accuracy, marking a foundational step toward secure neuromorphic computing.

1. Introduction

Spiking Neural Networks (SNNs) represent a paradigm shift in neural computing, mimicking the energy-efficient, event-driven nature of the biological brain. By utilizing discrete spikes over time, SNNs offer substantial power savings when deployed on specialized neuromorphic hardware like Intel’s Loihi. However, like their continuous-valued counterparts (ANNs), SNNs are susceptible to adversarial attacks—small, intentional perturbations that can lead to catastrophic misclassification.

While "certified robustness" has emerged as a gold standard for defending ANNs, the mathematical foundations of these defenses rely on continuous activations and differentiability. SNNs, characterized by the non-differentiable Heaviside step function and temporal dependencies, break these standard tools. This work addresses this gap by proposing a robust training framework tailored to the unique mechanics of spiking neurons.

2. Methodology: S-IBP and S-CROWN

The core of our approach involves adapting linear relaxation-based verification to the SNN architecture. We focus on the Leaky Integrated-and-Fire (LIF) model, which governs how neurons accumulate membrane potential and fire spikes.

2.1 S-IBP (Spiking Interval Bound Propagation)

S-IBP is a forward-propagation technique that computes the interval bounds of a neuron's state. Given an input within a defined noise range (e.g., an $\ell_\infty$ ball), S-IBP propagates these ranges through the network to determine the maximum and minimum possible membrane potentials at each layer. This provides a conservative estimate of the network's output range under perturbation.

2.2 S-CROWN

Because IBP bounds can become excessively loose in deep networks, we introduce S-CROWN. This method utilizes linear relaxations to approximate the non-linear "fire" and "reset" functions of the LIF neuron. By wrapping the jagged Heaviside function in linear upper and lower bounds, S-CROWN allows for a more precise backward pass to compute tighter output boundaries.

2.3 Formalizing Input Boundaries

A key contribution of this work is the formalization of noise boundaries for two distinct input types:

  • Digital Inputs: Standard image data where perturbations are measured by continuous intensity changes.
  • Spike Inputs: Native neuromorphic data (e.g., from event cameras) where perturbations involve the addition or removal of discrete spikes.

3. Experimental Evaluation

We evaluated the proposed framework across three datasets: MNIST, Fashion-MNIST (FMNIST), and N-MNIST (a neuromorphic version of MNIST). Our experiments utilized both Fully Connected (FC) and Convolutional (CONV) SNN architectures.

3.1 Robustness Performance

The proposed robust training significantly improved the models' resilience to adversarial attacks. On the MNIST dataset with a CONV architecture, we achieved a 37.7% reduction in attack error. Crucially, this robustness did not come at the expense of general utility; the "clean" accuracy (accuracy on unperturbed data) only decreased by 3.7%.

3.2 The Role of Temporal Dynamics

SNNs operate over multiple time steps ($T$). We found that while SNNs typically require many steps for inference, robust training is most effective when optimized over a smaller temporal window. Using $T'=3$ steps during the robust training phase provided the optimal balance between computational efficiency and the tightness of the mathematical bounds.

3.3 Architecture and Stability

Our analysis revealed that Convolutional SNNs are generally more amenable to robust training than Fully Connected models. The spatial hierarchy of CONV layers appears to better absorb the constraints imposed by the S-CROWN/S-IBP bounds. Furthermore, the S-CROWN loss remained stable throughout the training process, indicating that our linear relaxations effectively mitigate the instability typically associated with discrete spiking functions.

4. Discussion and Limitations

While this work establishes a baseline for SNN robustness, several challenges remain:

  • Computational Overhead: Robust training is computationally intensive, often running up to 12.9x slower than standard training. This presents a barrier to scaling the method to larger datasets like ImageNet.
  • Bound Tightness: As networks grow in depth or temporal duration, the interval bounds naturally widen, potentially reducing the effectiveness of the defense.
  • Spike-Based Attack Space: For native spike inputs, the search space for perturbations is technically unbounded, necessitating further research into specialized certification for event-based data.

5. Conclusion

This research provides the first robust training framework specifically engineered for the unique constraints of Spiking Neural Networks. By introducing S-IBP and S-CROWN, we demonstrate that it is possible to provide mathematical guarantees for SNNs, bringing them closer to secure deployment in real-world, energy-sensitive applications.

Summary updated

Abstract

As spiking neural networks (SNNs) are deployed increasingly in real-world efficiency critical applications, the security concerns in SNNs attract more attention. Currently, researchers have already demonstrated an SNN can be attacked with adversarial examples. How to build a robust SNN becomes an urgent issue. Recently, many studies apply certified training in artificial neural networks (ANNs), which can improve the robustness of an NN model promisely. However, existing certifications cannot transfer to SNNs directly because of the distinct neuron behavior and input formats for SNNs. In this work, we first design S-IBP and S-CROWN that tackle the non-linear functions in SNNs' neuron modeling. Then, we formalize the boundaries for both digital and spike inputs. Finally, we demonstrate the efficiency of our proposed robust training method in different datasets and model architectures. Based on our experiment, we can achieve a maximum $37.7\%$ attack error reduction with $3.7\%$ original accuracy loss. To the best of our knowledge, this is the first analysis on robust training of SNNs.
BibTeX
@inproceedings{liang2022toward,
  author = {Ling Liang and Kaidi Xu and Xing Hu and Lei Deng and Yuan Xie},
  title = {{Toward Robust Spiking Neural Network Against Adversarial Perturbation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=Ncyc0JS7Q16},
}
Figure