Classification with Convolutional Neural Networks

CIFAR10 classification with a convolutional model with pytorch.

In this task, you should train a CNN model with pytorch to classify CIFAR10 dataset.

Load the dataset

Load the CIFAR10 dataset bellow. You can use either torchvision.datasets.CIFAR10 or sklearn.datasets.fetch_openml() or any other way to load the dataset.

In [ ]:

Design your model

Write your CNN model below using torch.nn modules. Feel free to add extra cells.

In [ ]:

Train your model

Write the training process below. Instantiate your model, Create an optimizer function such as Adam or SGD, and write your train/validation loop. Then train your model until it converges. Feel free to add extra cells.

In [ ]:

Draw the training curves

Draw two diagrams for train and validat ion, one showing loss of each epoch, and another showing accuracy of each epoch.

In [ ]:

Evaluate your model

Evaluate the best epoch's model (according to the validation accuracy) on the test set, and report the accuracy. Is your model overfitted?

In [ ]:

Draw misclassified images

Draw 20 misclassified images from test set with expected and predicted labels.

In [ ]:

Plot the confusion matrix

Plot the confusion matrix for the test set.

In [ ]: