Spiking Neural Network
A spiking neural network (SNN) sends information as timed spikes, like biological neurons, for low-power neuromorphic AI. Covers neurons and training.
A spiking neural network (SNN) is a neural network whose neurons communicate with discrete, all-or-nothing events called spikes, closer to the way biological neurons signal. Each neuron accumulates incoming spikes in an internal membrane potential that slowly leaks away, and it fires a spike of its own only when that potential crosses a threshold. Information lives in which neurons fire and when, so SNNs process data as it arrives over time and do work only when spikes occur. That event-driven sparsity makes them attractive for low-power edge AI on neuromorphic chips and a natural match for event cameras, which also report changes as asynchronous events. Wolfgang Maass described SNNs in 1997 as the third generation of neural network models, after threshold units and networks with continuous activations.
How Spiking Neurons Work#
The most widely used model is the leaky integrate-and-fire (LIF) neuron. At every time step, its membrane potential decays by a fixed fraction, the weighted input spikes are added, and if the potential reaches the threshold, the neuron emits a spike and resets. A neuron with weak input never reaches the threshold, and a neuron with strong input fires often, so firing frequency encodes input strength. The simulation below drives three LIF neurons with different constant input currents:
import torch
# Three leaky integrate-and-fire neurons, each driven by a constant input current
current = torch.tensor([0.15, 0.3, 0.6])
decay, threshold = 0.8, 1.0 # fraction of potential kept per step, firing threshold
potential = torch.zeros(3)
spike_counts = torch.zeros(3)
for step in range(20):
potential = decay * potential + current # leak, then integrate the input
spikes = (potential >= threshold).float() # fire where the threshold is crossed
potential = potential * (1 - spikes) # reset neurons that fired
spike_counts += spikes
print(f"Spikes in 20 steps: {spike_counts.tolist()}")It prints Spikes in 20 steps: [0.0, 4.0, 10.0]. With an input of 0.15, the potential levels off at 0.15 / (1 − 0.8) = 0.75, below the threshold, so that neuron never fires. An input of 0.3 produces 4 spikes, and an input of 0.6 crosses the threshold every second step for 10 spikes. Libraries such as snnTorch provide LIF layers like this as PyTorch modules that train on GPUs.
Encoding Information in Spikes#
Data must be turned into spikes before an SNN can use it, and the choice of code affects both accuracy and speed:
- Rate coding: A value becomes a firing frequency, as in the simulation above. It is robust but needs many time steps to represent a value precisely.
- Temporal coding: A value becomes the timing of a spike, such as earlier spikes for brighter pixels, which conveys information with very few spikes.
- Event sensors: Neuromorphic vision cameras output a spike-like event whenever a pixel's brightness changes, with microsecond timing and no fixed frame rate, so their data can feed an SNN directly.
Training SNNs#
A spike is a step function whose derivative is zero almost everywhere, so standard backpropagation cannot pass gradients through it. Three approaches work around this. ANN-to-SNN conversion trains an ordinary network with ReLU activations and maps each activation to a firing rate. Surrogate gradient training keeps the hard spike in the forward pass but substitutes a smooth function's derivative in the backward pass, and then trains with backpropagation through time like a recurrent neural network (RNN). Spike-timing-dependent plasticity (STDP) is a local, biologically inspired rule that strengthens a synapse when the input spike precedes the output spike, and it learns without labels. Most recent high-accuracy SNNs are trained directly with surrogate gradients, which need far fewer time steps than converted networks, and conversion remains the simplest route from an existing model.
Neuromorphic Hardware#
SNNs save the most energy on chips designed for them. Neuromorphic processors place memory next to many small cores, communicate with spike messages, and compute only when spikes arrive, and because spikes are binary, each synaptic event needs an addition instead of a multiplication. IBM's TrueNorth (2014) packed one million neurons onto a single chip, the University of Manchester's SpiNNaker uses large arrays of ARM cores, and Intel's Loihi 2 powers Hala Point, a 2024 research system with 1,152 Loihi 2 processors and 1.15 billion neurons. On standard GPUs, which are built for dense matrix math, SNNs usually run slower than equivalent conventional networks.
SNNs vs. Conventional Neural Networks#
- Signals: Conventional networks, including convolutional neural networks (CNNs) and transformers, pass continuous values through every neuron in a single forward pass. SNNs pass binary spikes over many time steps, and most neurons stay silent at any moment.
- Accuracy: Conventional networks still lead on standard image benchmarks, and SNNs have narrowed the gap mostly through surrogate gradient training and architectures borrowed from conventional models.
- Efficiency: SNNs on neuromorphic hardware use far less energy for sparse, event-driven input such as event-camera streams and always-on audio.
Applications#
- Event-based vision and robotics: In a 2024 Science Robotics study, TU Delft researchers flew a drone with a fully spiking vision and control network on Intel's Loihi, mapping raw event-camera data to motion commands at 200 Hz.
- Always-on sensing: Keyword spotting, gesture recognition, and anomaly detection in sensors benefit from SNNs that draw almost no power while nothing changes.
- Object detection: SpikeYOLO, an ECCV 2024 spiking detector from Xinhao Luo, Man Yao, and colleagues, is built on the Ultralytics codebase and simplifies the Ultralytics YOLOv8 architecture with spike-driven blocks, reaching 48.9% mAP50-95 on COCO with integer-valued training and spike-driven inference.










