Coder Social home page Coder Social logo

linecode / handwritten-digits-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hypjudy/handwritten-digits-recognition

0.0 2.0 0.0 2.44 MB

Automatically recognize handwritten digits from photos. Handwritten digits recognition by CNN and SVM.

License: MIT License

Python 100.00%

handwritten-digits-recognition's Introduction

Handwritten Digits Recognition

Automatically recognize handwritten digits from photos. Handwritten digits recognition by convolutional neural network and Support Vector Machine. Implement with Python, numpy and OpenCV.

For more details about the theory, implementation and results, please read my post (in chinese). Any feedback is welcomed!

Method

We can do this in three steps. Firstly, segment strings of digits into digits one by one. Then train models/classifiers by CNN with TensorFlow and SVM with scikit-learn framework. Lastly, test and get results.

To segment digit strings, firstly we need to detect and crop paper sheet in photo (please refer to A4-paper-sheet-detection-and-cropping). Secondly process image with binary conversion. Thirdly judge the handwritten direction to detect digit strings. Lastly segment digits in a digit string.

Results

Dividing MNIST dataset into training and testing set, the accuracy of SVM can be 0.9852 and the accuracy of CNN can be 0.992. When testing on my own handwritten digits dataset, the accuracy is lower (~0.7 for SVM and ~0.9 for CNN).

Data Number 0 1 3 4 5+6+7 average
SVM accuracy 9 / 14 = 0.642857 8 / 17 = 0.470588 46 / 60 = 0.766667 28 / 39 = 0.717949 59 / 73 = 0.808219 150 / 203 = 0.738916
CNN accuracy 12 / 14 = 0.857143 10 / 17 = 0.588235 48 / 60 = 0.800000 32 / 39 = 0.820513 73 / 73 = 1.000000 175 / 203 = 0.862068

handwritten-digits-recognition's People

Contributors

hypjudy avatar

Watchers

 avatar  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.