Spaces:
Running
Running
File size: 4,551 Bytes
0411144 032379c d035fbd 0411144 d035fbd 0411144 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd 032379c d035fbd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | ---
title: Cortex-Conv — Browser-Native Equilibrium Propagation
emoji: 🧠
colorFrom: purple
colorTo: indigo
sdk: static
pinned: false
license: mit
short_description: 34K-param EqProp net at 96.8% MNIST, in your browser.
tags:
- equilibrium-propagation
- webgpu
- mnist
- fashion-mnist
- biologically-plausible-learning
- no-backprop
- browser
---
# cortex-conv
**A 34,106-weight convolutional neural network trained with Equilibrium Propagation — no backpropagation — running entirely in your browser on WebGPU. Ships pre-trained at 96.8% MNIST test accuracy: the page loads at 96.8% on the very first visit.**
The neuron is a leaky integrator with sigmoid activation. The training rule is two forward passes (free + ±β-clamped) plus a local activity-difference weight update — no backward graph, no transposed weights, no autodiff. Toggle to Fashion-MNIST to watch the same network train from scratch on clothing items, live.
## What's in this Space
| Panel | What it shows |
|---|---|
| **Panel 03** — *the lead* | `cortex-conv` itself: a trained network that ships at 96.8% MNIST. Click `train` to keep refining; toggle `data` for Fashion-MNIST. |
| **Panel 00** — *context* | The FitzHugh-Nagumo reaction-diffusion substrate that EqProp's underlying proof was developed on. Cortex-conv inherits the proof's broader-class guarantee but uses a simpler neuron. |
| **Panel 01** — *context* | An inference shortcut cortex-conv deliberately doesn't use (it has a ~30-layer precision wall; cortex-conv has 3 layers and uses iterative settling instead). |
| **Panel 02** — *context* | The self-adjointness proof that lets any EqProp variant work on this neuron class. |
## How cortex-conv stacks up
| Method | Params | MNIST accuracy | Deployment |
|---|---|---|---|
| Kendall 2026 (FHN, 5-layer dense) | 1,457,674 | 97.2% | Python |
| EqSpike (Martin et al. 2021, spiking) | unspec. | 97.6% | neuromorphic HW |
| Oscillator Ising EqProp (2025) | unspec. | 97.2% ± 0.1% | physical oscillators |
| Scellier & Bengio 2017 (original) | unspec. | 97-98% | Python |
| **cortex-conv (this Space)** | **34,106** | **96.8%** | **browser, WebGPU** |
| (small backprop CNN, for context) | 31,818 | 99.26% | Python |
Honest positioning: **the smallest browser-deployed EqProp net on MNIST**. Slightly below the EqProp accuracy frontier (96.8% vs 97.2-97.6%) but orders of magnitude more deployable — no Python, no GPU server, no hardware lab, just a browser tab.
## Technical write-up
See [`PAPER_COMPANION.md`](./PAPER_COMPANION.md) for the architecture, the four "cortex" learning ingredients (each with verified citations), the comparison math, and reproducibility instructions.
## Related work
- Jack Kendall, *Equilibrium Propagation and Hamiltonian Inference in the Diffusive FitzHugh-Nagumo Model*, [arXiv:2605.21568](https://arxiv.org/abs/2605.21568) (2026) — the self-adjointness proof Panel 02 visualises.
- Liu & Chen, *FRE-RNN: Feedback Regulation for Practical EqProp*, [arXiv:2508.11659](https://arxiv.org/abs/2508.11659) (2025) — source of the adaptation-current ingredient.
- Kubo, Chalmers & Luczak, *Adjusted Adaptation*, [arXiv:2204.14008](https://arxiv.org/abs/2204.14008) (2022) — source of the adjusted-relaxation ingredient.
- Zhang, Liu & Schaeffer, *AdaGO: AdaGrad Meets Muon*, [arXiv:2509.02981](https://arxiv.org/abs/2509.02981) (2025) — the optimiser cortex-conv uses on top of EqProp gradients.
- Scellier & Bengio, *Equilibrium Propagation*, Frontiers Comp. Neurosci. (2017) — the foundational EqProp paper.
## Requirements
A browser with WebGPU enabled (Chrome / Edge 113+ on macOS / Windows / Linux; Safari 18+ on macOS Sonoma). If WebGPU is unavailable the page falls back to a slower CPU path with a smaller embedded MNIST.
## Files
| Path | Purpose |
|---|---|
| `index.html` | The four-panel demo page |
| `tests/gpu_lib_conv_multi.js` | WGSL training pipeline (forward + ±β-clamped relaxation + gradient kernels) |
| `tests/gpu_lib_deep.js` | Muon / AdaGO optimisers + helpers |
| `tests/gpu_lib_conv_full.js` | WebGPU device init + command-encoder utilities |
| `tests/eqprop_lib.js` | Shared activation funcs + dataset loader |
| `mnist/mnist_pack_28_60k.json` | 60K MNIST samples at 28×28 (base64-packed uint8) |
| `fashion/fashion_pack_28_60k.json` | 60K Fashion-MNIST samples at 28×28 |
| `weights/cortex_conv_mnist_R28.json` | Pre-trained cortex-conv weights (96.8% test acc, 720 KB) |
| `PAPER_COMPANION.md` | Full technical write-up |
## License
MIT.
|