Back to SNNs Hub

Deconstructing Spiking Neural Networks (SNNs)

Part 3: Same Accuracy. Half the Energy.

Introduction

Part 1 covered the LIF neuron. Part 2 built it in PyTorch. Now the question: does a spiking network actually earn its complexity?

Not in accuracy. In energy.

We benchmark our SNNClassifier (269,834 params) against a parameter-matched ANN (269,322 params, MLP with ReLU) on MNIST for 10 epochs, then compute effective inference energy via Synaptic Operation (SOP) counting--the standard proxy on neuromorphic hardware.

Result: the SNN reaches 97.45% test accuracy (vs. 97.92% for the ANN, $\Delta = 0.47$ pp) at 51.7% lower energy cost.

Benchmark Setup

Task

MNIST digit classification. 60k training / 10k test images, 10 classes. Each $28 \times 28$ image is flattened to 784 dimensions and normalized (mean 0.1307, std 0.3081).

Model Architectures

Hidden dimension 256, batch size 256, Adam at $10^{-3}$, 10 epochs.

Model Architecture Parameters Timesteps $T$
ANN (MLP) Linear(784,256) → ReLU → Linear(256,256) → ReLU → Linear(256,10) 269,322
SNN (LIF) Linear(784,256) → LIF → Linear(256,256) → LIF → Linear(256,10) 269,834 25

Accuracy

Model Params Train Acc. Test Acc.
ANN (MLP) 269,322 99.52% 97.92%
SNN (LIF) 269,834 98.70% 97.45%

A 0.47 pp gap. Both are competitive classifiers. The real comparison is cost.

Energy: MACs vs. ACs

The Hardware Distinction

In an ANN forward pass, every weight interaction is a Multiply-Accumulate (MAC):

$$ \text{output} \mathrel{+}= \text{weight} \times \text{activation} $$

On neuromorphic hardware (Intel Loihi, IBM TrueNorth, SpiNNaker), spikes are binary. A received spike triggers a weight Accumulate (AC)--no multiply:

$$ \text{membrane} \mathrel{+}= \text{weight} \qquad (\text{if spike received}) $$

ACs are roughly $5\times$ cheaper than MACs. And if a neuron does not fire, nothing happens--no weight read, no energy spent.

SOP Counting

Total SOPs for one SNN inference:

$$ \text{SOPs} = \sum_{\ell} \text{fan-in}_\ell \times \text{fan-out}_\ell \times \bar{r} \times T $$

$\bar{r}$ is the measured average firing rate, $T=25$ simulation steps. For the ANN:

$$ \text{MACs} = \sum_{\ell} \text{fan-in}_\ell \times \text{fan-out}_\ell $$

Measured Numbers

At any given timestep, 90.3% of the SNN's hidden neurons are silent. Their weights are never read.

Effective Energy

Converting SOPs to MAC-equivalent units (dividing by the $5\times$ AC/MAC factor):

$$ \text{SNN effective energy} = \frac{\text{SOPs}}{5} = \frac{649{,}765}{5} \approx 129{,}953 \text{ MAC-equivalent units} $$

Against the ANN's 268,800 MACs: a 51.7% energy reduction. The SNN uses 48% of the ANN's energy at 0.47 pp lower accuracy.

Three-panel energy benchmark comparing SNN and ANN on accuracy, raw operations, and effective energy.

Left: test accuracy ($\Delta = 0.47$ pp). Center: raw operation counts (SOPs vs. MACs). Right: effective energy after the $5\times$ AC/MAC conversion--SNN uses $2.07\times$ less.

The center panel is deceptive: 649,765 SOPs looks worse than 268,800 MACs. But SOPs are integer accumulates, not float multiplies. After conversion, the SNN wins by $2\times$.

Training accuracy curves for SNN and ANN over 10 epochs on MNIST.

Training curves over 10 epochs. ANN: 97.92% test. SNN: 97.45% test.

Scaling Perspective

MNIST is a small benchmark. The energy advantage compounds at scale:

Conclusion

Our from-scratch SNN hits 97.45% on MNIST (vs. 97.92% for the ANN) while burning 51.7% less energy per inference on neuromorphic hardware. SNNs do not win accuracy contests. They win on power--which matters in edge deployment: wearables, implants, autonomous sensors, neuromorphic accelerators.