# Towards Facial Biometrics for ID Document Validation in Mobile Devices
## 3 Materials and Methods
### Facial Biometric Template  
In our investigation, we focus on the search for a method for facial description which is optimized for encoding into MRC and embedding into mobile devices. We combine our facial biometric template from several types of discriminative features which include information about face geometry and texture. The process of extracting features from the frontal face image starts with the applying active appearance model and detecting facial landmarks (Figure 2). We employ the standard appearance model that includes 68 facial landmarks and entirely specifies face semantic regions to be further processing by the algorithm. The coordinates of the detected set of landmarks carry all discriminative geometric information given by the chosen model. However, due to the uncertainty of face parameters (e.g., size or pose) on the source image, these raw data cannot be directly used for making biometric comparisons and require some normalization procedure. To achieve that, we define some fixed set of landmarks that serves as a reference for alignment. In that case, if two sets of landmarks from different arbitrary face images are aligned to the defined supporting set, they also become aligned to each other. In our work, we choose this supporting set by extracting facial landmarks from averaged face image in Figure 2.  
The alignment of the input set of points \(\{x_{i},y_{i}\}\) with the supporting set, is implemented as a coordinate transformation to \(\{x^{\prime}_{i},y^{\prime}_{i}\}\) by rotating, scaling and shifting operations, defined by Equation (1). The \(\alpha\) rotation is determined to achieve the horizontal face pose. Scaling is performed by the relation of values of face contour perimeters (\(P_{sup}\) corresponds to the supporting set and \(P\) to the input set), which is the selection of points with indices in the range [0-26] (depicted with blue color in Figure 2). The shift \(S(s_{x},s_{y})\) is defined as the difference between the centers of supporting and scaled input sets of points. \[ \begin{bmatrix}x^{\prime}_{j}\\ y^{\prime}_{i}\end{bmatrix} =\frac{P_{sup}}{P}* \begin{bmatrix}cos(\alpha)&-sin( \alpha)\\ sin(\alpha)&cos(\alpha)\end{bmatrix} * \begin{bmatrix}x_{i}\\ y_{i}\end{bmatrix} + \begin{bmatrix}s_{x}\\ s_{y}\end{bmatrix}  \tag{1}\]  
A facial biometric template for two aligned sets of landmarks is composed as a result of element-wise subtraction of their coordinates. However, the result values signify some  
Figure 2: The process of extracting facial biometric template from the input face image. pixel distance between coordinates and thus depend on the image characteristics. To avoid that, we normalize the template elements to the constant perimeter \(P_{sup}\). Due to the parameters of the employed active appearance model, the resultant descriptor includes 136 values. Many other geometry-based descriptor implementations usually consider subsets on the landmarks or rely on hand-crafted features which are manually designed by selecting special relations within the active appearance model. Our implementation retains the geometric data in its entirety and gives a profound geometric description. However, the impact of discriminative power for different template elements is not equal and requires proper analysis or weighting which we achieve by learning methods. To increase the template robustness against specific biometric distortion attacks (e.g., when the fake face image is warped to fit the geometry of the original image), texture features are also included in it. The texture descriptor in our method is based on the combined usage of HOG and LBP techniques. In order to define the image regions from which the features are extracted, we perform the segmentation of aligned input face image by ten characteristic semantic sections. The contours of the sections are depicted in Figure 2. The particular choice of the region's borders is based on intensive experiments of searching for a better selection.