Transfer learning using TensorFlow Hub and Keras Application

Author: Zen and the Art of Computer Programming

1 Introduction

Computer vision and natural language processing are an important and popular direction in the field of artificial intelligence. As artificial intelligence models have achieved good results in image classification, object detection, text recognition and other tasks in recent years, more and more people have begun to pay attention to how to apply these models to other fields. For example, the deep learning framework TensorFlow has released TFHub, through which cross-platform model sharing and transfer learning can be realized. In this paper, the image classification task is realized through the Keras Applications library and the ResNet50 model in TFHub.

2. Main terms and concepts

data set

  • Dataset: The image dataset used in this article is the CIFAR-10 dataset, which has a total of 60,000 color images divided into 10 categories (airplane, car, bird, cat, deer, dog, frog, horse, boat, truck) . The training set contains 50,000 images, the validation set contains 10,000 images, and the test set contains 10,000 images.
  • Preprocessing: First preprocess the original image, including normalization, cropping, scaling, centering and other operations.
  • Augmentation: Perform data enhancement operations on the training set, including random flipping, rotation, cropping, brightness adjustment, etc.
  • Splitting: Divide the data set into training set, validation set and test set for model training and evaluation.

Model

  • Architecture: Use the ResNet50 model as the backbone network, which is a deep convolutional neural network with hundreds of convolutional layers and thousands of parameters.
  • Transfer Learning: When training the model, in addition to pre-training weights with ImageNet, you can also use the model provided by TFHub or the parameters of your own trained model as the initial value.
  • Optimization Strategy: Use the optimization algorithm SGD for model training, and use the exponential decay learning rate strategy to

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132053411