Brain Criticality Demo
Overview
This live demo is an interactive neural-field simulation designed to illustrate core ideas behind the brain criticality hypothesis. It is a conceptual model, not a biophysically realistic reconstruction of brain tissue and not a direct method for measuring criticality in experimental data.
The simulation lets users explore how excitation, inhibition, refractoriness, spontaneous activity, long-range connectivity, synaptic plasticity, and homeostatic regulation shape collective network dynamics. By adjusting the control parameters, the network can be pushed toward qualitatively subcritical, near-critical, or supercritical regimes.
As described in Brain Criticality Hypothesis, a system is often said to be near criticality when activity is approximately self-sustaining: it does not die out too quickly, but it also does not expand into persistent runaway activation.
Core Dynamics
Each unit in the network can be in one of three states at a given time step:
- Active: the unit emits output to other units
- Resting: the unit is available to become active
- Refractory: the unit is temporarily unable to fire after recent activation
At each step, resting units may become active with a probability determined by the balance of excitatory and inhibitory input, together with a small baseline activation term and slower adaptive effects.
In general:
- stronger excitatory input increases the probability of firing
- stronger inhibitory input decreases the probability of firing
- recently active units enter a refractory period before they can participate again
When a unit fires, it sends either excitatory or inhibitory influence to connected targets and then becomes refractory for a fixed number of time steps.
Activity-Dependent Adaptation
The model includes a simplified Hebbian-like plasticity rule.
If an active excitatory unit helps recruit an excitatory target on the next time step, the weight of that connection increases slightly, up to a preset cap. Over time, all weights relax back toward baseline.
This mechanism is included to illustrate how activity can reshape effective connectivity. It should be interpreted as a coarse phenomenological rule, not as a detailed biological model of synaptic learning.
The simulation also includes a slow homeostatic term that adjusts effective excitatory gain toward a target activity level. This helps prevent the system from remaining trapped in prolonged silence or runaway saturation.
Branching Ratio
The demo tracks a live branching ratio, defined here as
In this simplified setting:
- a value below 1 indicates that activity tends to decay
- a value near 1 indicates approximately marginal propagation
- a value above 1 indicates that activity tends to expand
The displayed value is smoothed over time, so it is more stable than the raw one-step ratio.
This quantity should be interpreted carefully. In real neural systems, branching ratio is difficult to estimate directly because one typically cannot observe every neuron or every causal interaction. In this demo, it is best treated as an internal diagnostic of propagation balance rather than a definitive measurement of criticality in the brain.
User Controls
The interface exposes the following parameters:
excitatoryGain: scales excitatory recruitmentinhibitoryStrength: scales inhibitory suppressionlongRange: controls the contribution of sparse long-range connectionsrefractorySteps: sets how long units remain refractory after firingnoiseFloor: sets the baseline spontaneous drivehebbianPlasticity: controls the strength of activity-dependent potentiationhomeostaticPull: controls the strength of slow homeostatic regulation
These parameters are best understood as dynamical controls for the simulation, not as one-to-one physiological measurements.
Network Structure
The model is implemented on a 48 × 30 grid of units.
Each unit stores:
neuronType: excitatory (+1) or inhibitory (-1)refractory: remaining refractory countdownactive: whether the unit is active nownextActive: whether the unit will be active on the next stepexcInput: total excitatory input received this stepinhInput: total inhibitory input received this step
The connectivity structure includes:
- local neighbor connections
- broader inhibitory neighborhoods
- sparse long-range shortcut connections
- separate weight maps for local and long-range links
The simulation also tracks recent activity, branching history, avalanche statistics, and dashboard summary metrics.
Network Initialization
When the network is rebuilt, the script:
- allocates state and input arrays
- generates sparse long-range shortcuts
- initializes local and long-range weights
- randomly assigns each unit as excitatory or inhibitory
- clears histories and derived statistics
- seeds an initial burst of activity
- computes the initial dashboard values
Local connectivity is fixed by the grid geometry, whereas long-range shortcuts are randomized when the network is rebuilt. All weights begin at baseline.
Simulation Update
The system evolves in discrete time steps. On each step, the script:
- clears temporary input buffers
- relaxes learned weights slightly toward baseline
- lets currently active units distribute excitatory or inhibitory influence
- computes the effective excitatory gain
- probabilistically recruits resting, non-refractory units
- applies the Hebbian-like weight update
- advances refractory timers
- updates branching, activity, and avalanche statistics
- applies slow homeostatic correction
- optionally reseeds the field after prolonged silence
- swaps the current and next activity states
- redraws the field and the dashboard
Only units that are neither active nor refractory are eligible to fire.
For each eligible unit, the firing probability is computed from the balance of excitatory drive, inhibitory suppression, baseline noise, and a small bias term:
If Math.random() < p_fire, the unit becomes active on the next step.
The effective excitatory gain is
Avalanche Analysis
The demo also tracks avalanche-like population events from the recent activity trace.
A baseline threshold is estimated from the lower quantile of recent activity values. An avalanche is then defined operationally as a contiguous period during which activity remains above that threshold.
For each completed avalanche, the script records:
- duration: the number of consecutive above-threshold time steps
- size: the integrated activity above threshold during that burst
These quantities are useful for visualizing burst structure, but they remain dependent on the model, thresholding rule, and analysis window.
Dashboard Metrics
The dashboard displays several summary measures:
branching ratio: a smoothed estimate of next-step versus current-step activitycomplexity score: a heuristic summary of variability, branching behavior, occupancy, and avalanche structurepower-law slope: a simple regression slope from the avalanche size distribution in log-log coordinateslast avalanche: the most recent completed avalanche sizelargest avalanche: the largest completed avalanche observed so faractive excitatory: the number of excitatory units currently activeactive inhibitory: the number of inhibitory units currently activerecorded avalanches: the number of completed avalanches currently available for analysis
These metrics are intended for qualitative interpretation within the demo. They should not be treated as formal statistical evidence of criticality in biological neural systems.