Git Product home page Git Product logo

snn-eeg's Introduction

Decoding EEG with Spiking Neural Networks on Neuromorphic Hardware

This package is the PyTorch implementation of the Spiking Neural Network for decoding EEG on Neuromorphic Hardware which is 95% more energy-efficient than deep neural networks while obtaining similar classification performance. The paper has been accepted at TMLR and is available on OpenReview.

Citation

N. Kumar, G. Tang, R. Yoo, and K. P. Michmizos, "Decoding EEG With Spiking Neural Networks on Neuromorphic Hardware," Transactions on Machine Learning Research (TMLR), 2022, url: https://openreview.net/forum?id=ZPBJPGX3Bz.

@article{kumar2022decoding,
title={Decoding EEG With Spiking Neural Networks on Neuromorphic Hardware},
author={Neelesh Kumar and Guangzhi Tang and Raymond Yoo and Konstantinos P. Michmizos},
journal={Transactions on Machine Learning Research},
year={2022},
url={https://openreview.net/forum?id=ZPBJPGX3Bz},
note={}}

Software Installation

  • Python 3.7 or higher
  • PyTorch 1.2 (with CUDA 10.0)
  • NxSDK 0.9

A CUDA enabled GPU is not required but preferred for training. The results in the paper are generated from models trained using both Nvidia Tesla K40c and Nvidia GeForce RTX 2080Ti.

Intel's neuromorphic library NxSDK is only required for SNN deployment on the Loihi neuromorphic chip. If you are interested in deploying the trained SNN on Loihi, please contact the Intel Neuromorphic Lab.

Dataset

We provide here the implementation for training the SNN on eegmmidb dataset. The dataset can be downloaded from this link. Please download the files into a folder named 'data' in your working directory.

Example Usage

1. Preprocessing the dataset

To preprocess and save the preprocessed data, run the following

cd <Dir>/<Project Name>/utils
python utility.py

This will preprocess the dataset and save it into a folder named "eegmmidb_slice_norm"

2. Train the SNN

To train the SNN on the eegmmidb dataset, execute the following commands:

cd <Dir>/<Project Name>/eegmmidb
python train.py

This will automatically train the SNN and display the progress of training.

3. Deploy the trained SNN on Loihi

To evaluate SNN realization on Loihi, first run the following to train the simplified model for Loihi:

cd <Dir>/<Project Name>/eegmmidb_loihi/offline_train
python train.py

Then execute the following commands to start testing on Loihi:

cd <Dir>/<Project Name>/eegmmidb_loihi/online_loihi_inf
KAPOHOBAY=1 python online_loihi_inf.py

This will test the model that is trained on the GPU and deployed on Loihi. To run the code correctly, MODEL_DIR value in the script needs to be changed to the directory that stores the trained model.

Acknowledgment

This work is supported through the Grant K12HD093427 from the National Center for Medical Rehabilitation Research, NIH/NICHD; and Intel's Neuromorphic Research Community Grant Award

snn-eeg's People

Contributors

neelesh314 avatar michaelgzt avatar

Stargazers

Andy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.