TL;DR
Conventional neural networks speak in continuous numbers, while brain-inspired Spiking Neural Networks (SNNs) communicate in binary flashes—either a neuron fires a spike, or it stays silent. Because SNNs only care when an internal voltage crosses a firing threshold, defending them against adversarial attacks shouldn't mean policing every tiny numerical ripple, as traditional defenses do. Instead, this paper makes SNNs dramatically more robust by gently nudging internal voltages away from the "cliff's edge" of the firing threshold, preventing attackers from easily flipping spikes on or off.
What Problem Does This Paper Address?
Spiking Neural Networks (SNNs) are the darlings of low-power edge computing and neuromorphic hardware because they process information via sparse, discrete events rather than dense matrix multiplications. Each neuron acts like a leaky bucket (specifically, a Leaky Integrate-and-Fire model): incoming signals build up an internal "membrane potential," and if it hits a threshold, the neuron emits a binary spike (1) and resets; otherwise, it outputs 0.
Like standard Artificial Neural Networks (ANNs), SNNs are vulnerable to adversarial attacks—imperceptible noise crafted to fool the model. Historically, researchers tried to toughen up SNNs by borrowing ANN defenses that force internal continuous numbers to stay utterly still under attack.
Here is the catch: in an SNN, if a neuron's voltage wiggles from 0.2 to 0.4 (when the threshold is 1.0), downstream layers never even know it happened. The neuron still outputs 0. Enforcing strict numerical stability everywhere wastes optimization effort on harmless fluctuations while ignoring the real danger: neurons sitting at 0.99, right on the razor's edge of misfiring.
Methods
The authors reframe SNN robustness around discrete events rather than continuous values, introducing two diagnostic metrics and a new training regularizer:
- Spike Flips & Flip Rate: A "spike flip" occurs when an adversarial input causes a neuron at a specific timestep to change its binary decision (
0to1, or1to0). Averaging this across the network gives the flip rate, a clean, training-agnostic metric for instability. - Margin Occupancy (MO): How do we measure how many neurons are loitering dangerously close to the firing threshold? Instead of inventing an arbitrary distance window, the authors cleverly repurpose the surrogate gradient—the smooth mathematical curve already used during backpropagation to approximate the non-differentiable spike step-function. MO uses this curve to score how densely a layer's voltages crowd the threshold.
- Margin-Resculpted Learning (MRL): You cannot just banish all neurons from the threshold region; if no voltages live near the boundary, surrogate gradients vanish and the network stops learning entirely! MRL solves this by adding a penalty to the training loss only when a layer's Margin Occupancy exceeds an activity-adaptive budget, defined as $[r_\ell(1 - r_\ell)]^2$, where $r_\ell$ is the layer's average firing rate. In addition, gradient-norm matching automatically balances this regularizer against standard cross-entropy loss without manual hyperparameter tuning.
Datasets
The authors evaluate MRL across both standard static image benchmarks and neuromorphic, event-based vision datasets (captured by Dynamic Vision Sensors that natively output asynchronous pixel-change events):
- Static Images: CIFAR-10, CIFAR-100, and large-scale ImageNet.
- Event-based (DVS): DVS-CIFAR10 and DVS-Gesture.
No new datasets were introduced; these are standard benchmarks used to test scalability and cross-domain SNN performance.
Key Insights and Ideas
- Vulnerability lives at the cliff's edge: As attack strength grows, classification error tracks monotonically with the global spike flip rate. Digging deeper, layers with high flip rates show sharp spikes of membrane potentials clustered right on the firing threshold, whereas stable layers have dispersed distributions.
- Clean-data geometry predicts adversarial failure: Layer-wise Margin Occupancy—measured purely on clean, unattacked inputs—correlates remarkably well with how badly that layer's spikes will flip under attack (Spearman rank correlation $\rho > 0.7$ across all tested settings, and often $\rho > 0.9$).
- The Goldilocks zone of threshold crowding: Ablating the adaptive budget (forcing MO all the way to zero) causes training to completely collapse to random guessing (e.g., 10.28% clean accuracy on CIFAR-10 with a Rectangle surrogate). Neurons need some threshold occupancy to learn, and tying that allowance to Bernoulli firing uncertainty $r_\ell(1 - r_\ell)$ hits the sweet spot between trainability and robustness.
Key Results
MRL consistently outperforms state-of-the-art SNN defenses across architectures (VGG11, ResNet18, NF-ResNets), surrogate gradient shapes, and white-box/black-box attacks (FGSM, PGD, APGD):
- CIFAR-100 (VGG11): Under white-box PGD attacks, baseline SNNs drop to nearly 0% accuracy. MRL reaches up to 14.25% accuracy, substantially beating recent defenses like DSD (8.09%) and FEEL (2.04%).
- CIFAR-10 (VGG11): MRL boosts white-box PGD accuracy from 0.03% (vanilla SNN) to 32.89%, while maintaining 92.57% clean accuracy.
- Scaling to ImageNet: On NF-ResNet50, MRL lifts white-box FGSM accuracy from 7.02% to 22.72% and PGD accuracy from 0.02% to 9.33%.
- Neuromorphic Data: On DVS-CIFAR10, MRL achieves 69.10% (FGSM) and 63.40% (PGD) accuracy, outperforming prior defenses. Furthermore, rigorous diagnostic checks confirm these gains come from genuine spike stability rather than "gradient obfuscation" (tricking the attacker's optimizer with broken gradients).
Limitations and Future Work
- The Clean-Robustness Trade-off: Because MRL actively pushes membrane potentials out of the prime operating zone of surrogate gradients, models experience a slight dip in clean accuracy (typically 1%–5% depending on the architecture and dataset). Resolving this fundamental trade-off remains an open challenge for the field.
- Training Overhead: Computing layer-wise margin occupancy and gradient-norm balancing introduces a modest increase in training cost (though inference remains completely untouched).
Summary updated