The leaky integrate-and-fire neuron

The simplest model of a spiking neuron: a live membrane trace, a dose of noise, and an f-I curve that fills in as you explore.

A real neuron is a complicated thing, but a surprising amount of its behaviour can be captured by treating it as a leaky bucket. Current flows in, the membrane voltage rises, some of it leaks away, and once the voltage reaches a threshold the neuron fires a spike and starts over. That is the leaky integrate-and-fire model. It goes back to Lapicque (1907), long before anyone knew what an action potential was made of, and it is still the first neuron model most people meet in computational neuroscience. I used it in a webinar for the German Neuroscience Olympiad in 2020. The simulation keeps running while you move the sliders.

The model

The only variable is the membrane potential \(V\), measured in millivolts. Left alone, it sits at the resting potential \(V_{\text{rest}} = -65\) mV. An input current \(I\) pushes it away from rest, and the leak pulls it back, so that

\[\tau_m \frac{dV}{dt} = (V_{\text{rest}} - V) + R\,I(t).\]

The membrane time constant \(\tau_m\) sets how fast \(V\) follows a change in input. A small \(\tau_m\) means a nervous neuron that tracks its input closely, a large one means a sluggish neuron that averages over a longer stretch of time. The input resistance \(R\) converts current to voltage and is fixed at 2 MΩ here, so a steady current of 10 nA lifts the voltage by 20 mV in the long run.

The equation alone would let \(V\) settle at a new level and nothing more. The spike is added by hand. Whenever \(V\) reaches the threshold \(V_{\text{th}}\), the neuron is said to fire, \(V\) is reset to \(V_{\text{reset}} = -70\) mV, and it is held there for a refractory period of 2 ms before the integration starts again. Nothing about the shape of a real action potential is in the model. The spike is an event, drawn here as a vertical stroke so that you can see it. The Hodgkin–Huxley page shows where the spike comes from when it is not added by hand.

With noise switched on, a random Gaussian value is added to the current at every time step. The slider sets the size of these fluctuations. This is a crude stand-in for the thousands of synaptic inputs a cortical neuron receives, which never add up to a perfectly steady current.

Reading the figure

The two panels on the left show 300 ms of the simulation. They work like an oscilloscope: the traces stay where they are and a grey cursor sweeps across, overwriting them, so your eye can rest on what has already been drawn; the Speed setting changes how fast the cursor moves. The upper panel is the input current, the lower one the membrane potential, blue while the input is noise-free and orange once you add noise. The red dashed line is the threshold, labelled in the panel. Each time the trace touches it you see a spike drawn up to +20 mV, then the voltage drops to the reset value and climbs again. The number in the corner is the firing rate, averaged since you last changed a setting.

The panel on the right is the f-I curve, the firing rate as a function of the input current. This is the standard way to characterise a neuron, and the page builds it up from your own experiments: every input strength you leave the neuron at for half a second adds a dot. Blue dots are noise-free measurements, orange dots were taken at the current noise level, and the dashed curve is the formula below. Changing the noise level clears the orange dots, because they no longer belong to the same curve. The open ring shows where the current setting sits.

The blue dashed line is the firing rate of the noise-free model worked out by hand rather than measured: the time the voltage needs to climb from reset to threshold under a constant current, plus the refractory period, is one interspike interval, and the rate is its inverse,

\[f = \frac{1}{t_{\text{ref}} + \tau_m \ln \dfrac{RI}{RI - (V_{\text{th}} - V_{\text{rest}})}} .\]

The formula makes two things obvious. Below the rheobase current \(I = (V_{\text{th}} - V_{\text{rest}})/R\), the voltage never reaches threshold and the rate is zero, so the curve has a hard corner. And at large currents the rate saturates at \(1/t_{\text{ref}}\), because the neuron cannot fire faster than once per refractory period.

Things to try

Start with the noise off and raise the current slowly. Nothing happens until you cross 7.5 nA, and then the neuron starts firing at a rate that goes up quickly at first and then more slowly. Your dots should land on the dashed curve.

Now set the current to 6 nA, just below the rheobase, and turn on the noise. The voltage hovers below threshold and crosses it now and then, so the neuron fires at a low and irregular rate where the noise-free model is silent. Take a few measurements at different currents and compare the orange dots with the dashed line. Besides adding scatter, noise rounds off the corner of the f-I curve, and this smoothing is the main reason real neurons show no hard threshold in their rate.

Change the time constant. With a long \(\tau_m\) the voltage trace is smooth and the neuron is slow to respond, but the noise-free f-I curve shifts too, since a slower climb means a longer interval. With a short \(\tau_m\) and noise on, the trace becomes jagged and the firing increasingly random.

The model and the f-I formula are treated in Dayan and Abbott (2001, chapter 5) and at greater length in Gerstner et al. (2014), which also covers what noise does to the firing statistics. Brunel and van Rossum (2007) tell the story of Lapicque’s original paper.

Notebook on GitHub · Open in Google Colab

References

Brunel N, van Rossum MCW (2007). Lapicque’s 1907 paper: from frogs to integrate-and-fire. Biological Cybernetics 97: 337–339. DOI

Dayan P, Abbott LF (2001). Theoretical Neuroscience: Computational and Mathematical Modeling of Neural Systems. MIT Press.

Gerstner W, Kistler WM, Naud R, Paninski L (2014). Neuronal Dynamics: From Single Neurons to Networks and Models of Cognition. Cambridge University Press.

Lapicque L (1907). Recherches quantitatives sur l’excitation électrique des nerfs traitée comme une polarisation. Journal de Physiologie et de Pathologie Générale 9: 620–635.