Coder Social home page Coder Social logo

lausbelphegor / eeg_mi_dl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edw4rdyao/eeg_mi_dl

0.0 0.0 0.0 885 KB

A fork for implementing Physionet MI in a research repository of deep learning on electroencephalographic (EEG) for Motor imagery(MI), including eeg data processing(visualization & analysis), papers(research and summary), deep learning models(reproduction and experiments).

License: MIT License

Python 4.25% Jupyter Notebook 95.75%

eeg_mi_dl's Introduction

EEG Motor Imagery Deep Learning

English 中文

A research repository of deep learning on electroencephalographic (EEG) for Motor imagery(MI), including eeg data processing(visualization & analysis), papers(research and summary), deep learning models(reproduction and experiments).

The experiments in this repository are based on MNE-Python, Moabb, Braindecode and Skorch.

You can find more contents of this repository through the following sections:

Field Researching

Field Researching currently includes the following papers and datasets:

Awesome Papers

2017 Schirrmeister et al. Deep learning with convolutional neural networks for EEG decoding and visualization [paper link] [source code] [reproduce1]
2018 Lawhern et al. EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces [paper link] [source code] [reproduce1] [reproduce2]
2018 Sakhavi et al. Learning Temporal Information for Brain-Computer Interface Using Convolutional Neural Networks [paper link]
2019 Dose et al. An end-to-end deep learning approach to MI-EEG signal classification for BCIs [paper link] [source code]
2020 Wang et al. An Accurate EEGNet-based Motor-Imagery Brain Computer Interface for Low-Power Edge Computing [paper link] [source code]
2020 Ingolfsson et al. EEG-TCNet: An Accurate Temporal Convolutional Network for Embedded Motor-Imagery Brain-Machine Interfaces [paper link] [source code] [reproduce1]
2021 Mane et al. A Multi-view CNN with Novel Variance Layer for Motor Imagery Brain Computer Interface [paper link] [source code]
2022 Hamdi Altaheri et al. Physics-Informed Attention Temporal Convolutional Network for EEG-Based Motor Imagery Classification [paper link] [source code]

Public Datasets

List of the most frequently used public datasets in the papers

Dataset description: BCI Competition 2008 – Graz data set A

Download link: .gdf format or .mat format

Dataset description: Physionet Database EEG Motor Movement/Imagery Dataset

Download link: .edf format

[Image reference]

For deep learning experiments, to easier downloading of datasets and faster data processing, it is recommended to use Moabb dataset or Braindecode dataset to do experiments.

EEG Data Analysis and Processing

  • Data Load and Analysis

Using MNE-Python library with Jupyter Notebook to analyze demo EEG data of BCI IV 2a, including loading data, plotting signal, extracting events...

For details and code, please move to data_load_visualization.ipynb, for more examples, to MNE-Python tutorials.

  • Data Processing

Using MNE-Python library with Jupyter Notebook to process demo EEG data of BCI IV 2a, including filtering, resampling, segmenting data ...

For details and code, please move to data_processing.ipynb, for more examples, to MNE-Python tutorials.

Experiments

This repo is based on Python 3.8. And before you run experiments of this repo, install the environment first:

$ pip install -r requirements.txt

Then you can use -h to get usage:

$ python .\main.py -h
usage: main.py [-h] [--dataset {bci2a,physionet}] [--model {EEGNet,EEGConformer,ATCNet,EEGInception,EEGITNet}] [--config CONFIG] [--strategy {cross-subject,within-subject}] [--save]

optional arguments:
  -h, --help            show this help message and exit
  --dataset {bci2a,physionet}
                        data set used of the experiments
  --model {EEGNet,EEGConformer,ATCNet,EEGInception,EEGITNet}
                        model used of the experiments
  --config CONFIG       config file name(.yaml format)
  --strategy {cross-subject,within-subject}
                        experiments strategy on subjects
  --save                save the pytorch model and history (follow skorch)

If you run experiments on dataset BCI 2a using EEGNet model, simply run:

$ python .\main.py --dataset bci2a --model EEGNet

It will use the default config in bci2a_EEGNet_default.yaml and default within-subject strategy , surely you can use --config to specify.

Then you can get the output accuracy and result.log in ./save folder:

[13:41:23 2024] Subject1 test accuracy: 70.4861%
[13:42:06 2024] Subject2 test accuracy: 57.9861%
[13:42:50 2024] Subject3 test accuracy: 79.5139%
[13:43:33 2024] Subject4 test accuracy: 60.0694%
[13:44:16 2024] Subject5 test accuracy: 70.8333%
[13:45:00 2024] Subject6 test accuracy: 59.3750%
[13:45:46 2024] Subject7 test accuracy: 69.0972%
[13:46:30 2024] Subject8 test accuracy: 62.1528%
[13:47:13 2024] Subject9 test accuracy: 68.4028%
[13:47:13 2024] Average test accuracy: 66.4352%

You can also modify the config yaml file to adjust parameter or make your own models to do experiments.

eeg_mi_dl's People

Contributors

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