/Automated-facial-recognition

On Identifying the characteristic features that will be stored for each subject performing SVD

Primary LanguageMATLAB

Automated-facial-recognition

Problem

Grayscale images of 15 subjects under 10 different conditions were obtained and are given in the file Dataset_Question1. Due to storage limitations, only one representative image can be stored for each subject in the database for future automated facial recognition purposes. we have to Perform SVD on all the images for a subject to identify characteristic features that will be stored for each subject. Only this information should be used in the future automated facial recognition tasks. In the report, please show the representative images of all the subjects. Given an image, the facial recognition method is based on the smallest norm between the image and the representative images in the database. Determine the number of images out of 150 that you are able to correctly identify based on this approach in terms of accuracy. MATLAB image processing functions or python image processing libraries are not to be used for this assignment.

Solution

Given dataset includes 15 subjects with 10 pictures each.

Steps :

Data Preprocessing

  1. The images of the subject were read and transformed into a 100 by 100-pixel intensity matrix each.
  2. This intensity matrix was then converted to a vector of length 10000 and stored as a row in another matrix ‘mat’.
  3. Each row in the matrix mat indicates the features of one picture of the subject, hence the size of the matrix mat is 10 x 10000.
  4. Each of the rows of the matrix mat is then normalized.

Computing svd

  1. The normalized matrix is then decomposed using svd to identify and obtain characteristic features for each subject. Singular value decomposition factorizes a matrix into U, S, and V . We take the first eigenvalue (largest) from S, and the first columns of U and V to obtain a rank-one matrix ‘representative’ = U(:,1)S(1)V(:,1) T . The first row of this matrix is taken as the representative feature vector of the subject.(since all the other rows are the multiples of this row) All the steps are repeated for each subject to obtain a representative feature vector.
  2. These feature vectors are stored in a matrix ‘image_features’ (15 x 10000), where each row indicates the features of one subject.
  3. These characteristic features are then used to get representative images by transforming each subject vector (1 x 10000) into a 100 x 100 matrix and then printing this matrix in an image form in the folder ‘representative images’. Testing Accuracy
  4. To test the algorithm’s performance, all the 150 pictures of the subjects are taken again as test cases.
  5. Each image is pre-processed as stated in data preprocessing to obtain a normalized feature vector.
  6. This vector is compared to the stored representative features of each subject and the norms are obtained. The subject which gives the minimum value of norm is stored to be the subject in the test case image.

Output An accuracy of 99.3333% is obtained with the used algorithm to identify 150 test case images. The representative images of all the subjects are given below