THE FUTURE IS HERE

Tips Tricks 20 – Understanding transfer learning for different size and channel inputs

Code generated in the video can be downloaded from here:
https://github.com/bnsreenu/python_for_microscopists

The input to the Vgg 16 model is 224x224x3 pixels images.
The Kernel size is 3×3 and the pool size is 2×2 for all the layers.

If our image size is different, can we still use transfer learning?
The answer is YES.

Input image size does not matter as the weights are associated with the filter kernel size. This does not change based on the input image size, for convolutional layers.

The number of channels does matter, as it affects the number of weights for the first convolutional layer. We can still use transfer learning by copying weights for the first channels from the original model and then filling the additional channel weights with the mean of existing weights along the channels.