Role of Distance Measures in Approximate String Matching Algorithms for Face Recognition System

. This paper is based on the recognition of faces using string matching.The approximate string matching is a method for finding an approximate match of a pattern within a string. Exact matching is impracticable for a larger amount of data as it involves more time. Those issues can be solved by finding anapproximate match rather than an exact match. This paper aims to experiment with the performance of approximation string matching approaches usingvarious distance measures such as Edit distance, Longest Common Subsequence (LCSS), Hamming distance, Jaro distance, and Jaro-Winkler distance. The algorithms generate a near-optimal solution to face recognition system with reduced computational complexity. This paper deals with the conversion of face images into strings, matching those image strings by using the approximation string matching algorithm that determines the distance and classifies a face image based on the minimum distance. Experiments have been performed with FEI and ORL face databases for the evaluation of approximation string matching algorithms and the results demonstrate theutility of distance measures for the face recognition system.


Introduction
Face recognition is the identification or verification of a person's face from a database of different person's faces [1].Nowadays, face recognition has become a widely used application in mobile phones, and robotics, and security systems.It hasalso received attention in applications such as surveillance, human-computer interaction, access control,a criminal investigation, border control, and smart cars.Certain applications such as text searching, DNA subsequence searching, and signal processing and object recognition require faster and near-optimal solutions.Face recognition is also one such application that may require a near-optimal and faster solution.
Several face recognition approaches deal with controlled face recognition [2][3][4][5][6][7][8], but only a few approaches address the face recognition under uncontrolled conditions include partial occlusion, pose changes, illumination changes, and expression changes [9][10][11].Uncontrollable face recognition is a difficult and challenging task.An efficient face recognition system should address those conditions.
String matching [12] is a high level structural and syntactic technique for finding similarity between two strings.In other words, a string matching algorithm finds the location of a certain pattern in a larger amount of text or string.The applications of string matching include search engines, object recognition, speech recognition, Information retrieval systems, and molecular biology.
An approximation algorithm [13] is designed to solve optimization problems in polynomial time.A method based on approximation yields a near-optimal solution with a guarantee on the solution's quality.An approximation algorithm for string matching [14,15] is designed for determining strings that match a pattern approximately instead of exactly.
In this paper, the face recognition problem is modeled as the optimization problem since the approximation algorithm tries to find the distances between the test face image and all the database face images and select the minimum of those distances.Thus, the algorithm performs image matching based on the minimum distance obtained which becomes a minimization problem and any minimization or maximization problem is considered as the optimization problem.The overall goal of the work presented in this paper is to handle the challenges in the uncontrolled face recognition with different distance measures using approximation matching algorithms.
The rest of the paper is ordered as follows.Section 2 presents literature work on face recognition techniques, the methodology is described in section 3, the experimental results are discussed in section 4, and the last section gives the conclusion of the paper.

Related Work
Conventional methods for face recognition such as PCA (principal component analysis) [2,3], LDA (linear discriminant analysis) [4,5], ICA (independent component analysis) [6], and HMM [7] perform face recognition under controlled conditions.These methods do not perform well when there are uncontrolled conditions such as lighting, pose, expression variations, and occlusion.The different approaches that deal with the face recognition under uncontrolled conditions include SRC (Sparse representation-based classification) [20], SRC-MRF (SRC with Markov random fields) [21],HQM (half quadratic with multiplicative form) [22], Virtual samples and SRC based algorithm [23] and GSR (group sparse representation-based) [24].The computational cost of these sparse representation based approaches is more and require a larger number of training samples.Local feature matching face recognition methods such as metric learned extended robust point set matching [25], dynamic image-to-classwarping for face recognition [26] handles uncontrolled face recognition using local features such as image patches.
The research towards face recognition using string matching is very less.One of the related work is an ensemble string matching [27], performs string-to-string matching for the recognition of faces.The human face profile [28] is another work based on representing a face as a sequence of strings.
The latest research face recognition systems based on deep learning [29][30][31][32][33] are succeeded for controlled face recognition, butnot producing successful results in uncontrolled conditions.The algorithms presented in this paper make use of different string distance measures for performing face recognition and yield a good recognition rate in case of face recognition application.In the clustering phase, aclustering algorithm is applied on patch vectors to group related patch vectors to the same cluster.Clustering associates each patch vector with a cluster label.There are several clustering algorithms for clustering the data.In this work, K-means clustering is used.In the generation of string phase, a string fora database image is formed by the sequence of cluster labels assigned to patch vectors of a database image.A test mage is also split into a smaller number of patches.Test and database image patch vectors are compared by finding the local distance between them.Cluster label of the database image patch vector \with minimum local distance is obtained and cluster labels with a minimum local distance taken in sequence produce a string for atest image.String generation algorithm is presented in the previous work [34].Fig. 2 shows a sample face image and its corresponding string which is a sequence of cluster labels assigned to patches of the image, the length of the string is 64 which is equal to the number of patches in that image.
In the matching phase, the approximated string matching algorithm is applied to compute the distance between the test and the database image strings and to classify the test image based on the minimum distance computed.The algorithm performs classification in addition to the matching of face images.Thus, the approximation algorithm using distance measures for face image matching does not require any classifier.Hence the complexity of the system is less.

Approximate string matching algorithm based on Dynamic Edit Distance
This is also known asLevenshtein distance, which counts the number of dissimilarities between two strings [15].The Edit distance between two stringss 1 and s 2 is Ed (s 1 , s 2 ), defined as the least number of operations required to transform s 1 into s 2 .The operations are transformation (substitution), insertion, and deletion.Two strings s 1 ="appreciate" and s 2 ="approximate", the edit distance between s 1 and s 2 is 3 since it requires 2 substitutions and 1 insertion to transform s 1 into s 2 .This is shown in Fig. 3. ED (i,j)= ED(i-1,j-1); else ED(i,j) =min{ED(i-1,j-1)+1,ED(i-1,j)+1,ED(i,j-1)+1}; end if end for end for Edit_dist= ED (n,m); returnEdit_dist; In algorithm1, T and D are test and database face image strings.String element of T is compared with the string element of D if matches EDIT distance is set to 0, otherwise, it is set to a minimum of insert, delete, and substitute operation costs.The time complexity of the EDIT distance algorithm is O (mn), where mis a length of database image string and nis the length of the test image string.

Approximate string matching algorithm based on Dynamic LCSS Distance
It is a measure of similarity between two strings, which is determined by finding common substrings between them [16].The pattern is said to match a certain string in a string sequence if the pattern has the maximum number of similarities with that string compared to other strings.In the Longest common subsequence algorithm, the goal is to produce their longest common subsequence: the longest sequence of characters that appear left-to-right order in both the strings.Two string sequences s 1 =a 1 a 2 ---a p and s 2 =b 1 b 2 ---b q of lengths p and q respectively, The Longest common subsequence problem computes the length of the largest string that is common to two sequences s 1 and s 2 .LCSS for string matching is implemented through dynamic programming.For example, X= PQPRQNQP and Y=QRRMNQPR.The LCSS of X and Y is QRNQP with length 5. Fig. 4 describes this example.LCSS_dist: the longest common sub sequence distance between test and database images; Set each element in LC to 0 LC [:,0] = 0; LC[0,:] = 0; fori = 1 to n do for j = 1 to m do if (T(i-1) = = D(j-1)) LC (i,j) =LC (i-1,j-1)+1; else LC(i,j)= max {LC(i-1,j-1),LC(i-1,j),LC(i,j-1)}; end if end for end for LCSS_dist = LC (n,m); returnLCSS_dist; In algorithm2, the String element of T is compared with the string element of D, if they are equal LCSS distance is set to diagonal element cost plus 1,otherwise, it is set to a maximum of up, down, and diagonal element costs.If m, n are the lengths of database and test image strings, then the complexity of the LCSS algorithm is O(mn).

Approximate string matching algorithm based on Hamming Distance
For two similar-length strings X and Y, Hamming distanceis the number of character positions at which the corresponding characters in strings are different [17].Hamming distance determines the least number of replacements or the least number of errors required for transforming a string into anotherstring.The main applications of the hamming code include coding theory and error detection/ correction.For example, given two input strings,s 1 and s 2 Hamming distance is Hd (s 1 , s 2 ).If s 1 ="mouse" and s 2 = "mouth", then Hd (s 1 , s 2 )= 2. The following algorithm is used to calculate the hamming distance between two strings.In algorithm3, if the test image string element (T (i)) does not match with the database image string element (D (j)), then the hamming distance is set to the substitution operation cost plus 1.The final hamming distance is based on the number of substitutions or replacements.The time complexity of the hamming distance is O (n),where n is the length of the database as well as test image strings.

Approximate string matching algorithm based on Jaro Distance
Jaro similarity measure between two strings is determined based on common characters and character transpositions [18].The maximum Jaro distance results in more similarity between strings.Jaro distance is a normalized score with value 0 for no match and 1 for the correct match.This distance is computed in two steps; the first is the matching and the second is the transposition.Matching.In this, a score is computed based on the common character occurrences in the strings.The algorithm finds the common characters in two strings within a specified match range around the character's position in the first string with the consideration of unmatched characters in the second string.If s 1 and s 2 are the two strings, then the match range is computed using the following equation.
Transposing.This evaluates the characters in the first string that do not match with the character at the same position in the second string.The transposition score is obtained by dividing this result by 2. The Jaro distance Jaro(i,j) between 2 strings s 1 and s 2 is Here ݉_ܿ is the total number of matches T is half of the total transpositions n, m are the lengths of two strings.The strings s 1 and s 2 have two characters that match when they are the same and not beyond the match range which is equal to max (n, m)/2-1.In all the algorithms, a patch size of 8 × 8 pixels is used,the face images are resized to 64 × 64 pixels and the total number of patches in each image 64 and the number of cluster centers (value of K) is chosen to be the nearest value equal to the number of patches in an image.By empirical observation, the number of clusters is fixed to 70 which has given a good performance.

Conclusion and Future Work
In this work, Face recognition is addressed using approximate string matching algorithms using different distance measures such as EDIT, LCSS, hamming, and Jaro.String sequences for the faces are generated and approximated string-based distance is calculated.The string algorithms find the minimum matching path based on the minimum distance and finally, classifies the input face image.The approximation string matching using edit distance yields better results over the other distance metrics such as LCSS, Hamming, Jaro, and Jaro-Winkler for the face recognition system.This work can be used in security, forensic, and other applications.The work presented in this paper concludes that syntactic string approaches perform well for face recognition applications.

Table 1 .
Face recognition using the approximation string matching algorithms for the FEI database