$29
Task
This project is to implement neural network and convolutional neural network for the task of classi - cation.
The classi cation task will be that of recognizing an image and identify it as one of ten classes. You are required to train the classi ers using Fashion-MNIST clothing images. Following are the three tasks to be performed:
Build a Neural Network with one hidden layer to be trained and tested on Fashion-MNIST dataset. Code from scratch in Python.
Build multi-layer Neural Network with open-source neural-network library, Keras on Fashion-MNIST dataset.
Build Convolutional Neural Network (CNN) with open-source neural-network library, Keras on Fashion-MNIST dataset.
Evaluate the results obtained by each of the classi er (Single layer Neural Network, Multi-Layer neural network and CNN) as shown in the evaluation section.
Dataset
For training and testing of our classi ers, we will use the Fashion-MNIST dataset. The Fashion-MNIST is a dataset of Zalando’s article images, consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes.
Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255. The training
1
Figure 1: Example of how the data looks like.
and test data sets have 785 columns. The rst column consists of the class labels (see above), and represents the article of clothing. The rest of the columns contain the pixel-values of the associated image.
Each training and test example is assigned to one of the labels as shown in table 1.
1
T-shirt/top
2
Trouser
3
Pullover
4
Dress
5
Coat
6
Sandal
7
Shirt
8
Sneaker
9
Bag
10
Ankle Boot
Table 1: Labels for Fashion-MNIST dataset
You can simply load the Fashion MNIST dataset using fashion mnist reader notebook present inside the scripts folder.
Plan of Work
Extract feature values and labels from the data: Fashion MNIST dataset is downloaded and processed into a Numpy array that contains the feature vectors and a Numpy array that contains the labels using fashion mnist reader notebook present inside the scripts folder.
Data Partitioning: The Fashion MNIST dataset is originally partitioned into a training set and a testing set. You will use this partition and train your model on the training set.
Train using Neural Network with One Hidden Layer Use Gradient Descent for neural network to train the model using a group of hyperparameters. (Code from scratch in python)
2
Train using Multi-Layer Neural Network with high level Neural Network library, Keras using a group of hyperparameters.
Train using Convolution Neural Network with high level Neural Network library, Keras using a group of hyperparameters.
Tune hyper-parameters: For steps 3, 4 and 5: Validate the class cation performance of your model on the validation set. Change your hyper-parameters and repeat the step. Try to nd what values those hyperparameters should take so as to give better performance on the testing set.
Test your machine learning scheme on the testing set: For steps 3, 4 and 5: After tuning the hyper-parameters, x your hyper-parameters and model parameter and test your models performance on the testing set. This shows the ultimate e ectiveness of your models generalization power gained by learning.
Evaluation
Plot graph of training loss vs number of epochs while training on each classi er (Neural Network with single hidden layer, multi-layer neural network and convolutional neural network).
2. For each classi er evaluate solution on the test set using classi cation accuracy:
Accuracy = Ncorrect
N
Where where Ncorrect is the number of corrected classi ed data samples, and N number of samples of the validation set.
(1)
is the total
3. Construct a confusion matrix for each classi er and observe the relative strengths and weaknesses.
Deliverables
There are two deliverables: report and code. After nishing the project, you may be asked to demon-strate it to the TAs, particularly if your results and reasoning in your report are not clear enough.
Report (30 points)
The report should describe your results, experimental setup and comparison between the results obtained from di erent setting of the algorithm. Submit the PDF on a CSE student server with the following script:
submit cse474 proj2.pdf for undergraduates submit cse574 proj2.pdf for graduates
3
Code (70 points)
The code for your implementation should be in Python only. You can submit multiple les, but the name of the entrance le should be main.ipynb. Please provide necessary comments in the code. Python code and data les should be packed in a ZIP le named proj2code.zip. Submit the Python code on a CSE student server with the following script:
submit cse474 proj2code.zip for undergraduates submit cse574 proj2code.zip for graduates
4