# Finger-Vein Verification Based on LSTM Recurrent Neural Networks
## 2 The Proposed Approach
### Supervised Feature Encoding  
In this section, we propose a scheme to obtain the threshold for vein feature encoding. After applying SCNN-LSTM for all pixels, an enhancing vein image is obtained and then we encode it for matching. In existing works [3, 13, 14, 15, 27, 33, 43], the vein patterns are encoded by one or more thresholds. For example, the probability of 0.5 is employed to obtain vein patterns in [33]. In [3], the vein image is enhanced by Gabor and then subject to binarzition using threshold of 0. In the classic repeated line tracking approach [24], two global thresholds (i.e., 85 and 175) are used to divide a image into three regions for matching. Some curvature-based approaches [14, 15, 23] enhanced vein patterns by computing the curvature of all pixels and an empirical threshold is employed to encode resulting enhancement image. For the finger-vein verification, the primary target of feature encoding is to improve performance, mainly verification error rates. However, the approaches determine the threshold based on human perception instead of minimizing the verification error, so the resulting binary code (vein texture features) may not be robust for finger-vein verification. To overcome this problem, in this section, a supervised scheme is proposed to encode vein pattern. Our approach decides the threshold by maximizing the distance between intra-class score set and inter-class score set computed from a training set, such that the resulting threshold is directly related to verification performance. The robust thresholds \(T\) are computed as follows. Assume that there are \(N\) classes in the training set and each class provides \(M\) samples. Using the proposed SCNN-LSTM model (Figure 5), all finger-vein images are enhanced and we denote the \(m\)th enhancement image in the \(n\)th class as \(x_{m,n}\), where \(m=1,2,...,M\) and \(n=1,2,...N\). We aim to find a function to map and quantize each enhancement image into a binary image \(b_{m,n}\in\{0,1\}^{l\times l}\) which encodes a more discriminative information for verification error minimization. In our work, the binary code (vein texture pattern) \(b_{m,n}\) of \(x_{m,n}\) is computed by  
\[b_{m,n}=0.5\times(sgn(x_{m,n}-T)+1) \tag{13}\]  
where \(sgn(z)\) is equal to \(-1\) if \(z\leq 0\) and \(1\) otherwise and \(T\in[0\quad 1]\) is a parameter which is determined as follows. Based on the Equation (13), all training samples are mapped into Hamming space, so a Hamming distance in [47] is employed to match two images for verification. We match the binary codes from same class to generate intra-class scores while the inter-class scores are produced by matching the binary codes from different class. So there are \(a_{1}=N\times C_{2}^{M}\) genuine matching scores \(\Omega_{1}=\{d_{1}(T),d_{2}(T),...,d_{a_{1}}(T)\}\) and \(a_{2}=N\times(N-1)\times M\times M/2\) impostor scores \(\Omega_{2}=\{d_{1}^{\prime}(T),d_{2}^{\prime}(T),...,d_{a_{2}}^{\prime}(T)\}\). To make \(b_{m,n}\) discriminative, we enforce an important criterion to encode the enhancement images that the resulting binary codes should maximize the distance between two sets \(\Omega_{1}\) and \(\Omega_{2}\). Therefore, we formulate the following optimization objective function:  
\[\max_{T}J(T)=\frac{|u_{1}(T)-u_{2}(T)|}{D_{1}(T)+D_{2}(T)} \tag{14}\]  
where \(|\cdot|\) represents the absolute value. \(u_{1}(T)\) and \(u_{2}(T)\) are the means of the scores in \(\Omega_{1}\) and \(\Omega_{2}\), and \(D_{1}(T)\) and \(D_{2}(T)\) are the variances of the scores in the sets \(\Omega_{1}\) and \(\Omega_{2}\)  
To facilitate to search the threshold \(T\), all enhancement images are converted to gray-scale images with integer values between 0 and 255. The parameter \(T\) is assigned from 0 to 255 to transform the enhancement image into a binary code map according to Equation (13). So, 256 different values \(J(T)\) (\(T=1,2,...,256\)) are computed using Equation (14). The parameter \(T_{*}\), which can maximize Equation (14), are selected to encode the vein pattern.