HomeBiology & LifeSpiking Neural Network

🧠 Spiking Neural Network

Simulate a network of leaky integrate-and-fire neurons. Watch membrane potentials build, spikes fire, and synchrony emerge in a live raster plot. Tune coupling, drive and inhibition.

Biology & Life3DModerate60 FPS
neuron-network ↗ Open standalone

About this simulation

This simulation models a network of leaky integrate-and-fire (LIF) neurons wired together with random directed connections. Each neuron's membrane potential V leaks toward rest, is driven by a constant external current plus noise, and fires a spike the instant V crosses threshold — after which it resets and sits out a refractory period. Spikes are delivered to every post-synaptic target with a weight scaled by coupling strength, with excitatory neurons adding current and inhibitory neurons subtracting it. Watching the live spike raster and synchrony index shows how simple per-neuron rules can produce network-wide rhythms.

What it shows

A ring of neurons connected via K random directed synapses each. The canvas view shows membrane potential as a colour heatmap with a bright flash on every spike, while the raster plot beneath tracks which neuron fires when over a rolling 2-second window. Live stats report the mean firing rate, a variance-based synchrony index, the excitatory fraction, and spikes counted in the last second.

How to use

Adjust Neurons (20-200) and Connections per neuron K (2-40) to change network size and density, and Excitatory fraction to set the mix of excitatory versus inhibitory cells. External drive pushes every neuron's membrane potential up over time, while Coupling strength scales how strongly a spike affects its targets. Try the five presets — Asynchronous, Synchronous bursting, Sparse, Inhibition-dominated, Strong coupling — to jump to interesting regimes, or use Pause/Reset to freeze a moment or rebuild the network from scratch.

Did you know?

Real cortical networks keep a similar balance of roughly 80% excitatory and 20% inhibitory neurons. In this simulation, pushing the excitatory fraction too high with strong coupling drives the network into runaway synchronous bursting, while enough inhibition damps it back into irregular, asynchronous firing — a balance neuroscientists call excitation-inhibition (E/I) balance.

Frequently asked questions

What is a leaky integrate-and-fire neuron?

It is a simplified neuron model where a single variable, the membrane potential V, decays toward a resting value over time (the "leak") while also integrating incoming current from external drive and synaptic input. When V crosses a fixed threshold, the neuron emits a spike, V resets, and the neuron becomes briefly unresponsive during a refractory period. It captures the essential spiking behaviour of real neurons without modelling detailed ion-channel biophysics.

What do the Connections per neuron (K) and Excitatory fraction controls do?

K sets how many random directed synapses each neuron sends to other neurons in the network, controlling how densely connected the population is. Excitatory fraction sets what percentage of neurons add positive current to their targets when they spike, versus the remainder, which are inhibitory and subtract current, taming runaway activity.

What does the synchrony index measure?

It compares how evenly spikes are spread over time against how clumped they are. Spike times are grouped into short 20-millisecond bins across the last second, and the variance of spike counts across those bins is normalised by the mean. A low value means neurons fire fairly independently and evenly over time; a high value means many neurons tend to spike together in tight bursts.

Why does the network suddenly start firing in synchronized bursts?

When excitatory coupling is strong relative to inhibition, a few neurons firing together deliver enough extra current to push many of their neighbours over threshold at once, and that burst cascades through the network. This runaway effect is reduced by increasing the inhibitory fraction or lowering coupling strength and external drive, which is exactly what the Inhibition-dominated and Sparse presets demonstrate.

Is this simulation biologically realistic?

It captures core principles of spiking dynamics — thresholds, refractory periods, excitation/inhibition balance, and network-driven synchrony — but it is a simplified model, not a biophysically detailed simulation. It uses arbitrary units and a random directed-graph connectivity rather than realistic axon delays, dendritic geometry, or ion-channel kinetics, so it is best used to build intuition about network-level spiking behaviour rather than to reproduce quantitative experimental data.

⚙ Under the hood

Watch a leaky integrate-and-fire neural network fire in real time. Tune connectivity, the excitatory/inhibitory ratio, input current and coupling, and see the spike raster shift between asynchronous and synchronous regimes.

Canvas 2DNeuroscienceLIFSpiking NetworkSynchrony

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)