This project performs digit recognition using deep learning concepts. It can classify an image into 10 classes.We have built a Multilayer perceptron (MLP) model using most popular Google library Tensorflow to recognize handwritten digits.
A Multi Layer Perceptron is a feedforward neural network, which means that the data is transmitted from the input layer to the output layer in the forward direction.A perceptron is a single neuron model that was a precursor to larger neural networks. The Perceptron consists of an input layer and an output layer which are fully connected.MLPs have the same input and output layers but may have multiple hidden layers in between them.
The MNIST dataset is an acronym that stands for the Modified National Institute of Standards and Technology dataset.It is a dataset of 70,000 small square 28×28 pixel grayscale images of handwritten single digits between 0 and 9.In this project we have used it to classify a given image of a handwritten digit drawn on a canvas into one of 10 classes representing integer values from 0 to 9, inclusively.
- Splitting the data into training, testing and validation sets.
- Flattening the images and displaying it.
- Checking the number of instances for each digit.
- Plotting graphs and charts for easier understanding.
Deep learning model: After manually pre-processing the dataset, we come to the part where we use concepts of Multilayer perceptron to build and train a model that classifies the handwritten digits.The 10 classes of digits are 0,1,2,3,4,5,6,7,8,9.
-
This model used in Astro Numbers has been trained to detect 10 classes of objects: Numbers from 0-9 using deep learning on the MLP model.
-
It contains 2 hidden layers, 1 dense layer with 512 nodes (ReLU),1 dense layer with 64 nodes (ReLU) and a softmax layer with 10 output nodes using TensorFlow and its libraries.
-
The model is compiled using the adam optimizer and the categorical cross-entropy loss function will be optimized which is suitable for multi-class classification.We are monitoring the classification accuracy metric since we have the same number of examples in each of the 10 classes.
-
The final trained model resulted in an accuracy around 97.67% on the dataset with 70,000 images.
-
The model can be experimented , the user can provide the digit input to the canvas and the model will detect which number it is.
- Astro numbers help primary teachers to give the students a unique experience in solving maths problems.
- Works on a canvas providing an easy drawing interface.
- The web based application interface of Astro numbers uses a MLP model to classify the answers drawn by students.
- Assessment can be done by teachers and the final scores will appear on the screen.
-
pip install --upgrade pandas
-
pip install --upgrade matplotlib
-
pip install --upgrade seaborn
-
pip install --upgrade numpy
-
pip install --upgrade tensorflow
-
python -m http.server 8000
Astro-Numbers uses Tensorflow and Keras libraries to build a sequential model with 2 Conv2D
layers.
We use batch_normalization
at the end of every layer for higher accuracy. Activation relu
worked best for the dataset.
For the output layer, a dense
layer was used with softmax
activation.The tabular explanation of the same can be seen below.
The following is the validation and training loss of the above model.
As seen, there is very little noise in our model. This is due the fact that we have used the `adam` optimizer.
The following is the validation and training accuracy of the above model.
You can check out our website in the link given here: https://data-science-community-srm.github.io/Hand-Written-Digit-Classification-Recognition/index.html
Kruthi M |
Abhay Lal |
Jahnavi Darbhamulla |
Aryan Karoliwal |
Made with ❤️ by DS Community SRM