UnitRefine: A Community Toolbox for Automated Spike Sorting Curation
Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Electrophysiological recordings capture signals from hundreds of neurons simultaneously, but isolating single-unit activity often requires manual curation due to limitations in spike-sorting algorithms. As dataset sizes keep increasing, the time and expertise required for accurate and consistent human curation pose a major challenge for experimental labs. To address this issue, we developed UnitRefine, a classification toolbox that leverages diverse machine-learning algorithms to minimize manual curation efforts. Using acute recordings with Neuropixel probes, we collected a large neural dataset with reproducible experimental conditions and had multiple expert human curators label each recording for reliable cluster identification. This carefully labeled dataset served as the foundation for our automated curation system to learn from human annotations and replicate curator decisions. UnitRefine incorporates existing and newly developed quality metrics, including hyper-synchronous spiking events and drifts in firing rate, to automatically separate noise from neural clusters with high accuracy. To address inherent labeling imbalances between well-isolated single-unit clusters and mixed-population activity, we implemented a cascading classification system. UnitRefine uses a comprehensive hyperparameter optimization search across various classification algorithms to identify optimal model parameters. Across recordings, an optimized Random Forest decoder outperformed other approaches, with up to 83% balanced decoding accuracy for unseen recordings. The broad applicability of UnitRefine is demonstrated by its successful performance across diverse labs and recording conditions, including high-density probes in mice, rats, mole rats, primates, and clinical recordings in epilepsy patients. UnitRefine is developed for broad community adoption. It is fully integrated into the open-source SpikeInterface toolbox, allowing users to either apply our pre-trained models or generate new decoders based on their own curation. Our models and new models can be downloaded and shared via HuggingFaceHub.