Program implements a convolutional neural network for classifying images of numbers in the MNIST dataset as either even or odd using GPU framework.
- Contructing CNN: MNIST dataset is split into training, validation, and testing subsets with 55000, 10000, and 5000 examples, respectively. Digit labels are converted to even or odd using 0 and 1. Also plotting training and validation loss and accuracy as a function of epochs.
- Hyper-parameters Tuning: Evaluating different variations of basic network by changing:
- network architecture
- receptive field using dilation
- stride
- optimizer
- loss function
- dropout
- learning rate
- number of epochs
- weight initializers
- batch normalization
- layer normalization
- Inference: Taking images with handwritten digits as input and performing image preprocessing like resizing, converting to grayscale and then to binary image using threshold. Classifying input images into odd/even labels.
Program was implemented using Python, TensorFlow, Keras, and OpenCV. Refer the report for further implementation details and instructions to run the code:
View Report
- Contructed CNN for training:
- After Hyper-parameter Tuning:
Parameters | Values |
Dilation | 1 |
Stride | 1 |
Optimizer | Adam |
Loss function | Binary cross entropy |
Dropout | 0.3 |
Learning rate | 0.001 |
Weight Initializer | He normal |
Epochs | 15 |
Batch Normalization | Added layers after convolution and max pooling layers |
Layer Normalization | Added layers after convolution layers |
- Inference with handwritten images: