# UnifiedFace: A Uniform Margin Loss Function for Face Recognition
## 1 Introduction  
In recent years, face recognition has achieved remarkable success due to the rapid development of deep convolutional neural networks(DCNNs) [1, 2, 3] and loss functions, especially the loss function based on margin [4, 5, 6, 7, 8, 9]. Moreover, face recognition technology has been widely used in the fields of finance, public security, 3D sensors in face recognition applications [10], and Crowd counting models adapted to drone-assisted systems [11]. However, complex DCNNs generate a large number of parameters and computational consumption, which is not friendly to resource-limited embedded or mobile devices. Meanwhile, these loss functions embed the face features into the hypersphere space and further increase the intra-class compactness and inter-class separation by introducing margins. Nevertheless, all these margin-based loss functions introduce only one type of margin and cannot further introduce larger margins to achieve tighter classification bounds. To alleviate the problem of the excessive number of parameters and computational effort associated with complex DCCNs, a series of methods have been proposed to build efficient and lightweight convolutional neural networks, such as knowledge distillation [12, 13], networks pruning [14, 15], and quantization [16]. In addition, recent research has focused on building efficient convolutional networks with fewer parameters and computationaleffort and has achieved great success. Several works [17; 18; 19] propose the construction of efficient modules to design lightweight convolutional neural networks. Depthwise separable convolution operations and inverse residual structures are used to construct efficient modules in MobileNet [17; 20; 21] and obtain competitive performance. To achieve state-of-the-art performance, channel shuffle operation is utilized in ShuffleNet [18]. Although these methods achieve lightweight convolutional neural networks with low computational cost and a low number of parameters by designing efficient units, they do not take redundant information in features into account. For example, as shown in Figure 1a,b, we mark similar features with the same color. GhostNet [19] employs ordinary convolution to generate intrinsic features, followed by inexpensive linear transformations to produce ghost features. The ghost feature reveals sufficient information about the intrinsic features and is able to reduce convolutional consumption with similar recognition performance. Nevertheless, the direct use of the ghost module in face recognition can lead to a significant degradation in model performance. We, therefore, reconstructed an efficient model called GhostFaceNet, based on the ghost module, which significantly reduces the number of parameters and the amount of computation without noticeably degrading performance. Margin-based softmax loss functions are proposed to further reduce intra-class compactness and increase inter-class dispersion. The margin-based loss function usually embeds the face features into the hypersphere space and introduces large margins. The core idea is to redesign the target activation function \(cos(\theta_{y})\) in the softmax cross-entropy loss function. \(\theta_{y}\) denotes the angle between the sample \(x\) and the weight \(W_{y}\), where \(y\) is the true label of the sample \(x\). The redesigned target activation function needs to be guaranteed to be monotonically decreasing in \([0,\pi]\), so that the angle \(\theta_{y}\) can become smaller when \(cos(\theta_{y})\) reaches the same value. The large margins include additive and multiplicative margins. SphereFace [5] and SphereFaceR [7] further enhance intra-class compactness and inter-class separation by introducing multiplicative margins. CosFace [6; 8] and ArcFace [9] achieve the same goal by introducing additive angle margins. Formally, the multiplicative margin is multiplied directly on angle \(\theta_{y}\), and the additive margin is added to angle \(\theta_{y}\) or acts on \(cos(\theta_{y})\).