We introduced the concept of transfer learning in Chapter 5, Neural Network Architecture and Models, and how to predict image classes based on pre-trained models was demonstrated in the Coding deep learning model using TensorFlow section. We have observed that the pre-trained model gets reasonable accuracy on large datasets, but we can improve on this by training the model on our own datasets. One approach is to build the entire model (ResNet for example) and train it on our datasets—but this process will likely require a significant amount of time to run the model and then optimize the model parameters for our own datasets.
The other more efficient approach (called transfer learning) is to extract the feature vector from the base model without the top layer trained on an ImageNet dataset and then add our custom fully...