{'fraction_non_alphanumeric': 0.028076067007692607, 'fraction_numerical': 0.010621265961185521, 'mean_word_length': 4.954312950476633, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Introduction to Presentation Attack Detection in Face Biometrics and Recent Advances

The main scope of this chapter is to serve as an introduction to face presentation attack detection, including key resources and advances in the field in the last few years. The next pages present the different presentation attacks that a face recognition system can confront, in which an attacker presents to the sensor, mainly a camera, a Presentation Attack Instrument (PAI), that is generally a photograph, a video, or a mask, to try to impersonate a genuine user. First, we make an introduction of the current status of face recognition, its level of deployment, and its challenges. In addition, we present the vulnerabilities and the possible attacks that a face recognition system may be exposed to, showing that way the high importance of presentation attack detection methods. We review different types of presentation attack methods, from simpler to more complex ones, and in which cases they could be effective. Then, we summarize the most popular presentation attack detection methods to deal with these attacks. Finally, we introduce public datasets used by the research community for exploring vulnerabilities of face biometrics to presentation attacks and developing effective countermeasures against known PAIs.


Introduction
Over the last decades there have been numerous technological advances that helped to bring new possibilities to people in the form of new devices and services. Some years ago, it would have been almost impossible to imagine having in the market devices like current smartphones and laptops, at affordable prices, that allow a high percentage of the population to have their own piece of top-level technology at home, a privilege that historically has been restricted to big companies and research groups.
Thanks to this quick advance in technology, specially in computer science and electronics, it has been possible to broadly deploy biometric systems for the first time. Nowadays, they are present in a high number of scenarios like: border access control [26], surveillance [88], smartphone authentication [4], forensics [89], and on-line services like e-commerce and e-learning [41].
Among all the existing biometric characteristics, face recognition is currently one of the most extended. Face has been studied as a mean of recognition since the 60s, acquiring special relevance in the 90s following the evolution of computer vision [90]. Some interesting properties of the interaction of human faces with biometric systems are: acquisition at a distance, non-intrusive, and the highly discriminant features of the face to perform identity recognition.
At present, face is one of the biometric characteristics with the highest economical and social impact due to several reasons: • Face is one of the most largely deployed biometric modes at world level in terms of market quota [46]. Each day more and more manufacturers are including Face Recognition Systems (FRSs) in their products, like Apple with its Face ID technology. The public sector is also starting to use face recognition for a wide range of purposes like demographic analysis, identification, and access control [75]. • Face is adopted in most identification documents such as the ICAO-compliant biometric passport [34] or national ID cards [31].
Given their high level of deployment, attacks having a FRS as their target are not restricted anymore to theoretical scenarios, becoming a real threat. There are all kinds of applications and sensitive information that can be menaced by attackers. Providing each face recognition application with an appropriate level of security, as it is being done with other biometric characteristics, like iris or fingerprint, should be a top priority.
Historically, the main focus of research in face recognition has been given to the improvement of the performance at verification and identification tasks, that means, distinguishing better between subjects using the available information of their faces. To achieve that goal, a FRS should be able to optimize the differences between the facial features of each user and also the similarities among samples of the same user [49,85]. Within the variability factors that can affect the performance of face recognition systems there are occlusions, low-resolution, different viewpoints, lighting, etc. Improving the performance of recognition systems in the presence of these variability factors is currently an active and challenging area in face recognition research [98,56,36].
Contrary to the optimization of their performance, the security vulnerabilities of face recognition systems have been much less studied in the past, and only over the recent few years some attention has been given to detecting different types of attacks [40,55,27].
Presentation Attacks (PA) can be defined as the presentation of human characteristics or artifacts directly to the input sensor of a biometric system, trying to interfere its normal operation. This category of attacks are highly present in real world applications of biometrics since the attackers do not need to have access to the internal modules of the recognition system. For example, presenting a high quality printed face of a legitimate user to a camera can be enough to compromise a face recognition system if it does not implement proper countermeasures against these artifacts.
The target of face Presentation Attack Detection (PAD) systems is the automated determination of presentation attacks. Face PAD methods aim to distinguish between a legitimate face and a Presentation Attack Instrument (PAI) that tries to mimic bona fide biometric traits. For example, a subset of PAD methods, referred to as liveness detection, involve measurement and analysis of anatomical characteristics or of involuntary and voluntary reactions, in order to determine if a biometric sample is being captured from a living subject actually present at the point of capture. By applying liveness detection, a face recognition system can become resilient against many presentation attacks like the printed photo attacks mentioned previously.
The rest of this chapter is organized as follows: Section 1.2 overviews the main vulnerabilities of face recognition systems, making a description of several presentation attack approaches. Section 1.3 introduces presentation attack detection techniques. Section 1.4 presents some available public databases for research and evaluation of face presentation attack detection. Section 1.5 discusses different architectures and applications of face PAD. Finally, concluding remarks and future lines of work in face PAD are drawn in Section 1.6.

Vulnerabilities in Face Biometrics
In the present chapter we concentrate on Presentation Attacks, i.e. attacks against the sensor of a FRS [28] (see point V1 in Fig. 1.1). Some relevant properties of these attacks are that they require low information about the attacked system and that they present a high success probability when the FRS is not properly protected.
On the contrary, indirect attacks (points V2-V7 in Fig. 1.1) are those attacks to the inner modules of the FRS, i.e., the preprocessing module, the feature extractor, the classifier, or the enrolling database. A detailed definition of indirect attacks to face systems can be found in [35]. Indirect attacks can be prevented by improving certain points of the FRS [62], like the communication channels, the equipment and infrastructure involved and the perimeter security. The techniques needed for improving those modules are more related to "classical" cybersecurity than to biometric techniques. These attacks and their countermeasures are beyond the scope of this book but should not be underestimated.
Presentation attacks are a purely biometric vulnerability that is not shared with other IT security solutions and that needs specific countermeasures. In these attacks, intruders use some type of artefact, typically artificial (e.g. a face photo, a mask, a synthetic fingerprint, or a printed iris image), or try to mimic the aspect of genuine users (e.g., gait, signature, or facial expression [68]) to present it to the acquisition scanner and fraudulently access the biometric system.
A high amount of biometric data are exposed, (e.g. photographs and videos at social media sites) showing the face, eyes, voice and behaviour of people. Presentation attackers are aware of this reality and take advantage of those sources of information to try to circumvent face recognition systems [64]. This is one of the well-known drawbacks of biometrics: "biometric characteristics are not secrets" [39]. In this context, it is worth noting that the factors that make face an interesting characteristic for person recognition, that is, images that can be taken at a distance and in a non-intrusive way, make it also specially vulnerable to attackers who want to use biometric information in an illicit manner.
In addition to being fairly easy to obtain a face image of the legitimate users, face recognition systems are known to respond weakly to presentation attacks, for example using one of these three categories of attacks: 1. Using a photograph of the user to be impersonated [84]. 2. Using a video of the user to be impersonated [14,58]. 3. Building and using a 3D model of the attacked face, for example an hyperrealistic mask [22].
The success probability of an attack may vary considerably depending on the characteristics of the FRS, for example if it uses visible light or works in another range of the electromagnetic spectrum (e.g., infra-red lighting), if it has one or several sensors (e.g., 3D sensors, thermal sensors), the resolution, the lighting; and also depending on the characteristics of the PAI: quality of the texture, the appearance, the resolution of the presentation device, the type of support used to present the fake, or the background conditions. Without implementing presentation attack detection measures most of the stateof-the-art facial biometric systems are vulnerable to simple attacks that a regular person would detect easily. This is the case, for example, of trying to impersonate a subject using a photograph of his face. Therefore, in order to design a secure FRS in a real scenario, for instance for replacing password-based authentication, Presentation Attack Detection (PAD) techniques should be a top priority from the initial planning of the system. Given the discussion above, it could be stated that face recognition systems without PAD techniques are at clear risk, so a question often rises: What technique(s) should be adopted to secure them? The fact is that counterfeiting this type of threats is not a straightforward problem, as new specific countermeasures need to be developed and adopted whenever a new attack appears.
With the scope of encouraging and boosting the research in presentation attack detection techniques in face biometrics, there are numerous and very diverse initiatives in the form of dedicated tracks, sessions and workshops in biometricspecific and general signal processing conferences [1,2]; organization of competitions [12,16,10]; and acquisition of benchmark datasets [22,97,33,58,71] that have resulted in the proposal of new presentation attack detection methods [28,43]; standards in the area [47,48]; and patented PAD mechanisms for face recognition systems [50, 73].

Presentation Attack Methods
Typically, a FRS can be spoofed by presenting to the sensor (e.g. a camera) a photograph, a video, or a 3D mask of a targeted person (see Fig. 1.2). There are other possibilities in order to circumvent a FRS, such as using makeup [18,13] or plastic surgery. However, using photographs and videos are the most common type of attacks due to the high exposition of face (e.g. social media, video-surveillance), and the low cost of high resolution digital cameras, printers or digital screens.
Regarding the attack types, a general classification can be done taking into account the nature and the level of complexity of the PAI used to attack: photo-based, video-based, and mask-based (as can be seen in Fig. 1.2). It must be remarked that this is only a classification of the most common types of attacks, but there are some complex attacks that may not fall specifically into in any of these categories, or that may belong to several categories at the same time. This is the case of DeepFake methods, that are usually defined as techniques able to create fake videos by swap-ping the face of a person by the face of another person, and that could be classified into photo attacks, video attacks, or even mask attacks. In this chapter we have classified those more complex and special attacks in a category named "Other attacks".

Photo Attacks
A photo-attack consists in displaying a photograph of the attacked identity to the sensor of the face recognition system [5,69] (see example in Fig. 1.2).
Photo attacks are the most critical type of attack to be protected from due to several factors. On the one hand, printing color images from the face of the genuine user is really cheap and easy to do. These are usually called print-attacks in the literature [6]. Alternatively, the photos can be displayed in the high-resolution screen of a device (e.g. a smartphone, a tablet or a laptop [5,14,97]). On the other hand, it is also easy to obtain samples of genuine faces thanks to the recent growth of social media sites like Facebook, Twitter, and Instagram [64]. Additionally, with the price and size reduction experimented by digital cameras in recent years, it is also possible to obtain high-quality photos of a legitimate user simply by using a hidden camera.
Among the photo attack techniques there are also more complex approaches like photographic masks. This technique consists in printing a photograph of the subject's face and then making holes for the eyes and the mouth [97]. This is a good way to avoid presentation attack detection techniques based on blink detection and in eyes and mouth movement tracking [78].
Even if these attacks may seem too simple to work in a real scenario, some studies indicate that many state-of-the-art systems are vulnerable to them [65,77,74]. Due to their simplicity, implementing effective countermeasures that perform well against them should be a must for any facial recognition system.
• Information needed to perform the attack: image of the face of the subject to be impersonated. • Generation and acquisition of the PAIs: there are plenty of options to obtain high quality face images of the users to be impersonated, e.g., social networks, internet profiles, and hidden cameras. Then, those photographs can be printed or displayed on a screen in order to present them to the sensor of the FRS. • Expected impact of the attack: most basic face recognition systems are vulnerable to this type of attack if specific countermeasures are not implemented. However, the literature offers a large number of approaches with good detection rates of printed photo attacks [5,7].

Video Attacks
Similarly to the case of photo attacks, video acquisition of people intended to be impersonated is also becoming increasingly easier with the growth of public video sharing sites and social networks, or even using a hidden camera. Another reason to use this type of attack is that it increases the probability of success by introducing liveness appearance to the displayed fake biometric sample [79,70]. Once a video of the legitimate user is obtained, one attacker could play it in any device that reproduces video (smartphone, tablet, laptop, etc) and then present it to the sensor/camera [52], (see Fig. 1.2). This type of attacks is often referred to in the literature as replay attacks, a more sophisticated version of the simple photo attacks.
Replay attacks are more difficult to detect, compared to photo attacks, as not only the face texture and shape is emulated but also its dynamics, like eye-blinking, mouth and/or facial movements [14]. Due to their higher sophistication, it is reasonable to assume that systems that are vulnerable to photo attacks will perform even worse with respect to video attacks, and also that being resilient against photo attacks does not mean to be equally strong against video attacks [97]. Therefore, specific countermeasures need to be developed and implemented, e.g., an authentication protocol based on challenge-response [78].
• Information needed to perform the attack: video of the face of the subject to be impersonated. • Generation and acquisition of the PAIs: similarly to the case of photo attacks, obtaining face videos of the users to be impersonated is relatively easy thanks to the growth of video sharing platforms (YouTube, Twitch) and social networks (Facebook, Instagram), and also using hidden cameras. The videos are then displayed on a screen in order to present them to the sensor of the FRS.
• Expected impact of the attack: like in the case of photo attacks most face recognition systems are inherently vulnerable to these attacks, and countermeasures based on challenge-response or in the appearance of the faces are normally implemented. With these countermeasures, classic video attacks have a low success rate.

Mask Attacks
In this type of attack the PAI is a 3D mask of the user's face. The attacker builds a 3D reconstruction of the face and presents it to the sensor/camera. Mask attacks require more skills to be well executed than the previous attacks, and also access to extra information in order to construct a realistic mask of the genuine user [61,8].
There are different types of masks depending on the complexity of the manufacturing process and the amount of data that is required. Some examples, ordered from simpler to more complex are: • The simplest method is to print a 2D photograph of the user's face and then stick it to a deformable structure. Examples of this type of structures could be a t-shirt or a plastic bag. Finally, the attacker can put the bag on his face and present it to the biometric sensor [97]. This attack can mimic some deformable patterns of the human face, allowing to spoof some low level 3D face recognition systems. • Image reconstruction techniques can generate 3D models from 2 or more pictures of the genuine user's face, e.g. one frontal photo and a profile photo. Using these photographs, the attacker could be able to extrapolate a 3D reconstruction of the real face 1 (see Fig. 1.2). This method is unlikely to spoof top-level 3D face recognition systems, but it can be an easy and cheap option to spoof a high number of standard systems. • A more sophisticated method consists in making directly a 3D capture of a genuine user's face [30,22,8] (see Fig. 1.3). This method entails a higher level of Left) The 17 hard-resin facial masks used to create the 3DMAD dataset, from [22]. Right) Face Masks built by Real-F reproducing even the eyeballs and finest skin details.
difficulty than the previous ones since a 3D acquisition can be done only with dedicated equipment and it is complex to obtain without the cooperation of the end-user. However, this is becoming more feasible and easier each day with the new generation of affordable 3D acquisition sensors [45].
When using any of the two last methods, the attacker would be able to build a 3D mask with the model he has computed. Even though the price of 3D printing devices is decreasing, 3D printers with suficient quality and definition are still expensive. See references [30,8] for examples of 3D-printed masks. There are some companies where such 3D face models may be obtained for a reasonable price 2 .
This type of attack may be more likely to succeed due to the high realism of the spoofs. As the complete structure of the face is imitated, it becomes difficult to find effective countermeasures. For example, the use of depth information becomes inefficient against this particular threat.
These attacks are far less common than the previous two categories because of the difficulties mentioned above to generate the spoofs. Despite the technical complexity, mask attacks have started to be systematically studied thanks to the acquisition of the first specific databases which include masks of different materials and sizes [22,30,53,61,8,60].
• Information needed to perform the attack: 2D masks can be created using only one face image of the user to be impersonated. However, 3D realistic masks usually need 3 or more face images acquired from different angles. • Generation and acquisition of the PAIs: compared to photo and video attacks it is more difficult to generate realistic 3D masks since the attacker needs images of high quality captured from different and complementary angles. Using the photographs, face masks can be orderer to third companies for a reasonable price. • Expected impact of the attack: these attacks are more challenging than photo and video attacks because of the higher realism of the PAIs. However, they are less common due to the difficulty in generating the masks.

Other Attacks
There are other possibilities in order to circumvent a face recognition system, such as using DeepFake techniques, facial makeup, or modifications via plastic surgery. Together to the recent availability of large-scale face databases, the progress of deep learning methods like Generative Adversarial Networks (GANs) [38] has led to the emergence of new realistic face manipulation techniques that can be used to spoof face recognition systems. The term Identity Swap (commonly known as DeepFakes) englobes the manipulation techniques consisting in replacing the face of one person in a video with the face of another person. User-friendly applications like FaceApp allow to create fake face images and videos without the need of any previous coding experience. Public information from social networks can be used to create realistic fake videos capable to spoof a FRS, e.g., by means of a replay attack. Recent examples of DeepFake video databases are Celeb-DF [58] and DFDC [20]. DeepFake techniques are evolving very fast, with their outputs becoming more and more realistic each day, so countermeasuring them is a very challenging problem [87,44].
Works like [18] studied the impact of facial makeup in the accuracy of automatic face recognition systems. They focused their work on determining if facial makeup can affect the matching accuracy of a FRS. They acquired two different databases of females with and without makeup and they tested the accuracy of several face recognition systems whe using those images. They concluded that the accuracy of the FRS is hugely impacted by the presence of facial makeup.
Nowadays, the technology advancements and the social acceptance have led to a higher presence of plastic surgery among the population. Therefore, the authors of [80] and [3] focused their research on determining the level of affectance of face recognition accuracy when using images with presence of plastic surgery that modifies facial appearance. In [80] they reported a high reduction of face recognition accuracy (around a 30%) of several matching algorithms when comparing images with and without plastic surgery modifications.
• Information needed to perform the attack: in the case of DeepFake attacks, PAIs can be created only with a few photographs of the targeted subject. Makeup and surgery also need information about the face of the user to be impersonated. • Generation and acquisition of the PAIs: similarly to the case of the previous types of attacks, obtaining face images and videos of the users to be impersonated can be easy thanks to video sharing platforms and social networks. Then, the DeepFake videos can be displayed on a screen to present them to the camera of the FRS. Makeup-based attacks need of certain skills to achieve a high quality makeup. Attacks based on surgery modifications are much harder to achieve since they need of highly qualified professionals and of some recovery time after the modifications. • Expected impact of the attack: DeepFake attacks are more difficult to detect than other attacks and how to prevent them is a very active research area nowadays. Surgery attacks are also very difficult to detect since they are actually faces and not synthetic fakes. Makeup attacks, on the other hand, can be detected more easily using PAD techniques based on texture or color, like in the case of photo and video attacks.

Presentation Attack Detection
Face recognition systems are designed to differentiate between genuine users, not to determine if the biometric sample presented to the sensor is legitimate or a fake. A presentation attack detection method is usually accepted to be any technique that is able to automatically distinguish between legitimate biometric characteristics presented to the sensor and artificially produced PAIs.
Presentation attack detection can be done in four different ways [40]: (i) with dedicated hardware to detect an evidence of liveness, which is not always possible to deploy, (ii) with a challenge-response method where a presentation attack can be detected by requesting the user to interact with the system in a specific way, (iii) employing recognition algorithms intrinsically resilient against attacks, and (iv) with software that uses already available sensors to detect any pattern characteristic of live traits. Fig. 1.4 shows how PAD methods are organized according this proposed taxonomy.
• Hardware-based: PAD approaches based on dedicated hardware usually take benefit of special sensors like Near Infrared (NIR) cameras [43], thermal sensors [9], Light Field Cameras (LFC) [72], multispectral sensors [93], and 3D cameras [54]. Using the unique properties of the different types of dedicated hardware, the biological and physical characteristics of legitimate faces can be measured and distinguished from PAIs more easily, e.g., processing temperature information with thermal cameras [83] and estimating the 3D volume of the artifacts thanks to 3D acquisition sensors [54]. However, these approaches are not popular even though they tend to achieve high presentation detection rates, because in most systems the required hardware is expensive and not broadly available. • Challenge-Response: These PAD methods present a challenge to the user, i.e., completing a predefined task, or expose them to a stimulus in order to record their voluntary or involuntary response. Then that response is analyzed to decide if the access attempt comes from a legitimate user or from an attacker. An example of this approach can be found in [81], where the authors studied the involuntary eye response of users exposed to a visual stimulus. Other examples are [78] where the authors requested the users to make specific movements with their eyes and [17] where the users were indicated to say some predefined words. Challenge-response methods can be effective against many presentation attacks but they usually require more time and cooperation from users' side, something that is not always possible or desirable. • Robust algorithms: Existing face recognition systems can be designed or trained to learn how to distinguish between legitimate faces and PAIs, making them inherently robust to some types of presentation attacks. However, developing face recognition algorithms intrinsically robust against presentation attacks is  not straightforward and the most common approach consists in relying on multimodal biometrics to increment the security level thanks to the information coming from the other biometric modalities.
The limitations of these three types of PAD methods, together with the easiness of deploying software-based PAD methods, have made most of the literature on face Presentation Attack Methods (PAD) to be focused on running software-based PAD algorithms over already deployed hardware. This is why in the next part of the chapter we focus on describing software-based PAD and the different categories that compose this type of approach.

Software-based face PAD
Software-based PAD methods are convinient in most of the cases since they allow to upgrade the countermeasures in existing systems without needing new pieces of hardware and permitting authentication to be done in real time without extra user interaction. Table 1.1 shows a selection of relevant PAD works based on software techniques, including information about the type of images they use, the databases in which they are evaluated, and the types of features they analyze. The table also illustrates the current dominance of deep learning among PAD methods, since like in many other research areas, during the last years most state-of-the-art face PAD works have changed from methods based on hand-crafted features to deep learning approaches based on architectures like Convolutional Neural Networks and Generative Adversarial Networks.
Regardless of whether they belong to one category (hand-crafted) or the other (deep learning), software-based PAD methods can be divided into two main categories depending on whether they take into account temporal information or not: static and dynamic analysis.

Static Analysis
This subsection refers to the development of techniques that analyze static features like the facial texture to discover unnatural characteristics that may be related to presentation attacks.
The key idea of the texture-based approach is to learn and detect the structure of facial micro-textures that characterise real faces but not fake ones. Micro-texture analysis has been effectively used in detecting photo attacks from single face images: extraction of texture descriptions such as Local Binary Patterns (LBP) [14] or Gray-Level Co-occurrence Matrices (GLCM) followed by a learning stage to perform discrimination between textures.
For example, the recapturing process by a potential attacker, the printing of an image to create a spoof, usually introduces quality degradation in the sample, making it possible to distinguish between a genuine access attempt and an attack, by analyzing their textures [29].
The major drawback of texture-based presentation attack detection is that high resolution images are required in order to extract the fine details from the faces that are needed for discriminating genuine faces from presentation attacks. These countermeasures will not work properly with bad illumination conditions that make the captured images to have bad quality in general.
Most of the time, the differences between genuine faces and artificial materials can be seen in images acquired in the visual spectrum with or without a preprocessing stage. However, sometimes a translation to a more proper feature space [95], or working with images from outside the visible spectrum [37] is needed in order to distinguish between real faces and spoof-attack images.
Aditionally to the texture, there are other properties of the human face and skin that can be exploited to differentiate between real and fake samples. Some of these properties are: absorption, reflection, scattering, and refraction [51].
This type of approaches may be useful to detect photo-attacks, video-attacks, and also mask-attacks, since all kinds of spoofs may present texture or optical properties different than real faces.
In recent years, to improve the accuracy of traditional static face PAD methods the researchers have been focused on applying the power of deep learning to face PAD mainly using transfer-learning from face recognition. This technique makes possible to adapt facial features learned for face recognition to face presentation attack detection without the need of a huge amount of labeled data. This is the case of [33] where the authors transfer facial features learned for face recognition and used them for detecting presentation attacks. Finally, to increase the generalization ability of their method to unseen attacks, they fused the decisions of different models trained with distinct types of attacks.
However, even though deep learning methods have shown to be really accurate when evaluated in intra-database scenarios, their performance usually drops significantly when they are tested under inter-database scenarios. Deep learning models are capable of learning directly from data, but they are normally overfitted to the training databases, causing poor generalization of the resulting models when fac-ing data from other sources. To avoid this, the most recent works in the literature face this problem by implementing domain generalization techniques. For example, the authors of [32] introduced a novel loss function to force their model to learn a compact embedding for genuine faces while being far from the embeddings of the different presentation attacks.

Dynamic Analysis
These techniques have the target of distinguishing presentation attacks from genuine access attempts based on the analysis of motion. The analysis may consist in detecting any physiological sign of life, for example: pulse [42], eye-blinking [19], facial expression changes [68], or mouth movements. This objective is achieved using knowledge of the human anatomy and physiology.
As stated in Section 1.2, photo attacks are not able to reproduce all signs of life because of their static nature. However, video attacks and mask attacks can emulate blinking, mouth movements, etc. Related to these types of presentation attacks, it can be assumed that the movement of the PAIs, differs from the movement of real human faces which are complex nonrigid 3D objects with deformations.
One simple aproximation to this type of countermeasures consists in trying to find correlations between the movement of the face and the movement of the background respect to the camera [5,52]. If the fake face presented contains also a piece of fake background, the correlation between the movement of both regions should be high. This could be the case of a replay attack, in which the face is shown on the screen of some device. This correlation in the movements allows to evaluate the degree of synchronization within the scene during a defined period of time. If there is no movement, as in the case of a fixed support attack, or too much movement, as in a hand-based attack, the input data is likely to come from a presentation attack. Genuine authentication will usually have uncorrelated movement between the face and the background, since user's head generally moves independently from the background.
Other example of this type of countermeasures is [70] where the authors propose a method for detecting face presentation attacks based on properties of the scenario and the facial surfaces such as albedo, depth, and reflectance.
A high number of the software-based PAD techniques are based on liveness detection without needing any special help of the user. These presentation attack detection techniques aim to detect some physiological signs of life such as eye blinking [19,92,67], facial expression changes [68], and mouth movements.
Other works like [7] provide more evidence of liveness using Eulerian video magnification [91] applying it to enhance small changes in face regions, that often go unnoticed. Some changes that are amplified thanks to this technique are, for example, small color and motion changes on the face caused by the human blood flow, by finding peaks in the frequency domain that correspond to the human heartbeat rate. Works like [43, 94, 44] use remote photoplethysmography for liveness detection, and more specifically 3D mask PAD, without relying on the appearance features of the spoof like the texture, shape, etc.
As metioned above, motion analysis approaches usually require some level of motion between different head parts or between the head and the background. Sometimes this can be achieved through user cooperation [82]. Therefore, some of these techniques can only be used in scenarios without time requirements as they may need time for analyzing a piece of video and/or for recording the user's response to a command. Due to the nature of these approaches, some videos and well-performed mask attacks may deceive the countermeasures.

Face Presentation Attacks Databases
In this section we overview some publicly available databases for research in face PAD. The information contained in these datasets can be used for the development and evaluation of new face PAD techniques against presentation attacks.
As it has been mentioned in the past sections, with the recent spread of biometric applications, the threat of presentation attacks has grown, and the biometric community is starting to acquire large and comprehensive databases to make recognition systems more resilient against presentation attacks.
International competitions have played a key role to promote the development of PAD measures. These competitions include the recent LivDet-Face 2021 [71], the CelebA-Spoof Challenge 2020 [58], the ChaLearn Face Antispoofing Attack Detection Challenge 2019 [59], the Multi-modal Face Anti-spoofing (Presentation Attack Detection) Challenge 2019 [96], the Competition on Generalized Face Presentation Attack Detection in Mobile Authentication Scenarios 2017 [10], and the 2011 and 2013 2D Face Anti-Spoofing contests [12,16].
Despite the increasing interest of the community in studying the vulnerabilities of face recognition systems, the availability of PAD databases is still scarce. The acquisition of new datasets is highly difficult because of two main reasons: • Technical aspects: the acquisition of presentation attack data offers additional challenges to the usual difficulties encountered in the acquisition of standard biometric databases [66] in order to correctly capture similar fake data than the present in real attacks (e.g., generation of multiple types of PAIs). • Legal aspects: as in the face recognition field in general, data protection limits the distribution or sharing of biometric databases among research groups. These legal restrictions have forced most laboratories or companies working in the field of presentation attacks to acquire their own datasets usually small and limited.
In the area of face recognition PAD, we can find the following public databases (ordered chronologically following their publication date): • The NUAA Photo Imposter Database (NUAA PI DB) [84] was one of the first efforts to generate a large public face PAD dataset. It contains images of real access attempts and print-attacks of 15 users. The images contain frontal faces with a neutral expression captured using a webcam. Users were also told to avoid eye-blinks. The attacks are performed using printed photographs on photographic paper. Examples from this database can be seen in Fig. 1.5. The NUAA PI DB is property of the Nanjing University of Aeronautics and Astronautics.
• The PRINT-ATTACK DB [6] represents another step in the evolution of face PAD databases, both in terms of the size (50 different users were captured) and of the types of data acquired (it contains video sequences instead of still images). It only considers the case of photo attacks. It consists of 200 videos of real accesses and 200 videos of print attack attempts from 50 different users. Videos were recorded under two different background and illumination conditions. Attacks were carried out with hard copies of high resolution photographs of the 50 users, printed on plain A4 paper. The PRINT-ATTACK DB is property of the Idiap Research Institute.
• The REPLAY-ATTACK database [14], is an extension of the PRINT-ATTACK database. It contains short videos of both real-access and presentation attack attempts of 50 different subjects. The attack attempts present in the database are 1300 photo and video attacks using mobile phones and tablets under different lighting conditions. The attack attempts are also distinguished depending on how the attack device is hold: hand-based and fixed-support. Examples from this database can be seen in Fig. 1.6.
• The 3D MASK-ATTACK DB (3DMAD) [22], as its name indicates, contains information related to mask-attacks. As described above, all previous databases contain attacks performed with 2D spoofing artifacts (i.e., photo or video) that are very rarely effective against systems capturing 3D face data. It contains access attempts of 17 different users. The attacks were performed with real-size 3D masks manufactured by ThatsMyFace.com 3 . For each access attempt a video  [84]. Samples from two different users are shown. Each row corresponds to one different session. In each row, the left pair are from a live human and the right pair from a photo fake. Images have been taken from [84].
was captured using the Microsoft Kinect for Xbox 360, that provides RGB data and also depth information. That allows to evaluate both 2D and 3D PAD techniques, and also their fusion [30]. Example masks from this database can be seen in Fig. 1.3. 3DMAD is property of the Idiap Research Institute.
• The OULU-NPU DB [11], contains information of presentation attacks acquired with mobile devices. Nowadays mobile authentication is one of the most relevant scenarios due to the wide spread of the use of smartphones. However, in most datasets the images are acquired in constrained conditions. This type of data may present motion, blur, and changing illumination conditions, backgrounds and head poses. The database consists of 5, 940 videos of 55 subjects recorded in three distinct illumination conditions, with 6 different smartphone models. The resolution of all videos is 1920×1080 and it comprehends print and video-replay attacks. The OULU-NPU DB is property of the University of Oulu and it has been used in the IJCB 2017 Competition on Generalized Face Presentation Attack Detection [10]. Examples from this database can be seen in Fig. 1.7.
• The Custom Silicone Mask Attack Dataset (CSMAD) [8] (collected at the Idiap Research Institute) contains 3D mask presentation attacks. It is comprised of face data from 14 subjects, from which 6 subjects has been selected to construct realistic silicone masks (made by Nimba Creations Ltd.). The database contains 87 bonafide videos and 159 attack videos captured under four different lighting conditions. CSMAD is composed of RGB, Depth, NIR, and thermal videos of 10 seconds of duration. Fig. 1.6 Examples of real and fake samples from the REPLAY-ATTACK DB [14]. The images come from videos acquired in two illumination and background scenarios (controlled and adverse). The first row belongs to the controlled scenario while the second row represents the adverse conditions. (a) Shows real samples, (b) shows samples of a printed photo attack, (c) corresponds to a LCD photo attack, and (d) to a high-definition photo attack.
• The Wide Multi Channel Presentation Attack Database (WMCA) [33] consists of video recordings of 10 seconds for both bonafide attemps and presentation attacks. The database is composed of RGB, Depth, NIR, and thermal videos of 72 different subjects, with 7 sessions for each subject. WCMA contains 2D and 3D presentation attacks including print, replay, and paper and silicone mask attacks. The total number of videos in the database is 1, 679 (1, 332 are attacks).
• The CelebA-Spoof Database [58] is a large-scale face anti-spoofing dataset with 625, 537 images from 10, 177 different subjects. The database includes labels for 43 attributes related to the face, the illumination conditions, the environment, and the spoof types. The spoof images were captured on 2 different environments and under 4 illumination conditions using 10 different acquisition devices. CelebA-Spoof contains 10 different attack types, e.g., print attacks, replay attacks, and 3D masks.
• The LiveDet Database [71], is a dataset built as a combination of data from two of the organizers of the Face Liveness Detection Competition (LivDet-Face 2021). The final database contains data from 48 subjects, with a total of 724 images and 814 videos (of 6 seconds) acquired using 5 different sensors including reflex cameras and mobile devices. 8 different presentation artifacts were used for the images and 9 for the videos, comprehending paper photographs, photograps shown from digital screens (e.g., a laptop), paper masks, 3D silicone masks, and video replays.
Finally, we include the description of two of the most challenging DeepFake databases up to date [63,86], i.e., Celeb-DF v2 and DFDC. The videos in these databases contain DeepFakes with a large range of variations in face sizes, illumination, environments, pose variations, etc. DeepFake videos can be used for example, to create a video with the face of a user and use it for a replay attack against a FRS.

Integration with Face Recognition Systems
In order to create a face recognition system resistant to presentation attacks, the proper PAD techniques have to be selected. After that, the integration of the PAD countermeasures with the FRS can be done at different levels, namely, score-level or decision-level fusion [15,23].
The first possibility consists in using score level fusion as shown in Fig. 1.8. This is a popular approach due to its simplicity and the good results given in fusion of multimodal biometric systems [25,24,76]. In this case, the biometric data enter at the same time to both the face recognition system and the PAD system, and each one computes their own scores. Then the scores from each system are combined into a new final score that is used to determine if the sample comes from a genuine user or not. The main advantage of this approach is its speed, as both modules, i.e. the PAD and face recognition modules, perform their operations at the same time. This fact DB Score Recog. Score PAD Score Mated Instances Non-mated instances Fig. 1.8 Scheme of a parallel score-level fusion between a PAD and a face recognition system. In this type of scheme, the input biometric data is sent at the same time to both the face recognition system and the PAD system, and each one generates a independent score, then the two scores are fused to take one unique decision.
can be exploited in systems with good parallel computation specifications, such as those with multicore/multithread processors.
Another common way to combine PAD and face recognition systems is a serial scheme, as in Fig. 1.9, in which the PAD system makes its decision first, and only if the samples are determined to come from a living person, then they are processed by the face recognition system. Thanks to this decision-level fusion, the FRS will search for the identity that corresponds to the biometric sample knowing previously that the sample does not come from a presentation attack. Differently to the parallel approach, in the serial scheme the average time for an access attempt will be longer due to the consecutive delays of the PAD and the face recognition modules. However, this approach avoids extra work to the face recognition system in the case of a PAD attack, since it should be detected in an early stage.

Conclusion and Look Ahead on Face PAD
Face recognition systems are increasingly being deployed in a diversity of scenarios and applications. Due to this widespread use, they have to withstand a high variety of attacks. Among all these threats, one with high impact are presentation attacks.
In this chapter, an introduction of the strengths and vulnerabilities of face as a biometric characteristic has been presented, including key resources and advances in the field in the last few years. We have described the main presentation attacks, differentiating between multiple approaches, the corresponding PAD countermeasures, and the public databases that can be used to evaluate new protection tech-  Fig. 1.9 Scheme of a serial fusion between a PAD and a face recognition system. In this type of scheme the PAD system makes its decision first, and only if the samples are determined to come from a living person, then they are processed by the face recognition system. niques. The weak points of the existing countermeasures have been stated, and also some possible future directions to deal with those weaknesses have been discussed.
Due to the nature of face recognition systems, without the correct PAD countermeasures, most of the state-of-the-art systems are vulnerable to attacks since they do not integrate any module to discriminate between legitimate and fake samples. Usually, PAD techniques are developed to fight against one concrete type of attack (e.g. printed photos), retrieved from a specific dataset. The countermeasures are thus designed to achieve high presentation attack detection against that particular spoof technique. However, when testing these same techniques against other type of PAIs (e.g. video-replay), usually the system is unable to efficiently detect them. There is one important lesson to be learned from this fact: there is not a superior PAD technique that outperforms all the others in all conditions; so knowing which technique to use against each type of attack is a key element. It would be interesting to use different countermeasures that have proved to be effective against particular types of PAIs, in order to develop fusion schemes that combine their results, achieving that way a high performance against a variety of presentation attacks data [24,25,40].
In addition, as technology progresses constantly, new hardware devices and software techniques continue to appear. This is the case of the recent and popular Deep-Fakes, a term that englobes those methods capable of generating images and videos with very realistic face spoofs using deep learning methods and few input data. From the detection point of view it is also important to keep track of this quick technological progress in order to use it to develop more efficient presentation attack detection techniques. For example, using the power of deep learning and some of its associated techniques like transfer-learning has shown to improve the accuracy of PAD methods in the recent years [33]. Additionally, focusing the research on the biological nature of biometric characteristics (e.g. thermogram, blood flow, etc.) should be considered [44,57], as the standard techniques based on texture and movement seem to be inefficient against some PAIs.
Additionally, it is of the utmost importance to collect new databases with new scenarios in order to develop more effective PAD methods. Otherwise, it will be difficult to grant an acceptable level of security of face recognition systems. However, it is especially challenging to recreate realistic attacking conditions in a laboratory evaluation. Under controlled conditions, systems are tested against a restricted num-ber of typical PAIs. These restrictions make it unfeasible to collect a database with all the different fake spoofs that may be found in the real world.
To conclude this introductory chapter, it could be said that even though a great amount of work has been done to fight face presentation attacks, there are still big challenges to be addressed in this topic, due to the evolving nature of the attacks, and the critical applications in which these systems are deployed in the real world.