acceptodds
Under review as a conference paper at ICLR 2027

Improved Certified Robustness and Adversarial Attacks for Rate-Encoded Spiking Neural Networks

Abstract

Spiking Neural Networks (SNNs) are well known for their energy-efficient neuromorphic implementations and robustness to adversarial examples, especially with rate encoding, which encodes inputs as the rate of binary spikes from a Bernoulli distribution. Recently, rate encoded SNNs under Bernoulli smoothing were shown to be provably robust against any adversarial examples that lie within radius, , from the test input having top two class probabilities and , respectively. However, this radius decreases exponentially with the SNN latency , notwithstanding experimental evidence. We provide an improved adversarial robustness guarantee for the rate-encoded SNNs under the same setting, showing that the certified radius of the smooth classifier decays only linearly with latency, i.e., , offering a larger certified radius of robustness that reduces the gap between empirical and certified robustness. We extend the proof to the recently proposed signed rate encoding, which offers higher standard accuracy than rate encoding. Experimentally, we improve the existing -norm-bounded sparse encoding attack (SEA) and propose SEA-PGD, which consistently outperforms SEA across three standard datasets and encoding techniques.

Primary area:
unsupervised, self-supervised, semi-supervised, and supervised representation learning
Keywords:
Spiking Neural Networks, Certified Robustness, Adversarial Attacks

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_u9uYOpenReview ↗
Rating
3(+1)
Confidence
2(+1)
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper investigates the adversarial robustness theory of rate-coded SNNs. By refining the Lipschitz bounds for Bernoulli-smoothed classifiers, the study improves the dependence of the certified robustness radius on the number of time steps TT from exponential decay to inverse-linear decay, for a fixed class-probability margin, while also extending the certified robustness guarantee to signed rate encoding. Methodologically, the paper proposes SEA-PGD, an iterative sparse attack targeting the encoded spike sequences. Experiments on CIFAR-10, CIFAR-100, and SVHN demonstrate that SEA-PGD is more potent than the original SEA attack. The results further indicate that robustness guarantees in the input space do not inherently cover attacks in the encoding space, though adversarial training can enhance defense performance.

Critical strengths

The exponential decay of the certified radius with respect to time steps TT is improved to linear decay.

Critical weaknesses

Equation (14) is written as Δ=sign⁡(g)−zsign⁡(g)\Delta=\operatorname{sign}(g)-z\operatorname{sign}(g). Taking z=−1,g<0z=-1,g<0, we get Δ=−2\Delta=-2, and after the attack z+Δ=−3z+\Delta=-3, violating the specified $ \{-1,0,1\} $ constraint. It may just be a typo, but the implementation must be checked to determine if it affects the experiment.

Questions for authors

In Table 1, the clean accuracy of a certain signed model in SVHN is 84.35%, but it increases to 93.05% after the SEA attack. While an increase in accuracy after an attack is not entirely impossible, the magnitude of this increase requires explanation.

9 comments

We thank the reviewer for the comments. Equation (14) indeed has a typo. The correct expression should be sign(g)−z∣sign(g)∣sign(g) - z \lvert sign(g)\rvert. We have verified that it does not affect the experiments, we will correct this in the next version of the draft.

Q1: In Table 1, the clean accuracy of a certain signed model in SVHN is 84.35%, but it increases to 93.05% after the SEA attack.

Reviewer J2Ut has the same question. Reproducing the reply for convenience.

As the number of non-zero spikes in Signed Rate Encoding is significantly lower than in Rate Encoding, an l0l_0-norm-bounded perturbation leaves a stronger footprint on the encoded input under Signed Rate Encoding compared to Rate Encoding. It is possible that an adversarially trained model generates a spurious correlation between the adversarially perturbed image and the correct label, and when presented with the same attack, it performs better than without the perturbation. Since this is a shortcut, it actually disappears under the stronger SEA-PGD attack. The same phenomenon can be observed for CIFAR-10 (78.18-> 82.42) and CIFAR-100 (49.92 ->57.76).

Thank you for the clarification. I have two remaining concerns:

  1. In Appendix A.1 (p. 14, lines 707–708), the triangle inequality is written as an equality. In Appendix A.2 (p. 16, line 843), differentiability at zero is incorrectly assumed; signed encoding can yield an expectation proportional to ∣x∣|x|. Moreover, coupling the encodings gives
∣gt(x)y−gt(x′)y∣≤t∥∣x−x′∥∣1,|g_t(x)_y-g_t(x')_y|\le t\||x-x'\||_1,

suggesting that the Lipschitz bound for GTG_T can be reduced from T+1T+1 to (T+1)/2(T+1)/2, doubling the certified radius. Please verify these points and revise the proofs and constants accordingly.

  1. The shortcut explanation is plausible but remains unverified. To adequately address the increase from 84.35% to 93.05%, please: (i) report correct-to-incorrect and incorrect-to-correct prediction transitions, and recompute robust accuracy while retaining zero perturbation as a valid candidate; (ii) test the label-leaking hypothesis, for example by replacing true labels with predicted labels when generating attacks; and (iii) provide paired/repeated evaluations to control encoding randomness, together with implementation checks confirming that the corrected Eq. (14) satisfies the spike-value and sparsity constraints.

We are grateful to the reviewer for the detailed reading of the manuscript.

  1. (i) We have corrected the typo related to the triangle inequality on p. 14, lines 707–708.

    (ii) It is correctly highlighted that the function is non-differentiable at xi=0x_i =0; we should have been more careful. Fortunately, this does not break the proof of Lipschitzness. To simplify the exposition, consider the case with d=1,T=1d=1, T=1, where x∈[−1,1]x \in [-1,1] for signed rate encoding. We have,

\begin{align} g(x) = \mathbb{E}_{z \sim sBer(x)}[f(z)]= f(1) x + f(0) (1-x) \quad \text{if } x\in [0,1]\ \text{and, } g(x) =f(-1) (-x) + f(0) (1+x) \quad \text{if } x \in [-1,0] \end{align} So that,

\begin{align} \lvert g'(x) \rvert = \lvert f(1)- f(0) \rvert \leq 1 \quad \text{if, } x\in (0,1] \text{and,} \quad \lvert g'(x) \rvert = \lvert f(0) -f(-1) \rvert \leq 1 \quad \text{if } x \in [-1,0) \end{align}

We have ∣g′(x)∣≤1\lvert g'(x) \rvert \leq 1 piecewise on the intervals [−1,0)[-1,0) and (0,1](0,1], except at 00 where it is non-differentiable. However, gg is continuous at 00, with g(0)=f(0)g(0)=f(0). By the Mean Value Theorem, a continuous function that is differentiable on finitely many subintervals and whose derivative is bounded in absolute value by LL on each subinterval is globally LL-Lipschitz.

This ensures that the function gg is 11-Lipschitz, for T=1,d=1T=1, d=1. We would extend the argument for the general case and update the proof.

(iii) Showing GTG_T is T+12\frac{T+1}{2}-Lipschitz instead of T+1T+1-Lipschitz, is possible. For T=1T=1, this follows from the above. We will attempt to tighten the proof in the next version of the draft.

  1. (i) and (ii) To verify the shortcut explanation, we have performed test-time evaluations on CIFAR-10, where we compare adversarial attacks with the correct label (Corr.: reported in the left 3 three columns) and predicted label (Pred.: reported in the right 3 three columns) and report the robust accuracy for various attack sparsities, k∈{0,2,4,6,8,10}k \in \{0,2,4,6,8,10\} of the SEA attack. We perform the analysis on three models (STD, SEA-AT, SEA-PGD AT) under signed rate encoding, while only SEA-AT originally had this anomaly. We also report the correct-to-incorrect (C -> I) and incorrect-to-correct (I -> C) rates, as given in the table below:
ModelkkCorr. I→CCorr. C→ICorr. Acc.Pred. I→CPred. C→IPred. Acc.
Standard (clean 82.18)00.000.0082.180.000.0082.18
20.2616.1466.307.6016.1473.64
40.1026.0956.208.8826.0964.97
60.0533.3448.899.4233.3458.27
80.0538.5743.669.5738.5753.18
100.0642.8339.429.7942.8349.15
SEA-AT (clean 78.26)00.000.0078.260.000.0078.26
26.003.4180.853.013.4177.86
47.503.2982.462.833.2977.80
68.313.4283.152.883.4277.72
88.563.8283.012.943.8277.38
108.664.2582.673.074.2577.07
SEA-PGD-AT (clean 78.62)00.000.0078.620.000.0078.62
24.724.0879.263.514.0878.04
45.774.7479.653.514.7477.39
66.344.9480.023.664.9477.34
86.445.6079.463.895.6076.91
106.566.1479.034.116.1476.58

It can be observed that the anomaly can be avoided when predicted labels are used instead of correct labels while constructing the attack. However, using predicted label also amplifies the robust accuracy in other cases.

Reviewer_J2UtOpenReview ↗
Rating
3(+1)
Confidence
4
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The authors consider rate-encoded SNN under Bernoulli smoothing. This paper improves the certified robustness from exponential decay to linear decay with respect to the temporal latency T by deriving a tighter Lipschitz bound. Based on the proposed theory, authors further proposes SEA-PGD as a stronger iterative attack method. Experiments on CIFAR-10, CIFAR-100, and SVHN demonstrate substantially improved certified robustness bounds and the effectiveness of SEA-PGD.

Critical strengths
  1. The paper introduces a solid theoretical analysis and derives a substantially tighter Lipschitz bound for the certified robustness.
  2. The proposed method is evaluated on several standard benchmarks, including CIFAR-10, CIFAR-100, and SVHN.
  3. The paper introduces a stronger iterative attack targeting rate-encoded SNNs. The experimental results demonstrate its effectiveness compared with the existing method.
Critical weaknesses
  1. One of the major issue is that the theoretical improvement mainly relies on Bernoulli randomized smoothing rather than the specific neuronal dynamics or computational properties of SNNs. The authors should clarify what unique advantages SNNs provide under the rate-encoded setting. For example, one could consider evaluating an ANN with Bernoulli-encoded inputs to investigate whether the proposed certified robustness guarantee still holds and compare the performance under attack with robustSNNs.

  2. The framework is restricted to rate-based encoding, which is too narrow as it does not fully exploit the temporal information processing capabilities of SNNs. Have the authors consider generalizing the certified robustness framework to broader encoding schemes, such as time-to-first-spike (TTFS) or temporal coding.

  3. All reported experiments use a fixed timestep. In the main paper, the authors only vary the number of Monte Carlo sample numbers, while skipping the investigation of different inference time settings.

Questions for authors

In Table 1, SVHN+Signed Rate Encoding, Why model accuarcy under SEA attack are even high than clean accuracy. (93.05>84.35, 89.35>86.25)

3 comments

We thank the reviewer for the insightful comments.

Q1. Evaluating an ANN with Bernoulli-encoded inputs to investigate whether the proposed certified robustness guarantee still holds and compare the performance under attack with robust SNNs.

This is indeed a great suggestion. Yes, our analysis is not specific to SNNs; it generalizes whenever the input is Bernoulli-encoded. We can certainly train a VGG network (ANN equivalent to VGGSNN) with Bernoulli-encoded input for T=1T=1, and offer a certified robustness guarantee. However, the clean accuracy of such a network will not be very high, as encoding with T=1T=1 contains less information about the original input x∈[0,1]d\mathbf x \in [0,1]^d compared to encoding with T=4T=4. This can be observed from the Table below, in which we compare these models on CIFAR-10.

To compare ANN vs. SNN performance on comparable input, i.e., with T=4T=4, we train a standard VGG network that takes the entire encoded input ZT∈0,1d×TZ_T \in \\{0,1\\}^{d \times T} and produces the class probabilities. As reported in the Table below, the standard accuracy offered by the ANN is slightly higher than the SNN, but the parameter dimension of the input convolution is also higher than the SNN (SNN processes the input in TT steps, for each step, the input dimension is 0,1d\\{0,1\\}^d). The certified robustness of the ANN can be computed using Lemma 4, which states that the Lipschitzness of such a classifier gTg_T is 2T2T, so that for a given input the certified robustness radius is pa−pb2L=pa−pb4T\frac{p_a - p_b}{2L}=\frac{p_a - p_b}{4T}, which is slightly worse than the SNN certified robustness of pa−pb2(T+1)\frac{p_a - p_b}{2(T+1)}, introduced due to averaging of neuronal output over time steps.

ModelLipschitznessClean Acc.Evaluationε = 0.01ε = 0.02ε = 0.05
ANN (T = 1)L = 2T = 270.18Certified68.3667.4864.33
PGD-ℓ₁69.6969.6869.64
ANN (T = 4)L = 2T = 881.96Certified78.4075.6060.74
PGD-ℓ₁81.9081.8981.81
SNN (T = 4)L = T + 1 = 579.38Certified75.1772.7764.46
PGD-ℓ₁78.9678.7478.98

Q2. Have the authors considered generalizing the certified robustness framework to broader encoding schemes, such as time-to-first-spike (TTFS) or temporal coding?

A key aspect of standard TTFS is that the encoding is deterministic, i.e., the pixel intensity xi∈[0,1]x_i \in [0,1] completely determines the encoding zi∈0,1T\mathbf{z_i} \in \\{0,1\\}^T. Our proof essentially leverages the randomness introduced by the encoding for robustness guarantees, and it is empirically verified that deterministic encoding, such as constant/direct encoded SNNs, does not offer robustness under standard training, as can be found in Table 1 in [mukhoty2024certified]. Since standard TTFS does not introduce randomness in the encoding, there seems to be little scope for robustness. However, deriving robustness guarantees for stochastic TTFS is an important future direction.

Q3. The authors only vary the number of Monte Carlo samples, while skipping the investigation of different inference time.

Given a test input x\mathbf{x}, the certified radius is computed as r=pa−pb2(T+1)r=\frac{p_a - p_b}{2(T+1)}, where pap_a and pbp_b are top two class probabilities. By fixing ϵ\epsilon, we compute the fraction of test points that offer a certified radius $ r$ greater than ϵ\epsilon to compute the certified test accuracy.

Thus, by fixing ϵ\epsilon, we can compare the old and the proposed certified test accuracies across different inference latencies TT. The following table shows this comparison for ϵ=0.01\epsilon=0.01. Similar to Figure 1 in the paper, the results show improvement in the certified robustness.

EncodingMetric346810
RateCertified, old bound59.350.000.000.000.00
Certified, new bound72.7175.1778.0479.1380.14
Empirical (PGD-ℓ₁)76.5678.9681.7883.0484.00
Clean77.0278.8281.8782.5084.61
Signed rateCertified, old bound65.210.000.000.000.00
Certified, new bound76.7178.9780.9882.2782.73
Empirical (PGD-ℓ₁)80.5581.9484.4485.4786.09
Clean80.1881.8984.6585.2786.11

Q4. In Table 1, why model accuarcy under SEA attack are even high than clean accuracy?

As the number of non-zero spikes in Signed Rate Encoding is significantly lower than in Rate Encoding, an $ l_0$-norm-bounded perturbation leaves a stronger footprint on the encoded input under Signed Rate Encoding compared to Rate Encoding. It is possible that an adversarially trained model generates a spurious correlation between the adversarially perturbed image and the correct label, and when presented with the same attack, it performs better than without the perturbation. Since this is a shortcut, it actually disappears under the stronger SEA-PGD attack. The same phenomenon can be observed for CIFAR-10 (78.18-> 82.42) and CIFAR-100 (49.92 ->57.76).

This is further clarified in the discussion with reviewer u9uY, which shows that some incorrect predictions on clean images (i.e., with zero perturbation) can have correct predictions on adversarial images, as adversarial attacks use the correct label. This goes away as we base our adversarial attacks on predicted labels, or put the restriction that both clean prediction and adversarial example have to be correctly classified to be counted under robust accuracy.

Reviewer_VaNVOpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
1
Soundness
2
Read review
Paper summary

This work presents a theoratical proof for certified robustness of rate coded SNNs, it reduces the gap between empirical and certified robustness.

Critical strengths

This work's proof reduces the gap between certified robustness and the emperical evaluation. It is helpful for develop more robust SNNs. The SEA-PGD is a good idea and focus on a realstic setting, wthere spikes are flipped while the original image remains unchanged.

Critical weaknesses

Though the idea is interesting, the presentation shall be improved:

proposed SEA-PGD attack is listed as a primary contribution in the introduction, however it is presented in inor subsection disproportionately. and the it is not presented very clear. It would be bettter if authors can reorganize it. and in addition, authors shall explain in a more understandable language, and highlight that this approach directly manipulates/flips individual spikes, rather than changing original image pixel values.

The structure needs improvements. The paper presents empirical results and data plots prematurely in Section 3.2 and Figure 1. And then it abruptly shifts to theoratical analysis of section 4. It would be better if theoratical framework and emperical analysis can be seperated clearly.

Questions for authors
  1. Since SEA-PGD attacks in the encoding space, is it possible to apply it to DVS datasets?

  2. Though authors apply k=10 and 20 in the SEA-PGD to limit altered spike numbers. what are the total spike number and averate spike of the original input? Sparsity is a relative metric, it is necessary to comapre altered spike number and total spike number of input to under how much the input is changed to pefrorm the attack. For example, If a specific time frame only possesses 60 natural spikes, altering 20 of them represents a 33% corruption of the active signal, which may not be considered as sparse.

2 comments

We thank the reviewer for the insightful comments.

In the next version of the draft, we will incorporate a more detailed description of SEA-PGD and restructure the paper as suggested in the critical weakness section. To emphasize, the key reason that SEA-PGD improves over SEA despite the same l0l_0 budget is that SEA-PGD explores gradient directions at ZT+ΔsZ_T + \Delta_s, while SEA only looks at gradients at ZTZ_T. The gradient obtained at ZT+ΔsZ_T + \Delta_s can be globally a more important direction to move towards than what can be observed at ZTZ_T. Additionally, we accept the perturbation only when Δs+1\Delta_{s+1} offers a higher loss compared to Δs\Delta_{s}.

Q1. Since SEA-PGD attacks in the encoding space, is it possible to apply it to DVS datasets?

Yes, we have now implemented the SEA-PGD attack on DVS-CIFAR-10, and compared it with SEA. The table below reports the robust accuracies for attack sparsity budget k=10 and k=20. The results demonstrate the effectiveness of SEA-PGD over SEA. The temporal events of a DVS-CIFAR-10 data are split into T=10T=10 frames of resolution 2×128×1282 \times 128\times128 and downsampled to 2×48×482 \times 48\times48. The VGGSNN model for CIFAR-10 is used, layers resized for 2×48×482\times 48\times48 input. It is trained with the CIFAR-10 recipe, as reported in the paper.

CLEANSEA(k=10)SEA-PGD (k=10)SEA(k=20)SEA-PGD(k=20)
75.8045.3037.1030.8021.40

Q2. Sparsity of the attack relative to the input.

We would like to highlight that k=10, or, k=20k=10, \text{ or, } k=20 pixels per frame are altered, where a frame size is e.g., 3×32×32=30723\times 32 \times 32 = 3072. As suggested by the reviewer, we compute the mean non-zero pixels per frame (μ^\hat{\mu}), where the mean is taken over all test images and T=4T=4 frames per image. Considering k=20k=20, we report attack sparsity k∗100μ^\frac{k*100}{\hat{\mu}} in the last column, which shows that the corruptions are indeed sparse.

DatasetEncodingEntriesMean ± stdMedianSparsity
CIFAR-10Rate30721464 ± 38414411.37%
Signed3072680 ± 2176472.94%
CIFAR-100Rate30721473 ± 45214271.36%
Signed3072720 ± 2526682.78%
SVHNRate30721407 ± 54913771.42%
Signed3072611 ± 2755423.27%
CIFAR10-DVSDVS46081573 ± 35115771.27%

Thanks for update. It is good to see proposed method works on DVS gesture. I don't have additional concerns.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.