Friday, October 14, 2011

Pattern Recognition

Objects can be classified into a group/class in which they share almost the same features. To be able to classify an object belonging to one class, we must be able to extract certain features from it and compare this with a database of features of different classes. The features must be easily quantified. Comparison can be made using the minimum distance classification.

First, we compute for the mean features of a class by taking 5 images of objects belonging to one class and extracting features from it. The mean feature vector of a class is the matrix containing the average of the quantified features for the class.

I used four different objects (that is, four classes) with 5 training samples and 5 test samples.

 
Training sets for the coin, post, card, and leaf classes.
 From these, I extracted 7 features: the area from the binarized image, the means of the red layer, green layer, and blue layer, and the standard deviations of the red layer, green layer, and blue layer. Each feature was normalized to the maximum value for that feature from all the training images so that all features are equally considered. If it were not so, the standard deviations would not count at all compared to the pixel area of the images. We can now compute the mean feature vector from each class.

So now we examine different objects and classify them by determining the mean feature vector it is nearest to. 

Test objects.

 We can use the Euclidean distance


to determine the class. x is the feature vector of the test sample and m is the mean feature vector. The results are shown below. Each row indicates the test object and each column indicates the mean feature vector for the four classes. The values are the distances computed using the equation for the Euclidean distance. The minimum distance for each row would indicate the class to where the object belongs (highlighted in yellow). 

Everything was classified correctly yay! :D







___________________________________________________________________________
I'm giving myself a 10 for 100% correct classification. :D

No comments:

Post a Comment