Transfer Learning
credit: https://laptrinhx.com/improve-your-model-accuracy-by-transfer-learning-824916605/

Transfer Learning

Transfer Learning

Transfer learning is a machine learning method where you store knowledge gained from one task/model and apply it to different but related problem.

What did we do?

Decided to use EfficientNetV2S from the Keras Application API, freeze some layers and add my own to apply them to the CIFAR10 dataset. There was a bit of iterating done to find the best combination of dense layers, units, amount of layers frozen and the optimizer used.

What was the problem?

This week we were tasked to apply one of the already trained models in Keras' application API and tweak them a bit to apply it to the CIFAR 10 dataset and achieve a validation accuracy of at least 87%.

How was the problem solved?

Based on Andrew Ng's Deep Learning Specialization and Laurence Mooney's TF Specialization, I decided to start off with about 3/4 of the layers frozen and 3 Dense layers with a decreasing amount of units in each. From there I would try increasing and decreasing the number of frozen layers then trying each one with 2 or 3 dense layers and then switching the optimizer from Adam to RMSProp.

What did I find out?

It was quite the time consuming endeavor to do all these iterations and then realize it wasn't getting any better and sometimes outright worse, but ultimately a fun experience. Eventually found out that freezing less layers (about half), gave better results and keeping it simple with 3 Dense layers of 256, 128, and 64 units, with some Dropout layers (rate=0.5/0.4) to avoid overfitting, was the best combination. Surprisingly, the optimizer that worked best was actually RMSProp.

What did it all mean?

It was an excellent experience to see how transfer learning could be applied to similar tasks and to start to really see just how long these iteration cycles and hypertuning parameters can really take. In this case, less was more and ultimately the 87% val accuracy was achieved!

To view or add a comment, sign in

More articles by Ornella Russo

  • Summary of ImageNet Classification with Deep CNNs by Krizhevsky et al.

    Intro Today I'll be writing a brief summary of ImageNet Classification with Deep Convolutional Neural Networks by Alex…

  • Regularization in Machine Learning

    Regularization in ML are techniques used to avoid over/under fitting your function to the training data so that when…

    2 Comments
  • Optimization in Machine Learning

    Optimization in machine learning is the process of iteratively improving a machine learning model that results in a…

  • IoT - Internet of Things

    What exactly is the Internet of Things? The Internet of Things, or IoT, refers to the multitude of devices (things)…

  • Recursion

    Recursion: What is it? Recursion occurs when a thing is defined in terms of itself or of it's type. In programming this…

  • Python3: Mutable, Immutable... everything is object!

    Python is a high level general purpose programming language. It focuses on code readability with its use of significant…

  • Difference Between Static and Shared Libraries

    We have already talked about static libraries in C in a previous article. Now let's introduce dynamic, or shared…

  • C Static Libraries

    What are Static Libraries and Why are they needed? A Static library is a set of routines (external functions…

  • GCC Compiler: What Do

    What even is a compiler? A compiler is a program that processes statements written in a particular programming language…

  • Let's talk Hard and Symbolic links in Linux

    So what are Hard links and Symbolic links in a Linux/UNIX system? Short answer: It's a pointer to a file or folder…

Others also viewed

Explore content categories