dataesr/scientific-paragraphs-categorization huggingface dataset:
A. Hot Loops (HLs) Extraction and Detection (1-3) LLVM front-end receives the source code to compile and extract the corresponding IR code. Moreover, the IR is inserted to an LLVM transformation pass to instrument IR code. Then, the HLs are extracted during early run. The output of this preparatory step is a new modified IR with identified HLs. The new IR is executed using LLVM modified interpreter till reaching a HL to begin our analysis. The LLVM interpreter would detect the HL using the added annotations.
E. Dependence Flags Map and Recommendations (7) The output is a map that consists of two different instructions and a flag, with values true for dependent pairs, and false for independent pairs. Also, our system could send a flag for parallelization recommendation 1 for parallel possibility and 0 for sequential execution. F. Resuming Current HL Execution in SP  (8) (9)  Typical execution environments, such as HotSpot for the Java bytecode  [31] , rely on adaptive compilation. An interpreter first runs the bytecode without any startup delay. While executing, the interpreter collects information about the frequency of functions and various regions, such as loops. When a function is deemed critical enough, based on a predefined recompilation policy, the system decides to invoke a JIT compiler to produce native code.
Low optimization levels guarantee short compilation time. Again, the code is monitored using our interpreter. When a second threshold is reached, the JIT compiler is invoked again, at a higher optimization level. The process repeats until the most aggressive optimizations are applied. By doing so, the systems only spends compilation time on the critical regions, and optimization time is recouped. Our approach could detect from step 7 whether the current HL has the ability to be parallelized or not. As shown in Figure  2 , by detecting during interpretation that a loop is parallel and no dependent instruction pairs at the same HL, our system has the ability to immediately apply parallelization (a typically aggressive optimization), hereby skipping the intermediate optimization levels. Parallelization is applied to the running loop, for the remaining iterations.
If there is no detected problems, the checkpoint commits the acquired work in parallel execution. The SP technique of Yusuf et al. [32]  would be suggested to be applied at the highest level of optimization. This optimization jump would be useful for executing the program in parallel whenever our method generate its recommendations for current HL. The running HL analysis would be correct for the same analyzed trace. In rare cases, if the trace would change, the SP would take the decision to resume at parallel or serial. Moreover, it would be able to roll-back for any occurred violation. Therefore, the interpreter jumps to the highest level of optimization to resume the remaining iterations using SP in IR-level. After the current HL is interpreted and executed whatever in parallel or serial, the interpretation is resumed in LLVM interpreter till reaching a new HL.
VI. EXPERIMENTAL RESULTS In this section, we study the main results generated by our proposed AI method shown in Figure  1. We used Intel Core i7-2670QM CPU 2. 20 GHz x8. Moreover, the machine runs Ubuntu 14. 04 LTS 64-bit Linux operating system. The approach is implemented on LLVM version 3. 9. 0. We study our technique on a number of kernels of the Polyhedral Benchmark suite, Polybench  [33]. The Polybench kernels are applied as a single file to compute the kernel instrumentation. Also, each kernel has loop bounds which are parametric in order to be applied with general-purpose implementation. The excluded kernels contain instructions that are not applicable with the original LLVM interpreter. The technique is applied in all hot loops in each kernel in the main two functions (init and kernel).
These missing program points have never been passed, executed, during the current run of the hot trace in each hot loop. Finally, the non-mentioned for-loops are actually not included in hot loops. Thus, they are out of our concern. We applied a simple static AI version by setting the initial values of uninitialized variables to [-∞, ∞]. The results of loops will be dependent in most cases which are actually incorrect. Figure  4  presents the overhead in terms of the difference in execution time on the selected kernels running by original LLVM interpreter in comparison with our modified version. The overhead is computed using the following equation: Overhead = (Time m -Time o )/Time o (4) Overhead: refers to the main metric of execution time for our approach. Time m : refers to the execution time using our modified LLVM interpreter.
VII. CONCLUSIONS AND FUTURE WORK This paper investigated how to manage systems to detect data dependence at IR-level at runtime. The proposed analysis would be utilized in order to execute speculative parallelized system efficiently without re-compilation or re-execution. The proposed approach detects data dependence during program interpretation without requiring a separate analysis pass. The interpreter relies on conducting data dependence analysis on HLs through using AI. Our system applied the analysis in the LLVM interpreter and conducted a preliminary performance study on a set of kernels from the Polybench benchmark. The overhead range is from 0. 88 to 1. 49. Moreover, the results show accurate dependence analysis. Based on the analysis provided by our approach, we suggested how to manage the parallelization technique at the same run by jumping to the highest level of optimization to eliminate the overhead with more speedup.
Despite their totally different objectives, both types of attacks are listed in the ISO standard  [16]  dedicated to biometric PAD. In this survey paper, we focus on impersonation (spoofing) attacks, where the impostor might either use directly biometric data from a legitimate user to mount an attack or to create Presentation Attack Instruments (PAIs, usually spoofs or fakes) that will be used for attacking the face recognition system. Common PAs/PAIs can generally be categorized as photo attacks, video replay attacks and 3D mask attacks (see Figure  1  for their categorization and Figure  2  for illustrations), whereas obfuscation attacks generally rely on tricks to hide the user's real identity, such as facial makeup, plastic surgery or face region occlusion. Examples of common facial presentation attacks: (a) a printed photo attack from the SiW dataset  [17] ; (b) an example of a warped photo attack extracted from  [18] ; (c) an example of a cut photo attack extracted from  [18] ; (d) a video replay attack from the CASIA-FASD dataset  [19] ; (e) a paper-crafted mask from UMRE  [20] ; and (f) a high-quality 3D mask attack from REAL-f  [17].
Structure of This Paper The remainder of this paper is structured as follows. In Section 2, we propose a typology for facial PAD methods based on RGB cameras from GCDs and review the most representative/recent approaches for each category. In Section 3, we present a summarized overview of the most used/interesting datasets together with their main advantages and limitations. Then, Section 4 presents a comparative evaluation of the reviewed PAD methods. Section 5 provides a discussion about current trends and some insights for future directions of research. Finally, we draw the conclusions in Section 6.
The rPPG signals are extracted from three facial regions (forehead and left/right cheeks) and two background regions (on the left and right sides of the facial region). The use of background regions provides robustness against noise due to illumination fluctuations, as this noise can be subtracted from the facial regions after having been detected in the background regions. Finally, the Fourier spectrum's magnitudes of the filtered rPPG signals are fed into an SVM or a Random Forest Classifier  [108]. The authors showed experimentally the interest of using background regions, and their method obtained better performances than the one in  [51]  on some dataset. In 2018, Liu et al. [33]  proposed a deep learning-based approach that can learn rPPG signals in a robust way (under different poses, illumination conditions and facial expression).
Then, the high-level descriptors are weighted using average pooling to extract higher-level image representations. Finally, the histogram of these image representations are concatenated into a single feature vector fed into an SVM classifier to detect PAs. In 2013, Kose et al. [56]  first proposed a static texture-based approach to detect 3D mask attacks. Due to the unavailability of public mask attack databases at that time, 3D mask PADs were much less studied than photo or video replay attacks. In this work, the LBP-based method in  [55]  is directly applied to detect 3D mask attacks by using the texture (original) image or depth image of the 3D mask attacks (from a self-constructed database), as shown in Figure  14. Note that all the texture images and the depth images were obtained by MORPHO (http://www.
morpho. com/). This work showed that using the texture (original) image is better than using a depth image for detecting 3D mask attacks with LBP features. The authors also proposed in  [57]  to improve this method by fusing the LBP features of the texture image and depth image. They showed the superiority of this approach toward the previous method (using only texture images). Erdogmus et al. [25, 58]  also proposed in 2013 a method for 3D mask attack detection based on LBP. They used different classifiers, such as Linear Discriminant Analysis (LDA) and SVMs. On the proposed 3D Mask Attack Database (3DMAD), which is also the first public spoofing database for 3D mask attacks, LDA was proved to be best among the tested classifiers. Galbally et al. [64, 65]  introduced in 2013 and 2014 new facial PAD methods based on Image Quality Assessment (IQA), assuming that a spoofing image captured in a photo or video replay PA should have a different quality than a real sample, as it was captured twice instead of once for genuine faces (this idea is similar to the underlying idea of the method in  [52]  presented above).
8 or 2. 6. These results are consistent with the previous studies in  [62, 63]  that had already shown that including more context information from the background can help facial PAD. It was the first time that CNNs were proven to be effective for automatically learning texture features for face PAD. This method has surpassed almost all the existing state-of-the-art methods for photo and video replay attacks. It showed the potential of deep CNNs for face PAD. Later, more and more CNN-based methods were explored for facial PAD. In 2016, Patel et al. [67]  first proposed an end-to-end framework based on one-path AlexNet  [2] , namely CaffeNet, for facial PAD. A two-way softmax replaced the original 1000-way softmax as a binary classifier. Given the small sizes of existing face spoof databases, especially at that time, such deep CNNs were likely to overfit  [67]  if trained on such datasets.
Therefore, the proposed CNN was pretrained on ImageNet  [129]  and WebFace  [130]  to provide a reasonable initialization and fine-tuned using the existing face PAD databases. More specifically, two separate CNNs are trained, respectively from aligned face images and enlarged images including some background. Finally, a voting fusion is used to generate a final decision. Just like Yang et al. 's method  [34] , the proposed CNN-based method has surpassed the state-of-the-art methods based on hand-crafted features for photo and video replay attacks. Also in 2016, Li et al. [68]  proposed to train a deep CNN based on VGG-Face  [7]  for facial PAD. As in  [67] , the CNN was pretrained on massive datasets and fine-tuned on the (way smaller) facial spoofing database. Furthermore, the features extracted from the different layers of the CNN were fused to a single feature and fed into an SVM for facial PAD.
Benefitting from using a deeper CNN based on VGG-Face, the proposed method has achieved state-of-the-art performances in both intra-dataset and cross-dataset scenarios (see Section 4) for detecting photo and video replay attacks. In 2018, Jourabloo et al. [69]  proposed to estimate the noise of a given spoof face image to detect photo/video replay attacks (the authors also claimed that the proposed method could be applied to detect makeup attacks). In this work, the spoof image was regarded as the summation of the genuine image and image-dependent noise (e. g. , blurring, reflection and moiré pattern) introduced when generating the spoof image. Since the noise of a genuine image was assumed as zero in this work, a spoof image can be detected by thresholding the estimated noise. A GAN framework based on CNNs, De-Spoof Net (DS Net), was proposed to estimate the noise.
Then, the conventional LBP operation can be applied to each of the three planes. The concatenation of the three LBP features extracted from the three orthogonal planes generates the LBP-TOP feature of the current image. Similar to many static LBP-based facial PAD methods, LBP-TOP is then fed into a classifier such as SVM, LDA or χ 2 distance-based classifier to perform facial PAD. In 2013, the same authors extended their work  [73]  by proposing two new training strategies to improve generalization. One strategy was to train the model with the combination of multiple datasets. The other was to use a score level fusion-based framework, in which the model was trained on each dataset, and a sum of the normalized score of each trained model was used as the final output. Despite the fact that these two strategies somehow ameliorate generalization, they have obvious drawbacks.
First, even a combination of multiple databases cannot deal with new types of attacks that are not included in the current training datasets, so the model has to be retrained when a new attack type is added. Second, the fusion strategy relies on an assumption of statistical independence that is not necessarily verified in practice. Also in 2013, Bharadwaj et al. [74]  proposed to use motion magnification  [132]  as preprocessing to enhance the intensity value of motion in the video before extracting the texture features. The authors claimed that the motion magnification might enrich the texture of the magnified video. The authors proposed to apply Histogram of Oriented Optical Flows (HOOF)  [133]  on the enhanced video to conduct facial PAD. HOOF calculates the optical flow between frames at a fixed interval and collects the optical flow orientation angle weighted by its magnitude in a histogram.
Like several researchers before them, the authors also observed that using the scaled image of an original detected face including more background information can help in facial PAD. In 2019, Yang et al. [79]  proposed a Spatiotemporal Anti-Spoofing Network (STASN) to detect photo and video replay PAs. STASN consists of three modules: Temporal Anti-Spoofing Module (TASM), Region Attention Module (RAM) and Spatial Anti-Spoofing Module (SASM). The proposed TASM is composed of CNN and LSTM units to learn the temporal features of the input video. One significant contribution is that, instead of using local regions with predefined locations as in  [51, 62] , STASN uses K local regions of the image selected automatically by RAM and TASM based on attention mechanism. These regions are then fed into SASM (i.
New Trends in PAD Methods In this section, we describe the methods that constitute the leading edge of facial PAD methods based on RGB cameras. Thanks to the development of deep learning, especially in the computer vision domain, not only has face anti-spoofing detection performance been significantly boosted, but also many new ideas have been introduced. These new ideas relied on the following: • the proposal of new cues to detect the face artifact (e. g. , the pseudo-depth maps described in Section 2. 4. 2); • learning the most appropriate neural networks architectures for facial PAD (e. g. , using Neural Architecture Search (NAS) (see hereafter Section 2. 6. 1)); and • address of the generalization issues, especially towards types of attacks that are not (or insufficiently) represented in the learning dataset.
Zero/Few-Shot Learning Based PAD Methods Thanks to the significant development of deep learning, most state-of-the-art facial PAD methods show promising performance in intra-database tests on the existing public datasets  [33, 36, 82]  (see Section 4). Nevertheless, the generalization to cross-dataset scenarios is still challenging, in particular due to the possible presence in the test set of facial PAs that were not represented (or underrepresented) in the training dataset  [32, 65, 155]. One possible solution is to collect a large-scale dataset to include as much diverse spoofing attack types as possible. However, as detailed below in Section 3, unlike other problems such as facial recognition where it is relatively easy to collect massive public dataset from the Internet, the images/videos of spoofing artifacts recaptured by a biometric system are quite rarely available on the Internet.
Therefore, several research teams are currently investigating another solution that consists in leveraging zero/few-shot learning to detect the previously unseen face PAs. This problem has been named Zero-Shot Face Anti-spoofing (ZSFA) in  [87]. In 2017, Arashloo et al. [86]  first addressed unseen attack detection, as an anomaly detection problem where real faces constitute the positive class and are used to train a one-class classifier such as one-class SVM  [176]. In the same spirit, in 2018, Nikisins et al. [85]  also used one-class classification. However, they used one-class Gaussian Mixed Models (GMM) to model the distribution of the real faces in order to detect unseen attacks. Also, contrary to  [86] , they trained their model not only using one dataset but also aggregating three publicly available datasets (i.
Domain Adaption-Based PAD Methods As detailed above, improving the generalization ability of existing facial PAD methods is one of the greatest challenges nowadays. To mitigate this problem, Pereira et al. [73]  first proposed to combine multiple databases to train the model (see page  19). This is the most intuitive attempt towards improving generalization of the earned models. However, even by combining all the existing datasets, it is impossible to collect attacks from all possible domains (i. e. , with every possible device and in all possible capture environments) to train the model. However, even though printed photo or video replay attacks from unseen domains may differ greatly from the source domain, they all are based on paper or video screens as PAI  [88]. Thus, if there exists a generalized feature space underlying the observed multiple source domains and the (hidden but related) target domain, then domain adaptation can be applied  [177, 178].
In 2019, Shao et al. [88]  first applied a domain adaption method based on adversarial learning  [179, 180]  to tackle facial PAD. Under an adversarial learning schema, N discriminators were trained to help the feature generator produce generalized features for each of the N specific domains, as shown in Figure  30. Triplet loss is also used to enhance the learned generalized features to be even more discriminative, both within a database (intra-domain) and among different databases (inter-domain). To apply facial PAD, the learned generalized features are also trained to estimate the depth map of a given image as in  [33]  and to classify the image based on a binary classifier trained by softmax loss. This approach shows its superiority when increasing the number of source domains for learning generalized features.
Indeed, in contrast, the previous methods without domain adaption such as LBP-TOP  [71]  or  [33]  cannot effectively improve the model's generalization capacity, even when using multiple source datasets for training. Figure  30. Overview of the domain adaption approach based on adversarial learning for facial anti-spoofing, as shown in  [88] : each discriminator is trained to help the generalized features (learned by the generator from multiple source domains) to better generalize on their corresponding source domain. The depth loss, triplet loss and the classification loss ("Cls loss") are then used to enhance the ability to discriminate any kind of PA.
Some Useful Definitions Facial PAD (anti-spoofing) datasets consist of two different kinds of documents (files) in the form of photos or videos: • the set of "genuine faces", that contains photos or videos of the genuine users' faces (authentic faces of the alive genuine users), and • the set of "PA documents", containing photos or videos of the PAI (printed photo, video replay, 3D mask, etc. ) Figure  31  illustrates the data collection procedure for constructing facial anti-spoofing databases. In facial anti-spoofing datasets, genuine faces and PAIs (presented by imposters) are generally captured using the same device. This device plays the role of the biometric system's camera in real-life authentication applications; we therefore chose to call it the "biometric system acquisition device".
Of course, there could be datasets where the PAI also plays the role of the PA acquisition device, but this is not the case in general. Indeed, it is not the case in most real-life applications, where the imposter generally does not have control over the PA acquisition device (e. g. , photos or videos found on the web). For printed photo attacks, paper-crafted mask attacks and 3D mask attacks, yet another device is used: a printer. For photo attacks as well as paper-crafted mask attacks, usually (2D) printers are used. The printer's characteristics as well as the quality of the paper used can greatly affect the quality of the PAI and therefore the chances of success of the attack. For 3D mask attacks, a 3D printer is used; its characteristics as well as the material used (e. g. , silicone or hard resin) and its thickness also have an impact on the attack's chances of success.
Brief Overview of the Existing Datasets The early studies of facial PAD, such as  [42, [44] [45] [46] 56, 83] , are mostly based on private datasets. Such private datasets being quite limited, both in volume and diversity of attack types, makes it very difficult to fairly compare the different approaches. The first public dataset was proposed in 2008 by Tan et al. [52]. The dataset was named NUAA, and it contains examples of photo attacks. The NUAA dataset enabled researchers to compare the results of their methods on the same benchmark. Later on, respectively in 2011 and 2012, Anjos et al. publicly shared the datasets PRINT-ATTACK  [147]  (containing photo attacks) and its extended version REPLAY-ATTACK  [37]  (containing video replay attacks as well). Quickly, these two datasets were widely adopted by the research community and as was one of the most challenging datasets: CASIA-FASD  [19] , that has also been published in 2012 and contains photo/video replay attacks but with more diversity in the PAs, PAIs and video resolutions.
Later on, several other similar datasets were shared publicly for photo and video replay attacks, such as MSU-MFSD  [32] , MSU-USSA  [66] , OULU-NPU  [181] , SiW  [33]  and the very recent multi-modal dataset CASIA-SURF  [182]. These datasets contain more diverse spoofing scenarios, such as MSU-MFSD  [32] , which first introduced a mobile phone scenario; MSU-USSA  [66] , which used celebrities' photos from the Internet to increase the mass of data; OULU-NPU  [181] , which focused on attacks using mobile phones; and SiW  [33] , which contains faces with various poses, illumination and facial expressions. The first public 3D mask attack dataset was 3DMAD  [58] , which includes texture maps, depth maps and point clouds together with the original images. Note that the depth maps and point clouds were collected by the Kinect 3D sensor rather than generic RGB cameras.