This repository contains the PyTorch implementation of "SimSort: A Data-Driven Framework for Spike Sorting by Large-Scale Electrophysiology Simulation".
SimSort is a data-driven spike sorting framework. It provides:
✨ A large-scale electrophysiology simulator for generating biologically realistic extracellular data
✨ Pre-trained models for spike detection and identification
✨ Evaluation on public benchmark datasets
✨ A tool for custom spike sorting on tetrode data
# Create and activate conda environment
conda create -n SimSort python=3.10 -y
conda activate SimSort
# Install dependencies
cd SimSort-Tetrode
pip install -r model/requirements.txt
# Install and setup kachery-cloud (required for benchmark datasets)
pip install kachery-cloud
kachery-cloud-init
‼️ Additionally, you need to install PyTorch following the official setup guide depending on your system configuration.
Download the pre-trained models from our GitHub Release and place them in the correct directory structure.
# Create directory for pre-trained models
mkdir -p model/simsort_pretrained
# Download and extract pre-trained models
cd model/simsort_pretrained
wget https://github.com/SimSortTool/SimSort-Tetrode/releases/download/v1.0.0/extractor_bbp_L1-L5-8192.zip
wget https://github.com/SimSortTool/SimSort-Tetrode/releases/download/v1.0.0/detector_bbp_L1-L5-8192.zip
unzip extractor_bbp_L1-L5-8192.zip
unzip detector_bbp_L1-L5-8192.zip
cd ../..Important: After extraction, ensure that the models are in the correct directory structure:
model/simsort_pretrained/ ├── detector_bbp_L1-L5-8192/ │ ├── detection_config.yaml │ ├── detection_aug_config.yaml │ └── saved_models/ │ ├── checkpoint.pth │ └── args.yaml └── extractor_bbp_L1-L5-8192/ ├── config.yaml ├── aug_config.yaml └── saved_models/ ├── checkpoint.pth └── args.yaml
# Run spike sorting with pre-trained models
bash scripts/run_sorting.sh# Train detection model
bash scripts/train_detector.sh
# Train identification model
bash scripts/train_extractor.sh# Compare with other spike sorting methods (e.g., Kilosort)
bash scripts/run_sorting_with_si.sh --si_sorter kilosortIf you want to apply SimSort to your own neural recordings, please check out the example notebook at model/SimSort_Tool_Demo.ipynb
For a step-by-step guide, please visit 👉 SimSortTool