# ViT-Cap: A Novel Vision Transformer-Based Capsule Network Model for Finger Vein Recognition
## 4 Results
### Experimental Setup for Finger-Vein Recognition  
We conducted three sets of experiments on four public datasets. In the first set of experiments, we changed the number of multi-heads and studied the relationship between the attention mechanism and model performance. Then we changed the number of encoder layers and the number of routing iterations and studied the relationship between network depth and model performance. In addition, equal error rate (EER) and recognition accuracy (ACC) were used to evaluate the performance of the finger vein recognition model. The EER is the error rate when the false acceptance rate (FAR) equals the false rejection rate (FRR). The FRR is the probability that the correct sample is wrongly rejected by the system, while FAR is the probability that the wrong sample is considered correct by the system. The recognition accuracy was selected to evaluate the recognition performance of the model. By feeding the test set into the training model and outputting it through Softmax, the maximum probability was selected as the category of the current image. By comparing  
Figure 6: Comparison of finger vein images before and after ROI in four public datasets. with the labels, the proportion of the number of samples with the same prediction category and categories in the total number of samples was calculated, as shown in Equation (15) (where \(N\_T\) represents the number of correctly classified samples and \(N\) represents the total number of samples). \[Accuracy=\frac{N_{T}}{N} \tag{15}\]  
We clearly described the calculation method of the EER. For multi-classification methods, such as ours, we regarded the prediction of each class as a binary classification task. For instance, we fed an image of a finger vein, which belonged to class three, into the model, which outputted a list of predictions. We assumed that there were 100 predictions: [0.0031, 0.5362, 0.9966, 0.0042,..., 0.0033]. The threshold (from 0 to 1) was set to 0.5. If the prediction probability was greater than 0.5, the corresponding sample was marked as positive (\(P\)); otherwise, it was marked as negative (\(N\)). If the predicted label of the corresponding sample was the same as its true label, we marked it as a true (\(T\)) sample; otherwise, it was a false (\(F\)) sample. For the value 0.9966, the true label of its corresponding sample was three, which was equal to the predicted result, so it was a \(TP\) sample. Similarly, 0.0031 was a \(TN\) sample, and 0.5362 was an \(FP\) sample. Then, the \(FAR\) and \(FRR\) were calculated (as shown in Equations (16) and (17)). Multiple sets of \(FAR\) and \(FRR\) were obtained by setting a series of thresholds. We connected these points to form a receiver operating characteristic curve (ROC), and its intersection with the diagonal was EER, while AUC was the area under the ROC curve. \[FAR=\frac{FP}{FP+TN} \tag{16}\]  
\[FRR=\frac{FN}{FN+TP} \tag{17}\]  
In the second set of experiments, we compared the results of our model with several state-of-the-art methods, including ACC and EER values. Finally, we tested the model's performance on datasets of small categories, selecting 50, 100, 150, and 200 categories on four public finger vein datasets for experimentation. We also used fewer images for training and compared the results. The main purpose of the third set of experiments was to test the performance of our proposed model in processing small categories and small-scale image data. In all experiments, the basic framework of our proposed ViT-Cap model did not change. What we changed during the experiment were the layers of the encoder, the number of multi-heads, and the number of routing iterations. The embedding dimension of the ViT-Cap model was 784, and the number of routing iterations used in the experiment was three or four. To improve the experimental effect, we adjusted the ROI pre-processed image size to 224 \(\times\) 224 and the patch size to 28 \(\times\) 28.