7 Neural networks and deep learning

 

This chapter covers

  • Convolutional neural networks for image classification
  • TensorFlow and Keras—frameworks for building neural networks
  • Using pretrained neural networks
  • Internals of a convolutional neural network
  • Training a model with transfer learning
  • Data augmentations—the process of generating more training data

Previously, we only dealt with tabular data—data in CSV files. In this chapter, we’ll work with a completely different type of data—images.

The project we prepared for this chapter is classification of clothes. We will predict if an image of clothing is a T-shirt, a shirt, a skirt, a dress, or something else.

This is an image classification problem. To solve it, we will learn how to train a deep neural network using TensorFlow and Keras to recognize the types of clothes. The materials of this chapter will help you start using neural networks and perform any similar image classification project.

Let’s start!

7.1 Fashion classification

Imagine that we work at an online fashion marketplace. Our users upload thousands of images every day to sell their clothes. We want to help our users create listings faster by automatically recommending the right category for their clothes.

7.1.1 GPU vs. CPU

7.1.2 Downloading the clothing dataset

7.1.3 TensorFlow and Keras

7.1.4 images

7.2 Convolutional neural networks

7.2.1 Using a pretrained model

7.2.2 Getting predictions

7.3 Internals of the model

7.3.1 Convolutional layers

7.3.2 Dense layers

7.4 Training the model

7.4.1 Transfer learning

7.4.2 Loading the data

7.4.3 Creating the model

7.4.4 Training the model