Git Product home page Git Product logo

eegnet-based-embedded-bci's Introduction

Copyright (C) 2020 ETH Zurich, Switzerland. SPDX-License-Identifier: Apache-2.0. See LICENSE file for details.

Authors: Xiaying Wang, Michael Hersche

An Accurate EEGNet-based Motor-Imagery Brain--Computer Interface for Low-Power Edge Computing

In this repository, we share the code for classifying MI data of the Physionet EEG Motor Movement/Imagery Dataset using EEGNet. For details, please refer to the papers below.

If this code proves useful for your research, please cite

Xiaying Wang, Michael Hersche, Batuhan Tömekce, Burak Kaya, Michele Magno, Luca Benini, "An Accurate EEGNet-based Motor-Imagery Brain--Computer Interface for Low-Power Edge Computing", in IEEE International Symposium on Medical Measurements and Applications (MEMEA), 2020.

Installing Dependencies

You will need a machine with a CUDA-enabled GPU and the Nvidia SDK installed to compile the CUDA kernels. Further, we have used conda as a python package manager and exported the environment specifications to dependency.yml. You can recreate our environment by running

conda env create -f dependency.yml -n mybciEnv 

Make sure to activate the environment before running any code.

If get a batchnormalization error when running the code, follow the instructions by gurjar112 here:

change "()" to "[ ]" in line no 1908,1910,1914, 1918 in anaconda3/envs/mybciEnv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py (e.g. beta = tf.reshape(beta, [-1])) and have 'channels_last' in keras.json

Download Physionet Dataset

EEGNet: Download the .edf files of the Physionet EEG Motor Movement/Imagery Dataset here, unpack it, and put into the folder dataset/

Train and Validate Global and Subject-specific Models

Global models are trained and validated in main_global.py. Results are in results/your-global-experiment/stats and global models in results/your-experiment-name/model.

$ (mybciEnv) python3 main_global.py

After having trained and stored the global model, they can be refined by doing subject-specific transfer learning (SS-TL) using main_ss.py.

$ (mybciEnv) python3 main_ss.py

Plots

A notebook with selected plots is available under plot_nbook/.

License and Attribution

Please refer to the LICENSE file for the licensing of our code.

eegnet-based-embedded-bci's People

Contributors

batom3 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.