Specifically, the initialized first recognition model may be a first recognition model with model parameters that is obtained by importing the model parameters of a trained general-purpose machine learning model with recognition capabilities into a first recognition model structure. The model parameter carried in the first recognition model participates in the training as an initial parameter used to train the first recognition model. The initialized first recognition model may also be a machine learning model initialized by a developer based on historical model training experience. The server directly uses the model parameter carried in the initialized machine learning model as the initial parameter for training the first recognition model, and applies the model parameter to the training. Parameter initialization of the first recognition model may be Gaussian random initialization.
Further, the server may add a training label to each first training sample. The training label is used to indicate whether the image sample from which the first training sample is obtained is a live facial image. The server then trains the first recognition model according to the first training sample and the corresponding added training label. In the specific training process, after the first training sample is output from the first recognition model, the first recognition model will output a first recognition result. In this case, the server may compare the first recognition result with the training label of the input first training sample, and adjust the model parameters of the first recognition model with a view to reducing differences.