Digit Recognizer Using Convolution Neural Network
In this project, we used the MNIST(Modified National Institute of Standards and Technology) dataset which is available in Kaggle.
MNIST dataset contains handwritten numbers images to work for the classification algorithm. These numbers are between 0 and 9. Also, you can see these numbers with their labels in Figure 1.0. Digit labels are under each image.
Figure 1.0
Figure 1.1 shows the distribution of digits. As you can be seen, each digit has a different sample size.
Figure 1.1
We used a convolution neural network (CNN) for digit classification. Before the classification, we converted images to a two-dimensional array. Each image size was 28x28 and then, applied zero-padding the feature maps and each image size converted 32x32 dimensional array. The purpose of using the padding method is that the first layer is learnt nothing in the network. The input layer is built to take 32x32 dimensional and the dimensions of images are passed into the next layer and keep the 28x28 dimensional image. Moreover, the images normalized from 0 to 255. The reason for normalization is to ensure that the batch of images has a mean of 0 and a standard deviation of 1. The advantage of this is seen in the reduction in the amount of training time.
We used LeNet-5 CNN which is made up of 7 layers. The combinations consist of 3 convolutional layers, 2 subsampling layers and 2 fully connected layers. We used 32, 48, and 256 filters respectively for convolutional layers. The output layer was 10. We used adam optimizer and accuracy metric. For fitting the network model, we practised optimizer 32 rows of training data to do that 30 times through the dataset. Also, you can see the model summary and results in Figure 1.2 and Figure 1.3.
Figure 1.2
Figure 1.3
Lastly, we evaluated the model on the test data and gained a 99.43 percentage of success. The result is available in below Figure 1.4
Figure 1.4