Paper Feed

Issue 29 · Pick 02 Neuroscience ✓ read

Low-latency neuromorphic closed-loop control of hippocampal ripples in vivo

Alves, P., Jurado-Parras, M.-T., Freitas, J., Ventura, J., de la Prida, L. M., Aguiar, P.

TL;DR: A spiking network of just 41 neurons, running on a SpiNNaker board wired into a standard Open Ephys rig, watches hippocampal field potentials, spots a sharp-wave ripple as it begins, and fires an optogenetic light pulse fast enough (~50 ms round trip) to interrupt the ripple while it is still happening — using tens to hundreds of times less power than a CPU or GPU doing the same job. It is the first end-to-end neuromorphic sense-compute-stimulate loop closed on a fast, transient brain rhythm in a living animal. The detection is solid; the in vivo causal effect is a genuine but preliminary proof-of-concept, not yet a clean robust result.

Why this is a hard problem

Closed-loop neuromodulation lives or dies by timing. If you want to prove that a specific brain event causes something — or to therapeutically suppress it — you have to detect the event and stimulate while it is still unfolding. For deep-brain-stimulation-style targets like Parkinsonian beta bursts you have hundreds of milliseconds of slack. Hippocampal ripples give you almost none: they are 30–100 ms bursts of 100–250 Hz oscillation. Detect one, decide, route a command out to a stimulator, and get light into tissue — all inside the lifetime of the event.

That constraint collides with the usual decoding stack. A good deep-learning ripple detector (a CNN or LSTM) is accurate, but it wants a GPU, which means an external box, telemetry, buffering, and watts of power — latency and energy budgets that are fine offline and hopeless for an embedded, always-on implant. The field has wanted a computational substrate that is simultaneously accurate enough, fast enough, and cheap enough to sit at the edge. Neuromorphic hardware — event-driven spiking chips like SpiNNaker or Loihi — is the obvious candidate, but nobody had actually closed the full loop on a fast transient rhythm in vivo. That gap is exactly what this paper fills.

The pipeline

The trick that makes everything else possible is turning the continuous LFP into spikes before the network ever sees it. The raw signal is bandpass filtered to the ripple band (100–250 Hz) and then run through asynchronous delta modulation (also called step-forward encoding): whenever the signal climbs past a threshold above its last emitted value, emit an UP spike; whenever it falls past that threshold, emit a DN spike; reset the reference each time. You get two sparse event streams that carry the waveform's slope information — a natural fit for a spiking network, and event-driven by construction.

CA1 LFP filter + UP/DN spikes SNN on SpiNNaker Arduino TTL pulse µLED opto inhibitory light suppresses the ongoing ripple — the loop is closed ~50 ms round trip, target ripple still active
The whole loop is off-the-shelf neuroscience plumbing (Open Ephys, Arduino, µLED optoelectrodes) with a neuromorphic board dropped in as the decision-maker. The ~9.8 ms of USB overhead they isolate is the biggest remaining latency chunk.

The encoding is not lossless waveform capture — it is deliberately biased toward the events you care about. During ripples the UP/DN streams fire at a median 411.7 Hz; during baseline, only 40.8 Hz. Reconstruction SNR is 6.3 dB in ripples vs 3.5 dB in baseline. So the representation is sparse where nothing is happening and rich where a ripple is, which is exactly what makes an event-driven chip efficient.

The network itself is almost comically small: two input channels (UP, DN), two hidden LIF layers of 24 and 16 neurons, one output "ripple detector" neuron. 41 neurons, 530 trainable parameters. It is trained with surrogate-gradient backprop-through-time using a time-to-first-spike loss with a 20 ms tolerance window, so the output neuron learns to fire early in the event rather than just somewhere inside it.

How good is the detection?

Honestly assessed and honestly reported. Across 23 sessions from 5 mice (2719 annotated ripples), the SNN gets median recall 0.89 but precision only 0.50, for F1 0.56 (best configuration 0.61). It is a high-recall, moderate-precision detector — which is the correct failure mode for a stimulation trigger where you'd rather catch ripples than miss them.

The comparison to established detectors is where the framing matters.

Ripple detection F1 (median across 23 sessions)F1-score00.10.20.30.40.50.60.70.7Buzsaki RMS (optimized)0.61SNN (best)0.591D-CNN0.56SNN (default)0.52RippleNet0.52LSTMFrom Results 2.2 and Fig. 2E; exact values for 1D-CNN/RippleNet/LSTM are approximate from the text's comparisons (SNN significantly beat RippleNet p=0.012 and LSTM p=0.013, comparable to 1D-CNN p=0.22).

Two takeaways. First, the SNN significantly beats RippleNet and the LSTM and ties the 1D-CNN — so a 530-parameter spiking net is genuinely competitive with the deep models people actually use. Second, the paper does not claim to win on raw accuracy: a carefully tuned classical Buzsáki RMS detector gets the highest F1 (0.70). The authors are refreshingly clear that the SNN's value is not superior offline accuracy but the combination of competitive accuracy with compactness, event-driven computation, and stable real-time hardware behavior. The one nuance worth keeping: the SNN kept its performance under out-of-the-box settings, whereas the classical detectors collapsed without per-dataset tuning. For an autonomous chronic implant that can't be re-tuned per session, that robustness-to-defaults is the real argument.

A nice sanity check on what the network learned: TP/FP/FN events form a continuous feature space (UMAP and PCA show no clean clusters), and FPs and FNs overlap heavily. That argues the SNN isn't a glorified power-threshold — its errors sit exactly where human annotators themselves disagree, on ambiguous low-amplitude events.

The energy argument

This is the cleanest win in the paper. Running the same SNN inference over 14 sessions, a GPU drew ~70 W and a CPU ~53 W — and neither could keep up in real time. SpiNNaker ran in biological real time at ~3.6 W board-level, of which only ~0.35 W was the actual simulation.

Power to run the SNN in real timeWatts (log scale)01020304050607070GPU53CPU3.6SpiNNaker (board)0.35SpiNNaker (sim only)Results 2.4 / Fig. 4F, n=14 sessions. GPU and CPU also failed to run in real time; only SpiNNaker did.

That is a 16–20× reduction at board level, up to 170–200× if you count only simulation-attributed power. The 200× headline is the most favorable slice, so treat it as an upper bound — but even the conservative 16× board-level number, combined with the fact that the conventional processors couldn't hit real time at all, is the more honest and still-compelling comparison.

Latency: the part that makes it usable

Detection accuracy is worthless here if the light arrives after the ripple ends. The hardware-in-the-loop measurements produce a clean linear model:

\text{Latency (ms)} = 47.45 + 0.84 \times \text{Buffer (ms)}

where Buffer is the Open Ephys acquisition buffer size. With a 3 ms buffer, median round-trip latency is 48.5 ms, and — critically — stimulation lands before ripple termination in 80.4% of events. Two engineering details did most of the work: bypassing the Open Ephys Arduino plugin and triggering the Arduino directly from Python shaved ~9.2 ms (and pushed intra-event hit rate from 59% to 80%), and they identified ~9.8 ms of pure USB communication overhead as the next thing to kill (PCIe or a system-on-chip would remove it). Buffer size barely affects accuracy (2.7% of F1 variance) while dominating latency, so short buffers are basically free performance.

The in vivo result — and where to be skeptical

Here is where the reviewer's caution is warranted, and where the paper is more preliminary than the abstract suggests.

The actual awake-mouse experiments (12 sessions, 4 light-OFF / 8 light-ON, 2 mice, 1699 ripples) were run with a preliminary, un-optimized configuration: a 20 ms buffer and the slow Open Ephys plugin output. That gave a median latency of 76 ms — longer than the median ripple — so only 13.7% of ripples were actually stimulated before they ended. In other words, the beautiful 50 ms / 80% numbers come from the bench validation, not from the biology experiments.

Given that handicap, the causal effects are trends more than confirmed results. Peri-detection ripple power dropped in ON sessions but at p = 0.07 (large effect size, δ = 0.69). To find a significant effect they restricted analysis to the longest 25% of ripples per session — events long enough to still be running when the late light arrived — where ON sessions showed lower ripple energy (p = 0.048, δ = 0.75), plus sub-significant trends toward higher spectral entropy, lower peak frequency, and fewer long ripples.

So: the effect is real-looking and in the expected direction (inhibition desynchronizes and shortens ripples), the effect sizes are large, but the sample is tiny (2 mice, 8 ON sessions), the key p-value clears 0.05 by a hair, and it required a subset analysis. This is a legitimate proof-of-concept that the loop can alter ripple dynamics, not a robust demonstration of controlled ripple suppression across the full dataset. The honest reading is that the system is validated and the biological manipulation is a promising first result awaiting the low-latency config the bench work already showed is achievable.

What changes if this holds

The conceptual contribution is showing that the entire sense→compute→stimulate loop for a fast transient rhythm can be closed with a neuromorphic decision-maker sitting inside standard, widely-adopted neuroscience infrastructure — not a custom rig only one lab can reproduce. A 530-parameter SNN being competitive with deep detectors while drawing sub-watt power is a concrete argument that event-driven computation is the right substrate for implantable neural interfaces, and the same recipe transfers directly to beta bursts in Parkinson's or HFOs in epilepsy. SpiNNaker is not implantable, so the real endpoint is a system-on-chip version; this paper is the algorithm-and-integration proof that makes that chip worth building.

What to read

Section 2.5 (latency / hardware-in-the-loop) is the most quietly important part — it is where the engineering actually earns the "closed-loop on a fast rhythm" claim, and the latency decomposition (buffer, USB, triggering path) is the reusable knowledge. Section 2.2 plus Fig. 2 gives you the fair detector comparison. Read Section 2.6 / Fig. 6 critically, keeping the preliminary configuration and the subset analysis in mind before you believe the in vivo effect size.