Skip to content

prince-css/EEG-Motor-Imagery-Classification-CNN-Pytorch

Repository files navigation

EEG-Motor-Imagery-Classification-CNN-Pytorch

Date: July, 2023

Based on the Paper:

A Novel Approach of Decoding EEG Four-class Motor Imagery Tasks via Scout ESI and CNN

The method in this repository is EEG source imaging (ESI) + Fourier Transform for joint time-frequency analysis + Convolutional Neural Networks (CNNs). The raw data has been processed using the Matlab Toolkit Brainstorm. The technique of ESI uses a boundary element method (BEM) and weighted minimum norm estimation (WMNE) to solve the EEG forward and inverse problems, respectively. Ten scouts are then created within the motor cortex to select the region of interest (ROI). Features were extracted from the time series of scouts using a Morlet wavelet approach. Lastly, CNN is employed for classifying MI tasks.

64_channels

Filtering Data:

filter0

time-frequency analysis:

filter0

Model Summary:

        Layer (type)               Output Shape         Param #

            Conv2d-1           [-1, 32, 32, 20]             320
           Dropout-2           [-1, 32, 32, 20]               0
            Conv2d-3           [-1, 32, 32, 20]           9,248
       BatchNorm2d-4           [-1, 32, 32, 20]              64
            Conv2d-5           [-1, 64, 32, 20]          36,928
           Dropout-6           [-1, 64, 32, 20]               0
            Conv2d-7            [-1, 64, 14, 8]          36,928
       BatchNorm2d-8            [-1, 64, 14, 8]             128
           Dropout-9            [-1, 64, 14, 8]               0
           Conv2d-10            [-1, 64, 14, 8]          36,928
      BatchNorm2d-11            [-1, 64, 14, 8]             128
           Conv2d-12           [-1, 128, 14, 8]         147,584
          Dropout-13           [-1, 128, 14, 8]               0
          Flatten-14                 [-1, 3584]               0
           Linear-15                  [-1, 512]       1,835,520
      BatchNorm2d-16            [-1, 512, 1, 1]           1,024
          Dropout-17                  [-1, 512]               0
           Linear-18                    [-1, 4]           2,052
	   
Total params: 2,106,852
Trainable params: 2,106,852
Non-trainable params: 0

Results:

global_acc

all_tasks_acc

Confusion matrix of R5 scout:

cm_r5

Releases

No releases published

Packages

 
 
 

Contributors