Abstract
Spiking Neural Networks (SNNs) have attracted significant attention due to their energy-efficient properties and potential application on neuromorphic hardware. State-of-the-art SNNs are typically composed of simple Leaky Integrate-and-Fire (LIF) neurons and have become comparable to ANNs in image classification tasks on large-scale datasets. However, the robustness of these deep SNNs has not yet been fully uncovered. In this paper, we first experimentally observe that layers in these SNNs mostly communicate by rate coding. Based on this rate coding property, we develop a novel rate coding SNN-specified attack method, Rate Gradient Approximation Attack (RGA). We generalize the RGA attack to SNNs composed of LIF neurons with different leaky parameters and input encoding by designing surrogate gradients. In addition, we develop the time-extended enhancement to generate more effective adversarial examples. The experiment results indicate that our proposed RGA attack is more effective than the previous attack and is less sensitive to neuron hyperparameters. We also conclude from the experiment that rate-coded SNN composed of LIF neurons is not secure, which calls for exploring training methods for SNNs composed of complex neurons and other neuronal codings.
Introduction
Spiking Neural Networks (SNNs) are often considered the "third generation" of neural networks, utilizing discrete spikes to process information in a biologically inspired, energy-efficient manner. A prevailing assumption in the field has been that SNNs are inherently more robust to adversarial attacks than standard Artificial Neural Networks (ANNs) due to their non-differentiable, temporal nature. However, this research challenges that assumption by demonstrating that many high-performance SNNs rely primarily on rate coding—where the frequency of spikes matters more than their precise timing.
Methodology: Rate Gradient Approximation (RGA)
The core of the proposed vulnerability lies in the Rate Gradient Approximation (RGA) attack. Traditional attacks, such as Spatio-temporal Backpropagation (STBP), attempt to unroll the network's dynamics across every time step. This process is computationally expensive and often suffers from vanishing gradients.
In contrast, RGA exploits the rate-coding nature of modern SNNs. By performing a "spike shuffle" experiment, the authors confirmed that reordering spikes within a time window has negligible impact on accuracy, proving that firing rates are the primary information carriers. RGA replaces the complex temporal backpropagation with a surrogate gradient derived from the Static R-I Curve—the mathematical relationship between input current ($I$) and firing rate ($r$).
The method is generalized for both Integrate-and-Fire (IF) and Leaky Integrate-and-Fire (LIF) neurons. By using a relaxation parameter ($\beta$), the authors ensure stable gradient flow even at the boundaries of the activation function.
Experimental Evaluation
The RGA attack was evaluated on CIFAR-10, CIFAR-100, and the neuromorphic CIFAR10-DVS dataset using VGG-11 and ResNet-17 architectures. The results demonstrate that RGA consistently outperforms STBP in both white-box and black-box scenarios.
Key findings include:
- Superior Effectiveness: RGA often achieves a 100% success rate in white-box attacks where previous methods failed to reach full coverage.
- Enhanced Transferability: Adversarial examples generated by RGA are more effective at fooling models in black-box settings, showing a 5-8% improvement in success rate over STBP.
- Robustness to Hyperparameters: Unlike STBP, which is highly sensitive to the neuron's "leaky" constant, RGA remains consistently effective across different neuron configurations.
Conclusion
The success of the RGA attack reveals that the perceived robustness of current SNNs is largely a byproduct of inadequate attack methodologies rather than an inherent property of the architecture. As long as SNNs rely on rate coding, they remain vulnerable to gradient-based adversarial examples. This work serves as a critical call to the neuromorphic community to move beyond simple rate coding and explore more complex temporal coding schemes that may offer genuine security advantages.
Code is available at: https://github.com/putshua/SNN_attack_RGA
Summary updated