How to do transfer learning with multi-channel EEG data with Googlenet?

조회 수: 4 (최근 30일)
Manlin Wang
Manlin Wang 2020년 7월 7일
댓글: Alok 2023년 9월 30일
Hi Sir/Madam,
Thanks for your time. I am trying to do some deep learning classification on multi-channel EEG data with googlenet. The dimension of my data is 1000(time series points)*60(channels)*3038(samples). By doing the Continous wavelet transformation, each 1000 points can be transformed to be a time-frequency scalogram and the size I set is 227*227*1(greyscale images). Now I have the data dimension as 227(image height)*227(image width)*60(channels)*3038(samples) and I would like to fit it into google net for transfer learning. Two problems occurs now and I need some help. First, how to define the training set, if I create a matrix with dimension [227,227,60,3038], It will have an 'out of memory' error. Do we have another way to define the training set? Noted that for each sample, I have 60 images for input, since the 60 images are time correlated. Second, for the google net, the required input is [224,224,3], do I need to create some methods to make the 60 [224,224,1] images into one [224,224,3] image for transfer learning?
Great thanks for your help.
Best regards,
Manlin Wang

답변 (1개)

Srivardhan Gadila
Srivardhan Gadila 2020년 7월 13일
You can copy the layerGraph of the pretrained network and change the imageInputLayer, the first convolutionLayer to match the input image channel dimension & convolution filter dimensions. Then you can freeze/unfreeze the existing pretrained weights during training the new network accordingly.
You can do something like below:(N=60)
net = googlenet();
analyzeNetwork(net)
lgraph = layerGraph(net);
N = 60;
%%
newlgraph = replaceLayer(lgraph,'data',imageInputLayer([224 224 N],'Name','input'));
% or you can use the following as well
% newlgraph = replaceLayer(lgraph,'data',imageInputLayer([227 227 N],'Name','input'));
newlgraph = replaceLayer(newlgraph,'conv1-7x7_s2',convolution2dLayer(7,64,'stride',[2 2],'padding',[3 3 3 3],'Name','conv1-7x7_s2'));
analyzeNetwork(newlgraph)
You can refer to Datastores for Deep Learning for loading the training data required to train the network.
  댓글 수: 1
Alok
Alok 2023년 9월 30일
Thanks for providing this useful suggestion.
Yes, this works for googlenet and resnet. However, it gives error with EfficientNetB0. Could you provide some insights as to how to ironout EfficientNetB0 for multi-channel (N>3)

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

카테고리

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