Hey there! My dear readers.
Today this kernel review is going to be about the famous MNIST data-set, one of the most famous introductory datasets which we encounter along side Iris dataset and the titanic survival challenge data sets.
Since it is a competition kernel, I have decided not to make it public. (yet)
Also, if you want to try your hands at the challenge itself, then you can find the challenge page here :
Note: This kernel has been largely focused on network modelling rather than Exploratory Data Analysis because it's simple, classic stuff. Still, I will try my best to explain that stuff here.
First indication of a great dataset is the face that it gives all the mentioned labels equal rows in it and this one doesn't disappoint.
This data set maintains a fair 4000+ entries per label which actually is a great statistic for a good dataset.
Today this kernel review is going to be about the famous MNIST data-set, one of the most famous introductory datasets which we encounter along side Iris dataset and the titanic survival challenge data sets.
Since it is a competition kernel, I have decided not to make it public. (yet)
Also, if you want to try your hands at the challenge itself, then you can find the challenge page here :
Note: This kernel has been largely focused on network modelling rather than Exploratory Data Analysis because it's simple, classic stuff. Still, I will try my best to explain that stuff here.
Exploratory Data Analysis
This data set maintains a fair 4000+ entries per label which actually is a great statistic for a good dataset.
And the next thing one needs to know is how does that data look like?
For that, matplotlib's module comes handy. Essentially, in the dataset, each row describes pixel density in 1s and 0s, which can be represented like this :
Feature Engineering
Using the following processes, the dataset is perfectly pre processed. Mainly it converts the label data types into int32 and reshapes the training and testing numpy arrays into (number_of_examples, x_dimension, y_dimension, 1) . You must be thinking why 1? Well, we are dealing with black and white images. So 1 channel is sufficient, in case of colored images, you may want to use 3 channels.
To follow my steps, you can have fun using this code snippet:
Model Design
Here comes the fun part. I have modeled my own CNN in this way. Implementing Batch normalization, Dropouts and combined the classical CNN and Rectilinear Units in the end to try and maximize the accuracy. You can use this model here:
The model comes out to have the following architecture:
Model Training
The model architecture is fairly complex in itself, but there is one more technique i have used to complement the architectures training process. Namely Data Augmentation , using ImageDataGenerator, we achieve the same. The following code can be used to achieve the same.
The accuracy curve |
Result
The resulting prediction hits the lovely accuracy score of 0.99571 which fetches you a rank in top 14% of the leader board! Hope you enjoyed this kernel!
I will soon release the kernel in public. Till then, enjoy your day!
I will soon release the kernel in public. Till then, enjoy your day!
Uddeshya Singh
Comments
Post a Comment