Giter VIP home page Giter VIP logo

eeyhsong / eeg-transformer Goto Github PK

View Code? Open in Web Editor NEW
218.0 3.0 26.0 86 KB

i. A practical application of Transformer (ViT) on 2-D physiological signal (EEG) classification tasks. Also could be tried with EMG, EOG, ECG, etc. ii. Including the attention of spatial dimension (channel attention) and *temporal dimension*. iii. Common spatial pattern (CSP), an efficient feature enhancement method, realized with Python.

License: GNU General Public License v3.0

Python 88.41% MATLAB 11.59%
deep-learning attention-mechanism vit transformer attention common-spatial-pattern eeg eeg-classification physiological-signals

eeg-transformer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eeg-transformer's Issues

Dataset 2a accuracy surprisingly lower than the studies results

Hello
After running the transformer a couple of times, I'm receiving significantly smaller results compared to the study's results. I've attached an image of one of my confusion matrices which in comparison with the study, is much worse.
image
The only code I've edited was for the purpose of using it in google collaborate, otherwise, all the code is the same as how it was here on GitHub. What would be the cause of this and am I missing something quite obvious that is missing?
Best
Merlin

How to apply it to a 2-class task?

It's an excellent work that inspired me a lot. Now I am appling it to a 2-class task for DatasetIV-2b. Which parameter should I change?
I've found some potential code, Could you help to locate the para that needs modifing? Thank you!
In Trans.py:
Line 130: forward_expansion=4
Line 167: emb_size=10, depth=3, n_classes=4
LIne 253: self.c_dim=4
In common_spatial_pattern.py:
Line 15: idx_3=... (comment this line?)
Line 18: in range(4) and following elif for n_class==3
Line 70: Wb = np.concatenate((W[0][:, 0:4], W[1][:, 0:4], W[2][:, 0:4], W[3][:, 0:4]), axis=1)
Thanks again.

关于数据划分的一个疑问

代码中是将所有576个trial合起来然后选516个用于训练。
如果改为按照A01_T用于训练,A01E用于测试这样的数据划分的话,即288个trial用于训练,288个trial用于测试,模型的结果看上去不是很理想。
请问大佬针对这种情况有什么可以优化的手段吗

代码运行后accuracy不能达到论文所诉82%

作者您好,非常感谢您发表的这篇论文,在拜读了您的文章后对我产生了非常大的启发。
但是我在复现您的文章时,始终不能达到论文所诉的2a数据集上的82%的accuracy,我这边感觉可能是调参的问题,希望能得到您技术上的帮助。非常感谢!

About dataset

Hi there,
I'm trying to implement your code on the BCI IV 2a dataset. However, I'm wondering how is the structure of the label and data in your mat file since I couldn't rebuild the mat file based on the "getData.m" function. If you can provide a tree structure of the data regarding trials and labels, it will be clearer.

Dataset labelling issue

Hello
I have been trying to get your getData.m function working but I have run into an issue with labelling the evaluation datasets. Each time I run the code, the labels for all of the subject's evaluation data are labelled as NaN, preventing the Trans.py code to have a test accuracy score other than 0.

I looked at the BCI competition IV website and subject 1 from dataset 2a should have class labels but when I run
[s, HDR] = sload('dir of A01E');
The HDR.ClassLabels are all NaN so am unsure where I am going wrong.
Any help would be appreciated.
Best
Merlin

Pretrained weights

Would it be possible to share the pre-trained weights of the transformer, I would like to transfer learn the transformer to a BCI task

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.