# DTFA-Net: Dynamic and Texture Features Fusion Attention Network for Face Antispoofing

Authors: Xin Cheng; Hongfei Wang; Jingmei Zhou; Hui Chang; Xiangmo Zhao; Yilin Jia
Journal: Complexity
 (2020)

---

## Abstract

For face recognition systems, liveness detection can effectively avoid illegal fraud and improve the safety of face recognition systems. Common face attacks include photo printing and video replay attacks. This paper studied the differences between photos, videos, and real faces in static texture and motion information and proposed a living detection structure based on feature fusion and attention mechanism, Dynamic and Texture Fusion Attention Network (DTFA-Net). We proposed a dynamic information fusion structure of an interchannel attention block to fuse the magnitude and direction of optical flow to extract facial motion features. In addition, for the face detection failure of HOG algorithm under complex illumination, we proposed an improved Gamma image preprocessing algorithm, which effectively improved the face detection ability. We conducted experiments on the CASIA-MFSD and Replay Attack Databases. According to experiments, the DTFA-Net proposed in this paper achieved 6.9% EER on CASIA and 2.2% HTER on Replay Attack that was comparable to other methods.


---

## Body

## 1. Introduction

With the application of face recognition technology in the identification scene such as access security check and face payment, the methods of attack and fraud against face recognition system also appear. Face is obviously a much easier way to steal identity information than biometric features such as iris and fingerprints. Attackers can easily steal images or videos of legitimate users on social networking sites and then launching print or replay attacks on face recognition systems. Some face verification systems use techniques such as face tracking to locate key points on the face, requiring users to complete actions such as blinking, shaking their heads, and reading text aloud and use motion detection to determine whether the current image is a real face. This approach is not suitable for silent detection scenarios. In addition, some researchers use infrared camera, depth camera, and other sensors to collect different modes of face images to achieve living detection [1–3]. These methods show excellent performance in many scenarios but need to add information acquisition equipment other than camera to face recognition devices, need to invest additional hardware costs, and cannot meet the requirements of some mobile devices. In this paper, we will study the monocular static and silent living detection and achieve the living detection task by analyzing the difference between real face and fake face in image texture, facial structure, action change, and so on.Real face image is often taken directly by the camera, while attacking face images are collected many times. As shown in Figure1, false face images may show the texture of the image carrier itself, and the light region with large difference from the real face image is also easy to appear in the false face image. According to this, researchers proposed many feature descriptors for characterizing the living texture of face and then implemented the classification by training models such as SVM and LDA classifier. In order to characterize the high semantic features of face living body, the deep neural network is applied in the feature extraction process to further enhance the performance of living detection. The features included in the local area of the face can often be used as an important basis for living detection and play a different role, as shown in Figure 2. Based on this, some researchers [4, 5] decomposed faces into different regions to extract features through neural networks and then realize feature splicing.Figure 1
Face print and replay attack images. The face attacked has been collected many times, showing the difference between texture feature, light, image quality, and real face.Figure 2
Weights visualization of a layer in a depth neural network for real face texture information extraction. Different face regions occupy different weights in living detection task.Most prosthetic faces are difficult to simulate the vital signs of real faces, such as head movement, lip peristalsis, and blinking. At the same time, due to background noise, skin texture, and other factors, the dynamic characteristics of real face in some frequency bands are obviously higher than that of fraudulent face, which provides the basis for distinguishing real face from fraudulent face. The variation in optical flow field is an important basis of this kind of algorithm. However, the dynamic information generated by movement and bending of photo will influence the extraction of life signals. Remote photoplethysmography (rPPG) is another effective noncontact living signal extraction method, which provides a basis for face living detection by observing face images to calculate the changes in blood flow and flow rate [6, 7], but the rPPG method has strict requirements for algorithm application environment.This work proposed a network that fuses dynamic and texture information to represent face and detect the attacks. Optical flow method is used to calculate the motion change in two adjacent frames of face images. The optical flow generated by the bending and movement of the photo is different from the optical flow generated by the movement of the real face in the direction of displacement. We use a simple convolutional neural network with the same structure to characterize the magnitude and direction of displacement. Then, a feature fusion module is designed for the combination of the above two representations so that, on this basis, facial motion features can be further extracted. In addition, RGB images are used to extract texture information of the face area. By giving a different attention to the parts of the face, we enhance the network’s ability to represent living faces.Face detection algorithms are widely used in living body detection tasks, which can be used to locate faces, thereby eliminating the interference of background information on living body detection. In this paper, for face detection scenes under complex lighting, we propose an improved image preprocessing algorithm combined with local contrast in the face area, which effectively improves the performance of the face detection algorithm.


## 2. Relating Works

### 2.1. Texture based

Living verification is completed by using the difference between real face and replay image in surface texture, 3D structure, image quality, and so on. Boulkenafet et al. [8] analyzed the chroma and brightness difference between real and false face images, it is based on the color local binary pattern, and the feature histogram of each order image frequency band was extracted as the face texture representation. Finally, the classification was realized by support vector machine, and testing on the Replay Attack Dataset obtained the half error rate; it is 2.9%. Galbally et al. [9] prove that the image quality loss value produced by Gaussian filtering can distinguish the truth effectively with fraudulent face images, designed a quality assessment vector containing 14 indicators, and proposed a live detection method, the method in combination with LDA (linear discriminant analysis), and obtained 15.2% half error rate on the Replay Attack Dataset. However, such methods based on static feature often require the design of specific descriptors for a certain types of attacks, and the robustness is poor under different light conditions and different fraud carriers [10].


### 2.2. Dynamic Based

Some researchers have proposed a face living detection algorithm based on dynamic features by analyzing face motion patterns and show good performance in related datasets [11]. Kim et al. [12] designed a local velocity pattern for the estimation of the speed of light and distinguished the fraud from the real face according to the difference in the diffusion speed between the light on the real face and the fraud carrier surface. A 12.50% half error rate was obtained on the Replay Attack Dataset. Bharadwaj et al. [13] amplify the blink signal which is 0.2–0.5 Hz in the image by the Eulerian motion amplification algorithm, combined with local binary pattern with directional flow histogram (LBP-HOOF) to extract dynamic features as classification basis and obtained error rate which is 1.25% on the Replay Attack Dataset. At the same time, they proved the positive effect of image amplification algorithm on the performance of the algorithm. Freitas et al. [14] learned from the facial expression detection method, extracted feature histograms from the orthogonal plane of time-spatial domain by using LBP-TOP operator, used support vector machine to classify, and got 7.6% half error rate on Replay Attack Dataset. Xiaoguang et al. [15] based on the action information between adjacent frames established a CNN-LSTM network model, used convolutional neural network to extract the texture features of adjacent frame face images, and then input it to the long- and short-term memory structure to learn the time-domain action information in face video.In addition, some researchers combined different detection equipments or system modules to fuse information on different levels, which effectively increased the accuracy of living detection [1, 16]. Zhang and Wang [17] used Intel RealSense SR300 camera to construct multimodal face image database including RGB image, depth image (depth), and infrared image (IR). The face region was accurately located using face 3D reconstruction network PRNet [18] and mask operation and then based on ResNet 18 classification [19] network to extract and fuse feature of multimodal data which mixed RGB, depth, and IR.


## 2.1. Texture based

Living verification is completed by using the difference between real face and replay image in surface texture, 3D structure, image quality, and so on. Boulkenafet et al. [8] analyzed the chroma and brightness difference between real and false face images, it is based on the color local binary pattern, and the feature histogram of each order image frequency band was extracted as the face texture representation. Finally, the classification was realized by support vector machine, and testing on the Replay Attack Dataset obtained the half error rate; it is 2.9%. Galbally et al. [9] prove that the image quality loss value produced by Gaussian filtering can distinguish the truth effectively with fraudulent face images, designed a quality assessment vector containing 14 indicators, and proposed a live detection method, the method in combination with LDA (linear discriminant analysis), and obtained 15.2% half error rate on the Replay Attack Dataset. However, such methods based on static feature often require the design of specific descriptors for a certain types of attacks, and the robustness is poor under different light conditions and different fraud carriers [10].


## 2.2. Dynamic Based

Some researchers have proposed a face living detection algorithm based on dynamic features by analyzing face motion patterns and show good performance in related datasets [11]. Kim et al. [12] designed a local velocity pattern for the estimation of the speed of light and distinguished the fraud from the real face according to the difference in the diffusion speed between the light on the real face and the fraud carrier surface. A 12.50% half error rate was obtained on the Replay Attack Dataset. Bharadwaj et al. [13] amplify the blink signal which is 0.2–0.5 Hz in the image by the Eulerian motion amplification algorithm, combined with local binary pattern with directional flow histogram (LBP-HOOF) to extract dynamic features as classification basis and obtained error rate which is 1.25% on the Replay Attack Dataset. At the same time, they proved the positive effect of image amplification algorithm on the performance of the algorithm. Freitas et al. [14] learned from the facial expression detection method, extracted feature histograms from the orthogonal plane of time-spatial domain by using LBP-TOP operator, used support vector machine to classify, and got 7.6% half error rate on Replay Attack Dataset. Xiaoguang et al. [15] based on the action information between adjacent frames established a CNN-LSTM network model, used convolutional neural network to extract the texture features of adjacent frame face images, and then input it to the long- and short-term memory structure to learn the time-domain action information in face video.In addition, some researchers combined different detection equipments or system modules to fuse information on different levels, which effectively increased the accuracy of living detection [1, 16]. Zhang and Wang [17] used Intel RealSense SR300 camera to construct multimodal face image database including RGB image, depth image (depth), and infrared image (IR). The face region was accurately located using face 3D reconstruction network PRNet [18] and mask operation and then based on ResNet 18 classification [19] network to extract and fuse feature of multimodal data which mixed RGB, depth, and IR.


## 3. Proposed Method

### 3.1. Face Detection in Complex Illumination

In order to eliminate the interference of background in the process of living information extraction, it is necessary to segment the face area of the image. Traditional detection techniques can be divided into three categories: the face detection based on feature, the face detection based on template, and the face detection based on statistics. This paper uses face front detection API provided by Dlib, which uses gradient direction histogram feature to achieve face detection. The face detection algorithm based on gradient direction histogram can maintain good immutability of image texture and optical deformation and ignore the slight texture and changes in expression.Histogram of Oriented Gradients (HOGs) is a method used to describe the local texture features of image. The algorithm divides the image into small spaces and calculates the gradient of pixel points in each space. The pixel point gradient calculation is shown in the following equations:(1)Gxx,y=Ix+1,y−Ix−1,y,(2)Gyx,y=Ix,y+1−Ix,y−1,where Gxx,y and Gyx,y are the horizontal gradient and vertical gradient at the x,y of the image, respectively, and Ix,y is the gray value. In reality, local shading or over exposure will affect the extraction of gradient information because the image target will appear in different light environments, as shown in Figure 3. In order to enhance the robustness of the HOG feature descriptor to environmental changes and reduce the noise such as the local shadow of the image, a Gamma correction algorithm is used to preprocess the image to eliminate the interference of partial light.Figure 3
HOG feature of shadow on face region under light condition. It is necessary to initialize the face image because the shadow or exposure caused by complex light can affect the face region gradient information.Traditional Gamma correction method changes the brightness of image by selecting the appropriateγ operator, as follows:(3)Ox,y=255×Ix,y255γ,where Ix,y is the pixel value of the image at the position (x, y), Ox,y is the corrected pixel value, and γ is the constant. The traditional method performs image processing at the global level without considering the lightness difference between local and neighborhood pixels. Therefore, Schettini et al. [20] proposed a formula for the value of γ operator:(4)γx,y=∂128−maskx,y/128,∂=InI¯/255In0.5,I¯<128,1,I¯=128,In0.5InI¯/255,I¯>128,where mask is an image mask and Gaussian blur can be used in practice. For the more balanced image with bright area and dark area, the average pixel of the image is close to 128, so the calculated α is close to 1, and the image is hardly changed, which obviously does not meet the actual needs. Considering the local feature of face, this paper introduces the local normalization method proposed in [21] to calculate the ratio relation of pixels in the neighborhood and adjust the operator α:(5)∂x,y=InI¯/255In0.5+Nx,yInI¯/255In0.5,I¯<128,In0.5InI¯/255+Nx,yIn0.5InI¯255,I¯≥128.Among them, the specific calculation process of local normalized characteristicN is as follows:(1)
To calculate the maximum pixel valueImx,y in the neighborhood φx,y centered on pixel (x, y),(6)Imx,y=maxIi,ji,j∈φx,y.(2)
To calculate the median value of theImx,y of all pixels centered on pixel (x, y),(7)Immx,y=mediumImi,ji,j∈φx,y.(3)
To calculate the maximum value of theImmx,y of all pixels centered on pixel (x, y),(8)Sx,y=maxImmi,ji,j∈φx,y.(4)
To calculate the ratio of pixels (x, y) to neighborhood pixels,(9)Nx,y=Ix,ySx,y.We use algorithm in [20] and the improved algorithm in this paper to preprocess the portrait 208 photos on YaleB subdatabase that is difficult to be detected by HOG under complex lighting conditions and then detect 196 and 201 faces separately. The result is shown in Figure 4.Figure 4
Comparison between [20] and ours. The improved algorithm we proposed performs better than that in [20]. (a) Original images that cannot detect face by HOG; (b) images processed in [20] and the detection result; (c) images processed by ours and the detection result.
(a)(b)(c)


### 3.2. DTFA-Net Architecture

In Section3.2, we mainly introduce the dynamic and texture features fusion attention network DTFA-Net. As shown in Figure 5, the optical flow graph and the texture image are, respectively, subjected to obtain 256∗2 and 256∗4 embedding by extracting dynamic feature and texture feature from subnetwork and then fusing the spliced 256∗6 features through the fully connected layer and living detection. The specific details of the network are described below.Figure 5
The dynamic and texture features fusion attention network (DTFA-Net) architecture. The figure omits the ReLU and pooling layers after the convolution layer, and the id of the convolution is shown on the top. Color code used is as follows: pink = convolution; blue = fusion block; gray = spatial attention; green = fully connected layer.


#### 3.2.1. Dynamic Feature Fusion

This paper generates the optical flow field change map of adjacent two frames of face video by the optical flow method. The optical flow change in face region is extracted by dynamic feature fusion subnetwork in two dimensions of displacement and size, and the features of the two dimensions are fused by feature fusion block to extract the dynamic information of face region.(1) Optical Flow. Optical flow method is a proposal used to describe the motion information of adjacent frame objects. It reflects the interframe field changes by calculating the motion displacement in the x and y directions of the image on the time domain. Defining video midpoint P located (x, y) of the image at the t moment and moving to the place x+dx,y+dy, then when the dt is close to 0, the two pixel values satisfy the following relationship:(10)Iv=Iv+d,where v = (x, y) is the coordinate of the point P at the time t, I (v) is the gray value of the place (x, y) at the time t, d = (dx, dy) is the displacement of the point P during dt, and Iv+d is the gray value of the place x+dx,y+dy at the time t + dt.In this paper, the dense optical flow method proposed by Farneback [22] is used to calculate the interframe displacement of face video. The algorithm approximates the pixels of two-frame images by a polynomial expansion transformation. And it based on the assumption that the local optical flow and the image gradient are stable, and the displacement field is deduced in the polynomial expansion coefficient. We transform the displacement d=dx,dy to the extreme coordinate system d=ρ,θ and visualize the optical flow displacement and direction by the HSV model. As shown in Figure 6, the optical flow change image obtained will be used as input of the dynamic feature fusion network.Figure 6
Optical flow visualization of two adjacent face regions: (a) visualization of changes in optical flow direction: hue = direction of optical flow, saturation = 255, and value = 255; (b) optical flow magnitude visualize: hue = 255, saturation = 255, and value = size of optical flow. Among them, the left two are the optical flow changes in the real face, and the right two groups are the optical flow changes in the photo attacks.
(a)(b)(2) Fusion Attention Module. In the process of dynamic information extraction, we extract, respectively, the motion information contained in the input optical flow change direction feature map and the optical flow change intensity feature map through 5 convolution layers. Because the motion pattern of living human face contains two dimensions of direction and intensity, it is necessary to combine the above representations to further extract the moving features of the face. As a result, we designed a fusion module, as shown in Figure 7.Figure 7
Fusion attention module architecture.To improve the characterization ability of the model, we use the SE structure [23] in the fusion module, which gives different weights for the optical flow intensity, and direction features to strengthen the decision-making ability of some features. First, global pooling of feature graphs is(11)opc=AvgPoolFop=1H×W∑i=1H∑j=1WFopi,j,where Fopi,j stands for the concatenated features of optical magnitude and angle. Through global average pooling, the dimension of the stitching feature map changes from C × H × W to C × 1 × 1. Secondly, learn the nonlinear functional relationship between each channel through full connection (FC) and activation function (ReLU). Then, use normalization (sigmoid) to get the weight of each channel:(12)opa=σFCδFCopc,where σ is the sigmoid function and δ is the ReLU function. The two fully connected layers are used to reduce and recovery dimension, respectively, which is helpful to improve the complexity of the function. Finally, we multiply Fop with opa and pass through a convolution layer to get the fusion features:(13)Fop+=Convopa⊗Fop.(3) Network Details. Dynamic feature extraction subnetwork input image size is 227 × 227 × 3, which contains 11 convolution layers, 2 full connected layers, and 6 pooling layers. Tables 1–3 show the specific network parameters of convolution and pooling layers.Table 1
The network of Mag_Conv1-5.
LayerInput sizeKernel sizeFilterStrideMag_Conv1227∗ 22 ∗ 311∗ 11 ∗ 3964MaxPooo127∗ 27 ∗ 643∗ 32Mag_Conv227∗ 27 ∗ 645∗ 5 ∗ 641921MaxPool227∗ 27 ∗ 1923∗ 32Mag_Conv313∗ 13 ∗ 1923∗ 3 ∗ 1923841Mag_Conv413∗ 13 ∗ 3843∗ 3 ∗ 3842561Mag_Conv513∗ 13 ∗ 2563∗ 3 ∗ 2562561∗VecConv1-5 and TexConv1-5 parameters are same as MagConv1-5.Table 2
The structure of fusion attention module.
LayerInput sizeKernel sizeFilterStrideGlobalAvgPool13∗ 13 ∗ 51213∗ 131Fc1512Fc232LK_Conv13∗ 13 ∗ 5123∗ 3 ∗ 5122562LK_MaxPool6∗ 6 ∗ 2563∗ 31Table 3
The structure of FC1 in Figure5.
LayerInput sizeOutput sizeFC1_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC1_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC1_3256∗ 2 ∗ 2256∗ 2


#### 3.2.2. Texture Feature Representation

In specific, we map the input RBG image to the intermediate feature maps with a dimension of 384 through TexConv1-4 and then pay more attention to some of the regions through the spatial attention mechanism and then input the output of the attention module to TexConv5 and full connection layer FC2 performs feature extraction. The structure of the convolutional layer TexConv1-5 is shown in Table1, and the structure of the fully connected layer FC2 is shown in Table 4.Table 4
The structure of FC2-3 in Figure5.
LayerInput sizeOutput sizeFC2_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC2_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC3_1256∗ 6256∗ 3FC3_2256∗ 3256FC3_32562(1) Spatial Attention Block. After experiments, we found that neural networks often pay special attention to the human eyes, cheeks, mouths, and other areas when extracting living features. Therefore, we added a spatial attention module to the static texture extraction structure and give a different attention to the features of different face regions. We adopted the CBAM (Figure 8) spatial attention structure proposed in [24]. This module reduces the dimension of the input feature map through the maximum pooling and average pooling layers, splices the two feature maps, and obtains the attention weight of 1∗H∗W by the convolution layer and activation function:(14)SAc=δConvCatAvgPoolFt,MaxPoolFt.Figure 8
Spatial attention block. We introduce this module after the convolution layer of the subnetwork is extracted from the static feature, which gives the difference attention to the local area of the face.Finally, we utilized element-wise product for inputFt and SAc, and the output of the spatial attention block will pass through the next layers, TextConv5 and FC2:(15)Ft+=SAc⊗Ft.


#### 3.2.3. Feature Fusion

Through the above two subnetworks, dynamic information and texture information are obtained, respectively. By a series of fully connected layers, dropout layers, and activation functions, we fully fuse the two information, learning the nonlinear relationship between the dynamic and static features, and obtain a two-dimensional representation of face in living information for living detection, as shown in Table4.


## 3.1. Face Detection in Complex Illumination

In order to eliminate the interference of background in the process of living information extraction, it is necessary to segment the face area of the image. Traditional detection techniques can be divided into three categories: the face detection based on feature, the face detection based on template, and the face detection based on statistics. This paper uses face front detection API provided by Dlib, which uses gradient direction histogram feature to achieve face detection. The face detection algorithm based on gradient direction histogram can maintain good immutability of image texture and optical deformation and ignore the slight texture and changes in expression.Histogram of Oriented Gradients (HOGs) is a method used to describe the local texture features of image. The algorithm divides the image into small spaces and calculates the gradient of pixel points in each space. The pixel point gradient calculation is shown in the following equations:(1)Gxx,y=Ix+1,y−Ix−1,y,(2)Gyx,y=Ix,y+1−Ix,y−1,where Gxx,y and Gyx,y are the horizontal gradient and vertical gradient at the x,y of the image, respectively, and Ix,y is the gray value. In reality, local shading or over exposure will affect the extraction of gradient information because the image target will appear in different light environments, as shown in Figure 3. In order to enhance the robustness of the HOG feature descriptor to environmental changes and reduce the noise such as the local shadow of the image, a Gamma correction algorithm is used to preprocess the image to eliminate the interference of partial light.Figure 3
HOG feature of shadow on face region under light condition. It is necessary to initialize the face image because the shadow or exposure caused by complex light can affect the face region gradient information.Traditional Gamma correction method changes the brightness of image by selecting the appropriateγ operator, as follows:(3)Ox,y=255×Ix,y255γ,where Ix,y is the pixel value of the image at the position (x, y), Ox,y is the corrected pixel value, and γ is the constant. The traditional method performs image processing at the global level without considering the lightness difference between local and neighborhood pixels. Therefore, Schettini et al. [20] proposed a formula for the value of γ operator:(4)γx,y=∂128−maskx,y/128,∂=InI¯/255In0.5,I¯<128,1,I¯=128,In0.5InI¯/255,I¯>128,where mask is an image mask and Gaussian blur can be used in practice. For the more balanced image with bright area and dark area, the average pixel of the image is close to 128, so the calculated α is close to 1, and the image is hardly changed, which obviously does not meet the actual needs. Considering the local feature of face, this paper introduces the local normalization method proposed in [21] to calculate the ratio relation of pixels in the neighborhood and adjust the operator α:(5)∂x,y=InI¯/255In0.5+Nx,yInI¯/255In0.5,I¯<128,In0.5InI¯/255+Nx,yIn0.5InI¯255,I¯≥128.Among them, the specific calculation process of local normalized characteristicN is as follows:(1)
To calculate the maximum pixel valueImx,y in the neighborhood φx,y centered on pixel (x, y),(6)Imx,y=maxIi,ji,j∈φx,y.(2)
To calculate the median value of theImx,y of all pixels centered on pixel (x, y),(7)Immx,y=mediumImi,ji,j∈φx,y.(3)
To calculate the maximum value of theImmx,y of all pixels centered on pixel (x, y),(8)Sx,y=maxImmi,ji,j∈φx,y.(4)
To calculate the ratio of pixels (x, y) to neighborhood pixels,(9)Nx,y=Ix,ySx,y.We use algorithm in [20] and the improved algorithm in this paper to preprocess the portrait 208 photos on YaleB subdatabase that is difficult to be detected by HOG under complex lighting conditions and then detect 196 and 201 faces separately. The result is shown in Figure 4.Figure 4
Comparison between [20] and ours. The improved algorithm we proposed performs better than that in [20]. (a) Original images that cannot detect face by HOG; (b) images processed in [20] and the detection result; (c) images processed by ours and the detection result.
(a)(b)(c)


## 3.2. DTFA-Net Architecture

In Section3.2, we mainly introduce the dynamic and texture features fusion attention network DTFA-Net. As shown in Figure 5, the optical flow graph and the texture image are, respectively, subjected to obtain 256∗2 and 256∗4 embedding by extracting dynamic feature and texture feature from subnetwork and then fusing the spliced 256∗6 features through the fully connected layer and living detection. The specific details of the network are described below.Figure 5
The dynamic and texture features fusion attention network (DTFA-Net) architecture. The figure omits the ReLU and pooling layers after the convolution layer, and the id of the convolution is shown on the top. Color code used is as follows: pink = convolution; blue = fusion block; gray = spatial attention; green = fully connected layer.


### 3.2.1. Dynamic Feature Fusion

This paper generates the optical flow field change map of adjacent two frames of face video by the optical flow method. The optical flow change in face region is extracted by dynamic feature fusion subnetwork in two dimensions of displacement and size, and the features of the two dimensions are fused by feature fusion block to extract the dynamic information of face region.(1) Optical Flow. Optical flow method is a proposal used to describe the motion information of adjacent frame objects. It reflects the interframe field changes by calculating the motion displacement in the x and y directions of the image on the time domain. Defining video midpoint P located (x, y) of the image at the t moment and moving to the place x+dx,y+dy, then when the dt is close to 0, the two pixel values satisfy the following relationship:(10)Iv=Iv+d,where v = (x, y) is the coordinate of the point P at the time t, I (v) is the gray value of the place (x, y) at the time t, d = (dx, dy) is the displacement of the point P during dt, and Iv+d is the gray value of the place x+dx,y+dy at the time t + dt.In this paper, the dense optical flow method proposed by Farneback [22] is used to calculate the interframe displacement of face video. The algorithm approximates the pixels of two-frame images by a polynomial expansion transformation. And it based on the assumption that the local optical flow and the image gradient are stable, and the displacement field is deduced in the polynomial expansion coefficient. We transform the displacement d=dx,dy to the extreme coordinate system d=ρ,θ and visualize the optical flow displacement and direction by the HSV model. As shown in Figure 6, the optical flow change image obtained will be used as input of the dynamic feature fusion network.Figure 6
Optical flow visualization of two adjacent face regions: (a) visualization of changes in optical flow direction: hue = direction of optical flow, saturation = 255, and value = 255; (b) optical flow magnitude visualize: hue = 255, saturation = 255, and value = size of optical flow. Among them, the left two are the optical flow changes in the real face, and the right two groups are the optical flow changes in the photo attacks.
(a)(b)(2) Fusion Attention Module. In the process of dynamic information extraction, we extract, respectively, the motion information contained in the input optical flow change direction feature map and the optical flow change intensity feature map through 5 convolution layers. Because the motion pattern of living human face contains two dimensions of direction and intensity, it is necessary to combine the above representations to further extract the moving features of the face. As a result, we designed a fusion module, as shown in Figure 7.Figure 7
Fusion attention module architecture.To improve the characterization ability of the model, we use the SE structure [23] in the fusion module, which gives different weights for the optical flow intensity, and direction features to strengthen the decision-making ability of some features. First, global pooling of feature graphs is(11)opc=AvgPoolFop=1H×W∑i=1H∑j=1WFopi,j,where Fopi,j stands for the concatenated features of optical magnitude and angle. Through global average pooling, the dimension of the stitching feature map changes from C × H × W to C × 1 × 1. Secondly, learn the nonlinear functional relationship between each channel through full connection (FC) and activation function (ReLU). Then, use normalization (sigmoid) to get the weight of each channel:(12)opa=σFCδFCopc,where σ is the sigmoid function and δ is the ReLU function. The two fully connected layers are used to reduce and recovery dimension, respectively, which is helpful to improve the complexity of the function. Finally, we multiply Fop with opa and pass through a convolution layer to get the fusion features:(13)Fop+=Convopa⊗Fop.(3) Network Details. Dynamic feature extraction subnetwork input image size is 227 × 227 × 3, which contains 11 convolution layers, 2 full connected layers, and 6 pooling layers. Tables 1–3 show the specific network parameters of convolution and pooling layers.Table 1
The network of Mag_Conv1-5.
LayerInput sizeKernel sizeFilterStrideMag_Conv1227∗ 22 ∗ 311∗ 11 ∗ 3964MaxPooo127∗ 27 ∗ 643∗ 32Mag_Conv227∗ 27 ∗ 645∗ 5 ∗ 641921MaxPool227∗ 27 ∗ 1923∗ 32Mag_Conv313∗ 13 ∗ 1923∗ 3 ∗ 1923841Mag_Conv413∗ 13 ∗ 3843∗ 3 ∗ 3842561Mag_Conv513∗ 13 ∗ 2563∗ 3 ∗ 2562561∗VecConv1-5 and TexConv1-5 parameters are same as MagConv1-5.Table 2
The structure of fusion attention module.
LayerInput sizeKernel sizeFilterStrideGlobalAvgPool13∗ 13 ∗ 51213∗ 131Fc1512Fc232LK_Conv13∗ 13 ∗ 5123∗ 3 ∗ 5122562LK_MaxPool6∗ 6 ∗ 2563∗ 31Table 3
The structure of FC1 in Figure5.
LayerInput sizeOutput sizeFC1_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC1_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC1_3256∗ 2 ∗ 2256∗ 2


### 3.2.2. Texture Feature Representation

In specific, we map the input RBG image to the intermediate feature maps with a dimension of 384 through TexConv1-4 and then pay more attention to some of the regions through the spatial attention mechanism and then input the output of the attention module to TexConv5 and full connection layer FC2 performs feature extraction. The structure of the convolutional layer TexConv1-5 is shown in Table1, and the structure of the fully connected layer FC2 is shown in Table 4.Table 4
The structure of FC2-3 in Figure5.
LayerInput sizeOutput sizeFC2_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC2_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC3_1256∗ 6256∗ 3FC3_2256∗ 3256FC3_32562(1) Spatial Attention Block. After experiments, we found that neural networks often pay special attention to the human eyes, cheeks, mouths, and other areas when extracting living features. Therefore, we added a spatial attention module to the static texture extraction structure and give a different attention to the features of different face regions. We adopted the CBAM (Figure 8) spatial attention structure proposed in [24]. This module reduces the dimension of the input feature map through the maximum pooling and average pooling layers, splices the two feature maps, and obtains the attention weight of 1∗H∗W by the convolution layer and activation function:(14)SAc=δConvCatAvgPoolFt,MaxPoolFt.Figure 8
Spatial attention block. We introduce this module after the convolution layer of the subnetwork is extracted from the static feature, which gives the difference attention to the local area of the face.Finally, we utilized element-wise product for inputFt and SAc, and the output of the spatial attention block will pass through the next layers, TextConv5 and FC2:(15)Ft+=SAc⊗Ft.


### 3.2.3. Feature Fusion

Through the above two subnetworks, dynamic information and texture information are obtained, respectively. By a series of fully connected layers, dropout layers, and activation functions, we fully fuse the two information, learning the nonlinear relationship between the dynamic and static features, and obtain a two-dimensional representation of face in living information for living detection, as shown in Table4.


## 3.2.1. Dynamic Feature Fusion

This paper generates the optical flow field change map of adjacent two frames of face video by the optical flow method. The optical flow change in face region is extracted by dynamic feature fusion subnetwork in two dimensions of displacement and size, and the features of the two dimensions are fused by feature fusion block to extract the dynamic information of face region.(1) Optical Flow. Optical flow method is a proposal used to describe the motion information of adjacent frame objects. It reflects the interframe field changes by calculating the motion displacement in the x and y directions of the image on the time domain. Defining video midpoint P located (x, y) of the image at the t moment and moving to the place x+dx,y+dy, then when the dt is close to 0, the two pixel values satisfy the following relationship:(10)Iv=Iv+d,where v = (x, y) is the coordinate of the point P at the time t, I (v) is the gray value of the place (x, y) at the time t, d = (dx, dy) is the displacement of the point P during dt, and Iv+d is the gray value of the place x+dx,y+dy at the time t + dt.In this paper, the dense optical flow method proposed by Farneback [22] is used to calculate the interframe displacement of face video. The algorithm approximates the pixels of two-frame images by a polynomial expansion transformation. And it based on the assumption that the local optical flow and the image gradient are stable, and the displacement field is deduced in the polynomial expansion coefficient. We transform the displacement d=dx,dy to the extreme coordinate system d=ρ,θ and visualize the optical flow displacement and direction by the HSV model. As shown in Figure 6, the optical flow change image obtained will be used as input of the dynamic feature fusion network.Figure 6
Optical flow visualization of two adjacent face regions: (a) visualization of changes in optical flow direction: hue = direction of optical flow, saturation = 255, and value = 255; (b) optical flow magnitude visualize: hue = 255, saturation = 255, and value = size of optical flow. Among them, the left two are the optical flow changes in the real face, and the right two groups are the optical flow changes in the photo attacks.
(a)(b)(2) Fusion Attention Module. In the process of dynamic information extraction, we extract, respectively, the motion information contained in the input optical flow change direction feature map and the optical flow change intensity feature map through 5 convolution layers. Because the motion pattern of living human face contains two dimensions of direction and intensity, it is necessary to combine the above representations to further extract the moving features of the face. As a result, we designed a fusion module, as shown in Figure 7.Figure 7
Fusion attention module architecture.To improve the characterization ability of the model, we use the SE structure [23] in the fusion module, which gives different weights for the optical flow intensity, and direction features to strengthen the decision-making ability of some features. First, global pooling of feature graphs is(11)opc=AvgPoolFop=1H×W∑i=1H∑j=1WFopi,j,where Fopi,j stands for the concatenated features of optical magnitude and angle. Through global average pooling, the dimension of the stitching feature map changes from C × H × W to C × 1 × 1. Secondly, learn the nonlinear functional relationship between each channel through full connection (FC) and activation function (ReLU). Then, use normalization (sigmoid) to get the weight of each channel:(12)opa=σFCδFCopc,where σ is the sigmoid function and δ is the ReLU function. The two fully connected layers are used to reduce and recovery dimension, respectively, which is helpful to improve the complexity of the function. Finally, we multiply Fop with opa and pass through a convolution layer to get the fusion features:(13)Fop+=Convopa⊗Fop.(3) Network Details. Dynamic feature extraction subnetwork input image size is 227 × 227 × 3, which contains 11 convolution layers, 2 full connected layers, and 6 pooling layers. Tables 1–3 show the specific network parameters of convolution and pooling layers.Table 1
The network of Mag_Conv1-5.
LayerInput sizeKernel sizeFilterStrideMag_Conv1227∗ 22 ∗ 311∗ 11 ∗ 3964MaxPooo127∗ 27 ∗ 643∗ 32Mag_Conv227∗ 27 ∗ 645∗ 5 ∗ 641921MaxPool227∗ 27 ∗ 1923∗ 32Mag_Conv313∗ 13 ∗ 1923∗ 3 ∗ 1923841Mag_Conv413∗ 13 ∗ 3843∗ 3 ∗ 3842561Mag_Conv513∗ 13 ∗ 2563∗ 3 ∗ 2562561∗VecConv1-5 and TexConv1-5 parameters are same as MagConv1-5.Table 2
The structure of fusion attention module.
LayerInput sizeKernel sizeFilterStrideGlobalAvgPool13∗ 13 ∗ 51213∗ 131Fc1512Fc232LK_Conv13∗ 13 ∗ 5123∗ 3 ∗ 5122562LK_MaxPool6∗ 6 ∗ 2563∗ 31Table 3
The structure of FC1 in Figure5.
LayerInput sizeOutput sizeFC1_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC1_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC1_3256∗ 2 ∗ 2256∗ 2


## 3.2.2. Texture Feature Representation

In specific, we map the input RBG image to the intermediate feature maps with a dimension of 384 through TexConv1-4 and then pay more attention to some of the regions through the spatial attention mechanism and then input the output of the attention module to TexConv5 and full connection layer FC2 performs feature extraction. The structure of the convolutional layer TexConv1-5 is shown in Table1, and the structure of the fully connected layer FC2 is shown in Table 4.Table 4
The structure of FC2-3 in Figure5.
LayerInput sizeOutput sizeFC2_1256∗ 6 ∗ 6256∗ 3 ∗ 3FC2_2256∗ 3 ∗ 3256∗ 2 ∗ 2FC3_1256∗ 6256∗ 3FC3_2256∗ 3256FC3_32562(1) Spatial Attention Block. After experiments, we found that neural networks often pay special attention to the human eyes, cheeks, mouths, and other areas when extracting living features. Therefore, we added a spatial attention module to the static texture extraction structure and give a different attention to the features of different face regions. We adopted the CBAM (Figure 8) spatial attention structure proposed in [24]. This module reduces the dimension of the input feature map through the maximum pooling and average pooling layers, splices the two feature maps, and obtains the attention weight of 1∗H∗W by the convolution layer and activation function:(14)SAc=δConvCatAvgPoolFt,MaxPoolFt.Figure 8
Spatial attention block. We introduce this module after the convolution layer of the subnetwork is extracted from the static feature, which gives the difference attention to the local area of the face.Finally, we utilized element-wise product for inputFt and SAc, and the output of the spatial attention block will pass through the next layers, TextConv5 and FC2:(15)Ft+=SAc⊗Ft.


## 3.2.3. Feature Fusion

Through the above two subnetworks, dynamic information and texture information are obtained, respectively. By a series of fully connected layers, dropout layers, and activation functions, we fully fuse the two information, learning the nonlinear relationship between the dynamic and static features, and obtain a two-dimensional representation of face in living information for living detection, as shown in Table4.


## 4. Experiment

### 4.1. Dataset

We use CASIA-MFSD [25] to train and test the model. The dataset contains a total of 600 face videos collected from 50 individuals. Face video of real face, photo attack, and video attack scenes are collected at different resolutions. Among them, photo attack includes photo bending and photo mask. We ignore the different attack ways and divide all the videos into real face and false face. Through the calculation of optical flow field, face region detection and tailoring, etc., get 35428 sets of training images and 64674 sets of test images, as shown in Figure 9. And we also train and test our model on Replay Attack Database.Figure 9
CASIA-MFSD examples after preprocessing. From left to right: texture image, optical flow magnitude, and optical flow direction. Among them, (a) fake face and (b) real face.
(a)(b)


### 4.2. Evaluation

This experiment uses false acceptance rate (FAR), false rejection rate (FRR), equal error rate (EER), and half total error rate (HTER). The face living detection algorithm is based on these indicators. The FAR refers to the ratio of judging the fake face as the real face; the FRR refers to the ratio of judging the real face as false, and the calculation formulas are shown as follows:(16)FAR=Nf_rNf,(17)FRR=Nr_fNr,where Nf_r is the number of false face error, Nr_f is the number of real face error, Nf is the number of false face liveness detection, and Nr is the number of real face detection. The two classification methods of this experiment are as follows: (1) nearest neighborhood (NN), which corresponds the two-dimensional vector, of which each dimension value represents the probability of real face or attack face and selects the category which corresponds to the maximum value as the classification result. (2) Thresholding selects a certain threshold to classify the representation result. This method is mainly for model validation and testing. Calculating FAR and FRR at different thresholds can plot the receiver operating characteristic (ROC) curve for measuring the nonequilibrium in the classification problem; the area under the ROC curve (area under curve, AUC) can intuitively show the algorithm classification effect.


### 4.3. Implementation Details

The proposed method is implemented in Pytorch with an inconstant learning rate (e.g., lr = 0.01 when epoch<5 and lr = 0.001 when epoch ≥ 5). The batch size of the model is 128 with num_worker = 100. We initialize our network by using the parameters of AlextNet100. The network is trained with standard SGD for 50 or 100 epochs on Tesla V100 GPU. And we use cross entropy loss, and the input resolution is 227 × 227.


### 4.4. Experimental Result

#### 4.4.1. Ablation of Spatial Attention Module

We conducted an ablation experiment on the attention module of the texture feature extraction subnetwork and only rely on texture features to perform live detection on the CAISA dataset. We trained the two texture feature extraction networks with or without spatial attention block 50 times, respectively, and verified them on the CASIA test set. Figure10 shows the training loss process (Epoch0-Epoch29) and the ROC curve in the test set (Epoch50). The experiment shows that, after introducing the attention mechanism, due to the increase in the network structure (in fact, a convolution layer is added), the loss of the model during the training process is slower than that of model without SA in the initial stage of training and there is a large shock. However, as the number of network training iterations increases, the loss tends to be stable, and there is almost no difference between the two cases. After 50 cycles of training, the model with SA achieved AUC = 95.4% on the test set, which is higher than model without SA.Figure 10
Network loss and ROC curve with or without spatial attention module: (a) training loss as time step went by; (b) ROC curve.
(a)(b)Visualize the input and output results of our spatial attention mechanism module, as shown in Figure11. It shows that SA pays more attention to local areas in the face image, such as the mouth and eyes. This point shows the consistency of the prior knowledge as assumed by the traditional image feature description method.Figure 11
Change in weight heat map before and after spatial attention module: (a) before; (b) after. The spatial attention module pays special attention to some features of the face area.
(a)(b)We first do not use SA to train the DTFA network to a certain degree and then add the SA structure to train 100 times so that the spatial attention module can better learn face area information and accelerate model convergence. Figure12 shows the training and test results of DTFA-Net on the CASIA dataset. When the number of training iterations of the model reaches the interval of 49 – 89, EER = 0.069 and AUC = 0.975 ± 0.0001, reaching a stable state.Figure 12
DTFA-Net training and evaluation results in Epoch49-89: (a) the loss fluctuations of model training in Epoch49-89; (b) the AUC results of the model in the test set in Epoch49-89; (c) the ACC results of the model in the test set in Epoch49-89; (d) the ERR results of the model in the test set in Epoch49-89.
(a)(b)(c)(d)Table5 provides a comparison between the results of our proposed approach and those of the other methods in both intradatabase evaluation. Our model result is comparable to the state-of-the-art methods.Table 5
Comparison between our proposed method and the other in intradatabase.
MethodCASIA-MFSDReplay AttackEER (%)EER (%)HTER (%)LBP [26]18.213.913.8IQA [9]32.4–15.2CNN [4]7.46.12.1LiveNet [27]4.59–5.74DTFA-Net (ours)6.906.472.2


### 4.5. Samples

Figure13 shows several samples of the failure and right detection of real faces. Through analysis, we found that the illumination in RGB images may be the main cause of wrong classification.Figure 13
The false and right detection samples. Left: false-negative result; right: true-positive case.


## 4.1. Dataset

We use CASIA-MFSD [25] to train and test the model. The dataset contains a total of 600 face videos collected from 50 individuals. Face video of real face, photo attack, and video attack scenes are collected at different resolutions. Among them, photo attack includes photo bending and photo mask. We ignore the different attack ways and divide all the videos into real face and false face. Through the calculation of optical flow field, face region detection and tailoring, etc., get 35428 sets of training images and 64674 sets of test images, as shown in Figure 9. And we also train and test our model on Replay Attack Database.Figure 9
CASIA-MFSD examples after preprocessing. From left to right: texture image, optical flow magnitude, and optical flow direction. Among them, (a) fake face and (b) real face.
(a)(b)


## 4.2. Evaluation

This experiment uses false acceptance rate (FAR), false rejection rate (FRR), equal error rate (EER), and half total error rate (HTER). The face living detection algorithm is based on these indicators. The FAR refers to the ratio of judging the fake face as the real face; the FRR refers to the ratio of judging the real face as false, and the calculation formulas are shown as follows:(16)FAR=Nf_rNf,(17)FRR=Nr_fNr,where Nf_r is the number of false face error, Nr_f is the number of real face error, Nf is the number of false face liveness detection, and Nr is the number of real face detection. The two classification methods of this experiment are as follows: (1) nearest neighborhood (NN), which corresponds the two-dimensional vector, of which each dimension value represents the probability of real face or attack face and selects the category which corresponds to the maximum value as the classification result. (2) Thresholding selects a certain threshold to classify the representation result. This method is mainly for model validation and testing. Calculating FAR and FRR at different thresholds can plot the receiver operating characteristic (ROC) curve for measuring the nonequilibrium in the classification problem; the area under the ROC curve (area under curve, AUC) can intuitively show the algorithm classification effect.


## 4.3. Implementation Details

The proposed method is implemented in Pytorch with an inconstant learning rate (e.g., lr = 0.01 when epoch<5 and lr = 0.001 when epoch ≥ 5). The batch size of the model is 128 with num_worker = 100. We initialize our network by using the parameters of AlextNet100. The network is trained with standard SGD for 50 or 100 epochs on Tesla V100 GPU. And we use cross entropy loss, and the input resolution is 227 × 227.


## 4.4. Experimental Result

### 4.4.1. Ablation of Spatial Attention Module

We conducted an ablation experiment on the attention module of the texture feature extraction subnetwork and only rely on texture features to perform live detection on the CAISA dataset. We trained the two texture feature extraction networks with or without spatial attention block 50 times, respectively, and verified them on the CASIA test set. Figure10 shows the training loss process (Epoch0-Epoch29) and the ROC curve in the test set (Epoch50). The experiment shows that, after introducing the attention mechanism, due to the increase in the network structure (in fact, a convolution layer is added), the loss of the model during the training process is slower than that of model without SA in the initial stage of training and there is a large shock. However, as the number of network training iterations increases, the loss tends to be stable, and there is almost no difference between the two cases. After 50 cycles of training, the model with SA achieved AUC = 95.4% on the test set, which is higher than model without SA.Figure 10
Network loss and ROC curve with or without spatial attention module: (a) training loss as time step went by; (b) ROC curve.
(a)(b)Visualize the input and output results of our spatial attention mechanism module, as shown in Figure11. It shows that SA pays more attention to local areas in the face image, such as the mouth and eyes. This point shows the consistency of the prior knowledge as assumed by the traditional image feature description method.Figure 11
Change in weight heat map before and after spatial attention module: (a) before; (b) after. The spatial attention module pays special attention to some features of the face area.
(a)(b)We first do not use SA to train the DTFA network to a certain degree and then add the SA structure to train 100 times so that the spatial attention module can better learn face area information and accelerate model convergence. Figure12 shows the training and test results of DTFA-Net on the CASIA dataset. When the number of training iterations of the model reaches the interval of 49 – 89, EER = 0.069 and AUC = 0.975 ± 0.0001, reaching a stable state.Figure 12
DTFA-Net training and evaluation results in Epoch49-89: (a) the loss fluctuations of model training in Epoch49-89; (b) the AUC results of the model in the test set in Epoch49-89; (c) the ACC results of the model in the test set in Epoch49-89; (d) the ERR results of the model in the test set in Epoch49-89.
(a)(b)(c)(d)Table5 provides a comparison between the results of our proposed approach and those of the other methods in both intradatabase evaluation. Our model result is comparable to the state-of-the-art methods.Table 5
Comparison between our proposed method and the other in intradatabase.
MethodCASIA-MFSDReplay AttackEER (%)EER (%)HTER (%)LBP [26]18.213.913.8IQA [9]32.4–15.2CNN [4]7.46.12.1LiveNet [27]4.59–5.74DTFA-Net (ours)6.906.472.2


## 4.4.1. Ablation of Spatial Attention Module

We conducted an ablation experiment on the attention module of the texture feature extraction subnetwork and only rely on texture features to perform live detection on the CAISA dataset. We trained the two texture feature extraction networks with or without spatial attention block 50 times, respectively, and verified them on the CASIA test set. Figure10 shows the training loss process (Epoch0-Epoch29) and the ROC curve in the test set (Epoch50). The experiment shows that, after introducing the attention mechanism, due to the increase in the network structure (in fact, a convolution layer is added), the loss of the model during the training process is slower than that of model without SA in the initial stage of training and there is a large shock. However, as the number of network training iterations increases, the loss tends to be stable, and there is almost no difference between the two cases. After 50 cycles of training, the model with SA achieved AUC = 95.4% on the test set, which is higher than model without SA.Figure 10
Network loss and ROC curve with or without spatial attention module: (a) training loss as time step went by; (b) ROC curve.
(a)(b)Visualize the input and output results of our spatial attention mechanism module, as shown in Figure11. It shows that SA pays more attention to local areas in the face image, such as the mouth and eyes. This point shows the consistency of the prior knowledge as assumed by the traditional image feature description method.Figure 11
Change in weight heat map before and after spatial attention module: (a) before; (b) after. The spatial attention module pays special attention to some features of the face area.
(a)(b)We first do not use SA to train the DTFA network to a certain degree and then add the SA structure to train 100 times so that the spatial attention module can better learn face area information and accelerate model convergence. Figure12 shows the training and test results of DTFA-Net on the CASIA dataset. When the number of training iterations of the model reaches the interval of 49 – 89, EER = 0.069 and AUC = 0.975 ± 0.0001, reaching a stable state.Figure 12
DTFA-Net training and evaluation results in Epoch49-89: (a) the loss fluctuations of model training in Epoch49-89; (b) the AUC results of the model in the test set in Epoch49-89; (c) the ACC results of the model in the test set in Epoch49-89; (d) the ERR results of the model in the test set in Epoch49-89.
(a)(b)(c)(d)Table5 provides a comparison between the results of our proposed approach and those of the other methods in both intradatabase evaluation. Our model result is comparable to the state-of-the-art methods.Table 5
Comparison between our proposed method and the other in intradatabase.
MethodCASIA-MFSDReplay AttackEER (%)EER (%)HTER (%)LBP [26]18.213.913.8IQA [9]32.4–15.2CNN [4]7.46.12.1LiveNet [27]4.59–5.74DTFA-Net (ours)6.906.472.2


## 4.5. Samples

Figure13 shows several samples of the failure and right detection of real faces. Through analysis, we found that the illumination in RGB images may be the main cause of wrong classification.Figure 13
The false and right detection samples. Left: false-negative result; right: true-positive case.


## 5. Conclusion

This paper analyzed the photo and video replay attacks of face spoofing and built an attention network structure that integrated dynamic-texture features and designed a dynamic information fusion module that extracted features from texture images based on the spatial attention mechanism. At the same time, an improved gamma image optimization algorithm was proposed for preprocessing of image in face detection tasks under multiple illuminations.



---

*Source: 5836596-2020-07-10.xml*