This disclosure relates to the field of face recognition technology, and provides a training method and apparatus for a face recognition model that avoids the long
tail problem of data. The method includes: constructing a face recognition model; obtaining a training dataset, and executing the following loop to
train the face recognition model in multiple rounds: sampling the current round of training from the training dataset using a dynamic sampler to obtain a sample set used for the current round of training; inputting the sample set into a
feature extraction network to obtain a
feature vector set corresponding to the sample set; inputting the
feature vector set into a normalization network to normalize the feature vectors in the
feature vector set; calculating a classification loss using a classification network and a contrastive loss using a contrastive network based on the feature vector set processed by the normalization network; updating the
model parameters of the face recognition model based on the classification loss and contrastive loss; incrementing the training round number corresponding to the current round of training by one; and ending the loop when the training round number equals a preset round number.