🧠 Spiking Neural Network — LIF & STDP

A network of 50 Leaky Integrate-and-Fire (LIF) neurons (40 excitatory, 10 inhibitory) with spike-timing-dependent plasticity (STDP). Each neuron follows τm·dV/dt = −(V − Vrest) + Rm·I. Watch synchronous bursting in the raster plot and voltage trace below.

🇺🇦 Українська
Raster plot — each dot is a spike (excitatory = purple, inhibitory = red)
Membrane voltage — neuron #0 (Vthresh = −55 mV, dashed)

Drive

Connectivity

Plasticity

Statistics

Firing rate
Synchrony
Burst period
Spikes / s

LIF Model & STDP

Each neuron integrates synaptic and external input: τm·dV/dt = −(V − Vrest) + Rm·Itotal. When V exceeds the threshold Vthresh = −55 mV a spike is emitted, V resets to −75 mV, and a 2 ms absolute refractory period begins. Synaptic currents decay exponentially with τsyn = 3 ms. STDP adjusts weights based on the time difference between pre- and post-synaptic spikes: Δw = A+·exp(−|Δt|/τ+) for causal pairs (potentiation) and Δw = −A·exp(−|Δt|/τ) for anti-causal pairs (depression).

About the Spiking Neural Network Simulator

This simulation runs a network of 50 Leaky Integrate-and-Fire (LIF) neurons — 40 excitatory and 10 inhibitory — wired with sparse random synapses. Each neuron obeys τm·dV/dt = −(V − Vrest) + Rm·I, integrating input until V crosses the −55 mV threshold, then firing a spike, resetting to −75 mV and entering a 2 ms refractory period. A scrolling raster plot and a live membrane-voltage trace reveal the dynamics.

The sliders set the external drive current Iext, noise σ, synaptic coupling g, the excitatory-to-inhibitory ratio, and the STDP learning rates A+ and A. Spike-timing-dependent plasticity strengthens or weakens connections according to spike order, so weights self-organise over time. Such networks underpin computational neuroscience and neuromorphic, event-driven hardware that mimics how real brains compute with sparse spikes.

Frequently Asked Questions

What is a spiking neural network?

A spiking neural network models neurons that communicate with discrete electrical pulses, or spikes, rather than continuous values. Here, 50 Leaky Integrate-and-Fire neurons accumulate input over time and emit a spike only when their membrane voltage crosses a threshold, mimicking how biological neurons actually fire.

What does the LIF (Leaky Integrate-and-Fire) model do?

The LIF model treats a neuron as a leaky capacitor. Its voltage follows τm·dV/dt = −(V − Vrest) + Rm·I, integrating input while leaking back toward the resting potential. When V reaches the −55 mV threshold it fires, resets to −75 mV, and pauses for a 2 ms refractory period before integrating again.

What is STDP and why does it matter?

Spike-Timing-Dependent Plasticity adjusts synaptic weights based on the precise timing of pre- and post-synaptic spikes. If the presynaptic neuron fires just before the postsynaptic one the connection strengthens (potentiation); if it fires just after, the connection weakens (depression). This timing rule is a leading biological mechanism for learning and memory.

What do the firing rate, synchrony and burst period statistics mean?

Firing rate is the average spikes per neuron per second in Hertz. Synchrony is the coefficient of variation of binned population activity — higher values mean neurons spike together in bursts rather than independently. Burst period estimates the time in milliseconds between population-wide bursts visible as vertical bands in the raster plot.

How do the input current and noise sliders change the behaviour?

The input current Iext (0–4 µA) sets the constant drive pushing every neuron toward threshold; higher current produces faster, denser firing. The noise σ slider adds random fluctuations to each neuron's input, de-synchronising the network and producing more irregular, biologically realistic spike trains.

What does the E/I ratio control change?

The E/I slider sets how many excitatory neurons there are per inhibitory neuron, from 1:1 up to 8:1 (default 4:1, matching cortical estimates). Excitatory synapses push targets toward firing while inhibitory ones pull them away, so the balance strongly shapes whether activity is stable, oscillatory, or runaway.

What are the A+ and A− STDP parameters?

A+ (default 0.01) is the maximum potentiation step applied when a presynaptic spike precedes a postsynaptic one, and A (default 0.012) is the maximum depression step for the reverse order. Both are scaled by exp(−|Δt|/τ) with τ = 20 ms, so weight changes shrink as the spike-time gap grows.

Why do the neurons fire in synchronous bursts?

Synchronous bursting emerges from recurrent excitation: when several neurons fire, their synaptic currents push neighbours over threshold, recruiting a cascade across the population. Inhibition and the refractory period then silence the network briefly before the cycle repeats, producing the rhythmic vertical bands seen in the raster plot.

Is this simulation biologically accurate?

It captures the qualitative essentials — leaky integration, threshold spiking, refractoriness, exponential synapses and Hebbian STDP — using realistic millivolt and millisecond scales. However, it is a simplified point-neuron model: it omits dendritic structure, multiple ion channels, conduction delays and the rich diversity of real cortical cell types.

Where are spiking neural networks used in the real world?

Spiking networks underpin computational neuroscience research into learning, memory and brain rhythms, and they power neuromorphic chips such as Intel Loihi and IBM TrueNorth. Because they compute with sparse, event-driven spikes, they promise very low-power machine learning for edge devices, robotics and real-time sensory processing.