Search code examples
machine-learningtransfer-learningimage-classification

How to use Transfer learning to a non-related problem


I would like to know and understand if it's possible to use transfer learning to recognize images not related to the original model.

For example, if I would like to recognize skin disease can I use a pre-trained model using a model that classifies cat and dogs?


Solution

  • Yeah it's possible, that's one of the main reasons why they've come up with Transfer Learning. You just take a pretrained model, freeze its original weights so that it keeps what it had previously learned, then you take the last layer out(which outputs the classes the model was trained on), and you add your own layer, for example a Dense layer with 5 neurons, that output 5 different types of skin diseases, with softmax activation function(or any number of neurons, depending on number of classes you wish to predict).