HuiduRep: A Robust Self-Supervised Framework for Learning Neural Representations from Extracellular Recordings

Feng Cao, Zishuo Feng, Jicong Zhang, Wei Shi

TL;DR

HuiduRep is a novel self-supervised framework that significantly improves "spike sorting"—the process of assigning electrical signals in the brain to specific neurons. By combining contrastive learning with a denoising autoencoder, the system learns neural representations that are remarkably resilient to noise and electrode drift, outperforming industry-standard tools like KiloSort4 and MountainSort5.

What Problem Does This Paper Address?

In neuroscience, recording the electrical activity of individual neurons (spikes) is fundamental to understanding the brain. However, electrodes usually pick up signals from multiple nearby neurons simultaneously. "Spike sorting" is the computational challenge of untangling this mess to determine which neuron fired when.

This task is notoriously difficult because of three main "real-world" headaches:

  1. Low Signal-to-Noise Ratio (SNR): Neural signals are often buried in background electrical noise.
  2. Electrode Drift: Over time, the physical probe can shift slightly relative to the neurons, causing the recorded waveform shapes to change.
  3. Overlapping Spikes: When two neurons fire at nearly the same time, their signals collide, creating a "compound" waveform that confuses traditional algorithms.

Existing tools often rely on rigid templates or manual curation, which struggle when the data is "non-stationary" (i.e., changing over time due to drift).

Methods

HuiduRep (named after the "Huidu" or Ragdoll cat) uses a self-supervised approach, meaning it learns to identify features without needing human-labeled "ground truth" data. Its architecture consists of two main branches:

  • Contrastive Learning Branch: Following the MoCo-v3 style, the model learns by comparing different "views" of the same spike. It is trained to recognize that two differently distorted versions of the same signal should have similar representations, while signals from different neurons should look distinct.
  • Denoising Autoencoder (DAE) Branch: This is the paper's "secret sauce." The DAE is tasked with reconstructing the original, clean spike waveform from a noisy, augmented version. This forces the model to ignore transient noise and focus on the stable, underlying features of the neuron's "fingerprint."

The authors also swapped out traditional ResNet encoders for Transformer encoders, which are better at capturing the complex temporal and cross-channel relationships in high-density electrode data.

Datasets

The researchers validated HuiduRep across three diverse types of data:

  • International Brain Laboratory (IBL) Dataset: Large-scale, real-world recordings from mouse hippocampi used for training and general performance testing.
  • Hybrid Janelia Dataset: A synthetic dataset specifically designed to simulate electrode drift, providing a rigorous benchmark for how well the algorithm handles moving probes.
  • Paired MEA64C Yger Dataset: A "gold standard" real-world dataset where researchers recorded the same neuron both extracellularly and intracellularly (providing absolute ground truth).

Key Insights and Ideas

  • The Power of Denoising: The integration of the DAE isn't just an add-on; it acts as a "domain aligner." When the model encounters data from a new session or a different brain region (out-of-distribution data), the DAE helps pull those features closer to what the model "knows," making the system much more generalizable.
  • Drift Resilience: Traditional sorters often lose accuracy when a probe drifts. HuiduRep’s learned representations are stable enough that a simple clustering algorithm (like a Gaussian Mixture Model) can still correctly group spikes even as their shapes evolve.
  • Efficiency Matters: Despite its complexity, HuiduRep uses significantly fewer active parameters (0.6M) than previous deep-learning attempts like CEED (1.8M), making it faster and more practical for large-scale experiments.

Key Results

  • Superior Accuracy: On the IBL test set, HuiduRep achieved an Adjusted Rand Index (ARI) of 71.9, significantly higher than CEED (63.5) and MoCo-v3 (66.9).
  • Crushing the Competition on Drift: In the Hybrid Janelia drift benchmark, HuiduRep maintained an accuracy of 0.60, whereas the widely-used KiloSort4 dropped to 0.34.
  • Real-World Performance: On the Paired MEA64C dataset, the HuiduRep pipeline matched or exceeded the precision of almost all state-of-the-art tools, proving its utility for actual lab work.

Limitations and Future Work

While HuiduRep excels at accuracy and precision, its recall (the ability to find every spike) was slightly lower than some specialized tools like IronClust on certain datasets. The authors attribute this to the threshold-based detection step used before the representation learning, which might miss very low-amplitude spikes.

The authors suggest that future iterations could integrate more "biological priors" (knowledge of how neurons behave) and expand the framework to other types of bio-signals, such as EMG (muscle activity) or EEG (brain waves), where noise and drift are also major hurdles.

Summary updated

BibTeX
@inproceedings{cao2026huidurep,
  author = {Feng Cao and Zishuo Feng and Jicong Zhang and Wei Shi},
  title = {{HuiduRep: A Robust Self-Supervised Framework for Learning Neural Representations from Extracellular Recordings}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i21.38790},
}
Figure