# Face Spoofing Detection with Stacking Ensembles in Work Time Registration System
## 4 Experimental Evaluation
### Experimental Results  
First, we present the partial results of individual models of the proposed system as well as of other tested systems. Then, the results obtained with different stacking and voting committees are presented. The following configurations were tested:  
* Our four developed modules: bezel detection, smartphone detection CNN, context analysis, and image analysis CNN (baseline). * Other methods used for face spoofing analysis: Depth prediction, MobileNet, ConvNeXt, EfficientNetV2, Vision Transformer, and Swin Transformer. * Various combinations of the above modules and methods in the stacking ensemble (between 2 and 7 models). * Various combinations of the above modules and methods in the voting ensemble (between 2 and 7 models). The obtained results, including the ensembles with 3, 4, 5, 6, and 7 models with the best accuracy across all datasets, are presented in Table 4. The ensembles were chosen based on mean rank across the four datasets, and we selected the best 3-model ensemble, the best 4-model ensemble, and so forth. The ranks and classification accuracy of the ensembles are presented in Table 10.  
We have performed hyperparameter optimization for our own neural network models (smartphone detection CNN and image analysis CNN) by varying the learning rate, batch size, epoch count, and dropout rate over the baseline values of \(LR=0.001\), \(BS=32\), \(EPOCHS=10\), \(DROPOUT\_RATE=0.25\). The reason for using these baseline values as a starting point was to start from the same hyperparameters as the other models (ConvNeXt, EfficientNetV2, Vision Transformer, and Swin Transformer) used. The results are presented in Tables 11 and 12 in the Appendix A. Based on the experimental results presented in Table 11, we determined the set of optimal hyperparameters with which the Smartphone Detection CNN and the Image Analysis CNN obtained the highest classification accuracies. The optimal hyperparameters for the smartphone detection CNN: \(LR=0.0001\), \(BS=32\), \(EPOCHS=10\), \(DROPOUT\_RATE=0.25\) The optimal hyperparameters for the image analysis CNN: \(LR=0.001\), \(BS=32\), \(EPOCHS=20\), \(DROPOUT\_RATE=0.25\)  
As can be seen from Table 12, when the Smartphone Detection CNN and the Image Analysis CNN are not used as standalone models but as part of a stacking ensemble, the hyperparameter optimization still improves the results, though the differences are much smaller, especially for the two largest datasets. In the analysis conducted here, the threshold of the final classifier network output above which a face is considered spoofed was set to 0.50. If the probability returned by the network is greater than or equal to 50%, then the system predicts the face as spoofed. Although other threshold values were tested, the results were not sensitive to the change in the threshold value, and for that reason, a threshold value of 50% could be used, as presented in Tables 15-16 in the Appendix A. Two conclusions can be drawn from Table 4. First, the best-performing models are stacking ensembles. Second, the best ensembles consisting of between three and seven models include some or all of our proposed methods. The complete results for various combinations of ensembles can be seen in Table 17.  
To test the statistical significance of the obtained results, two tests were used:  
* A one-way ANOVA, testing a null hypothesis: \"There is no difference among group means\". \(\alpha=0.05\)
* A rank-based Kruskal-Wallis, testing a null hypothesis: \"There is no difference among medians of populations from which the groups are taken\". \(\alpha=0.05\)  
To perform these tests, the accuracies obtained for each fold, random seed, and dataset for the ensembles and other methods presented in Table 4 were collected, amounting to a total of 100 values per system for a total of 11 systems. Then, the necessary metrics were calculated based on those values.