# Face Spoofing Detection with Stacking Ensembles in Work Time Registration System
## 4 Experimental Evaluation  
### Experimental Setup  
The proposed face-authenticity detection system was evaluated using four datasets:  
* A small dataset (\(N=477\)) prepared by us, which includes faces captured in the described scenario. There are 242 authentic face images and 234 spoof face images. This is the most realistic database for the purpose of our system. However, this dataset includes faces of individuals who did not agree to publish their images, and for this reason, we cannot share the data. The three remaining datasets are available for download. * The open Spoofing Dataset [35] (\(N=1054\)), which includes authentic faces and those displayed on electronic devices (522 authentic images, 532 spoof images). * The Large Crowd-collected Facial Anti-Spoofing Dataset by [PERSON] et al. [5] (\(N=16\),284, 1942 authentic images, 14,342 spoof images). * Parts of the Celeb-A Dataset by [PERSON] et al. [6]. This dataset contains over 200 thousand images, which is too much to process with our available resources. Instead, a total of \(N=23\),052 images were randomly sampled (13,543 authentic images, 9509 spoof images). Our system was developed in Python using PyTorch, Scikit-Learn, OpenCV, and other libraries. The source code is available at [[https://github.com/Stukeley/FaceAuthenticity](https://github.com/Stukeley/FaceAuthenticity)]([https://github.com/Stukeley/FaceAuthenticity](https://github.com/Stukeley/FaceAuthenticity)) Detection. Technical specifications of the development and testing system: We used three computers, and the tests were split among them. Two computers were equipped with AMD Ryzen 9 7950X CPU, 128 GB RAM, NVidia RTX4070 GPU, 512 GB FDD, 8 TB HDD, Windows Operating System, and one with 2 x AMD EPYC 7282, 512 GB RAM, NVidia Tesla T4 GPU, 512 GB FDD, 6 TB HDD, Windows Operating System. We tested our solutions and compared the results with the results obtained with other methods. The other methods include two implementations of facial spoofing detection, for which we were able to find the source code and train them on our data. Unfortunately, many authors either did not provide the source code, which made their methods practically impossible to use, or provided non-working code and did not respond to our emails when we asked for help to run their code. The remaining methods are the newest and well-known deep learning models, where we used the PyTorch implementation. * Depth Prediction with CNN [36], a method developed for facial spoofing detection using an open-source implementation by [PERSON] [37]. * MobileNet [38] implemented for facial spoofing detection in an open-source code by [PERSON] [39]. * The ConvNeXt architecture [40] without pre-trained weights for the \"BASE\" model, using PyTorch implementation. * The EfficientNetV2 architecture [41] without pre-trained weights for the \"S\" model size, using PyTorch implementation. * The Vision Transformer architecture [42] without pre-trained weights for the \(b\)16_ architecture. * The Swin Transformer architecture [43] without pre-trained weights for the _V2\(S\) architecture. To evaluate each system, five runs of a stratified 5-fold cross-validation were performed, starting each time from a different random data split and a different seed for training the models to account for stochasticity in training and testing performance, for a total of 25 training/testing pairs per dataset for each model. In a given cross-validation run, each model was trained using the same data split. For the bezel-detection algorithm, no training was performed at this step; instead, the parameters, including the grayscale threshold for detected bezels, the minimum size, and the number of bezels detected to consider an image spoofed, were empirically adjusted based on images from previous evaluations. The following models: ConvNeXt, EfficientNetV2, Vision Transformer, and Swin Transformer were trained with the same parameters: \(LR=0.001\), \(BS=32\), \(EPOCHS=10\), \(DROPOUT\_RATE=0.25\), which were the default parameters in the PyTorch implementations we used.