项目作者: misiakie

项目描述 :
C230 project: Recurrent Neural Network for brain-machine interfaces: decoding arm kinematics from intracortical signal
高级语言: Python
项目地址: git://github.com/misiakie/CS230-RNN-for-BMIs.git
创建时间: 2018-02-23T03:37:49Z
项目社区:https://github.com/misiakie/CS230-RNN-for-BMIs

开源协议:

下载


CS230-RNN-for-BMIs

CS230 project: Recurrent Neural Network for brain-machine interfaces: decoding arm kinematics from intracortical signal

Authors: Julien Boussard, Maxime Cauchois and Theodor Misiakiewicz

Introduction

Brain-machine interfaces attempt to translate neural activity into control signals and create a direct pathway between the brain and an external device. In particular, BMIs give hope to impaired patients for communicating via an external computer. The main challenge lies in reliably decoding neural activity, a highly non-linear and noisy time series data, into a particular stimulus. In this project, we build a recurrent neural network to decode covert mental processes of non-human primates from intracortical electrodes. The animals were trained to reach a target on a screen among 48 predefined positions. Our goal is to infer which target the animal plan on reaching from its neural activity. We used data provided by the Stanford Neural Prosthetic System Lab and constructed a RNN model with one LSTM that shows promising performances.

Task

Given the premovement neural activity of 192 neurons monitored for a given period of time, we aim to predict the target attained by the animal in an experiment, among 48 targets divided into three concentric circles.

Quickstart (~10 min)

  1. Build tfrecords files from the Matlab data recorded in MatlabAnimalData
    1. python build_data.py

1Bis. Data Already processed for tensorflow If your data is already under the format .tfrecords, you only need to put it in the folder data, and move on to step 2.

  1. Your first experiment We created a base_model directory for you under the experiments directory. It countains a file params.json which sets the parameters for the experiment. It looks like

    1. {
    2. "learning_rate": 1e-3,
    3. "batch_size": 5,
    4. "num_epochs": 2
    5. }

    For every new experiment, you will need to create a new directory under experiments with a params.json file.

  2. Train your experiment. If your data in in data/my_folder, simply run

    1. python train.py --model_dir experiments/base_model --data_dir data/my_folder

    It will instantiate a model and train it on the training set following the parameters specified in params.json. It will also evaluate some metrics on the development set, especially the accuracy, the ‘Top 3’ accuracy and so on.

If you want to reuse the weights from a past experiment you can use the --restore_dir option, precising the folder in which your weights have been saved (generally experiments/my_model/my_weights), for instance:

  1. python train.py --model_dir experiments/base_model --data_dir data/my_folder --restore_dir experiments/base_model/best_weights

Credits

The code architecture was taken from the “Named Entity Recognition with Tensorflow” project by Guillaume Genthial and Olivier Moindrot (see https://cs230-stanford.github.io).