CNEL

Spike-train decoding with kernel least-mean-squares (KLMS)

A from-scratch Python reproduction of a classic neural-decoding result: turning noisy spike trains into a continuous control signal with a kernel adaptive filter.

Diagram of spike trains feeding a KLMS decoder that reconstructs a micro-stimulation signal.

Overview

A faithful Python reproduction of Li et al. (IEEE MLSP 2011): a spike-time RKHS KLMS decoder that maps spike trains to micro-stimulation, benchmarked against binned KLMS and GLM baselines.

This project reproduces the core results of a well-known neural-decoding paper — Li et al., 'An adaptive decoder from spike trains to micro-stimulation using kernel least-mean-squares (KLMS)', IEEE MLSP 2011 — from scratch in Python, so the method can be understood, tested, and built on rather than taken on faith.

A small, honest project: take a classic neural-decoding paper and rebuild its results from scratch until the numbers line up.

Why reproduce a 2011 paper?

Kernel least-mean-squares decoding of spike trains is a foundational idea in neural interfaces, and the fastest way to really understand a method is to rebuild it until it reproduces the original numbers. This project reimplements Li et al. (IEEE MLSP 2011) in Python — decoder, baselines, synthetic data, and metrics — as a clean reference I can trust and extend.

It doubles as a proving ground for the kernel-adaptive-filtering tools I use elsewhere, on a problem where the right answer is already published.

How the decoder works

Spikes are events in time, not evenly-sampled numbers, so the decoder embeds each spike train in a reproducing-kernel Hilbert space using a spike-time (cross-intensity) kernel. A kernel least-mean-squares filter then learns online — updating on each sample — to map that representation to the continuous micro-stimulation command, which is scored by normalized mean-squared error.

Reproducing the published results

The point of a reproduction is the numbers, so the synthetic benchmark from the paper is rebuilt and every model is scored the same way. The spike-time kernel decoder leads the binned baselines, matching the paper's reported targets:

Spike-KLMS
NMSE ≈ 0.13 — the spike-time RKHS decoder, and the best of the three.
Binned-KLMS
NMSE ≈ 0.27 — a Gaussian-RBF KLMS on binned counts.
Binned-GLM
NMSE ≈ 0.35 — a Poisson GLM baseline.
Figure 1 — Reproduced synthetic NMSE. Working directly with spike times beats binning them, as the original paper reported.

Where it stands

The synthetic reproduction is complete, including the kernel APA family and a projection-order sweep. The next step is sourcing the real rat VPL–S1 dataset used in the original study to move from synthetic validation to real recordings.

FAQ

What is KLMS?

Kernel least-mean-squares: a least-mean-squares adaptive filter applied in a reproducing-kernel Hilbert space, so it can learn nonlinear mappings online while staying simple and interpretable.

Why work with spike times instead of binned counts?

Binning throws away temporal precision. A spike-time kernel keeps it, and the reproduction shows that this is exactly why the spike-time decoder reaches a lower error than the binned baselines.

Is this original research or a reproduction?

It is a faithful reproduction of a published result, built to understand and extend the method. The original work is Li et al., IEEE MLSP 2011.

Cite this work

@inproceedings{li2011klms,
  title     = {An adaptive decoder from spike trains to micro-stimulation using kernel least-mean-squares (KLMS)},
  author    = {Li, Lin and Park, Il Memming and Seth, Sohan and Choi, John S. and Francis, Joseph T. and Sanchez, Justin C. and Principe, Jose C.},
  booktitle = {IEEE International Workshop on Machine Learning for Signal Processing (MLSP)},
  year      = {2011}
}

What I built

  • A spike-time RKHS KLMS decoder built on the cross-intensity kernel, operating directly on spike times.
  • A spike-time kernel APA family (KAPA / KNLMS / affine projection) with a projection-order sweep.
  • Binned-data baselines for comparison: a Gaussian-RBF KLMS and a Poisson-log-link GLM.
  • Synthetic neural-response generation with biphasic stimulation pulses, plus NMSE scoring and reconstruction plots.

How it works

  • Represent each spike train in a reproducing-kernel Hilbert space via a spike-time kernel.
  • Learn an adaptive decoder online with kernel least-mean-squares, updating on each sample.
  • Reconstruct the continuous command signal and score it by normalized mean-squared error (NMSE).
  • Compare the spike-time decoder against binned KLMS and GLM baselines on the same synthetic data.

Related projects

Snapshot

Track
Research · neural decoding · reproduction
Status
Synthetic reproduction implemented; rat VPL–S1 dataset sourcing in progress.
Focus
Kernel adaptive filteringNeural decodingPaper reproduction

Stack

  • Python
  • NumPy / SciPy
  • Kernel adaptive filtering (KLMS, KAPA)

Glossary

KLMS
Kernel least-mean-squares: an adaptive filter that learns nonlinear mappings online in a reproducing-kernel Hilbert space.
Spike train
The sequence of firing times of a neuron, treated here as events in continuous time.
NMSE
Normalized mean-squared error: reconstruction error scaled by signal power, so lower is better.
RKHS
Reproducing-kernel Hilbert space: the feature space a kernel implicitly maps data into.