본문 바로가기

인공지능(AI)/Udacity tensorflow 강의

[Lesson 5] Transfer Learning

- In the previous lesson, we started out by training a CNN based image classifier to recognize images of cats and dogs.

 

- In this lesson, we'll introduce a technique called transfer learning that reuses the model that was created by machine learning experts and that has already been trained on a large data set.

 

- As it turns out, we can take advantage of high-performance neural networks by using a technique called transfer learning.

 

- It's called transfer learning because we transfer the learning of an existing model to a new dataset.

 

- In order to perform transfer learning, we need to change the last layer of the pre-trained model. this is because each dataset has a different number of output classes.

 

Pre-trained model

 

-  Also, we have to make sure that we don't change the pre-trained part of the model during the training process. This is done by setting the variables of the pre-trained model to non-trainable.(freezing the model)

 

- By freezing the parameters, we'll ensure that only the variables of the last classification layer get trained.

 

Freeze pre-trained model

 

- Benefit from this is they will reduce the training time significantly because we're only training the variables of our last classification layer.

 

- We must always remember to freeze the parameters of our pre-trained model when we perform transfer learning.

 

- In this lesson, we will use a-state-of-the-art convolutional neural network called MobileNet.

 

- MobileNet uses a very efficient neural network architecture that minimizes the amount of memory and computational resources needed while maintaing a high level of accuracy.

 

- TensorFlow has a repository of pretrained models called TensorFlow hub.

 

<Colab Notebook>

- To access the Colab Notebook, login to your Google account and click on the link below:

Cats and Dogs with Transfer Learning

 

Google Colaboratory

 

colab.research.google.com

 

- One way to try to understand CNNs is by visualizing the convolutional layers. Look at the link below to learn more about how to visualize convolutional layers:

Understanding your Convolution network with Visualizations

 

Understanding your Convolution network with Visualizations

The field of Computer Vision has seen tremendous advancements since Convolution Neural Networks have come into being. The incredible speed…

towardsdatascience.com

 

<소스 코드>

github.com/HoYoungChun/TensorFlow_study/blob/master/08_Cats%20and%20Dogs%20with%20Transfer%20Learning.py

 

HoYoungChun/TensorFlow_study

Udacity의 Intro to TensorFlow for Deep Learning 강좌 for TF_Certificate 취득 - HoYoungChun/TensorFlow_study

github.com