CIFAR10 Image Classification in PyTorch

Gabriele Mattioli
9 min readSep 19, 2022
A torch
Photo by Igor Lepilin on Unsplash

In this article, we’ll deep dive into the CIFAR10 image classification problem. To tackle this, we’ll use the well-known deep learning library PyTorch. In the end, you will be able to train a CNN from scratch and achieve over 90% accuracy on the CIFAR10 image dataset.

Outline

Setup

Since we’re going to train a heavy neural network against lots of data, it is recommended to use online tools provided with GPUs, such as Google Colaboratory, or even your machine if it has sufficient hardware.

First things first, we need to install extra pip packages. If you use Google Colaboratory, these are the only packages you’ll have to install.

!pip install ray
!pip install hpbandster ConfigSpace

They will be both useful in the hyperparameters tuning phase, using RayTune.

Then, we can import all the libraries that we’ll need throughout the project.

--

--

Gabriele Mattioli

Software Engineer, Machine Learning geek and Powerlifting addicted. Check out my last story: https://bit.ly/3lnGG3E