Skip to content

reshalfahsi/eeg-motor-imagery-classification

Repository files navigation

EEG Motor Imagery Classification Using CNN, Transformer, and MLP

colab

CNN-Transformer-MLP An illustration of the CNN-Transformer-MLP model.

The electroencephalogram, or EEG for short, is one of the biosignals that display brain activity in the form of time-series data. EEG can be used to help amputees or paralyzed people move their prosthetic arms via a brain-computer interface (BCI). In order to identify the correct limbs to control from the EEG signal, a combination of CNN, Transformer, and MLP is utilized in this work for motor imagery (MI) classification. CNN converts the epoched EEG signal into meaningful representation in accordance with the signal's non-stationary nature. Transformer finds the global relationship of the given representation from CNN. MLP classifies the expected upper limbs to move based on the extracted information from the Transformer. To gauge the capability of the CNN-Transformer-MLP model, PhysioNet's EEG Motor Movement/Imagery Dataset is used. The model attains an accuracy of 76.4% on the test set.

Experiment

To run the experiment, click here.

Result

Quantitative Result

To quantitatively validate the capability of the CNN-Transformer-MLP model, certain evaluation metrics are employed: accuracy and loss. Accuracy measures how many times the model makes a correct prediction in a particular split of the dataset. Loss quantifies how close the prediction is to the actual label. The loss calculation is utilized in the training stage as well. In this work, the binary cross-entropy (BCE) loss is adopted for the loss function.

Dataset Split Accuracy Loss
Train 82.9% 0.201
Validation 84.4% 0.269
Test 76.4% 0.856

Accuracy and Loss Curve

acc_curve
Accuracy curve on the train set and the validation set.

loss_curve
Loss curve on the train set and the validation set.

Qualitative Result

Here, the qualitative performance of the model is presented.

true_right
Correct prediction on the right arm class.

true_left
Correct prediction on the left arm class.

false_right
False prediction on the left arm class.

Citation

If you think this repository is helpful for your research, you may cite it:

@misc{eegal-fahsi,
   title = {EEG Motor Imagery Classification Using CNN, Transformer, and MLP},
   url = {https://github.com/reshalfahsi/eeg-motor-imagery-classification},
   author = {Resha Dwika Hefni Al-Fahsi},
}

Credit

About

EEG Motor Imagery Classification Using CNN, Transformer, and MLP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published