Transfer Learning Approaches

I am trying to understand the two common approaches of transfer learing. I am reading this: Transfer Learning for Computer Vision Tutorial — PyTorch Tutorials 1.9.0+cu102 documentation.

I am wondering what is the role of pre-trained weights(like ImageNet) in “ConvNet as fixed feature extractor” approach? Say, I am using resnet-18 (pre-trained on ImageNet), freezing all the convolutional layers in the network and keeping the last fully connected layer which is trained with random weight initialization(as stated in the given link). In this specific case of transfer learning, since the convolution layer is freezed, the weights are not being updated. Besides, the last fully connected layer is trained with random weight initialization based on the target dataset. So, in this scenario, what is the role of pre-trained weights from ImageNet? Or is it only about using the pre-defined renet-18 architecture? Kindly reply.

Freezing the conv layers (feature extractor) and training the linear layers (classifier) only would be a typical form of transfer learning. The idea is that the pretrained model (using the ImageNet dataset) learned to extract useful features from these images, i.e. the conv layers (with the non-linear activations, pooling layers, as well as potentially normalization layers) are detecting features from the spatial inputs, which can then be “combined” in the linear layers to classify the new dataset.

1 Like

Thanks a lot @ptrblck !

1 Like