As shown in
The model training module 807 is configured to obtain an image sample set, where the image sample set includes a live facial image and a non-live facial image; obtain a facial image in a corresponding image sample along a facial region of each image sample in the image sample set to obtain a first training sample; and train the first recognition model according to the first training sample.
In an embodiment, the model training module 807 is further configured to obtain an initialized first recognition model; determine a first training label corresponding to the first training sample; input the first training sample into the first recognition model to obtain a first recognition result; and adjust model parameters of the first recognition model according to a difference between the first recognition result and the first training label, and continue training until satisfaction of a training stop condition.
In an embodiment, the second extraction module 804 is further configured to determine a facial region in the target image; extend the facial region to obtain an extended facial region; obtain an extended facial image in the target image along the extended facial region; and input the extended facial image into a second recognition model, and extract background feature data of the extended facial image through the second recognition model.