# UnifiedFace: A Uniform Margin Loss Function for Face Recognition
## 4 Experiments
### Ablation Experiments  
#### 4.3.1 Effect of Hyperparameters \(M\) Furthermore, \(S\)  
We use VGGFace2 and MS1M V3 as training datasets to explore the effect of hyperparameters on the performance of UnifiedFace in training datasets of different scales, respectively.  
We first investigate the advantages and disadvantages of the performance of different hyperparameters in the small-scale training dataset VGGFace2, and the experimental results are shown in Table 5. The hyperparameter \(s\) is set to 64 and 40, and the hyperparameter \(m\) is fixed from 0.35 to 0.5. Experimental results show that UnifiedFace performs well for values of \(m\) ranging from 0.35 to 0.4 in small training datasets. In particular, when \(s=64\) and \(m=0.4\), UnifiedFace achieves the optimal performance. Specifically, the optimal setting for the additive margin of UnifiedFace is between 0.35 and 0.4. The optimal setting for the multiplicative margin of UnifiedFace is between 1.4 and 1.5.  
Then, we report the effect of hyperparameters on performance in the large-scale training dataset MS1M V3, and the experimental results are presented in Table 6. The hyperparameters \(s\) are set to 64 and 40, and the hyperparameters \(m\) are fixed from 0.35 to 0.5. In particular, the model performance is optimal when \(s=50\), \(m=0.4\). The experimental results show that the optimal setting interval for the hyperparameter \(m\) is from 0.4 to 0.45, which means that the optimal setting range for the additive margin is from 0.4 to 0.45, and the optimal setting range for the multiplicative margin is from 1.5 to 1.6. The results of hyperparametric experiments on training datasets of different sizes show that UnifiedFace has excellent generalization ability.  
In addition, we give the variation of loss values during UnifiedFace training with different hyperparameters, as shown in Figure 7a,e. During the training process, different hyperparameters lead to different values of the final convergence of the loss values. \(s=64\), \(m=0.5\), the loss values fluctuate the most. In other cases, the loss value starts with a sharp drop and then falls steadily. Although the loss value fluctuation during the training process is smoothest and converges to a minimum value when m is taken as small as possible, the performance is not the best. We select the best-performing hyperparameters as the experimental parameters and compare the change of loss values during the training process with the popular loss functions in recent years, as illustrated in Figure 7b,f.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**s** & **m** & **LFW** & **CALFW** & **CPLFW** & **VGG2\_FP** &
\begin{tabular}{c} **CFP** \\ **CFP\_FF** \\ \end{tabular} \\ \hline
64 & 0.5 & 99.77\% & 96.00\% & 92.42\% & 95.00\% & 99.77\% & 97.09\% \\
64 & 0.45 & 99.80\% & 96.00\% & 92.68\% & 95.34\% & 99.77\% & 97.30\% \\
50 & 0.4 & 99.80\% & 96.17\% & 92.65\% & 96.52\% & 99.79\% & 97.77\% \\
40 & 0.35 & 99.78\% & 95.90\% & 92.53\% & 96.02\% & 99.76\% & 97.83\% \\ \hline \hline \end{tabular}
\end{table}
Table 6: The ablation study on different hyperparameters \(s\) and \(m\) with ResNet-100. The large-scale MS1M V3 dataset is chosen as the training dataset.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**s** & **m** & **LFW** & **CALFW** & **CPLFW** & **VGG2\_FP** &
\begin{tabular}{c} **CFP** \\ **CFP\_FF** \\ \end{tabular} \\ \hline
64 & 0.5 & 99.55\% & 93.08\% & 91.92\% & 95.14\% & 99.34\% & 97.47\% \\
64 & 0.45 & 99.52\% & 92.80\% & 92.23\% & 94.80\% & 99.26\% & 97.01\% \\
64 & 0.4 & 99.73\% & 93.77\% & 92.58\% & 95.36\% & 99.37\% & 97.83\% \\
40 & 0.35 & 99.67\% & 93.10\% & 92.48\% & 95.76\% & 99.26\% & 97.59\% \\ \hline \hline \end{tabular}
\end{table}
Table 5: The ablation study on different hyperparameters \(s\) and \(m\) with ResNet-100. The VGGFace2 dataset, which is relatively small in size, is chosen for the training dataset.