A neural network for online spike classification that improves decoding accuracy

Deepa Issar, Ryan C. Williamson, Sanjeev B. Khanna, Matthew A. Smith

Abstract

Separating neural signals from noise can improve brain-computer interface performance and stability. However, most algorithms for separating neural action potentials from noise are not suitable for use in real time and have shown mixed effects on decoding performance. With the goal of removing noise that impedes online decoding, we sought to automate the intuition of human spike-sorters to operate in real time with an easily tunable parameter governing the stringency with which spike waveforms are classified. We trained an artificial neural network with one hidden layer on neural waveforms that were hand-labeled as either spikes or noise. The network output was a likelihood metric for each waveform it classified, and we tuned the network’s stringency by varying the minimum likelihood value for a waveform to be considered a spike. Using the network’s labels to exclude noise waveforms, we decoded remembered target location during a memory-guided saccade task from electrode arrays implanted in prefrontal cortex of rhesus macaque monkeys. The network classified waveforms in real time, and its classifications were qualitatively similar to those of a human spike-sorter. Compared to decoding with threshold crossings, in most sessions we improved decoding performance by removing waveforms with low spike likelihood values. Furthermore, decoding with our network’s classifications became more beneficial as time since array implantation increased. Our classifier serves as a feasible preprocessing step, with little risk of harm, that could be applied to both offline neural data analyses and online decoding.

New & Noteworthy: While there are many spike-sorting methods that isolate well-defined single units, these methods typically involve human intervention and have inconsistent effects on decoding. We used human classified neural waveforms as training data to create an artificial neural network that could be tuned to separate spikes from noise that impaired decoding. We found that this network operated in real time and was suitable for both offline data processing and online decoding.

Introduction

Brain-Computer Interfaces (BCIs) rely on the accurate detection of neural "spikes"—the electrical discharges of individual neurons. However, raw neural recordings are often contaminated by background "chatter" from distant neurons (multi-unit activity) and non-biological electrical interference. Traditionally, researchers have used manual spike sorting to isolate individual neurons, a process that is time-consuming and often unsuitable for real-time applications. Alternatively, simple threshold crossing is fast but prone to capturing excessive noise. This study introduces "Not A Sorter" (NAS), a lightweight artificial neural network designed to bridge this gap by providing real-time, tunable spike classification that improves decoding accuracy.

Methods

The researchers developed NAS, a simple artificial neural network (ANN) with a single hidden layer of 50 units using ReLU activation and a sigmoid output layer. Unlike traditional sorters, NAS does not attempt to identify specific neurons. Instead, it outputs a likelihood score ($P(spike)$) between 0 and 1 for every detected waveform.

A key feature of NAS is its tunability via a stringency parameter ($\gamma$). Users can adjust $\gamma$ to be permissive (allowing more waveforms) or restrictive (filtering for high-confidence spikes). The network is highly efficient, capable of classifying 1,000 waveforms in under 1ms, making it ideal for closed-loop BCI systems.

Datasets

The model was trained on a massive dataset of approximately 24.8 million waveforms. These waveforms were collected from four rhesus macaques across multiple brain regions and recording devices, then hand-labeled by human experts as either "spike" or "noise."

Summary of recording sessions used for training the neural network.

To test the model's generalizability, it was evaluated on data from two additional monkeys (Monkey Pe and Wa) performing a memory-guided saccade task. This testing data was recorded from the Prefrontal Cortex (PFC), a region not represented in the training set.

Key Results

NAS demonstrated significant improvements in BCI performance. On average, using NAS to filter waveforms improved target location decoding by 3.9% compared to standard threshold crossings. The system's performance was comparable to, and sometimes exceeded, manual spike sorting by experts, while operating at a fraction of the time.

A critical finding was the "aging implant" benefit. As electrode implants age, signal-to-noise ratios typically decline due to scar tissue formation. NAS proved particularly effective at "rescuing" data from older implants by filtering out the increased noise. Furthermore, the system showed high robustness, generalizing across different monkeys and brain regions without the need for session-specific retraining. In simulations, NAS classified waveforms from 192 channels in less than 0.1 ms.

Discussion

NAS offers a feasible preprocessing step for both offline analysis and online decoding. By focusing on classification rather than full sorting, it captures the primary benefits of noise reduction without the computational overhead or manual intervention required by traditional methods. While NAS evaluates waveforms in isolation—ignoring spatial or temporal context like inter-spike intervals—the results suggest this trade-off is acceptable for many BCI applications. Future work may explore more complex architectures, such as Convolutional Neural Networks (CNNs), or training the model to recognize specific laboratory artifacts. Overall, NAS serves as a robust, real-time tool for enhancing the stability and accuracy of neural decoding.

Summary updated

BibTeX
@article{issar2020neural,
  author = {Deepa Issar and Ryan C. Williamson and Sanjeev B. Khanna and Matthew A. Smith},
  title = {{A neural network for online spike classification that improves decoding accuracy}},
  journal = {Journal of Neurophysiology},
  year = {2020},
  doi = {10.1152/jn.00641.2019},
}
Figure