Poisson Encoding¶
Poisson encoding is the classical and most widely used rate coding strategy for converting continuous signals or static values into discrete, irregular spike trains. It models spike generation as an inhomogeneous Poisson process, where the instantaneous firing rate \(r(t)\) is directly proportional to the input intensity at time \(t\).
This method is biologically inspired by the irregular, rate-modulated firing observed in many sensory neurons (e.g., retinal ganglion cells, auditory nerve fibers) and is a standard choice for benchmarking spiking neural networks (SNNs), especially when converting static datasets like made of images to spike trains.
Algorithm Overview
Spikes are generated independently with probability proportional to the input value and time bin size. The probability of observing exactly \(k\) spikes in a small interval \(\Delta t\) follows the Poisson distribution:
where:
\(r(t)\) is the instantaneous firing rate, usually scaled from the normalized input signal,
\(k\) is the expected number of spikes in the time window,
\(\Delta t\) is the discrete time step.
Detailed Pseudocode
1Algorithm Poisson Encoding
2input: s signal, Δt interval length
3out = zeros(length(s))
4n_blocks = T // Δt
5blocks = reshape(s, (n_blocks, Δt))
6rates = mean(blocks, axis=1)
7for b = 0:Δt
8 if rate[b] > 0:
9 U = uniform(0,1, size=Δt)
10 ISI = -log(1 - U) / (rate[b] * Δt)
11 cumsum = cumulative_sum(ISI)
12 steps = searchsorted(bins, cumsum) - 1
13 for s = 0:length(steps)
14 if steps[s] < Δt
15 t = b * Δt + step[s]
16 out[t] = 1
17 end if
18 enf for
19 end if
20 end for
21output: out
Advantages
Biologically plausible — reproduces the irregular, rate-modulated firing observed in many cortical and sensory neurons.
Simple, analytically tractable, and easy to implement.
Standard for benchmarking SNNs (e.g., converting MNIST to spike trains for rate-based training).
Disadvantages
Extremely dense spike trains — high energy consumption and synaptic events in neuromorphic hardware.
Complete loss of precise temporal information — only average rate matters.
Not event-driven — generates spikes even during constant input, unlike temporal contrast methods (TBR, SF, etc.).
Less efficient than sparse, deterministic encodings (e.g., TTFS) for rapid processing or low-power applications.
For details on how to implement this algorithm in Python, refer to the Poisson Function.
References
Auge, D., Hille, J., Mueller, E., and Knoll, A. (2021). A survey of encoding techniques for signal processing in spiking neural networks. Neural Process.
Liu, Q., Pineda-García, G., Stromatias, E., Serrano-Gotarredona, T., and Furber, S. B. (2016). Benchmarking spike-based visual recognition: a dataset and evaluation. Front. Neurosci.