In an embodiment, the inputting the facial image into a first recognition model and extracting facial feature data of the facial image through the first recognition model include: inputting the facial image into the first recognition model; and extracting facial feature data of the facial image through a convolution layer of the first recognition model. Step 306 includes: classifying the target image through a fully connected layer of the first recognition model according to the extracted facial feature data to obtain a first confidence level of the target image being a live facial image.
The convolution layer is a feature extraction layer in a convolutional neural network. There may be multiple convolution layers, each convolution layer has a corresponding convolution kernel, and each layer may have multiple convolution kernels. The convolution layer performs a convolution operation on an input image through the convolution kernel, and extracts an image feature to obtain a feature map as an operation result.
A fully connected layer (FC) is a feature classification layer in a convolutional neural network, and is used to map the extracted feature to a corresponding classify according to a learned distributed feature mapping relationship.
Specifically, after intercepting a facial image, the server inputs the facial image into the first recognition model. The convolution layers included in the first recognition model perform a convolution operation on the input facial image layer by layer until the last convolution layer in the first recognition model completes the convolution operation, and then a result output by the last convolution layer is used as an input to the fully connected layer to obtain a first confidence level of the target image being a live facial image.