Skip to content

SimSortTool/SimSort-Tetrode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimSort: A Data-Driven Framework for Spike Sorting by Large-Scale Electrophysiology Simulation

· Paper · Code · Webpage ·

This repository contains the PyTorch implementation of "SimSort: A Data-Driven Framework for Spike Sorting by Large-Scale Electrophysiology Simulation".

Overview

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

🏃Quick Start

Installation

# 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 Pre-trained Models

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

Using Pre-trained Models for Benchmarking

# Run spike sorting with pre-trained models
bash scripts/run_sorting.sh

Training Models

# Train detection model
bash scripts/train_detector.sh

# Train identification model
bash scripts/train_extractor.sh

Benchmark Comparison

# Compare with other spike sorting methods (e.g., Kilosort)
bash scripts/run_sorting_with_si.sh --si_sorter kilosort

Custom Data

If 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors