This is a project where I classify images of everyday objects using a neural networks built from scratch.
To install PyTorch via Anaconda, use the following conda command:
conda install pytorch torchvision -c pytorch
To install PyTorch via pip, use one of the following two commands, depending on your Python version:
# Python 3.x
pip3 install torch torchvision
Here, I have designed feed forward neural nets and convolutional neural nets from scratch, in order to classify objects in the CIFAR10 dataset.
The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images.
The dataset is divided into five training batches and one test batch, each with 10000 images. The test batch contains exactly 1000 randomly-selected images from each class. The training batches contain the remaining images in random order, but some training batches may contain more images from one class than another. Between them, the training batches contain exactly 5000 images from each class.
1. Feed Forward Neural Network
Find the complete implementation here.
2. Convolutional Neural Network
Clearly, validation accuracy jumped from 57% to 76%, while the validation loss came down from 174% to about 90%.
Find the complete implementation here.
We could furthermore increase the accuracy and bring down the loss by using transfer learning methods.