How to Increase Alexnet Image Input layer Image size?

How to Increase Alexnet Image Input layer Image size?

1 件のコメント

Karthiga Mahalingam
Karthiga Mahalingam 2018 年 7 月 9 日
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.

サインインしてコメントする。

回答 (1 件)

amir ali aljarrah
amir ali aljarrah 2020 年 3 月 22 日
編集済み: amir ali aljarrah 2020 年 3 月 22 日

0 投票

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 件のコメント

Susama Bagchi
Susama Bagchi 2020 年 5 月 28 日
Hello Mr. Aljarrah,
I tried your procedure. but during the transfer learning, it is throwing error that pool5 layer size is not matching with its input image size.
Can you please help in this regard?
Daniel Vieira
Daniel Vieira 2023 年 2 月 17 日
編集済み: Daniel Vieira 2023 年 2 月 17 日
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
fa der
fa der 2023 年 2 月 28 日
thhx

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2018 年 3 月 30 日

コメント済み:

2023 年 2 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by