For this activity, we did pattern recognition using linear discriminant analysis (LDA). The patterns I used are the images shown in the previous activity. I also used the same features and method of determining the feature values. The images were also divided into two sets: training set and test set.
LDA can be used to classify patterns if the classes can be assumed to be linearly separable, i.e., classes can be separated by a linear combination of the features. Since three features of the pattern were used, the separator must be a plane.
In LDA, two variables are needed:
(1) dependent variable (y) which is the class of the pattern and
(2) independent variable (x) which is the feature of the pattern.
The size of y must be n x 1, where n is the total number of patterns. Moreover, x must be of size n x 3; 3 since there are three features. Same row in x and y represent one pattern. The diagram below shows the sequence of the necessary parameters needed to be calculated in LDA.

In evaluating f, all the variables except those with subscript T were calculated using the training set. The patterns were classified by first calculating f for all classes. It was then assigned to the class with the maximum f.
Tables 1 and 3 show the feature vectors of the patterns. Table 2 and 4 are summaries of the calculated f for all classes. The column of the highlighted f (red color) is the classification of the pattern. As you can see, LDA was also able to correctly assign all the patterns to their right classes (100%).
LDA can be used to classify patterns if the classes can be assumed to be linearly separable, i.e., classes can be separated by a linear combination of the features. Since three features of the pattern were used, the separator must be a plane.
In LDA, two variables are needed:
(1) dependent variable (y) which is the class of the pattern and
(2) independent variable (x) which is the feature of the pattern.
The size of y must be n x 1, where n is the total number of patterns. Moreover, x must be of size n x 3; 3 since there are three features. Same row in x and y represent one pattern. The diagram below shows the sequence of the necessary parameters needed to be calculated in LDA.

In evaluating f, all the variables except those with subscript T were calculated using the training set. The patterns were classified by first calculating f for all classes. It was then assigned to the class with the maximum f.
Tables 1 and 3 show the feature vectors of the patterns. Table 2 and 4 are summaries of the calculated f for all classes. The column of the highlighted f (red color) is the classification of the pattern. As you can see, LDA was also able to correctly assign all the patterns to their right classes (100%).


I give myself a grade of 10 for this activity.
No comments:
Post a Comment