7 Telling Birds from Airplanes - Learning from Images

 

This chapter covers:

  • working through an image recognition problem, step by step
  • building a feed forward neural network to classify images
  • loading data using Datasets and DataLoaders
  • why and how to use a classification loss
  • describing how convolution works
  • building a convolutional neural network to classify images

The last chapter gave us the opportunity to dive into the inner mechanics of learning through gradient descent, and the facilities that PyTorch offers to build models and optimize them. We have done so on a simple regression model of one input and one output, which allowed us to have everything in plain sight, but admittedly was only borderline exciting.

In this chapter we’ll keep moving ahead on building our neural network foundations. This time, we’ll turn our attention to images. Image recognition is arguably the task that made the world realize the potential of deep learning.

We will now approach a simple image recognition problem step by step, building from a simple neural network like we defined in the last chapter. This time, instead of a tiny dataset of numbers, we’ll use a more extensive dataset of tiny images. Let’s download the dataset first and get to work preparing it for use.

7.1  A dataset of tiny images

 
 
 

7.1.1  Downloading CIFAR10

 
 

7.1.2  The Dataset class

 

7.1.3  Dataset transforms

 
 

7.1.4  Normalizing data

 
 
 

7.2  Distinguishing birds from airplanes

 

7.2.1  Building the dataset

 

7.2.2 A fully connected classifier

 
 

7.2.3  A loss for classifying

 
 
 

7.2.4  Training the classifier

 
 
 

7.2.5  The limits of going fully connected

 
 

7.3  Conclusion

 
 

7.4  Exercises

 
 
 

7.5  Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest