0% found this document useful (0 votes)
12 views

Computer Vision (CS 6384.002) Project 2: Program Description

1. The document describes a CNN model created to classify images from the MNIST dataset using a training set of 6,000 images resized to 7x7 pixels. 2. The model contains max pooling, convolutional, and dense layers with different hyperparameters tested to achieve accuracies between 78.8-89.49% on various test sets. 3. The best performing model had 8 epochs, kernel regularization of 0.002, bias regularization of 0.003, and achieved an accuracy of 89.49% on one test set.

Uploaded by

Lazy Leetcoder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Computer Vision (CS 6384.002) Project 2: Program Description

1. The document describes a CNN model created to classify images from the MNIST dataset using a training set of 6,000 images resized to 7x7 pixels. 2. The model contains max pooling, convolutional, and dense layers with different hyperparameters tested to achieve accuracies between 78.8-89.49% on various test sets. 3. The best performing model had 8 epochs, kernel regularization of 0.002, bias regularization of 0.003, and achieved an accuracy of 89.49% on one test set.

Uploaded by

Lazy Leetcoder
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Vision (CS 6384.

002)
Project 2
Name: Rutuja Narendra Kaushike
Net Id: rnk170000

Program Description:

1. Here, the same code provided by professor has been used as the base code to solve a
problem of creating a classifier for the MNIST data.

2. The training data in our case has only 6,000 images, and each image is shrunk to size
7x7.

3. The goal is to train a CNN to recognize images of digits from the MNIST dataset. This
dataset consists of gray level images of size 28x28.

4. To test the program on different test csv files other than files provided by professor, I
used given fraction_xy.py file with parameters 0.1 and one of seeds : 3,7,8 and 15. I
have got different results on these different parameters (Test accuracies are: 87.86,
88.79, 88.86 and 89.49 respectively).

5. Network Description:
a. The first layer in the network must be a 4 × 4 max pooling layer. This effectively
shrinks the images from 28x28 to 7x7.
b. Then, I have added two Conv2D layers with 64 filters with the frame size of (3 X
3) and with activation function ReLu.
c. Then, I have added a 2 x 2 max pooling layer.
d. Then, I have added two Conv2D layers with 128 filters with the frame size of (3 X
3) and with activation function ReLu.
e. Then, I have added a 2 x 2 max pooling layer.
f. Then I flattened the layers using Flatten().
g. Then I have added a fully connected dense layers to this model. I have added
some parameters to this, for example kernel_regularizer and bias_regularizer.
h. After starting training and tweaking the values for above parameters, I got the
maximum accuracy at kernel_regularizer : 0.002 and bias_ regularizer: 0.003
with activation function ReLu.
i. After all, I just kept dense layer with activation function softmax at the end as it
was given in the code by professor.
6. Epochs: I started off with the default value given = 5. I observer that if I add some more,
I was getting more accurate results. I tried for 5, 8 and 10 and found the best accuracy
at epochs = 8. I did not increase further as there is a time limit of 6 minutes.

7. Accuracy: I have tried different combinations of layers, parameters and epochs

a. For example, for input as given by professor on my model, using 10 epochs, I


have got accuracy as 88.75 which is better than accuracy of original model
provided (73- 83%).

b. Another example, the input as given by fraction_xy.py with input parameters as


0.1 3, on my model, with epochs 8, the output accuracy is: 87.64% (least for my
model)

c. The best accuracy I received was at 8 epochs and at kernel_regularizer : 0.002


and bias_ regularizer: 0.003, with my model on a test set of input values 0.1 15
Accuracy received is: 89.49 %
d. Observations: 1. If I increase the epochs, the training accuracy increases but
testing accuracy stays the same / decreases. I believe this is because of
overfitting due to excessive training. 2. I tried different training data and got
accuracies between 78.8% - 89.49%.

Steps to Run the program:

1. Keep your training data under small/ with the names: x_train.csv and y_train.csv
2. Keep your testing data under big/ with the names: x_test.csv and y_test.csv
3. Go to the folder containing these two folders and start terminal from there. My
python file should go in the same folder where big/ and small/ are stored.
4. To run the program, just type à python3 file.py

You might also like