imdeep2905 / Digit-Recognizer

This is a little project which implements ML model (trained on "Hello World of ML" - MNIST Digit Dataset) in real life.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Digit-Recognizer

Demo

Contents

  1. Introduction
  2. How to run
  3. For ML nerds
  4. Credits

Introduction

This is a little project which implements ML model (trained on "Hello World of ML" - MNIST Digit Dataset) in real life. You can hand draw digit in GUI, Browse an exsisting image and open your webcam and capture digit. Although model is really unstable with noisy images.(Maybe i'll try to improve it in future.)
Some screenshots of Digit Recognizer:
Main Screen
Main Screen2
Main Screen3

How to run

  1. Fulfill requirements.txt (i.e. pip install -r requirements.txt).
  2. Run with command python main.py.

For all ML nerds

For all the ML nerds out there model was trained on following architecture:

model = keras.models.Sequential([
keras.layers.Conv2D(64, (2, 2), padding = 'same' , activation = 'elu', input_shape = [28, 28, 1]),
keras.layers.MaxPooling2D(2),
keras.layers.Conv2D(128, (3, 3), padding = "same", activation = "elu"),
keras.layers.Conv2D(256, (4, 4), padding = "same", activation = "elu"),
keras.layers.Dropout(0.5),
keras.layers.MaxPooling2D(2),
keras.layers.Flatten(),
keras.layers.Dense(128, activation = "elu"),
keras.layers.Dropout(0.25),
keras.layers.Dense(10, activation = "softmax")
])

model.compile(loss = "sparse_categorical_crossentropy", metrics = ["accuracy"], optimizer = keras.optimizers.SGD(lr = 0.08))

It's accuracy was around 0.99 on training data and 0.95-0.97(not sure) on testing data.
At last you can load pretrained model (model.h5) and play with it.

Credits

Contributors 💻 :

Without these excellant libraries ❤️ this would not have been possible.

  • tensorflow
  • pillow
  • opencv-python
  • numpy

About

This is a little project which implements ML model (trained on "Hello World of ML" - MNIST Digit Dataset) in real life.

License:MIT License


Languages

Language:Python 100.0%