Giter Club home page Giter Club logo

handwritten-digit-classification-using-svd's Introduction

Handwritten-digit-classification-using-SVD

Handwritten digit classification using singular value decomposition in matlab.

Acknowledgments

This was homework on subject Introduction to complex data search at the Faculty of Science in Zagreb done together with colleague Zadravec.

Dataset

In this project we use handwritten digits from the US Postal Service database to test the performance of our algorithm. The digits are represented by gray scale pixel images. Samples are show here: Samples of handwritten digits

azip

In azip are all train samples. The dimension of each image isn't 16 x 16 matrix rather a vector 256 x 1. So when we load all train data in one matrix, the dimensions of that matrix are 256 x number of samples, where each colum is one digit 0-9.

dzip

Is vector of dimensions 1 x number_of_samples where each "colum" is number from 0 to 9 witch tell us what is on image at that colum in azip

Idea

Algoritam starts with creation of matrix (let's call it B for whatever reason) B of all samples of one digit. The idea is to use Eckart–Young–Mirsky–Schmidt theorem, that is to approximate matrix B by a lower-ranking matrix. Now do that with every digit so we get 10 matrices. When we get new image we just look at projection on this 10 "spaces" and see which one is the closes to new image.

Determine low rank

To determine what low rank to choose lets look at singular values of matrix rank 100: 100 singular values Now if we select k (low rank) equal to 41 we will have matrix almost half rank smaller and error of only 10^-5. We used the same method to determine our k and came up with k = 22.

Results

When we run our code on test data with 2007 samples we get accuracy of 93%

handwritten-digit-classification-using-svd's People

Contributors

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