Article directory
foreword
The face recognition algorithm is relatively mature. FR based on deep learning can be divided into two parts, one is feature extraction, and the other is Loss. Loss is the focus of each FR algorithm improvement.
The overall Loss evolution route is: inter-class→distance+center→distance+angle
frame reference here
normalized meaning reference here
1. Softmax Loss
Softmax Loss is the most common Loss in classification. It is used to gather similar data together. With the decrease of Loss (the value in brackets tends to 1, log1=0), adjust the parameters W and b. Existing people Face Loss is basically based on Softmax Loss. Although Softmax can classify correctly, it does not consider the distance between classes.
2. Triplet Loss
Among them, Margin is as follows:
Triplet Loss needs to determine the Margin parameter, and the function of Margin is used to implement constraints, that is: the largest intra-class distance < the smallest inter-class distance, which increases the inter-class distance and reduces the intra-class distance. This Loss is relatively old, but this idea is still worth learning in many directions.
3. Center Loss
Tatal Loss = L + 入Lc
Center Loss proposes that each class has its class center, and the distance between the sample and the class center is also calculated for Loss, which reduces the intra-class distance, increases the inter-class distance, and enters the parameters to control the compactness of the class. The larger the entry, the tighter the aggregation within the class.
After normalization:
It can be seen that the angles of different classes will not overlap after normalization.
4. L-softmax
L-softmax adds angle constraints on the basis of softmax, which makes up for the defect that softmax cannot reduce the intra-class distance:
Change cosθ to cos(mθ), because cos(∞) tends to 0, so the larger m is, the larger the margin will be.
五、SphereFace(A-Softmax)
A-Softmax normalizes the weight W on the basis of L-softmax ||W|| = 1, b = 0
A-Softmax experiments prove that the more samples of the category, the larger the module length, so the weight W Normalization can reduce the influence of sample size.
After normalization:
五、CosFace(Additive Margin Softmax)
Compared with A-Softmax, Additive Margin Softmax also normalizes the features and increases Margin.
六、ArcFace(Addictive Augular Margin Loss)
Compared with Additive Margin Softmax using cosine distance, Addictive Augular Margin Loss directly uses angular distance, and its classicity makes the current successor unmatched
postscript
There are also recently released SphereFace2, which converts multi-classification into binary classification and combines Triple Loss. At present, the innovation of face loss is not as good as before. Successors can consider making innovations in face thermal images, blood oxygen maps, etc.