How to Increase Alexnet Image Input layer Image size?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to Increase Alexnet Image Input layer Image size?

1 commentaire
Karthiga Mahalingam
le 9 Juil 2018
The best option would be to adjust your input image size according to the input layer using preprocessing techniques like imresize because otherwise you would have to perform transfer learning and create your own inputImageLayer that involves changing convolutional layers and fc layer parameters- but as you can see, the latter is a lot more involved than the former.
Réponses (1)
amir ali aljarrah
le 22 Mar 2020
Modifié(e) : amir ali aljarrah
le 22 Mar 2020
can you change the input by use this code
net = alexnet;
layersTransfer = net.Layers(2:end-3);
layers = [
imageInputLayer([100,100,3]);
layersTransfer
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];
3 commentaires
Daniel Vieira
le 17 Fév 2023
Modifié(e) : Daniel Vieira
le 17 Fév 2023
It won't be that simple. If you change the input layer size, the convolutional layers deal with the new size just fine, they will just operate on the new size and pass on to the next layers. But as soon as you reach the first fullyConected layer you will have mismatching sizes, because the fully connected layers expect fixed sizes.
So, to change the input size you will also have to change everything from the first fully connected layer to the end. Something like this:
net = alexnet;
newSize=[100 100 3];
numClasses=10;
layersTransfer = net.Layers(2:16);
layers = [
imageInputLayer(newSize)
layersTransfer % layers preserved
fullyConnectedLayer(1000) % new 'middle' fc
reluLayer() %
dropoutLayer(0.10) %
fullyConnectedLayer(numClasses) % last fc
softmaxLayer %
classificationLayer];
analyzeNetwork(layers)
I just noticed I answered a 5 year old question... I hope it helps somebody else :p
Voir également
Catégories
En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!