Scalable Spike Source Localization in Extracellular Recordings using Amortized Variational Inference.

Cole L. Hurwitz, Kai Xu, Akash Srivastava, Alessio Paolo Buccino, Matthias Hennig

Abstract

Determining the positions of neurons in an extracellular recording is useful for investigating the functional properties of the underlying neural circuitry. In this work, we present a Bayesian modelling approach for localizing the source of individual spikes on high-density, microelectrode arrays (MEAs). To allow for scalable inference, we implement our model as a variational autoencoder (VAE) and perform amortized variational inference. We evaluate our method on both biophysically realistic simulated and real extracellular datasets, demonstrating that it is more accurate than and can improve spike sorting performance over heuristic localization methods such as center of mass.

Introduction

To understand the brain's complex architecture, neuroscientists utilize Microelectrode Arrays (MEAs) to record "spikes"—the electrical pulses neurons use to communicate. Modern MEAs are increasingly dense, featuring thousands of sensors that record activity from thousands of neurons simultaneously. A central challenge in processing this data is spike sorting: the process of assigning each recorded spike to the specific neuron that produced it.

A key component of spike sorting is localization—estimating the 3D coordinates of the neuron that fired. Existing localization methods generally fall into two categories: fast but inaccurate heuristics (e.g., Center of Mass) which suffer from significant biases near the edges of the sensor array, and accurate but computationally prohibitive model-based optimizations (e.g., MCMC). This work introduces a "best of both worlds" solution: a mathematically grounded Bayesian method that is fast enough for real-time applications through amortized inference.

Methodology

The proposed approach combines a biophysical generative model with modern deep learning techniques to achieve high-speed, high-accuracy localization.

The Generative Model

The researchers assumed a physical rule where the electrical signal's amplitude decays exponentially as it travels away from the neuron source, modeled as $a \cdot \exp(br)$. This simple monopole assumption provides a robust prior for the spatial distribution of electrical potential.

Amortized Variational Inference (AVI)

Instead of solving a unique optimization problem for every spike, the authors trained a Variational Autoencoder (VAE). The encoder network learns to map raw electrical waveforms directly to a probability distribution of the neuron's location $(x, y, z)$. Once the network is trained, inference for new spikes requires only a single forward pass, "amortizing" the computational cost of the Bayesian inference.

Handling Edge Effects

To mitigate the "edge effect" where neurons near the boundary of the array are mislocalized, the model uses data augmentation and "virtual channels." By padding the input with virtual unobserved channels, the VAE is prevented from being biased toward the center of the array, allowing it to accurately estimate positions even for neurons partially off-grid.

Comparison of source localization across three methods: Center of Mass (COM), Markov Chain Monte Carlo (MCMC), and the proposed Variational Autoencoder (VAE). Black stars represent ground truth neuron locations. The VAE successfully mitigates the "edge effect" seen in COM, where estimates are biased toward the center of the sensor grid.

Results

Accuracy and Scalability

The VAE method was validated against simulated data (using the MEArec package) and real biological data from Neuropixels probes and the BioCam4096 platform. In simulations with 10 $\mu$V noise, the VAE achieved a localization error of approximately 8.8 $\mu$m, significantly outperforming the 15.8 $\mu$m error produced by the Center of Mass baseline.

Quantitative comparison of localization error (µm) across different methods and noise levels (10, 20, and 30 µV). The VAE method consistently achieves the lowest error across various channel observation counts.

Beyond accuracy, the model demonstrated massive scalability. Utilizing a single TITAN X GPU, the VAE localized one million spikes in just 37 seconds. This speed makes it practical for the massive datasets generated by modern high-density probes, where traditional MCMC methods would take orders of magnitude longer.

Impact on Spike Sorting

By using these high-accuracy locations as features for clustering, the researchers observed significant boosts in precision and recall metrics. This demonstrates that improving the localization step directly enhances the reliability of the entire spike sorting pipeline.

Discussion and Future Work

While the VAE approach offers a significant leap in performance, it currently relies on a simplified "monopole" (point source) physical model. Real neurons possess complex geometries (dendrites and axons) that might be better captured by dipole models. Additionally, future iterations could incorporate more complex noise models, such as $1/f$ "pink noise" or background neural chatter, to further improve robustness in real-world recording environments.

The authors envision this scalable localization framework being integrated into existing open-source spike sorting pipelines like HerdingSpikes2 or SpikeInterface, providing a standard tool for high-throughput neural data analysis.

Summary updated

Abstract

Determining the positions of neurons in an extracellular recording is useful for investigating the functional properties of the underlying neural circuitry. In this work, we present a Bayesian modelling approach for localizing the source of individual spikes on high-density, microelectrode arrays. To allow for scalable inference, we implement our model as a variational autoencoder and perform amortized variational inference. We evaluate our method on both biophysically realistic simulated and real extracellular datasets, demonstrating that it is more accurate than and can improve spike sorting performance over heuristic localization methods such as center of mass.
BibTeX
@inproceedings{hurwitz2019scalable,
  author = {Cole L. Hurwitz and Kai Xu and Akash Srivastava and Alessio Paolo Buccino and Matthias Hennig},
  title = {{Scalable Spike Source Localization in Extracellular Recordings using Amortized Variational Inference.}},
  booktitle = {NeurIPS},
  year = {2019},
  url = {https://openreview.net/forum?id=GhWTs-Sw8wV},
}
Figure