Spiking Neuron Simulator: Leaky Integrate-and-Fire Model

simulator intermediate ~10 min
Loading simulation...
f = 38.5 Hz — regular spiking at moderate input

A LIF neuron with τ_m = 20 ms driven by 1.5 nA produces regular spikes at 38.5 Hz, characteristic of cortical pyramidal neurons in activated states.

Formula

τ_m × dV/dt = -(V - V_rest) + R_m × I_in
f = 1 / (τ_m × ln((R×I - V_reset)/(R×I - V_threshold)))
I_rheobase = (V_th - V_rest) / R_m

The Biological Inspiration

Every neuron in your brain is a tiny integrator. Synaptic currents charge the cell membrane like a capacitor, while ion channel leaks slowly drain it. When the membrane voltage crosses a critical threshold — roughly -50 mV — voltage-gated sodium channels open explosively, producing an all-or-nothing action potential that propagates down the axon. The leaky integrate-and-fire model distills this complex biophysics into a single differential equation that captures the essential input–output relationship.

The LIF Equation

The model treats the neuron as an RC circuit: τ_m × dV/dt = -(V - V_rest) + R_m × I_in. The membrane time constant τ_m determines the integration timescale, while the resistance R_m sets how much a given current depolarizes the membrane. When V reaches the threshold V_th, the neuron emits a spike (a discrete event) and resets to V_reset. This simple rule reproduces the regular spiking patterns observed in cortical pyramidal cells and generates realistic firing rate curves.

From Biology to Silicon

Neuromorphic engineers implement LIF neurons in analog or mixed-signal VLSI circuits. Intel's Loihi chip packs 128,000 neurons per core, each with configurable τ_m and V_th parameters. Because computation happens only when spikes arrive — not on every clock cycle — neuromorphic chips achieve milliwatt power budgets for tasks that consume watts on conventional GPUs. This event-driven paradigm mirrors the brain's sparse, energy-efficient coding strategy.

Coding Strategies

Spiking neurons can encode information in multiple ways: rate coding (average spike count), temporal coding (precise spike timing), burst coding (spike clusters), and population coding (patterns across neuron groups). The LIF model captures rate coding naturally — firing rate increases monotonically with input current above rheobase. By adding noise or adaptive thresholds, researchers extend LIF to reproduce irregular spiking and gain modulation seen in biological recordings.

FAQ

What is a leaky integrate-and-fire neuron?

The LIF neuron is the simplest biologically plausible spiking neuron model. It treats the cell membrane as a leaky RC circuit: input current charges the membrane capacitor, leak conductance discharges it, and when voltage reaches a threshold, the neuron emits a spike and resets. Despite its simplicity, LIF captures key properties like rate coding and temporal integration.

How does the membrane time constant affect spiking?

The membrane time constant τ_m = R_m × C_m determines how quickly the neuron integrates inputs. Short τ_m (<10 ms) makes the neuron a coincidence detector requiring near-simultaneous inputs. Long τ_m (>30 ms) enables temporal summation over wider windows, averaging input over time.

What is the rheobase current?

The rheobase is the minimum sustained input current needed to make the neuron fire. Below this threshold, leak conductance drains charge faster than input supplies it. It equals (V_th - V_rest) / R_m and sets the dynamic range floor for neural coding.

How are spiking neurons used in neuromorphic chips?

Neuromorphic processors like Intel's Loihi and IBM's TrueNorth implement millions of LIF-like neurons in silicon. Each neuron accumulates charge from weighted spike inputs, fires when threshold is crossed, and communicates via address-event representation — achieving 1000x energy savings over GPUs for inference tasks.

Sources

Embed

<iframe src="https://homo-deus.com/lab/neuromorphic-computing/spiking-neuron/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub