Analyzing time-to-first-spike coding schemes: A theoretical approach

Lina Bonilla, Jacques Gautrais, Simon J. Thorpe, Timothée MasquelierFrontiers in Neuroscience 2022 · DOI

TL;DR

This paper introduces a unifying mathematical framework to compare different Time-To-First-Spike (TTFS) coding schemes in spiking neural networks. The authors propose a new hybrid scheme called Ranked-NoM (R-NoM), which outperforms existing methods in "discriminability"—the ability to distinguish a specific pattern from noise—while remaining highly efficient for low-power neuromorphic hardware.

What Problem Does This Paper Address?

Traditional artificial neural networks rely on high-precision floating-point numbers, which are computationally expensive. In contrast, biological brains often use "spikes." Many researchers assume neurons use a rate code (counting spikes over time), but this is slow and inefficient; you have to wait a long time to get an accurate reading.

Time-To-First-Spike (TTFS) coding is a faster alternative where information is carried by the timing or order of the very first spikes emitted by a population of neurons. However, different researchers have proposed different ways to "read" these orders (e.g., Rank-Order Coding vs. N-of-M coding). Until now, there hasn't been a rigorous mathematical way to compare these schemes to see which is actually better for accuracy, speed, and hardware implementation.

Methods

The authors developed a mathematical framework that treats input spike patterns as permutations. They used this to compare three specific schemes:

  1. Rank-Order Coding (ROC): An older method where the order of all incoming spikes matters. It uses a "shunting inhibition" mechanism that makes later spikes count for geometrically less than earlier ones.
  2. N-of-M (NoM) Coding: Only the first $N$ spikes out of $M$ possible inputs are considered. The exact order of those $N$ spikes doesn't matter; the neuron just checks if they came from the "right" set of inputs.
  3. Ranked-NoM (R-NoM): The authors' new proposal. Like NoM, it only looks at the first $N$ spikes, but like ROC, it cares about their order. Crucially, it uses linear (rather than geometric) desensitization, making it much easier to build into digital hardware.

The core metric used for comparison is discriminability ($D_C$), essentially a signal-to-noise ratio that measures how much more a neuron responds to its "favorite" pattern compared to a random one.

Datasets

As this is a theoretical research paper, the authors did not use standard image or audio datasets for training. Instead, they used:

  • Analytical Derivations: Closed-form mathematical formulas for the mean and variance of neuron activation.
  • Monte Carlo Simulations: They ran $2 \cdot 10^5$ (200,000) simulations with random input spike patterns to validate their mathematical models and test the "speed-accuracy trade-off."

Key Insights and Ideas

  • The Power of Order: Simply knowing which neurons fired (NoM) is good, but knowing the order in which they fired (R-NoM) drastically increases the amount of information a single neuron can extract from the same number of spikes.
  • Linear is Better than Geometric: Original ROC proposals used geometric decreases in sensitivity (e.g., $0.8^1, 0.8^2, 0.8^3...$), which is hard for hardware to calculate. R-NoM uses linear decreases (integers), which is "hardware-friendly" while actually providing better discriminability.
  • Early Reactivity: R-NoM is exceptionally "reactive." It reaches a high level of discriminability very early in the spike wave. This means a system using R-NoM could make an accurate decision after seeing only a tiny fraction of the total input spikes.

Key Results

  • Superior Discriminability: R-NoM achieves significantly higher discriminability scores than both ROC and NoM across various parameters.
  • Speed-Accuracy Trade-off: In simulations with 20 input neurons, the authors found that if you want a neuron to fire after only 5 spikes:
  • R-NoM had a false alarm rate of roughly $0.0003$.
  • ROC had a false alarm rate of $0.1$ (hundreds of times worse).
  • NoM had a false alarm rate of $0.7$ (essentially useless at that speed).
  • Scalability: While ROC's discriminability saturates (levels off) as you add more input neurons, NoM and R-NoM continue to improve, making them better suited for large-scale networks.

Limitations and Future Work

  • Static Inputs Only: The current framework assumes "static" inputs (like a flashed image). It does not yet account for dynamic, changing environments where "leaky" neurons would be required to forget old information.
  • Learning Rules: The paper focuses on inference (how a neuron responds). The authors note that future work is needed to develop specific learning rules (like STDP or backpropagation) tailored for the R-NoM scheme.
  • Real-World Benchmarks: The next step is to test these schemes on standard datasets like CIFAR or ImageNet to see if the theoretical superiority of R-NoM translates to state-of-the-art accuracy in practical AI tasks.

Summary updated

Abstract

Spiking neural networks (SNNs) using time-to-first-spike (TTFS) codes, in which neurons fire at most once, are appealing for rapid and low power processing. In this theoretical paper, we focus on information coding and decoding in those networks, and introduce a new unifying mathematical framework that allows the comparison of various coding schemes. In an early proposal, called rank-order coding (ROC), neurons are maximally activated when inputs arrive in the order of their synaptic weights, thanks to a shunting inhibition mechanism that progressively desensitizes the neurons as spikes arrive. In another proposal, called NoM coding, only the first <i>N</i> spikes of <i>M</i> input neurons are propagated, and these "first spike patterns" can be readout by downstream neurons with homogeneous weights and no desensitization: as a result, the exact order between the first spikes does not matter. This paper also introduces a third option-"Ranked-NoM" (R-NoM), which combines features from both ROC and NoM coding schemes: only the first <i>N</i> input spikes are propagated, but their order is readout by downstream neurons thanks to inhomogeneous weights and linear desensitization. The unifying mathematical framework allows the three codes to be compared in terms of discriminability, which measures to what extent a neuron responds more strongly to its preferred input spike pattern than to random patterns. This discriminability turns out to be much higher for R-NoM than for the other codes, especially in the early phase of the responses. We also argue that R-NoM is much more hardware-friendly than the original ROC proposal, although NoM remains the easiest to implement in hardware because it only requires binary synapses.
BibTeX
@inproceedings{bonilla2022analyzing,
  author = {Lina Bonilla and Jacques Gautrais and Simon J. Thorpe and Timothée Masquelier},
  title = {{Analyzing time-to-first-spike coding schemes: A theoretical approach}},
  booktitle = {Frontiers in Neuroscience},
  year = {2022},
  doi = {10.3389/fnins.2022.971937},
}
Figure