SpikeCleaner: An Algorithm to Label Unit Quality After Automated Spike Sorting
Preprint
Abstract
Gap: Automated spike sorting algorithms have revolutionized the way neuronal activity is extracted from extracellular recordings, yet they remain imperfect. Specifically, inaccurate acceptance of noise-based units not only leaves researchers with clusters that require extensive manual curation, an essential but time-consuming process, that also leads to significant subjectivity in the selection of units. In an era of high-density probes like Neuropixels, where an hour of data can exceed 80 GB, manual curation is no longer scalable, automation of standard criteria can speed data curation and ensure quality of datasets. Here, we developed a semi-automated curation pipeline to label the quality of units after automated curation by Kilosort. Approach: Our algorithm standardizes criteria for labeling of Noise, Multi-Unit Activity (MUA), and Good Units using a combination of spike rate, spike timing metrics (from autocorrelogram), and waveform-based physiological features such as peak amplitude, slopes, half-width, and inter-channel correlation. Based on these features, clusters are assigned standardized labels (good, noise, multi-unit activity) that can be imported directly into Phy, where they serve as curation aids rather than absolute classifications, supporting but not replacing expert judgment. Heuristically, 'noise' units are those unlikely to be neuronal in origin; 'MUA' includes units with significant neural contribution (i.e., neuronal waveform) but with some degree of clear imperfection to be further cleaned, and 'good' units are those without any clear deviation from ideal unit criteria. By ensuring accurate selection of acceptable units, we enable robust downstream analyses such as neural decoding and longitudinal tracking of neuron identity. Thresholds for all metrics were chosen to maximize the matching of algorithm output to that of 2 expert manual curators. Of note, users may alter thresholds either based on their own judgment or using an included tool to semi-automatically find thresholds that optimize SpikeCleaner with their own expert curation. Results: To benchmark, we compared the outputs of our algorithm to expert-labels curated in Phy by two expert users across three recordings. SpikeCleaner achieved an average of 97% accuracy vs. experts & 92% F1 score in classifying Single Units. It achieved an accuracy of 97% & 92% F1 score in full-category agreement (SU, MUA, Noise), and 97% accuracy & 95% F1 score in distinguishing Neuronal vs. Non-Neuronal units.Keywords
Funding Information
- National Institutes of Health (NIH) (MH107662)
- National Institutes of Health (NIH) (MH131592)
- National Institutes of Health (NIH) (NS141983)
- National Institutes of Health (NIH) (NS139668)
- National Institutes of Health (NIH) (MH131527)
- Pritzker Neuropsychiatric Disorders Research Consortium
- University of Michigan Neuroscience Scholars Fund
This publication has 10 references indexed in Scilit:
- SLAy-ing oversplitting errors in high-density electrophysiology spike sortingbioRxiv, 2025
- Minute-scale periodicity of neuronal firing in the human entorhinal cortexCell Reports, 2023
- Characterization of extracellular spike waveforms recorded in wallaby primary visual cortexFrontiers in Neuroscience, 2023
- Spike sorting: new trends and challenges of the era of high-density probesProgress in Biomedical Engineering, 2022
- A Fully Automated Approach to Spike SortingNeuron, 2017
- Spike sorting for large, dense electrode arraysNature Neuroscience, 2016
- Inhibition-Induced Theta Resonance in Cortical CircuitsNeuron, 2013
- The origin of extracellular fields and currents — EEG, ECoG, LFP and spikesNature Reviews Neuroscience, 2012
- On the Origin of the Extracellular Action Potential Waveform: A Modeling StudyJournal of Neurophysiology, 2006
- Patterns of Body Temperature, Activity, and Reproductive Behavior in a Tropical Murid Rodent, Arvicanthis niloticusPhysiology & Behavior, 1997