Models trained on large and diverse datasets like ImageNet are able to detect and capture some of the universal features such as curves, edges, and shapes. Some of these features are easily applicable to other kinds of datasets. Thus, in transfer learning we take such universal models and use some of the following techniques to fine-tune or retrain them to our datasets:
- Repeal and replace the last layer: The most common practice is to remove the last layer and add the new classification layer that matches our dataset. For example, ImageNet models are trained with 1,000 categories, but our COCO animals dataset is only 8 classes, thus we remove the softmax layer that generates probabilities for 1,000 classes with a softmax layer that generates probabilities for 8 classes. Generally, this technique is used when the new dataset is almost similar to...