Rhtyme / digit-recognition

An implementation of Neural Networks from scratch in python using only numpy for MNIST dataset .

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Digit Recognition

Getting started

  • Clone this repository https://github.com/bharathikannan1311/digit-recognition

Implementations

  1. Neural Network from Scratch - for better understanding of how neural network works.
  2. Tensorflow - the same problem solved using tensorflow.
  3. Tensorflowjs - Classifying digits in the browser.
  4. Tensorflowjs - Webcam - Classifying the sign from the webcam in the browser.

1. Neural Network from scratch

  • A simple implementation of Neural Network from scratch in python. It does not use any Deeplearning library like tensorflow and all of the functions are implemented from scratch only using numpy for better understanding of concepts and how Neural Networks work.

  • It will be much slower when compared to the same problem solved using tensorflow because we can use much better optimization techniques. This code can be used for learning purposes.

  • Here we will be using MNIST dataset for digit recognition.

  • Prerequisites

    • Numpy - Numerical scientific computing library.
    • Matplotlib - Plotting library.
    • Python-mnist - for loading mnist dataset
    • MNIST Dataset - Dataset for Digit Recognition
      • Create MNIST directory and download the dataset and store it in this directory.

This code is not as efficient and takes long time to converge and the same problem solved through tensorflow will be much efficient and we can use better optimization techniques and Convolutional Neural Networks are suitable for Image Datasets.

2. Tensorflow Implementation.

  • The same problem implemented in tensorflow with Convolutional Neural Networks and adam optimizer.

  • Prerequisites

  • It's accuracy on the mnist test set is about 98.9%.

Accuracy Plot

3. Tensorflowjs

  • Implemented using Tensorflowjs library.
  • It trains the model in the browser when launched and then it then classifies the digit that we draw in the browser.

Model Architecture


Perdictions


Loss and Accuracy

4. Tensorflowjs - Webcam

  • We need to train the model in the browser by taking sign pictures as input from the webcam as training data.
  • Then we can use our model to classify for new inputs.

Video demo - link

About

An implementation of Neural Networks from scratch in python using only numpy for MNIST dataset .


Languages

Language:Jupyter Notebook 94.1%Language:JavaScript 4.6%Language:HTML 1.4%