CNN for EEG 2-class pattern classification

조회 수: 18 (최근 30일)
Joana
Joana 2019년 12월 5일
댓글: Mahesh Taparia 2019년 12월 10일
Hi
I am new to using the deep learning for classifcation so i have some basic questions, i will highly appreciate if anyone can help through.
I have EEG data collected from 16 channels,at 1200 sampling frequency of two classes. After pre-processing i have extracted the epochs of two classes (for N=100 for each class) for 1second which are in this format: 1200x16x100.I need to train the CNN to classify the class 1 and 2 with 70% training data and 30% for testing.
1: How to prepare the data for training and testing/target.?
2: How to assign the labels to each class for training/testing in CNN.?

채택된 답변

Mahesh Taparia
Mahesh Taparia 2019년 12월 9일
Hi Naina,
You have an EEG dataset of two classes of dimensions 1200X16X100. Initially, put the dataset of both the classes into two separate folders with their folder name as their labels. Convert this dataset into datastore using ‘datastore’ function. You can split the training and testing dataset using splitEachLabel function.
You can refer to this link for image classification. In your case instead of images as input, some matrix is there which can be loaded using datastore function.
To create a custom model, you can refer to this documentation.
  댓글 수: 2
Joana
Joana 2019년 12월 9일
Hi Mahesh
Thanks for the reply.
i have 2 questions actually.
1: What is the 'datastore' function.? i need to work with the time series points instead of converting it into the images.
2: I played around and converted the 1200X16X100 to 100x19200 of each class. and used that as input. so input is: 200x19200.
Then i generated a variable Target of size 200x1, where 100 are '0' and 100 are'1' as labels.
I used this to run with the pattern recognition GUI and it gives the training accuracy of 100% and and testing accuracy of 98.9%.
I don't know if this is the right way to do.? Can you please comment on it as well.?
Mahesh Taparia
Mahesh Taparia 2019년 12월 10일
Hi Naina,
The 'datastore' function creates a datastore, which is a repository for collections of data. For more more information of this function, you can refer to this link.
There are multiple ways to classify time series data, for example using RNN, CNN etc. You can refer to some research papers in this regards.
Regarding your approach, there is a tutorial on this using CNN. You can refer this link.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by