Real Time Digit Classifier

Abstract

Numbers are one of the first things taught to us in school or at home, but the computer is not lucky enough to have a home or go to school.

So, it relies on us to teach it things, even the basics like recognizing digits.

The techniques and algorithms used in training a machine to do specific tasks are grouped under a subject called Machine Learning and Neural Networks.

Approaches Employed

Single Layer Perceptron

The first approach was a naive one and used just a single layer of 10 Nodes that took all the pixels as individual inputs and gave a prediction using a simple Soft Max activation function.
The optimization algorithm used was Gradient Descent along with Gaussian Initialization

The accuracy achieved was :
Up to 91.32% on training set
Up to 91.68% on test set

For
Learning Rate = 0.1
Number of Iterations = 1000

Multi Layer Perceptron

The second approach employed by us was a Deep Neural Network with varying number of hidden layers, from 2 to 4. Every hidden layer is made up of an arbitrary number of nodes (here 150-600).
The hidden layers use a ReLU activation function.
The hidden layers are followed by an output layer which consists of 10 Nodes using SoftMax activation function.

The optimization algorithm used was Gradient Descent along with Gaussian Initialization

The accuracy achieved was :
Up to 97.65% on training set
Up to 97.03% on test set

For
Learning Rate = 0.3
Iterations = 2000

Convolutional Neural Network

The ultimate and the most effective architecture was a Convolutional Neural Network using 2 Convolution layersand 2 Fully connected layers.
The convolution layers first apply convolution using a 3×3 kernel and then apply Max Pooling to reduce the number of features while extracting the important ones.
The first FCL has 1000 Nodes and uses ReLU activation followed by the output layer with 10 Nodes using SoftMaxactivation
The optimization algorithm used was Adam Optimizationalong with Gaussian Initialization

The accuracy achieved was :
Up to 99.22% on training set
Up to 98.94% on test set

With
Learning Rate = 0.001
Number of Epochs = 5
Batch Size = 128

Demonstration

http://www.youtube.com/embed/SCYhVTUIdoo?wmode=opaque

How did we do it?

 ​The question is, how did the computer do it?

  • First it captured the live feed frame by frame
  • Along with that it followed the center of the cap so as to record the drawn digit
  • The digit was simultaneously drawn in Black and White.
  • The B/W image was then passed to the trained Neural Network and the result was printed out 

What we Learnt

  • Concepts of Machine Learning and their implementation
  • Deep Neural Networks and their architectures
  • Developing Deep Networks from scratch
  • Advantages and applications of optimization algorithms
  • Convolutional Neural Networks and their applications
  • Basics of Image Processing using OpenCV
  • Features and limitations of various Python libraries like NumPy, PyTorch and Pandas.

Team Members

  • Ritik Agrawal
  • Rishika Bhagwatkar
  • Yogesh Govindani
  • Jayesh Kandpal
  • Sushant Kumar
  • Sayan Chakraborty
  • Shreyash Waghe
  • Dhruv Sharma
  • Khurshed P. Fitter

Mentors