Transfer Learning

I was trying to teach transfer learning in my lab and couldn’t find a simple no-frills code for it over the internet. So, I wrote my own implementation using Tensorflow and Python over a modified cats and dogs dataset obtained from kaggle.

This was trained using only 1040 images placed in test directory and it could get more than 90% accuracy on a test set of  23936 images in just four epochs. This uses VVG-16 network pre-trained on imagenet to obtain the bottleneck features. These features are then used to train a simple two layer neural network to classify dogs and cats.

Complete implementation of it along with the datasets can be downloaded from here.

You need to have Jupyter, tensorflow and opencv-python installed on your machine to run this.

Leave a Reply

Your email address will not be published.