Recognizing Handwritten Digits

Hand-written digit recognition using scikit-learn library SVC

DESCRIBTION OF DATASET:

        Data Set Characteristics:


                   :Number of Instances: 5620

                   :Number of Attributes: 64

                   :Attribute Information: 8x8 image of integer pixels in the range 0..16.

                   :Missing Attribute Values: None

                   :Creator: E. Alpaydin (alpaydin '@' boun.edu.tr) 

                   :Date: July; 1998 


The data set contains images of hand-written digits: 10 classes where

each class refers to a digit.


Preprocessing programs made available by NIST were used to extract

normalized bitmaps of handwritten digits from a preprinted form. From a

total of 43 people, 30 contributed to the training set and different 13

to the test set. 32x32 bitmaps are divided into nonoverlapping blocks of

4x4 and the number of on pixels are counted in each block. This generates

an input matrix of 8x8 where each element is an integer in the range

0..16. This reduces dimensionality and gives invariance to small

distortions.




Example of a first digit in array form:

array([[ 0.,  0.,  5., 13.,  9.,  1.,  0.,  0.],
       [ 0.,  0., 13., 15., 10., 15.,  5.,  0.],
       [ 0.,  3., 15.,  2.,  0., 11.,  8.,  0.],
       [ 0.,  4., 12.,  0.,  0.,  8.,  8.,  0.],
       [ 0.,  5.,  8.,  0.,  0.,  9.,  8.,  0.],
       [ 0.,  4., 11.,  0.,  1., 12.,  7.,  0.],
       [ 0.,  2., 14.,  5., 10., 12.,  0.,  0.],
       [ 0.,  0.,  6., 13., 10.,  0.,  0.,  0.]])



Visualising  the first digit using Matplotlib :





Visualising the random 6 digit :







Prediction and their output

1.

svc.predict(digits.data[1791:1796])

array([4, 9, 0, 8, 9])

digits.target[1791:1796]

array([4, 9, 0, 8, 9])

2.
svc.predict(digits.data[1666:1681])
array([8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3])

digits.target[1666:1681]
array([8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3])

3.

svc.predict(digits.data[16:25])

array([6, 7, 8, 9, 0, 1, 2, 3, 4])


digits.target[0:25]
array([6, 7, 8, 9, 0, 1, 2, 3, 4])



CONCLUSION :


As per our results through above prediction that  Support vector mechanism has the highest accuracy in the Hand-written-digit recognition using Scikit-learn library


























































Comments