Coder Social home page Coder Social logo

computing-mathemtical-equations-using-visual-input's Introduction

Digit Classification using Logistic Regression and CNN

This is a project focusing on the classification of digits from 0-9 using Logistic Regression and Convolutional Neural Network. The trained model is used to predict digits drawn on the captured frames from the webcam using object tracking.

Getting Started

Built with

The Logistic Regression is implemented using numpy and softmax function is used for multiclass classification. The Convolutional Neural Network uses Keras API with tensorflow as backend.

Pretrained weights

Training examples = 8000, Test examples = 1000

Logistic Regression

Train accuracy = 92.1%, Test accuracy = 91.3%, learning rate = 0.1

CNN Model

Train accuracy = 98.1%, Test accuracy = 96.2%, no. of epochs = 8

(Feel free to train the models on your own.)

Prerequisites

Install Conda to resolve all requirements of python related dependencies.

Usage

Files usage

  • LRmodel.py : Logistic Regression implemented using numpy
  • conv_network.py : CNN model implemented using Keras API
  • digit_recognizer.py : File to either train or load saved weights
  • camera_pred.py : Used to test the models using webcam

Training the models

To Train the models on your own, delete the weights folder and run digit_recognizer.py

python digit_recognizer.py

(If any of the files in weights folder is not present, the models will be trained again.)

Testing using Camera

Run camera_pred.py (Use a green colored object to draw digit inside the red box).

python camera_pred.py

Press c to clear the box.

computing-mathemtical-equations-using-visual-input's People

Contributors

dhruv-vora avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.