How to apply Matlab CNN code on an input image with 6 channels

3 vues (au cours des 30 derniers jours)
Chandrama Sarker
Chandrama Sarker le 25 Juil 2017
Commenté : Walter Roberson le 15 Mar 2019
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 commentaire
Armin Eskandari
Armin Eskandari le 27 Oct 2017
Hi, all I have the same problem, Please remove this limitation

Connectez-vous pour commenter.

Réponse acceptée

Kristen Amaddio
Kristen Amaddio le 27 Juil 2017
Currently, CNN exclusively supports single and RGB channel imagery. Due to this limitation, the ability to use CNNs with image data with more than 3 channels is not available at this time.
I work at MathWorks, so I have forwarded this feedback to the relevant development team.
  7 commentaires
$
$ le 15 Mar 2019
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 7x7x2500. 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{:});*
please help me in this regard
Walter Roberson
Walter Roberson le 15 Mar 2019
reshape your data to 7 by 7 by 1 by 2500

Connectez-vous pour commenter.

Plus de réponses (4)

jim peyton
jim peyton le 1 Nov 2017
Modifié(e) : jim peyton le 1 Nov 2017
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 commentaire
Chandrama Sarker
Chandrama Sarker le 1 Nov 2017
Yes, I agree with you, Jim, that is why I have to shift from Matlab to Python in order to utilize the information from all the 6 channels of the image. In some cases specifically in the field of remote sensing, the number of channels would never be limited to 3 channel data and it may be higher than 6 channels too. Regards

Connectez-vous pour commenter.


Zhiyi TANG
Zhiyi TANG le 27 Mar 2018
  1 commentaire
Chandrama Sarker
Chandrama Sarker le 27 Mar 2018
Hi Zhiyi,
Thanks very much for the link. I will try that with my 6 channel data and will update the outcome.

Connectez-vous pour commenter.


Carole
Carole le 21 Fév 2018
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
Hang-Rai Kim le 17 Avr 2018
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 commentaires
Hang-Rai Kim
Hang-Rai Kim le 23 Avr 2018
oh ok~ Thank you! Goodday!!

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by