Input to Convolution Neural Network
Afficher commentaires plus anciens
I am using convolution neural network on face images of the size 1024*768*3.
I want to pass these images as input to first input layer of CNN.
what should be size of the 'inputImageLayer' for CNN?
How to decide the size of First layer of CNN?
Réponses (1)
bharath pro
le 29 Juin 2020
0 votes
The ImageInputLayer is used to take image inputs when designing a CNN. According to the documentation, it can be called using ImageInputLayer([h w c]), where c= number of chanels. I am assuming for you the height and width of images are 1024 and 768 respectively and c=3. So for this you would need to use ImageInputLayer([1024 768 3]) to instantiate this layer.
8 commentaires
AP
le 30 Juin 2020
bharath pro
le 30 Juin 2020
Is the input vector a 1*3 row vector? Can you check its dimensions?
AP
le 30 Juin 2020
bharath pro
le 30 Juin 2020
What output do you get when you run size(image)? Also the row vector has to be [768 1024 3] in your case.
AP
le 30 Juin 2020
bharath pro
le 30 Juin 2020
Can you share your code here. The problem could be in the other layers as well.
AP
le 30 Juin 2020
bharath pro
le 30 Juin 2020
change your layers to this:
layers = [
imageInputLayer(imageSize,'Normalization','none')
convolution2dLayer(5,20)
reluLayer()
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(5,20)
reluLayer()
maxPooling2dLayer(2,'Stride',2)
fullyConnectedLayer(1)
softmaxLayer
classificationLayer()];
Also your options seem to be wrong. Please change that.
Catégories
En savoir plus sur Deep Learning Toolbox 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!