Starting from:

$29.99

Homework 4: Convolutional Neural NetworkCSCE 633 Solution


Instructions for homework submission
a) For each question, please explain your thought process, results, and observations in a markdown cell after the code cells in your jupyter notebook with the name FirstName LastName HW4.ipynb b) You can use any available libraries for this homework. For the CNN model implementation, use PyTorch.
Question 1: Convolution Operation (30 points)
In this problem, we will use the convolution operation on the matrix using the 3x3 filter as shown below.

Apply the convolution operation for all the following settings respectively, and write your answers in a LaTex generated PDF file with the name FirstName LastName HW4.pdf
• Convolution with stride of 1
• Zero padding of 1 + convolution with stride of 1
• Zero padding of 2 + convolution with stride of 2
• Convolution with stride of 1 + max pooling of 3 with stride of 1
• Zero padding of 2 + convolution with stride of 1 + max pooling of 3 with stride of 1
1
Question 2: Image Classification using CNN in Pytorch (70 points)
(a) Dataloader Download the MNIST train and test dataset on Canvas. Implement a data loader with batch size and validation size as arguments. (HINT: You can check the documentation here: Creating a Custom Dataset for your files)
(b) Data Exploration Pick one example from each digit and visualize them. Count the number of samples per digit in the original training data. Is the data distribution balanced?
(c) Data Split Split original training data into 80% for training and 20% validation datasets.
(g) Inference Use the best fine-tuned model for inference on the test dataset. Save your predictions for every row of the test data in a CSV file with the name FirstName LastName Preds.csv (Do not shuffle the test data)
BONUS(+10 points): Filter Visualization Randomly pick an image from the training set. Visualize the feature maps corresponding to all convolution filters after the first and last convolution layers.
2

More products