Skip to content

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

\[ \text{branching ratio} = \frac{\text{next-step active units}}{\text{current active units}} \]

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 recruitment
  • inhibitoryStrength: scales inhibitory suppression
  • longRange: controls the contribution of sparse long-range connections
  • refractorySteps: sets how long units remain refractory after firing
  • noiseFloor: sets the baseline spontaneous drive
  • hebbianPlasticity: controls the strength of activity-dependent potentiation
  • homeostaticPull: 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 countdown
  • active: whether the unit is active now
  • nextActive: whether the unit will be active on the next step
  • excInput: total excitatory input received this step
  • inhInput: 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:

  1. allocates state and input arrays
  2. generates sparse long-range shortcuts
  3. initializes local and long-range weights
  4. randomly assigns each unit as excitatory or inhibitory
  5. clears histories and derived statistics
  6. seeds an initial burst of activity
  7. 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:

  1. clears temporary input buffers
  2. relaxes learned weights slightly toward baseline
  3. lets currently active units distribute excitatory or inhibitory influence
  4. computes the effective excitatory gain
  5. probabilistically recruits resting, non-refractory units
  6. applies the Hebbian-like weight update
  7. advances refractory timers
  8. updates branching, activity, and avalanche statistics
  9. applies slow homeostatic correction
  10. optionally reseeds the field after prolonged silence
  11. swaps the current and next activity states
  12. 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:

\[ \text{excitDrive} = 0.12 \cdot \text{excInput}[i] \cdot \text{effectiveGain} \]
\[ \text{inhibitoryBrake} = 0.078 \cdot \text{inhInput}[i] \cdot \text{inhibitoryStrength} \]
\[ \text{neuronBias} = \begin{cases} -0.018 & \text{if the unit is inhibitory} \\ 0 & \text{if the unit is excitatory} \end{cases} \]
\[ \text{drive} = \max\left(0,\; \text{noiseFloor} + \text{excitDrive} - \text{inhibitoryBrake} + \text{neuronBias}\right) \]
\[ p_\text{fire} = \min\left(0.98,\; 1 - e^{-\text{drive}}\right) \]

If Math.random() < p_fire, the unit becomes active on the next step.

The effective excitatory gain is

\[ \text{effectiveGain} = \operatorname{clamp}(\text{excitatoryGain} + \text{adaptiveBias}, 0.55, 1.55) \]

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 activity
  • complexity score: a heuristic summary of variability, branching behavior, occupancy, and avalanche structure
  • power-law slope: a simple regression slope from the avalanche size distribution in log-log coordinates
  • last avalanche: the most recent completed avalanche size
  • largest avalanche: the largest completed avalanche observed so far
  • active excitatory: the number of excitatory units currently active
  • active inhibitory: the number of inhibitory units currently active
  • recorded 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.