WorksComputer Science
Are Spiking Neural Networks Harder to Steal? The Role of Stochastic Encoding in Model Extraction
Abstract
Machine learning models deployed on edge devices are vulnerable to model stealing attacks, in which an adversary replicates a model using only its predictions. Existing defenses add mechanisms that are costly on resource-constrained hardware. Spiking neural networks (SNNs) offer energy-efficient inference at the edge and have been shown to leak less information about their training data than artificial neural networks (ANNs). This work investigates whether SNNs also resist model stealing and identifies the source of any such resistance. We evaluate four model stealing attacks against SNN and ANN models on three image datasets and introduce a metric that accounts for the stochastic outputs of SNNs. SNNs exhibit greater resistance than ANNs: on average, surrogate models extracted from SNNs agree with their targets 38% less often outside the training distribution, and targeted adversarial examples crafted on these surrogates transfer 54% less often. This resistance, however, arises mainly from the randomness of their input encoding rather than from their spiking computation, and an adversary who repeats each query can largely overcome it. SNNs therefore protect against model stealing without additional defense mechanisms, but this protection does not withstand adaptive adversaries.
Introduction
Machine learning models increasingly run on edge devices [1] in sensitive domains such as healthcare [2] and finance [3]. Deployment exposes these models to model stealing attacks (MSAs), in which an adversary queries a model, observes its predictions, and trains a surrogate that replicates its functionality using only the top-1 labels that any deployed classifier returns [4, 5, 6, 7]. The surrogate transfers the value of the model to the adversary and serves as a white-box proxy for further attacks, such as transferable adversarial examples [5, 8] and membership inference attacks (MIAs) [9].
Existing defenses detect suspicious query patterns [10] or perturb the returned predictions [11]. Both add a mechanism to the deployed system, which is costly on edge devices with limited energy and memory, and an adversary who owns the device can query it without the monitoring that a cloud service enforces. These constraints motivate architectures that limit extraction inherently.
Spiking neural networks (SNNs) are a promising candidate for such an architecture. SNNs communicate through sparse binary spikes and integrate their inputs over time in leaky integrate-and-fire (LIF) neurons, which enables energy-efficient inference on neuromorphic hardware [12]. Prior work shows that, compared with artificial neural networks (ANNs), SNNs reduce the success of MIAs [13, 14, 15, 16] and model inversion [17, 18], and that rate-encoded SNNs resist black-box adversarial examples [19]. These studies, however, address data-centric threats or input perturbations, and the resistance of SNNs to the replication of their decision function has not been systematically examined.
The stochasticity of rate encoding complicates this evaluation. Rate encoding samples spikes at random, so a rate-encoded SNN can return different labels for repeated queries of the same input. Lower agreement with an SNN target may therefore reflect noise in its outputs rather than a decision function that is harder to approximate. Standard extraction metrics assume a deterministic target and conflate these two effects, yet separating them determines whether a defender can rely on the resistance of SNNs.
This paper examines whether SNNs limit model extraction in the absence of dedicated defense mechanisms and identifies the mechanism responsible for any such resistance. We compare ANN and rate-encoded SNN targets with a shared convolutional backbone under four label-only attacks, namely Papernot [5], N-FGSM, N-DFGSM, and COLOR [10], on MNIST [20], Fashion-MNIST [21], and CIFAR-10 [22], and we measure fidelity, adversarial transferability, and query efficiency. To separate the fidelity of the surrogate from the stochasticity of the target, we normalize agreement by the output consistency of the SNN target, which bounds the agreement that any surrogate can attain. We also evaluate an adaptive adversary that queries each input five times and keeps the most frequent label, which we refer to as majority voting.
Under single-query attacks, the SNN target resists extraction more strongly than the ANN target. Surrogates match its predictions on natural inputs in most settings, but their agreement with it on random inputs is 38% lower on average, and targeted adversarial examples crafted on them transfer to it 54% less often. Most of this resistance, however, stems from stochastic encoding: normalization by output consistency reduces the deficit in random agreement to 8%, and majority voting restores targeted transfer on MNIST to the level attained against the ANN target. Rate-encoded SNNs therefore resist extraction without additional mechanisms, but an adaptive adversary can remove most of this resistance at a higher query cost.
The main contributions of this paper are as follows:
A systematic benchmark of model extraction against SNNs. We evaluate four label-only attacks against ANN and SNN targets on three datasets in terms of fidelity, adversarial transferability, and query efficiency.
A methodology for evaluating extraction against stochastic targets. We introduce output consistency, which bounds the agreement that any surrogate can attain and separates the fidelity of the surrogate from the noise of the target.
An attribution of SNN resistance to stochastic encoding. We show that stochastic outputs account for most of the reduction in random agreement and adversarial transferability that SNN targets exhibit.
An evaluation of adaptive adversaries and query budgets. We show that majority voting restores targeted transferability to the level of the ANN target, whereas a larger single-query budget does not raise agreement beyond the consistency bound; only a 6% gap in test agreement on MNIST persists.
Background
Privacy attacks on machine learning models span several threat models. Model inversion attacks recover representative inputs or sensitive attributes from model predictions [23], and MIAs determine whether specific samples were used during training [24, 25]. These attacks succeed against a range of ANN architectures and show that black-box query access alone can expose information about the training data of a model. For SNNs, prior work reports reduced vulnerability under both threat models, with lower MIA success rates [13, 14, 15, 16] and greater resistance to input reconstruction [17, 18]. These studies generally attribute this reduction to the sparse, event-driven nature of spike-based computation and the temporal dynamics of LIF neurons. A related line of work finds that SNNs with Poisson rate encoding resist adversarial examples better than ANNs, particularly in black-box settings, and attributes this robustness to the discretization that the encoder introduces and to the leak of LIF neurons [19].
Existing privacy studies of SNNs, however, address data-centric threats, in which the adversary seeks information about training samples. Whether the same properties limit the ability of an adversary to replicate the decision function of a model through query access has not been systematically examined; work on watermarking SNNs evaluates extraction only as a means of evading ownership verification [26]. We address this question by comparing the extractability of ANN and SNN targets under identical attacks and query budgets.
Spiking Neural Networks
SNNs encode information through discrete spike events over time rather than continuous activations [27, 28]. In the discrete-time LIF model [28, 29], the membrane potential of a neuron evolves as
where denotes the input current, the leakage factor, the threshold, the spike output, and the Heaviside step function. The last term of (1) implements reset by subtraction. Because has zero gradient almost everywhere, SNNs are trained with backpropagation through time and surrogate gradients [30], and the prediction is read out from the spike counts or the membrane potential of the output layer.
a) Input Encoding: Static inputs must be converted into spike trains over time steps. Rate encoding samples a spike for each input element at every step from a Bernoulli distribution whose probability equals the normalized intensity of that element [31]. Because the encoder draws a new spike train in every forward pass, repeated queries of the same input can return different labels. Direct encoding instead supplies the analog input at every step and yields deterministic outputs [32].
b) Implications for Model Extraction: Two properties of SNNs could therefore limit model extraction. Temporal dynamics may yield a decision function that an ANN surrogate approximates less accurately, and stochastic encoding returns noisy labels that corrupt the training data of the surrogate and limit the agreement that any surrogate can attain (Section III-C). Our evaluation distinguishes between these two explanations (Section IV).
Model Stealing Attacks
MSAs replicate the functionality of a target model through black-box query access [4]. Jagielski et al. [9] distinguish accuracy, which measures how well the surrogate performs the original task, from fidelity, which measures how closely it reproduces the predictions of the target; we evaluate fidelity. We consider four attacks: Papernot [5] and three attacks from the taxonomy of Juuti et al. [10], namely N I-FGSM, T-RND I-FGSM, and COLOR.
All four attacks share an iterative procedure (Figure 1). We denote the target, also called the oracle, by and the surrogate, also called the substitute, by ; denotes the label that the target returns for input . Starting from a small seed set of natural inputs, the adversary in each round trains on the labeled set , synthesizes new inputs from , queries the target once for their labels, and sets until the query budget is exhausted. Because the adversary cannot compute gradients of , the gradient-based attacks compute them on . The attacks differ only in how they synthesize .
Figure 1. Iterative extraction procedure, illustrated for the Papernot attack. In each round , the adversary queries the target for the labels of the input set , trains the surrogate on the labeled set , synthesizes a new input from each with (3), and updates the input set as until the query budget is exhausted.
Papernot: Papernot et al. [5] perturb each sample by a single step along the sign of the input gradient of the surrogate,
where denotes the cross-entropy loss and the step size, so that new queries probe the target where the predictions of the surrogate change. Each round doubles the labeled set.
I-FGSM: Tramer et al. [4] retrained the surrogate on queries near the decision boundary of the target, which they located through line search. I-FGSM [10] pursues the same goal with the non-targeted iterative fast gradient sign method (I-FGSM). Starting from , each of iterations increases the loss of the surrogate for the label of the target,
where denotes the step size and projects onto the ball of radius around . The synthesized input is . Like Papernot, I-FGSM synthesizes one input per sample in each round.
-RND I-FGSM: -RND I-FGSM [10] draws a target class uniformly from all classes except and replaces the ascent step in (4) with a descent step on . It thereby directs queries toward the decision regions of all classes rather than toward the boundary nearest to each sample.
COLOR: COLOR [10] synthesizes queries without gradients by adding an offset to every pixel of each channel , where each sign is drawn uniformly at random. For grayscale inputs, the offset changes only the brightness of the image; for color inputs, independent signs also shift its color balance (Figure 2). COLOR therefore serves as a gradient-free baseline.
Figure 2. COLOR perturbations of a CIFAR-10 test image. Each variant adds an offset of or ( in the normalized input space) to every pixel of a color channel, with the sign drawn independently for each channel; panel titles give the signs. Images are shown at the true perturbation magnitude.
Experimental Setup
We compare the extractability of ANN and SNN targets that share the same datasets, convolutional backbone, training schedule, and attack configurations.
Datasets and Models
Datasets
We evaluate on MNIST [20] and Fashion-MNIST [21], each with 60,000 training and 10,000 test grayscale images of pixels, and on CIFAR-10 [22], with 50,000 training and 10,000 test color images of pixels. MNIST and Fashion-MNIST pixel values lie in , and we normalize CIFAR-10 images to . CIFAR-10
training uses random crops with a padding of 4 pixels and random horizontal flips.
Architectures
Both targets share the convolutional backbone in Table I, with two convolutional layers followed by two fully connected (FC) layers. The ANN target predicts the argmax of its output logits. The SNN target processes each input over time steps. At every step, a rate encoder samples a Bernoulli spike for each pixel with probability for MNIST and Fashion-MNIST and for CIFAR-10. The convolutional layers process these spikes with ReLU activations, and LIF neurons (Section II-A) with , , and reset by subtraction follow both FC layers. The SNN target predicts the argmax of the membrane potential of the output layer at the final time step. The surrogate uses the ANN architecture and therefore matches the ANN target exactly, whereas it differs from the SNN target in input encoding and neuron model.
| Layer | ANN | SNN |
| Input encoding | None | Rate, |
| Conv, 32 filters, | ReLU | ReLU |
| Conv, 64 filters, | ReLU | ReLU |
| FC, 1,000 units | ReLU | LIF |
| FC, 10 units | None | LIF |
| Prediction | Logits | Membrane potential |
Table I. Architectures of the targets. Each convolutional layer uses a padding of 1 and max pooling. The first FC layer receives features for MNIST and Fashion-MNIST and for CIFAR-10. The surrogate uses the ANN architecture.
Target Training
We train each target from scratch with cross-entropy loss and Adam (learning rate , batch size 128, no weight decay) for 40 epochs on MNIST and Fashion-MNIST and 100 epochs on CIFAR-10, and retain the checkpoint with the highest test accuracy. The SNN target computes the loss on the final membrane potential of the output layer and uses the default arctangent surrogate gradient of snnTorch [31]. Table II reports the test accuracy of each target.
Attack Setup
a) Threat Model: The adversary observes only the top-1 label of the target, without access to confidence scores, parameters, or architecture, and holds a budget of 102,400 extraction queries. Every extraction query counts toward this budget, including repeated queries of the same input; the queries that we issue to evaluate a finished surrogate do not.
b) Extraction Procedure: Each attack starts from a balanced seed set of 10 samples per class drawn from the training split, which can overlap with the training data of both targets. We initialize the surrogate once and fine-tune it in every round for 10 epochs with Adam (learning rate , batch size 128), reinitializing the optimizer state each round. The attack stops after 10 rounds or when it exhausts the budget.
c) Query Synthesis: Papernot and COLOR use . N I-FGSM uses with iterations, and T-RND I-FGSM uses with ; both use the step size . All attacks clip queries to . For MNIST and Fashion-MNIST, whose inputs lie in , this range admits negative values, which the SNN encoder clamps to 0 but the ANN surrogate processes unchanged. For CIFAR-10, the encoder maps to and preserves the full range. Papernot and N I-FGSM synthesize one query per labeled sample and reach the budget after 10 rounds (). T-RND I-FGSM synthesizes nine variants and COLOR four variants of each sample added in the previous round, and both fill the remaining budget in their final round.
d) Adaptive Attacker: We also evaluate a majority-vote variant of Papernot on MNIST that queries each input five times and keeps the most frequent label. Because all queries count toward the budget, it labels at most 20,480 distinct inputs.
e) Transferability and Repetitions: We craft adversarial examples on the finished surrogate with targeted and non-targeted I-FGSM (, ), following Juuti et al. [10]. We repeat each configuration with three random seeds and report the mean. The random seed determines the initial seed set, the initialization of the surrogate, the order of its training data, and the spike sampling of the SNN target, whereas the target checkpoints remain fixed.
Evaluation Metrics
We evaluate extraction by fidelity, adversarial transferability, and query efficiency. As in § 2-B, denotes the target and the surrogate; here, denotes the class that the surrogate predicts. The SNN target predicts the argmax of its output membrane potential at the final time step, and denotes the label that a single query returns. We evaluate every metric with one query per input, as an attacker or a user of the deployed model would observe, and denotes the indicator function.
a) Fidelity: Agreement on an evaluation set is
Test agreement uses the full test split (10,000 inputs) and measures in-distribution fidelity. Random agreement uses 4,000 inputs sampled uniformly from with a fixed seed, which lie outside the data distribution.
b) Adversarial Transferability: We craft adversarial examples on the surrogate for the first 1,000 test inputs. Non-targeted transferability (NT) is the fraction of inputs for which the perturbation changes the prediction of the target. Targeted transferability (TT) is the fraction that the target assigns to a class drawn uniformly from all classes except :
TT additionally requires the surrogate to capture which class lies beyond each decision boundary. Because the SNN target returns stochastic labels, single-query evaluation may overstate its NT.
c) Query Efficiency: After the seed stage and each round, we record the cumulative number of queries and the test and random agreement of the current surrogate. We do this for Papernot and T-RND I-FGSM in three runs on MNIST and in one run on Fashion-MNIST and CIFAR-10, separately from the main runs. Each run labels the evaluation sets once, so that changes across checkpoints reflect only the surrogate.
d) Output Consistency: Let denote the probability that a single query of the SNN target returns class . Any surrogate agrees with a single query with probability at most , which it attains by predicting the most probable class. We define the output consistency of the target as the average of this maximum over an evaluation set and estimate it from queries per input. With the label of the -th query and the most frequent label among the queries,
| Dataset | Accuracy (%) ANN | Accuracy (%) SNN | SNN consistency Test | SNN consistency Uniform |
| MNIST | 98.49 | 99.22 | 0.997 | 0.636 |
| Fashion-MNIST | 92.51 | 90.25 | 0.959 | 0.839 |
| CIFAR-10 | 80.21 | 72.56 | 0.809 | 0.547 |
Table 2. TEST ACCURACY OF THE TARGETS AND OUTPUT CONSISTENCY OF THE SNN TARGET ON TEST AND UNIFORM RANDOM INPUTS. THE ANN TARGET HAS AN OUTPUT CONSISTENCY OF 1.0.
Output consistency thus estimates the highest expected agreement that any surrogate can attain under single-query evaluation. Because and the agreement derive from the same queries, the estimate slightly overstates this bound when several classes are nearly equally probable. The deterministic ANN target has an output consistency of 1.0. We use output consistency to interpret agreement (Section IV-A), not as a measure of attack success.
Evaluation
This section compares the extractability of the ANN and SNN targets. Section IV-A reports fidelity, Section IV-B adversarial transferability, and Section IV-C the effect of the query budget and of an adaptive adversary. All results use the ANN surrogate described in Section III-B.
Fidelity of Model Extraction
Table II summarizes the two targets. Their accuracy is comparable on MNIST and Fashion-MNIST, whereas the SNN target is 7.7 percentage points less accurate on CIFAR-10. The ANN target is deterministic. The SNN target is highly consistent on the test inputs of MNIST (0.997) and Fashion-MNIST (0.959), less consistent on those of CIFAR-10 (0.809), and substantially less consistent on uniform random inputs (0.636, 0.839, and 0.547, respectively).
Because output consistency bounds the agreement that any surrogate can attain against the SNN target (Section III-C), Figure 3 marks it with a dashed line. The line applies only to the SNN bars, and the gap between an SNN bar and the line measures the behavior of the SNN target that the surrogate fails to reproduce. The corresponding bound for the deterministic ANN target is 1.0, so ANN bars above the line do not violate any bound.
Figure 3. Fidelity of model extraction with an ANN surrogate: (a) test agreement and (b) random agreement, as means over three runs. The dashed line denotes the output consistency of the SNN target, the highest agreement that any surrogate can attain against it; it applies only to the SNN bars, and the bound for the ANN target is 1.0.
1) Test Agreement: On MNIST and Fashion-MNIST, surrogates attain comparable test agreement against both targets (Figure 3(a)). SNN test agreement falls more than 0.02 below ANN test agreement in only 2 of the 12 combinations, MNIST under Papernot (0.903 versus 0.961) and under T-RND I-FGSM (0.913 versus 0.984), and exceeds it in six (Table III). On CIFAR-10, extraction is ineffective against both targets, with test agreement between 0.23 and 0.38, well below the consistency bound of 0.809. The SNN target yields higher agreement there, which we do not interpret as greater vulnerability because its lower accuracy may make its decision function easier to approximate. Except on MNIST, the SNN target therefore confers no protection on in-distribution data.
2) Random Agreement: On random inputs, the SNN target yields lower agreement in 9 of the 12 combinations, by 0.191 on average (Figure 3(b)). This comparison conflates the fidelity of the surrogate with the stochasticity of the target, whose consistency bound on these inputs is as low as 0.547. We therefore normalize each SNN value by the bound of its dataset, which expresses it as a fraction of the maximum attainable agreement and makes it directly comparable to ANN agreement. After normalization, the SNN target yields lower agreement in six combinations, comparable agreement in two, and higher agreement in four, and the average deficit shrinks to 0.039 (Table III; Appendix Table V). Stochastic outputs thus account for most of the raw difference.
The residual difference concentrates on CIFAR-10, where normalized SNN agreement remains well below ANN agreement under Papernot (0.328 versus 0.654), N I-FGSM (0.354 versus 0.629), and T-RND I-FGSM (0.412 versus 0.603). On MNIST and Fashion-MNIST, the gradient-based attacks show no consistent trend. Random agreement also varies by up to 0.18 between individual runs (Section IV-C1). This variation exceeds the smaller differences on MNIST and Fashion-MNIST but not the CIFAR-10 residuals of 0.19 to 0.33.
The COLOR results on MNIST and Fashion-MNIST require qualification. COLOR queries and uniform inputs contain negative values that the SNN encoder clamps to 0 but the ANN surrogate processes (Section III-B), so a negative COLOR offset leaves the image background unchanged for the SNN target. We attribute the large COLOR differences on these datasets (normalized agreement of 0.231 versus 0.309 on MNIST and 0.204 versus 0.632 on Fashion-MNIST) at least in part to this mismatch. The mismatch also affects random agreement under every attack on these two datasets but does not arise on CIFAR-10.
In summary, the resistance of the SNN target outside the data distribution derives primarily from its stochastic outputs. A residual advantage remains only on CIFAR-10, where extraction is ineffective against both targets. Section IV-C2 evaluates an adversary that mitigates this stochasticity through repeated queries.
Adversarial Transferability
Transferability measures whether the surrogate inherits the vulnerabilities of the target (Figure 4). NT is lower for the SNN target in 9 of the 12 combinations, by 0.097 on average. The reduction is consistent on Fashion-MNIST (0.076 to 0.296) and CIFAR-10 (0.100 to 0.166). MNIST is mixed: NT decreases under Papernot (from 0.527 to 0.245), remains comparable under T-RND I-FGSM, and increases under N I-FGSM and COLOR, possibly because single-query evaluation counts stochastic label changes as transfer.
Figure 4. Adversarial transferability from the ANN surrogate to each target: (a) NT and (b) TT for I-FGSM adversarial examples (, 11 iterations) on the first 1,000 test examples, as means over three runs.
TT reveals the largest difference between the targets, because success requires the surrogate to capture the class beyond each boundary. Under T-RND I-FGSM, the most effective targeted attack, TT reaches 0.503 against the ANN target on MNIST but only 0.154 against the SNN target; on Fashion-MNIST, the corresponding values are 0.537 and 0.215. Papernot shows the same trend on both datasets. On CIFAR-10, TT does not exceed 0.07 for either target. Overall, the SNN target yields lower TT in five combinations, comparable TT in six, and higher TT in one.
Under single-query attacks, reduced transferability is thus the most consistent distinction between the targets: surrogates reproduce the labels of the SNN target on natural inputs as accurately as those of the ANN target, yet their adversarial examples transfer to it less often. Section IV-C2 examines whether this distinction persists when the adversary reduces label noise.
Query Budget and Adaptive Attackers
We now examine how fidelity develops as the adversary spends the budget and whether an adversary that repeats queries recovers what single-query attacks fail to extract. We focus on MNIST, where the SNN target yields the largest reduction in test agreement.
Fidelity across the Query Budget
Figure 5 reports test and random agreement on MNIST after each round of Papernot and T-RND I-FGSM over three runs. These runs are separate from those of Sections IV-A and IV-B, and their final values differ from them by at most 0.044. Appendix Fig. 6 reports single-run curves for Fashion-MNIST and CIFAR-10, in which the two targets yield similar test agreement on Fashion-MNIST and the SNN target yields slightly higher test agreement on
Figure 5. Test and random agreement on MNIST as a function of the cumulative number of target queries. Lines denote means and bands one standard deviation over three runs; green curves denote the majority-vote attacker, whose first checkpoint lies at 500 queries. The dashed line denotes the output consistency of the SNN target. Each run labels the evaluation sets once, so final values differ slightly from those in Tables IV and V.
| Metric | Lower | Comp. | Higher | Mean diff. |
| Test agreement | 2 | 4 | 6 | +0.017 |
| Random agreement | 9 | 1 | 2 | −0.191 |
| Random (normalized) | 6 | 2 | 4 | −0.039 |
| NT | 9 | 1 | 2 | −0.097 |
| TT | 5 | 6 | 1 | −0.092 |
Table 3. Comparison of the SNN and ANN targets across the 12 combinations of attack and dataset. Lower, comp., and higher count the combinations in which the SNN value is lower than, comparable to (difference of at most 0.02), or higher than the ANN value; mean diff. is the mean difference (SNN minus ANN). Random agreement varies by up to 0.18 between runs, so its counts are indicative only.
CIFAR-10.
Both surrogates start from the same test agreement (0.724 and 0.725) but diverge from the first round. Against the ANN target, test agreement rises steadily to 0.963 under Papernot and 0.981 under T-RND I-FGSM. Against the SNN target, it saturates early. Under Papernot, the mean peaks at 0.896 after 12,800 queries, below the 0.898 that the ANN surrogate attains after 800 queries; under T-RND I-FGSM, it peaks at 0.928. Because output consistency on test inputs is 0.997, label noise on natural inputs cannot explain this ceiling. Under Papernot, the mean also declines after 12,800 queries, to 0.859, in two of the three runs. This decline is consistent with noisy labels accumulating as synthesized queries move away from the data distribution.
Random agreement against the SNN target rises quickly and then plateaus between 0.40 and 0.44 under Papernot and between 0.38 and 0.40 under T-RND I-FGSM. These plateaus correspond to 0.60 to 0.70 of the consistency bound, comparable to or above the 0.56 to 0.64 that the ANN surrogate attains of its bound. A larger budget therefore does not close the gap on MNIST. Off the data distribution, the surrogate reaches the limit imposed by output consistency within a few thousand queries; on the data distribution, test agreement saturates below the level that the ANN surrogate
attains with 800 queries.
2) Majority-Vote Attacker: Section IV-A attributes most of the lower random agreement to stochastic outputs, which an adaptive adversary can suppress through majority voting (Section III-B). Table 4 compares this attacker with the single-query attacks. Majority voting leaves test agreement unchanged (0.902) and raises normalized random agreement only from 0.595 to 0.658. In Figure 5, it reaches a random agreement plateau similar to that of the single-query attacker but requires ten times as many queries. Its test agreement does not decline in late rounds, which supports the attribution of the single-query decline to noisy labels.
| Target, attacker | Test | Rand. | Norm. | NT | TT |
| ANN, single query | 0.961 | 0.600 | 0.600 | 0.527 | 0.114 |
| SNN, single query | 0.903 | 0.378 | 0.595 | 0.245 | 0.019 |
| SNN, 5-query majority | 0.902 | 0.418 | 0.658 | 0.636 | 0.120 |
Table 4. Single-query and majority-vote extraction of the MNIST targets under Papernot, as means over three runs. Rand. denotes random agreement, and Norm. divides it by the output consistency of the target (0.636 for the SNN target and 1.0 for the ANN target). Standard deviations of the majority-vote attacker are 0.018, 0.015, 0.017, and 0.025 for test agreement, random agreement, NT, and TT.
The effect of majority voting on transferability, in contrast, is substantial. NT rises from 0.245 to 0.636, above the ANN level of 0.527, partly because single-query evaluation counts stochastic label changes as transfer. TT rises from 0.019 to 0.120, matching the ANN level of 0.114. On MNIST under Papernot, the reduced transferability of the SNN target therefore derives primarily from label noise in the extraction data, which an adversary removes at five times the query cost per label. The lower test agreement, in contrast, persists (0.902 versus 0.961). This gap is confined to MNIST, as Fashion-MNIST and CIFAR-10 exhibit no corresponding reduction in test agreement. It therefore does not constitute a general property of SNN extraction, and its source remains a subject for future investigation.
Conclusion
The value of an architecture as a defense against MSAs depends not only on whether it resists extraction but also on why it does. In this work, we addressed both questions for SNNs under four label-only attacks on three datasets. Rate-encoded SNN targets reduced agreement on random inputs and the transferability of adversarial examples, particularly targeted transfer, while surrogates reproduced their predictions on natural inputs as faithfully as those of ANN targets in most settings. By bounding the attainable agreement with output consistency and evaluating an adversary that applies majority voting over repeated queries, we traced most of this resistance to the stochasticity of rate encoding rather than to a decision function that is harder to approximate. Rate encoding therefore acts as an implicit form of output randomization: it raises the cost of extraction without an additional mechanism, yet an adaptive adversary can remove most of its effect by repeating queries. These findings indicate that the resistance of SNNs to extraction depends substantially on how inputs are encoded, not only on spiking computation, and that evaluations of stochastic models should report output consistency alongside agreement to avoid attributing output noise to the robustness of the model.
Appendix
Table V reports the extraction results for every combination of attack and dataset that Sections IV-A and IV-B summarize. Figure 6 reports fidelity across the query budget on Fashion-MNIST and CIFAR-10 from a single run and complements the MNIST results in Section IV-C1.
| Attack | Test agreement ANN | Test agreement SNN | Random agreement ANN | Random agreement SNN | Random agreement SNN (norm.) | NT ANN | NT SNN | TT ANN | TT SNN |
| MNIST | |||||||||
| Papernot | 0.961 | 0.903 | 0.600 | 0.378 | 0.595 | 0.527 | 0.245 | 0.114 | 0.019 |
| N I-FGSM | 0.870 | 0.909 | 0.211 | 0.352 | 0.554 | 0.120 | 0.342 | 0.010 | 0.037 |
| T-RND I-FGSM | 0.984 | 0.913 | 0.621 | 0.383 | 0.603 | 0.712 | 0.694 | 0.503 | 0.154 |
| COLOR | 0.834 | 0.881 | 0.309 | 0.147 | 0.231 | 0.252 | 0.346 | 0.066 | 0.049 |
| Fashion-MNIST | |||||||||
| Papernot | 0.775 | 0.778 | 0.663 | 0.586 | 0.698 | 0.840 | 0.544 | 0.279 | 0.057 |
| N I-FGSM | 0.787 | 0.771 | 0.351 | 0.125 | 0.150 | 0.733 | 0.540 | 0.243 | 0.091 |
| T-RND I-FGSM | 0.807 | 0.792 | 0.666 | 0.677 | 0.807 | 0.855 | 0.779 | 0.537 | 0.215 |
| COLOR | 0.728 | 0.735 | 0.632 | 0.171 | 0.204 | 0.635 | 0.514 | 0.121 | 0.105 |
| CIFAR-10 | |||||||||
| Papernot | 0.244 | 0.269 | 0.654 | 0.180 | 0.328 | 0.437 | 0.306 | 0.023 | 0.042 |
| N I-FGSM | 0.226 | 0.289 | 0.629 | 0.194 | 0.354 | 0.467 | 0.301 | 0.028 | 0.042 |
| T-RND I-FGSM | 0.249 | 0.382 | 0.603 | 0.225 | 0.412 | 0.505 | 0.405 | 0.047 | 0.047 |
| COLOR | 0.307 | 0.354 | 0.146 | 0.373 | 0.682 | 0.510 | 0.408 | 0.064 | 0.070 |
Table V. Extraction results for the ANN and SNN targets with an ANN surrogate. Values are means over three runs. Normalized random agreement divides SNN random agreement by the output consistency of the SNN target on uniform inputs (Table II); the corresponding bound for the ANN target is 1.0.
Figure 6. Test and random agreement as a function of the cumulative number of target queries on Fashion-MNIST (top) and CIFAR-10 (bottom) under the Papernot and T-RND I-FGSM attacks, from a single run. The dashed line denotes the output consistency of the SNN target and applies only to the SNN curves.
References
- [1]Z. Zhou, X. Chen, E. Li, L. Zeng, K. Luo, and J. Zhang, “Edge intelligence: Paving the last mile of artificial intelligence with edge computing,” Proceedings of the IEEE, vol. 107, no. 8, pp. 1738–1762, 2019.arxiv.org/abs/1905.10083
- [2]W. N. Price and I. G. Cohen, “Privacy in the age of medical big data,” Nature Medicine, vol. 25, no. 1, 2019.DOI
- [3]N. Bussmann, P. Giudici, D. Marinelli, and J. Papenbrock, “Explainable machine learning in credit risk management,” Computational Economics, vol. 57, no. 1, pp. 203–216, 2021.DOI
- [4]F. Tramèr, F. Zhang, A. Juels, M. K. Reiter, and T. Ristenpart, “Stealing machine learning models via prediction APIs,” in 25th USENIX Security Symposium (USENIX Security 16), 2016, pp. 601–618.arxiv.org/abs/1609.02943
- [5]N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, Z. B. Celik, and A. Swami, “Practical black-box attacks against machine learning,” in AsiaCCS, 2017.arxiv.org/abs/1602.02697
- [6]T. Orekondy, B. Schiele, and M. Fritz, “Knockoff nets: Stealing functionality of black-box models,” in CVPR, 2019, pp. 4954–4963.arxiv.org/abs/1812.02766
- [7]J. R. Correia-Silva, R. F. Berriel, C. Badue, A. F. de Souza, and T. Oliveira-Santos, “Copycat CNN: Stealing knowledge by persuading confession with random non-labeled data,” in International Joint Conference on Neural Networks (IJCNN), 2018.
- [8]N. Papernot, P. McDaniel, and I. Goodfellow, “Transferability in machine learning: from phenomena to black-box attacks using adversarial samples,” 2016, arXiv:1605.07277.arxiv.org/abs/1605.07277
- [9]M. Jagielski, N. Carlini, D. Berthelot, A. Kurakin, and N. Papernot, “High accuracy and high fidelity extraction of neural networks,” in 29th USENIX Security Symposium (USENIX Security 20), 2020, pp. 1345–1362.arxiv.org/abs/1909.01838
- [10]M. Juuti, S. Szyller, S. Marchal, and N. Asokan, “Prada: protecting against dnn model stealing attacks,” in 2019 IEEE European Symposium on Security and Privacy (EuroS&P), IEEE, 2019, pp. 512–527.arxiv.org/abs/1805.02628
- [11]T. Orekondy, B. Schiele, and M. Fritz, “Prediction poisoning: Towards defenses against DNN model stealing attacks,” in International Conference on Learning Representations (ICLR), 2020.arxiv.org/abs/1906.10908
- [12]K. Roy, A. Jaiswal, and P. Panda, “Towards spike-based machine intelligence with neuromorphic computing,” Nature, vol. 575, pp. 607–617, 2019.DOI
- [13]A. Moshruba, I. Alouani, and M. Parsa, “Are neuromorphic architectures inherently privacy-preserving? an exploratory study,” Proceedings on Privacy Enhancing Technologies (PoPETs), 2025.arxiv.org/abs/2411.06613
- [14]A. Moshruba, S. Snyder, H. Poursiami, and M. Parsa, “On the privacy-preserving properties of spiking neural networks with unique surrogate gradients and quantization levels,” in 2025 International Joint Conference on Neural Networks (IJCNN), 2025, pp. 1–8.arxiv.org/abs/2502.18623
- [15]A. Moshruba, H. Poursiami, and M. Parsa, “Izhikevich-inspired temporal dynamics for enhancing privacy, efficiency, and transferability in spiking neural networks,” in 2025 International Conference on Neuromorphic Systems (ICONS), 2025, pp. 89–97.arxiv.org/abs/2505.04034
- [16]A. Moshruba and M. Parsa, “Edge-private spiking graph convolutional learning: Membership inference and structural differential privacy,” in 2025 First International Conference on Intelligent Computing and Systems at the Edge (ICEdge), vol. 1, 2025, pp. 1–7.DOI
- [17]H. Pourshami, I. Alouani, and M. Parsa, “Brainleaks: On the privacy-preserving properties of neuromorphic architectures against model inversion attacks,” in ICMLA, 2024.DOI
- [18]H. Pourshami, A. Moshruba, and M. Parsa, “Do spikes protect privacy? investigating black-box model inversion attacks in spiking neural networks,” arXiv preprint arXiv:2502.05509, 2025.DOI
- [19]S. Sharmin, N. Rathi, P. Panda, and K. Roy, “Inherent adversarial robustness of deep spiking neural networks: Effects of discrete input encoding and non-linear activations,” in European Conference on Computer Vision (ECCV), 2020.arxiv.org/abs/2003.10399
- [20]Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, 1998.
- [21]H. Xiao, K. Rasul, and R. Vollgraf, “Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms,” arXiv preprint arXiv:1708.07747, 2017.arxiv.org/abs/1708.07747
- [22]A. Krizhevsky, “Learning multiple layers of features from tiny images,” University of Toronto, Tech. Rep., 2009.
- [23]M. Fredrikson, S. Jha, and T. Ristenpart, “Model inversion attacks that exploit confidence information and basic countermeasures,” in Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security (CCS). ACM, 2015, pp. 1322–1333.DOI
- [24]R. Shokri, M. Stronati, C. Song, and V. Shmatikov, “Membership inference attacks against machine learning models,” in 2017 IEEE Symposium on Security and Privacy (SP). IEEE, 2017, pp. 3–18.arxiv.org/abs/1610.05820
- [25]S. Yeom, I. Giacomelli, M. Fredrikson, and J. F. D. Privacy, “Privacy risk in machine learning: Analyzing the connection to overfitting,” IEEE CSF, 2018.arxiv.org/abs/1709.01604
- [26]R. Riaño, G. Abad, S. Picek, and A. Urbieta, “MeMark: Membrane-space watermarking for spiking neural networks,” 2026, arXiv:2608.25738.arxiv.org/abs/2608.25738
- [27]W. Maass, “Networks of spiking neurons: The third generation of neural network models,” Neural Networks, vol. 10, no. 9, pp. 1659–1671, 1997.DOI
- [28]W. Gerstner and W. M. Kistler, Spiking Neuron Models: Single Neurons, Populations, Plasticity. Cambridge University Press, 2002.
- [29]A. N. Burkitt, “A review of the integrate-and-fire neuron model: I. homogeneous synaptic input,” Biological Cybernetics, vol. 95, no. 1, pp. 1–19, 2006.pubmed.ncbi.nlm.nih.gov/16622699
- [30]E. O. Neftci, H. Mostafa, and F. Zenke, “Surrogate gradient learning in spiking neural networks,” IEEE Signal Processing Magazine, vol. 36, no. 6, pp. 51–63, 2019.
- [31]J. K. Eshraghian, M. Ward, E. O. Neftci, X. Wang, G. Lenz, G. D. Dwivedi, M. Bennaoumn, D. S. Jeong, and W. D. Lu, “Training spiking neural networks using lessons from deep learning,” Proceedings of the IEEE, vol. 111, no. 9, pp. 1016–1054, 2023.
- [32]N. Rathi and K. Roy, “DIET-SNN: A low-latency spiking neural network with direct input encoding and leakage and threshold optimization,” IEEE Transactions on Neural Networks and Learning Systems, vol. 34, no. 6, pp. 3174–3182, 2023.DOI





