Can we change the input size of a pretrained network for transfer learning

조회 수: 9 (최근 30일)
Arjun Desai
Arjun Desai 2018년 5월 26일
댓글: Pakize 2021년 12월 26일
I want to use transfer learning on the Resnet-50 architecture trained on Imagenet. I noticed that the input size into the Resnet-50 architecture is [224 224 3]. However my images are [150 150 3]. I was wondering if there were a way to change the input size of the input layer rather than resizing my images.
  댓글 수: 4
Robert Jansen
Robert Jansen 2020년 8월 24일
None of these answers the original question which is again if there "were a way to change the input size of the input layer rather than resizing my images." i.e. can we change resnet50 to accept (unaltered) a different size image? Everyones answer is to resample the input. The question was explicitely not that! Pehaps the answer is no.
Pakize
Pakize 2021년 12월 26일
I have a same question. As far as I understand, we can only resize the images, but not change the input layer as we change the output layers.

댓글을 달려면 로그인하십시오.

답변 (1개)

BERGHOUT Tarek
BERGHOUT Tarek 2019년 4월 16일
yes this methode is cold:
1- if you are changing the neumber of neurons from N to n where N>n: this is called :'constructive' learning
2- if you are changing the neumber of neurons from N to n where N<n: this is called :'distructive' learning
but retraining alwayse requeired , not from the begining but from the final weights that u have in final net
if you want to found some papaers in this area use this key words :
neural networks with additive hidden nodes ; distructive neural nets .....etc. good luck.
  댓글 수: 2
Lenin Falconi
Lenin Falconi 2019년 4월 16일
I am having a hard time understanding your answer. Sure that is something new to me about constructive and distructive learning.
However, it seems like Arjun Desai wants to change the input layer of Resnet 50 so that he can test transfer learning on his/her images. As far as I understand, since Resnet 50 is trained with specific natural image dataset with the dimensions 224x224x3, I don't think the input layer could be changed because this would affect all internal dimensions of the ConvNet arquitecture.
Because of that I aided with a code to simply change image size.
About retraining, not from the beginning I agree totally with you. That's what should happen with transfer, but in order to that happen The image of interest must go forward through the ConvNet until it reaches the las Full Connecting Layers to start retraining or a pertinent node in case of fine tuning. But again image should be in the dimensions expressed by the architecture.
Time ago I found a paper that proposed an arquitecture to deal with images from different sizes. If I found it I will share the name....

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by