Skip to content

ojasvatsyayan/data-driven-neural-spike-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Machine-Learned Spike Sorting 🧠⚡

This project applies machine learning to classify neuronal spike data. It uses spike templates, amplitude data, and channel positions from PHY's spike sorting framework, and transforms them into a training dataset for classification.

📁 Project Overview

  • Extracts features from .npy files generated by spike-sorting tools (e.g., PHY/Kilosort)
  • Builds a CSV-based dataset for training
  • Applies multiple ML models to classify neuronal spikes
  • Evaluates classifier performance
  • Produces a predicted output dataset

🚀 Getting Started

Requirements

Install dependencies with:

pip install -r requirements.txt

Running the Notebook

Open the Jupyter notebook and follow the steps to:

  1. Load and preprocess .npy data
  2. Generate the training dataset
  3. Train ML models on spike features
  4. Evaluate model accuracy and compare results

Input Files

The original .npy spike data files are too large to include here. To run this notebook:

  • Download the data from your own recordings (or contact the repo author)
  • Place the following files in a data/ directory:
    • spike_templates.npy
    • amplitudes.npy
    • channel_positions.npy

Output Example

Included: example_output.csv
A simulated output of the final classification dataset (predicted spike types).

📊 Results Summary

We apply and evaluate several classifiers on the extracted spike data, including:

  • Logistic Regression
  • Support Vector Machines
  • Decision Trees

We summarize their performance using accuracy, confusion matrices, and example output tables. (See notebook for visualizations.)

📈 Visuals & Analysis

  • Feature distribution plots
  • Accuracy comparison bar chart (if enabled)
  • Discussion of classifier trade-offs

🔬 Future Work

  • Add support for real-time classification during spike recording
  • Explore deep learning methods (e.g., CNN, LSTM) on waveform segments
  • Integrate ground truth validation using labeled datasets

📚 Dependencies

  • numpy
  • pandas
  • matplotlib
  • scikit-learn

About

machine-learned-spike-sorting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors