2D CNN with mulitiple z stack vs 2D CNN with multiple colors

45 views
Skip to first unread message

notalway...@gmail.com

unread,
May 31, 2018, 5:21:18 AM5/31/18
to mdCNN: Multidimensional CNN library in Matlab
Dear Sir.

This is Hang-Rai Kim, from KAIST.

I am a user of your wonderful code.

I am sending this to ask some questions. 

Last time i tried to make a classifier using 3D CNN. However, it didn't seem to work as good as I expected.

Thus, this time i try to make a classifier using 2D CNN with multiple plane (My image is 3D image, Brain MRI). 

Therefore, I set net.hyperPara.numFmInput to "79" (size of 3D image is 79 x 95 x 79 ). 

This is the conf that i used. 

================================ 
 (1) Input settings
     -net.hyperParam.sizeFmInput = [79 95];
     -net.hyperParam.numFmInput  = 79;
 (2) Layers specification
     -net.layers{end+1}.properties = struct('type',2,'numFm',60, 'Activation',@Relu, 'dActivation',@dRelu,'kernel',5, 'stride', 1, 'pooling',1);
     -net.layers{end+1}.properties = struct('type',1,'numFm',120, 'dropOut',0.5);
     -net.layers{end+1}.properties = struct('type',1,'numFm',2);
 (3) Hyper params - training
     -net.hyperParam.trainLoopCount = 30;
net.hyperParam.testImageNum   = 100;   
net.hyperParam.ni_initial     = 0.01;
net.hyperParam.ni_final       = 0.00001;

================================

For the data input, 

First I loaded the MNIST3d_dataset

I transformed all the value of My data image to 0-255 (because I found out that sample data (MNIST3d_data) valued from 0 to 255) then I input the 3D data (79x95x79x309) to MNIST3d.I and put test 3D data (79x95x79x30) to MNIST3d.I_test

I made column matrix composed of ones (AD) and zeroes (NL) for labelling then I input the label to MNIST3d.labels and MNIST3d.labels_test.

Then it seem to work without any error

================================
Thus I wonder

1) For multi-plane image, some CNN code regard multi-2D image as 2D image with multiple color (spectral images), thus it merges kernel weights during learning process.

However, my input image is not image with multiple colors but images with different z stack, thus i think each kernel shouldn't be merged but processed parallelly.
How does your code process 2D image with multiple input?

2) Did I make any mistake during the above process? especially during making input data

Hagay Garty

unread,
Jun 1, 2018, 12:00:10 PM6/1/18
to mdCNN: Multidimensional CNN library in Matlab
MNIST3d.I should not be a 4D matrix, instead, it should be a cell array of 309 values, each struct is a 3D matrix (79x95x79). This is true for both cases.

A possible difference between 3d kernels and 2d kernels is 'normalizeNetworkInput'. it normalizes each feature map to be with mean 0 and variance 1. So if your network is 3D (sizeFmInput = [79 95 79] , numFmInput  = 1 / 2D ( sizeFmInput = [79 95] , numFmInput  = 79 ) normalization is different.
For MRI you should see better results when using a 3D a network

1) mdCNN process 2D image with multiple colours in the 'standard' CNN way. 2D convolutional kernel per feature map. You can see the CIFAR10 demo, each image is 32x32 RGB
2) If you wish to test your input for validity you can compare the dataset structure t CIFAR10 demo if you wish to use 2d kernels, or MNIST32 demo if you wish to use 3D kernels.

always...@gmail.com

unread,
Jun 5, 2018, 2:10:50 AM6/5/18
to mdCNN: Multidimensional CNN library in Matlab
Thank you. I understood.

Best regard

Hang-Rai Kim

2018년 6월 2일 토요일 오전 1시 0분 10초 UTC+9, Hagay Garty 님의 말:
Reply all
Reply to author
Forward
0 new messages