How to apply Matlab CNN code on an input image with 6 channels
Show older comments
I have currently applied the Matbal CNN function to train my research data. Unlike, the Matlab 'lettersTrainSet'with a size of 28x28x1x1500 (4-D array), the input train data of my experiment have a size of 7x7x6x30,000. The problem I have encountered is that while running the 'trainNetwork' function, Matlab shows me an error: *Error using trainNetwork>iAssertValidImageArray (line 575) X must be a 4-D array of images.
Error in trainNetwork>iParseInput (line 329) iAssertValidImageArray( X );
Error in trainNetwork (line 68) [layers, opts, X, Y] = iParseInput(varargin{:});*
However, the same training data with 3 channels or 1 channels I can run the CNN code without any error message. It will be a great help if anyone can suggest how to use image data with more than 3 channels in Matlab for CNN classification.
1 Comment
Armin Eskandari
on 27 Oct 2017
Hi, all I have the same problem, Please remove this limitation
Accepted Answer
More Answers (4)
jim peyton
on 1 Nov 2017
Edited: jim peyton
on 1 Nov 2017
2 votes
If the development team is prioritizing by market need, this is a deal-breaker for a few of our applications too:
Using XYZRGB (6ch), or XYZ+Gray(4ch), or XYZ+normals+gray(7ch), or two stereo channels with multiple exposures/textures each (up to 24ch)...
1 Comment
Chandrama Sarker
on 1 Nov 2017
Zhiyi TANG
on 27 Mar 2018
2 votes
Check the doc of imageInputLayer (2018a) below:
1 Comment
Chandrama Sarker
on 27 Mar 2018
Carole
on 21 Feb 2018
1 vote
This is the same for me. I wanted to implement a deconvolutional neural network and thus meed to have an input layer with more than 3 channels (to input the feature map and also to modify them as all needed layers for this are not yet implemented). Is there any workaround, or will this fixed in the next release? I will have to switch to Python otherwise. Is it in the plans of the development team? Cheers.
Hang-Rai Kim
on 17 Apr 2018
0 votes
I want to apply CNN in 3D images (MRI data). I am planning to use 3D images as 2D x z stacks thus need to work in 2D CNN with multi channels. Please let me know what should i do.. Thank you.
9 Comments
Áron Görög
on 17 Apr 2018
Hello, I am trying to do a similar thing, did you find any solution?
Hang-Rai Kim
on 18 Apr 2018
No Aron, I couldn't find any solution. Hope this is solved in a new version matlab code.
Walter Roberson
on 18 Apr 2018
As Zhiyi TANG pointed out above https://www.mathworks.com/matlabcentral/answers/350106-how-to-apply-matlab-cnn-code-on-an-input-image-with-6-channels#answer_312153, R2018a now supports multichannel input layers.
Áron Görög
on 18 Apr 2018
Is it possible to seperate the channels inside the network, and process them by parallel convolutional layers? I'm trying to process a sequence of images, I've created a new question about this: https://www.mathworks.com/matlabcentral/answers/395474-how-can-i-create-a-neural-network-with-an-input-of-image-sequences?s_tid=prof_contriblnk
Walter Roberson
on 18 Apr 2018
Sorry that is outside of my experience.
Hang-Rai Kim
on 23 Apr 2018
Dear Walter, thank you so much for your help. But i have one question regarding that, is this ok to use multiple 2D image in 2D CNN with multispectral channel??, because my 2D images are not images with different colors but images with grey scaled color at different z axis.
Walter Roberson
on 23 Apr 2018
Sorry, I do not know. Probably, but I am not certain at all.
Hang-Rai Kim
on 23 Apr 2018
oh ok~ Thank you! Goodday!!
Áron Görög
on 23 Apr 2018
Hang-Rai Kim, this might be useful for you:
https://www.mathworks.com/matlabcentral/fileexchange/58447-hagaygarty-mdcnn
Categories
Find more on Object Detection in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!