O'Reilly logo

Practical Deep Learning for Cloud and Mobile by Meher Kasam, Siddha Ganju, Anirudh Koul

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Cats vs Dogs - Transfer Learning in 30 lines with Keras

A Note for Early Release Readers

This will be the 3rd chapter of the final book.

If you have comments about how we might improve the content and/or examples in this book, or if you notice missing material, please reach out to the authors at practicaldlbook@gmail.com.

Imagine you want to learn how to play the ukulele. If you have no musical background, and you are starting fresh with the ukulele as your very first instrument, it’ll take you a few months to get proficient at playing it. On the other hand, if you are accustomed to playing the guitar, it might just take a week, due to how similar the two instruments are. Taking the learnings from one task and fine-tuning them on a similar task is something we often do in real life. The more similar the two tasks are, the easier it is to adapt the learnings from one task to the other.

This phenomenon from real life can also be applied to the world of deep learning. It is relatively quick to start with a pretrained model, reuse the knowledge that it learned during its training, and adapt it to the task at hand. This process is known as Transfer Learning.

In this chapter, we will use transfer learning to modify existing models by training our own classifier in minutes with Keras. Otherwise, training from scratch would have taken anywhere from days to weeks. By the end, you will have several tools in your arsenal to create high-quality image classifiers on any topic. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required