Date: April 5, 2026 Author: edvatar (toroleapinc) Repo: https://github.com/toroleapinc/encephagen
Day 5 executed all 4 phases of the revised plan, hit a fundamental wall, and built a working demo anyway.
Phase A (T1w/T2w gradient): Timescale hierarchy emerges (r=-0.45, p<0.0001) but is identical for connectome and random — it's driven by the gradient, not topology.
Phase B (Innate dynamics): Stimulus doesn't propagate beyond visual cortex. The wall: all dMRI-derived long-range connections are excitatory. At high coupling → saturation. At low coupling → no propagation. Added feedforward inhibition (3x stronger onto inhibitory neurons) which improved FC-FC to 0.30+ but didn't fix propagation.
Phase C (Learning scaffold): Both connectome and random at chance (~36%) on stimulus-action task. E-prop doesn't produce meaningful learning at this scale with 60 episodes.
Phase D (Demo): Built python demo.py — interactive brain with 16K neurons, 80 regions, T1w/T2w gradient, conduction delays, CPG walking, stimulus response. It works.
Implementation: Downloaded HCP S1200 T1w/T2w myelination map, parcellated onto 80 AAL2 cortical regions. Tau_m ranges from 10ms (Heschl/auditory) to 30ms (temporal pole).
Result: Timescale-rate correlation r=-0.445 (p=3.5e-5). Regions with shorter tau_m fire faster. Regional CV increased 24% (0.082 vs 0.066). FC-FC(emp) maintained at 0.43.
But: Hierarchy is IDENTICAL for connectome and random (both r≈-0.45). The gradient drives hierarchy, not topology. This means regional heterogeneity is necessary but not sufficient — topology still doesn't differentiate.
Test: Flash 100mV visual stimulus, measure response propagation to temporal, parietal, frontal regions.
Result: Visual cortex responds (+12% at gc=5, +10% at gc=10). All other regions show 0% change. Signal is TRAPPED in visual cortex.
Root cause: All between-region connections are excitatory (dMRI can't distinguish neurotransmitter type). At high coupling, every region is driven to saturation by global excitation — no room for stimulus-evoked changes. At low coupling, the stimulus increment is too small relative to local dynamics.
Feedforward inhibition fix: Made long-range connections 3x stronger onto local inhibitory neurons. This improved FC-FC (gc=5 → 0.304, passes benchmark!) and prevented saturation. But stimulus STILL doesn't propagate — the feedforward inhibition that prevents saturation also blocks signal cascade.
Fine temporal analysis: At 2ms resolution, the network shows ~50Hz oscillatory fluctuations. But single-trial evoked responses are buried in spontaneous noise.
This is the fundamental dMRI wall: Without inhibitory long-range connections (which require neurotransmitter identity that dMRI doesn't provide), you can't have BOTH balanced dynamics AND stimulus propagation.
Task: 3-way stimulus-action mapping with delayed reward. 60 episodes, e-prop learning.
Result: Connectome 36% vs Random 37% (chance=33%). p=0.47. Neither brain learns. 0/7 FDR-significant.
Interpretation: The task is too hard for e-prop at this scale. Can't compare learning speed when neither agent learns. Need either simpler task, more episodes, or stronger learning rule.
Built demo.py with full pipeline:
- 16,000 spiking neurons, 80 regions
- T1w/T2w timescale gradient (10-30ms)
- HCP structural connectivity with conduction delays
- Feedforward inhibition for balanced dynamics
- Visual/auditory/somatosensory stimulation
- CPG walking modulated by motor cortex
- FC-FC(empirical) = 0.28-0.43 depending on gc
Commands: look, sound, touch, walk, status, rest, quit
- SC-FC validation — simulated FC matches real fMRI at r=0.42 (neurolib80, gc=10)
- Timescale hierarchy — T1w/T2w gradient produces Murray et al. 2014 hierarchy
- Feedforward inhibition — prevents saturation, improves FC-FC
- Interactive demo — brain responds to stimuli, modulates CPG
- E-prop learning — produces weight changes, but doesn't solve cognitive tasks at this scale
- Structural advantage — 0/4 significant on any cognitive measure with validated dynamics (Exp 29)
- Stimulus propagation — signal trapped in stimulated region, doesn't cascade
- Learning — e-prop at 16K neurons with 60 episodes doesn't learn 3-way classification
- Connectome as learning scaffold — no learning speed difference
dMRI tractography provides excitatory-only, undirected, macro-scale routing. Without:
- Inhibitory long-range connections (needs neurotransmitter ID)
- Directed connections (dMRI is undirected)
- Synaptic-level specificity (dMRI resolves regions, not neurons)
...you cannot build a connectome-dominant model with differentiated dynamics.
Add ESTIMATED inhibitory long-range from neuroanatomy literature. Not just BG→thalamus, but:
- ~30% of between-region connections as inhibitory (from known long-range GABAergic projections)
- Thalamic reticular → thalamus (requires subcortical parcellation)
- Cortical SST+ long-range inhibition This requires switching to a parcellation WITH subcortical regions AND continuous weights.
Use Wilson-Cowan at regional level (which produces realistic SC-FC and propagation) coupled with spiking neurons in select regions (PFC for working memory, V1 for perception). This is the Arbor-TVB approach.
BT-SNN (Zhao et al. 2024) showed connectome topology helps for RL tasks when regions have different properties. Adapt their approach: use the connectome as architecture for a spiking RL agent on MuJoCo tasks, with region-specific tau_m from T1w/T2w.
Start with noisy connectome, let STDP/e-prop refine it. Compare final learned connectivity to real connectome. If learning converges toward the real pattern, that proves the connectome is an attractor of learning dynamics.
| File | Change |
|---|---|
src/encephagen/gpu/spiking_brain_gpu.py |
T1w/T2w gradient, feedforward inhibition |
src/encephagen/connectome/bundled/neurolib80_t1t2_*.npy |
HCP T1w/T2w myelination data |
experiments/30_innate_dynamics.py |
Stimulus propagation + oscillation tests |
experiments/31_learning_scaffold.py |
Learning speed comparison |
demo.py |
NEW: Interactive brain demo |
Goal: Replicate what the worm/fly projects did — innate animalistic behavior from structure alone. A newborn doesn't think, it MOVES: reflexes, spontaneous movement, righting response.
Setup: Brain→CPG→Body→Brain closed loop. Inverted pendulum physics with random perturbations. Somatosensory input (tilt, velocity) → brain → motor cortex → CPG modulation → hip torques → body.
Result: All 20 runs (10 connectome, 10 random) survive full 10s. Identical metrics: tilt_std=0.010, torque_diversity=0.016. 0/5 significant.
Why: The body physics is too stable — the damped pendulum converges to equilibrium regardless of brain activity. The CPG locks to constant output instead of oscillating. The brain's influence is too small to matter.
Lesson: Need a properly UNSTABLE body (MuJoCo Walker2d) where the brain must actively balance, not a self-stabilizing pendulum. The worm's body is inherently unstable in fluid — that's what makes the connectome's motor patterns matter. Our pendulum is passively stable.
| Experiment | Finding | Significant? |
|---|---|---|
| 1-4 | Wilson-Cowan: degree→hierarchy, wiring→FC | Yes (network science) |
| 5 | Spiking hierarchy matches Murray 2014 | Yes (but WC disagrees) |
| 6 | STDP habituation | Yes |
| 7-9 | Embodied learning INVALIDATED (motor death) | Negative |
| 10 | Pendulum learning: 5 approaches failed | Negative |
| 11 | Spontaneous body twitching | Descriptive |
| 12-13 | Brain+CPG+body: 0.98 Hz gait | Yes |
| 14 | Crawling worm | Yes |
| 15-18 | Cognitive functions (condition, discrim, memory, integrated) | Yes (but Hebbian) |
| 19-20 | Walker2d body control | Marginal |
| 21 | Connectome vs random (Hebbian) | CV only (p=0.0002) |
| 22 | Connectome vs random (e-prop) | Conditioning (p=0.011, parameter-dependent) |
| 23 | Discrimination analysis | Entropy artifact (d=-9) |
| 24 | Full biophysical model | ALIF reverses advantage |
| 25 | SC-FC validation FAILS at gc=0.15 | Exposed bad parameters |
| 26 | SC-FC tuning | gc=0.20 passes (r=0.388) |
| 27 | Validated connectome vs random (tvb96) | 1/5 structure, 3/5 random wins |
| 28 | tvb66 tuning | WIP |
| 29 | Validated (neurolib80) connectome vs random | 0/4 significant |
| 30 | Innate dynamics: stimulus propagation | Signal doesn't propagate (dMRI wall) |
| 31 | Learning scaffold | Neither learns (both at chance) |
| 32 | Newborn closed-loop | Body too stable to differentiate |
| 33 | Walker2d brain control | Brain helps (210 vs 119 baseline) but no structural advantage |
Net result: 0 significant structural advantages on validated dynamics. The macro-scale dMRI connectome does NOT provide measurable cognitive, learning, or behavioral advantage over random wiring.
Root causes identified:
- All-excitatory long-range connections (dMRI can't distinguish E/I)
- Regions are interchangeable (tau_m gradient helps but doesn't differentiate topology)
- E-prop doesn't learn at this scale (task too hard)
What works: SC-FC validation (r=0.42), timescale hierarchy (r=-0.45), feedforward inhibition, CPG locomotion, interactive demo, brain-controlled Walker2d (78% improvement over baseline).
Goal: Wire the heterogeneous brain to a properly unstable body. BT-SNN approach: connectome as RL architecture. Does structure help motor control?
Setup: 16K neuron brain (T1w/T2w gradient, neurolib80, delays, feedforward inhibition) → sensory input from Walker2d obs (17-dim) → somatosensory regions → brain routing → motor cortex (6 groups) → 6 joint torques. E-prop learning from reward. 5 runs × 20 episodes per condition.
Results:
| Metric | Connectome | Random | Baseline | p |
|---|---|---|---|---|
| Mean survival (steps) | 212.5 | 209.7 | 119 | 0.15 |
| Mean reward | 332.5 | 329.5 | — | 0.42 |
0/5 FDR-significant. Both brains keep Walker2d alive 78% longer than zero-action baseline. The brain IS controlling the body — processing sensory input and producing useful motor output. But the connectome provides no advantage over random wiring.
Key finding: The spiking brain with T1w/T2w gradient CAN control a MuJoCo body. This is the "animalistic behavior" we were targeting — the brain produces movement that keeps an unstable biped upright. But it works equally well with any wiring pattern.
Day 5. 33 experiments. The brain is alive and controls a body (210 vs 119 baseline). The connectome provides the scaffold but not the specificity. At macro-scale dMRI, random wiring works just as well.