why a Gray image is shown as a Colored image on CNN deep learning ?
Afficher commentaires plus anciens
CNN network of deep learning reads my gray image as a colored image. Whenever, tried to change the diminsions to gray [ 227 227 1], the system gives me error
layers = [
imageInputLayer([227 227 3],"Name","data")
convolution2dLayer([11 11],94,"Name","conv1","BiasLearnRateFactor",2,"Stride",[4 4])
reluLayer("Name","relu1")
crossChannelNormalizationLayer(5,"Name","norm1","K",1)
maxPooling2dLayer([3 3],"Name","pool1","Stride",[2 2])
groupedConvolution2dLayer([5 5],94,2,"Name","conv2","BiasLearnRateFactor",2,"Padding",[2 2 2 2])

Réponses (1)
Image Analyst
le 14 Déc 2020
0 votes
That's right. For most predefined network architectures, they were built to handle color images. Just make your gray scale images into color images and don't worry about it. The network will eventually learn during training that it doesn't need to use the other two color channels.
8 commentaires
Mohamed Elbeialy
le 14 Déc 2020
Image Analyst
le 14 Déc 2020
I think so but you'd have to build your network from scratch using the network designer, rather than use a pre-built network like AlexNet, ResNet, GoogLeNet, etc.
Mohamed Elbeialy
le 15 Déc 2020
Modifié(e) : Image Analyst
le 15 Déc 2020
Image Analyst
le 15 Déc 2020
Why can't you just convert to color? What's wrong with doing that?
Mohamed Elbeialy
le 15 Déc 2020
Image Analyst
le 15 Déc 2020
It can be converted:
rgbImage = cat(3, grayImage, grayImage, grayImage);
or
rgbImage = ind2rgb(grayImage, gray(256));
Mohamed Elbeialy
le 15 Déc 2020
Image Analyst
le 15 Déc 2020
WHAT did not work? The cat() function? Or your training/classification/prediction process?
I can't really download all your training images. Sorry. I suggest you call tech support and ask them to walk you through it step by step.
Catégories
En savoir plus sur Deep Learning for Image Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!