Multi-modal face anti-counterfeiting model training and face anti-counterfeiting identification method
By acquiring IR and RGB images using a binocular camera, calculating depth images, and training a multimodal face anti-spoofing model, the security risks of traditional face anti-spoofing recognition technology are solved, achieving higher recognition accuracy and security.
Patent Information
- Application Number
- CN202311428007.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-10-30
AI Technical Summary
Traditional facial recognition technology relies on single-modal data for feature extraction, which poses security risks, such as photo attacks and video attacks, resulting in low reliability.
A binocular camera is used to acquire IR and RGB images, and depth images are calculated. A multimodal face anti-counterfeiting model training method is used to combine IR, RGB and depth image data for feature extraction and recognition, and train the multimodal anti-counterfeiting model.
It improves the accuracy and security of facial recognition anti-spoofing and enhances resistance to photo and video attacks.
Smart Images

Figure CN117392482B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a multimodal face anti-spoofing model training and face anti-spoofing recognition method. Background Technology
[0002] Currently, facial recognition technology is widely used in various fields, such as mobile phone unlocking, access control systems, and payment systems. However, traditional facial recognition technology relies on facial modality data from IR images, RGB images, or Depth images to extract features and classify whether the face is genuine. This presents some security vulnerabilities, such as photo attacks, video attacks, and 3D model attacks, making traditional facial recognition technology unreliable. Summary of the Invention
[0003] This invention provides a multimodal face anti-spoofing model training and face anti-spoofing recognition method to solve the technical problem of low reliability of traditional face anti-spoofing recognition technology.
[0004] To address the aforementioned technical problems, embodiments of the present invention provide a multimodal face anti-spoofing model training method, comprising: A set of face images is formed by acquiring several face images using a binocular camera; wherein, the binocular camera includes an IR lens and an RGB lens arranged horizontally; the set of face images includes several IR images and an RGB image acquired at the same time and in the same scene corresponding to each IR image; Based on each group of IR images and corresponding RGB images in the face image set, calculate the corresponding depth image, and add the obtained depth image to the face image set to obtain the updated face image set; Perform face alignment on all images in the updated face image set to obtain an aligned face dataset; A multimodal anti-spoofing model is trained based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model.
[0005] As a preferred embodiment, the step of calculating the corresponding depth image based on each group of IR images and the corresponding RGB images in the face image set includes: The IR image and the RGB image are preprocessed to obtain the processed IR image and RGB image; The processed IR image and the RGB image are subjected to stereoscopic image correction to obtain the corrected IR image and RGB image; The feature points of each corrected IR image and its corresponding RGB image are obtained through a facial feature point detection algorithm. Based on the feature points of the IR image and the corresponding RGB image, calculate the matching matrix of the IR image and the corresponding RGB image, and obtain the pixel correspondence between the IR image and the corresponding RGB image based on the matching matrix; Based on the pixel correspondence between the IR image and the corresponding RGB image, calculate the disparity map of the IR image and the corresponding RGB image; Calculate the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image.
[0006] As a preferred embodiment, the step of calculating the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image includes: The disparity values of corresponding pixels in the IR image and the corresponding RGB image are determined based on the disparity map of the IR image and the corresponding RGB image. Obtain the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinates of the pixels in the IR image and the corresponding RGB image; The corresponding depth map is calculated based on the disparity value of the corresponding pixel, the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinate of the pixel.
[0007] As a preferred embodiment, the step of performing face alignment on all images in the updated face image set to obtain an aligned face dataset includes: Facial feature point detection is performed on all images in the updated face image set to obtain the feature point coordinates corresponding to each face image and the standard face image; wherein, the standard face image is a preset face image with specified feature points; Based on the feature point coordinates of each face image and the standard face, calculate the corresponding perspective transformation matrix; based on the perspective transformation matrix, calculate the aligned face image of each face image. The aligned face images are cropped to the same size as the standard face images to obtain the aligned face dataset.
[0008] As a preferred embodiment, the multimodal anti-counterfeiting model includes: an IR single-modal anti-counterfeiting sub-model, an RGB single-modal anti-counterfeiting sub-model, a deep single-modal anti-counterfeiting sub-model, and a multimodal anti-counterfeiting sub-model; wherein the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, and the deep single-modal anti-counterfeiting sub-model have the same structure; The step of training a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model includes: Based on the IR images in the aligned face dataset, the IR single-modal anti-counterfeiting sub-model is trained to obtain the trained IR single-modal anti-counterfeiting sub-model; Based on the RGB images in the aligned face dataset, the RGB unimodal anti-counterfeiting sub-model is trained to obtain the trained RGB unimodal anti-counterfeiting sub-model; Based on the depth images in the aligned face dataset, the deep unimodal anti-spoofing sub-model is trained to obtain the trained deep unimodal anti-spoofing sub-model. The IR images of the aligned face dataset are input into the trained IR single-modal anti-counterfeiting sub-model to obtain the output of the trained IR single-modal anti-counterfeiting sub-model. The RGB images of the aligned face dataset are input into the trained RGB unimodal anti-counterfeiting sub-model to obtain the output of the trained RGB unimodal anti-counterfeiting sub-model. Input the depth image of the aligned face dataset into the trained deep unimodal anti-spoofing sub-model to obtain the output of the trained deep unimodal anti-spoofing sub-model; The outputs of the trained IR unimodal anti-counterfeiting sub-model, the trained RGB unimodal anti-counterfeiting sub-model, and the trained deep unimodal anti-counterfeiting sub-model are used as inputs to train the multimodal anti-counterfeiting sub-model, resulting in the trained multimodal anti-counterfeiting sub-model. Based on the trained IR unimodal anti-spoofing sub-model, the trained RGB unimodal anti-spoofing sub-model, the trained deep unimodal anti-spoofing sub-model, and the trained multimodal anti-spoofing sub-model, a trained multimodal face anti-spoofing model is generated.
[0009] As a preferred embodiment, the loss functions of the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, the deep single-modal anti-counterfeiting sub-model, and the multimodal anti-counterfeiting sub-model are all binary classification loss functions.
[0010] As a preferred embodiment, the multimodal anti-counterfeiting model includes: an IR single-modal anti-counterfeiting sub-model, an RGB single-modal anti-counterfeiting sub-model, a depth single-modal anti-counterfeiting sub-model, and a multimodal anti-counterfeiting sub-model; wherein the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, and the depth single-modal anti-counterfeiting sub-model have the same structure; the input of the multimodal anti-counterfeiting sub-model is the output of the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, and the depth single-modal anti-counterfeiting sub-model; The step of training a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model includes: The IR image, RGB image, and depth image from the aligned face dataset are input into the IR unimodal anti-spoofing sub-model, the RGB unimodal anti-spoofing sub-model, and the depth unimodal anti-spoofing sub-model, respectively. The outputs of the obtained IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, and depth unimodal anti-spoofing sub-model are input into the multimodal anti-spoofing sub-model. The IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, depth unimodal anti-spoofing sub-model, and multimodal anti-spoofing sub-model are trained simultaneously to obtain the trained multimodal face anti-spoofing model.
[0011] As a preferred embodiment, the loss function of the multimodal face anti-spoofing model for: ; in, The loss value of the IR single-modal anti-counterfeiting sub-model is... The loss value is for the RGB single-modal anti-counterfeiting sub-model. The loss value of the deep single-modal anti-counterfeiting sub-model is given. The loss value of the multimodal anti-counterfeiting sub-model. These are the weighting coefficients for the preset IR single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset RGB single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset depth single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the pre-defined multimodal sub-model loss values.
[0012] Based on the above embodiments, another embodiment of the present invention provides a face anti-counterfeiting recognition method, including: Acquire facial images captured by a binocular camera; wherein the binocular camera includes an IR lens and an RGB lens; the facial image set includes several IR images and an RGB image captured at the same time and in the same scene corresponding to each IR image; The face image is input into a multimodal face anti-spoofing model so that the multimodal face anti-spoofing model can perform anti-spoofing recognition on the face image and obtain anti-spoofing recognition results; wherein, the multimodal face anti-spoofing model is trained according to the multimodal face anti-spoofing model training method described above.
[0013] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention acquires several face images using a binocular camera, forming a face image set. The binocular camera includes an IR lens and an RGB lens. The face image set includes several IR images and corresponding RGB images acquired simultaneously in the same scene for each IR image. Based on the intrinsic and extrinsic parameter matrices of the IR and RGB lenses, the depth image of each set of IR images and their corresponding RGB images in the face image set is calculated, and the resulting depth images are added to the face image set to obtain an updated face image set. Face alignment is performed on all images in the updated face image set to obtain a multimodal aligned face dataset. A multimodal anti-spoofing model is trained based on the multimodal aligned face dataset to obtain a trained multimodal face anti-spoofing model. This invention combines IR and RGB image face modal data to generate depth images, and trains a multimodal anti-spoofing model based on IR, RGB, and depth image face modal data. Using this trained multimodal anti-spoofing model for face anti-spoofing recognition can improve the accuracy and security of face anti-spoofing recognition. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating a multimodal face anti-spoofing model training method according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a multimodal face anti-spoofing model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of another multimodal face anti-spoofing model provided in an embodiment of the present invention; Figure 4 This is a flowchart illustrating a face anti-counterfeiting recognition method according to an embodiment of the present invention. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Example 1 Please refer to Figure 1 The above is a flowchart illustrating a multimodal face anti-spoofing model training method according to an embodiment of the present invention, including: S1. Acquire several face images using a binocular camera to form a face image set; wherein, the binocular camera includes an IR lens and an RGB lens arranged horizontally; the face image set includes several IR images and an RGB image acquired at the same time and in the same scene corresponding to each IR image.
[0017] In this embodiment, the binocular camera can simultaneously capture images from both the left and right perspectives of the same scene, obtaining images acquired by the two cameras. One image is an IR image, and the other is an RGB image. n IR images are acquired through the IR lens of the binocular camera, and n RGB images are acquired through the RGB lens of the binocular camera, forming a face image set, denoted as: ; in, Indicates the first Zhang IR image, Indicates the first RGB image.
[0018] It should be noted that the first Zhang IR image and the first The RGB images are two images that appear simultaneously from the same scene by the binocular cameras.
[0019] S2. Calculate the corresponding depth image based on each group of IR images and the corresponding RGB images in the face image set, and add the obtained depth image to the face image set to obtain the updated face image set.
[0020] It should be noted that the set of IR images and corresponding RGB images refers to IR images and RGB images of the same scene acquired simultaneously. In this embodiment, the corresponding depth image is calculated from the IR images and corresponding RGB images, which is less costly than directly using a depth camera to obtain the depth image.
[0021] In a preferred embodiment, calculating the corresponding depth image based on each group of IR images and the corresponding RGB images in the face image set includes: The IR image and the RGB image are preprocessed to obtain the processed IR image and RGB image; The processed IR image and the RGB image are subjected to stereoscopic image correction to obtain the corrected IR image and RGB image; The feature points of each corrected IR image and its corresponding RGB image are obtained through a facial feature point detection algorithm. Based on the feature points of the IR image and the corresponding RGB image, calculate the matching matrix of the IR image and the corresponding RGB image, and obtain the pixel correspondence between the IR image and the corresponding RGB image based on the matching matrix; Based on the pixel correspondence between the IR image and the corresponding RGB image, calculate the disparity map of the IR image and the corresponding RGB image; Calculate the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image.
[0022] In this embodiment, the IR image and the RGB image are preprocessed. The preprocessing steps include image removal and correction to eliminate camera lens distortion and correct the images from the left and right cameras. Stereo correction is performed on the images to align the images from the left and right cameras horizontally for subsequent disparity calculation. Using a face detection algorithm, feature points are obtained for each set of corrected IR images and their corresponding RGB images. Each feature point in the IR image corresponds to a feature point in the corresponding RGB image, forming a feature point group. Each set of IR images and their corresponding RGB images has at least eight feature point groups. Based on the feature points of the IR images and their corresponding RGB images, a matching matrix is calculated between the IR images and their corresponding RGB images. Based on the matching matrix, the pixel correspondence between the IR images and their corresponding RGB images is obtained. Based on the pixel correspondence between the IR images and their corresponding RGB images, a disparity map is calculated for the IR images and their corresponding RGB images. Finally, a depth map is calculated based on the disparity map of the IR images and their corresponding RGB images.
[0023] The updated face dataset is denoted as: ; in, Indicates the first Zhang IR image, Indicates the first RGB images, Indicates the first Zhang Depth Image.
[0024] It should be noted that, It is based on as well as The calculation shows that, in other words, yes as well as The corresponding depth image.
[0025] In a preferred embodiment, calculating the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image includes: The disparity values of corresponding pixels in the IR image and the corresponding RGB image are determined based on the disparity map of the IR image and the corresponding RGB image. Obtain the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinates of the pixels in the IR image and the corresponding RGB image; The corresponding depth map is calculated based on the disparity value of the corresponding pixel, the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinate of the pixel.
[0026] In this embodiment, based on the disparity value of the corresponding pixel, the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinate of the pixel, a corresponding depth map is calculated using the triangulation principle. The expression for the depth map is: ; in, Represents a depth image. express Depth value at pixel location, Indicates the camera's focal length. Indicates the distance between the baselines of the left and right cameras. express The disparity value at the pixel location, express Pixel position: Horizontal position of the IR camera. express Pixel position: Horizontal position of the RGB camera.
[0027] S3. Perform face alignment on all images in the updated face image set to obtain an aligned face dataset.
[0028] In a preferred embodiment, the step of performing face alignment on all images in the updated face image set to obtain an aligned face dataset includes: Facial feature point detection is performed on all images in the updated face image set to obtain the feature point coordinates corresponding to each face image and the standard face image; wherein, the standard face image is a preset face image with specified feature points; Based on the feature point coordinates of each face image and the standard face, calculate the corresponding perspective transformation matrix; based on the perspective transformation matrix, calculate the aligned face image of each face image. The aligned face images are cropped to the same size as the standard face images to obtain the aligned face dataset.
[0029] In this embodiment, facial feature point detection is performed on all images in the updated face image set to obtain the feature point coordinates corresponding to each face image and the standard face image. The standard face image is 112*112 pixels in size and has 5 preset feature point coordinates, which are labeled as follows: Five feature points of a standard face are set at the left eye, right eye, tip of the nose, left corner of the mouth, and right corner of the mouth. Therefore, face detection on a face image yields feature points corresponding to the standard face image at the left eye, right eye, tip of the nose, left corner of the mouth, and right corner of the mouth. The coordinates of these feature points in the face image are obtained and denoted as follows: .according to and The perspective transformation matrix of each face image and the standard face is calculated, and based on the perspective transformation matrix, the face image aligned with the standard face image is calculated. The aligned face images are then cropped to the same 112*112 pixel size as the standard face image, resulting in an aligned face dataset. This aligned face dataset includes aligned and cropped face images of a specified size corresponding to all images in the face image set. This aligned face dataset is denoted as: ; in, Indicates the first After alignment, the IR image is cropped to the specified size. Indicates the first After alignment, the RGB image is cropped to the specified size. Indicates the first The image is aligned and cropped to the specified size.
[0030] S4. Train a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model.
[0031] In a preferred embodiment, please refer to Figure 2 This is a schematic diagram of the structure of a multimodal face anti-spoofing model provided in an embodiment of the present invention, including: an IR single-modal anti-spoofing sub-model, an RGB single-modal anti-spoofing sub-model, a depth single-modal anti-spoofing sub-model, and a multimodal anti-spoofing sub-model; wherein, the IR single-modal anti-spoofing sub-model, the RGB single-modal anti-spoofing sub-model, and the depth single-modal anti-spoofing sub-model have the same structure; The step of training a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model includes: Based on the IR images in the aligned face dataset, the IR single-modal anti-counterfeiting sub-model is trained to obtain the trained IR single-modal anti-counterfeiting sub-model; Based on the RGB images in the aligned face dataset, the RGB unimodal anti-counterfeiting sub-model is trained to obtain the trained RGB unimodal anti-counterfeiting sub-model; Based on the depth images in the aligned face dataset, the deep unimodal anti-spoofing sub-model is trained to obtain the trained deep unimodal anti-spoofing sub-model. The IR images of the aligned face dataset are input into the trained IR single-modal anti-counterfeiting sub-model to obtain the output of the trained IR single-modal anti-counterfeiting sub-model. The RGB images of the aligned face dataset are input into the trained RGB unimodal anti-counterfeiting sub-model to obtain the output of the trained RGB unimodal anti-counterfeiting sub-model. Input the depth image of the aligned face dataset into the trained deep unimodal anti-spoofing sub-model to obtain the output of the trained deep unimodal anti-spoofing sub-model; The outputs of the trained IR unimodal anti-counterfeiting sub-model, the trained RGB unimodal anti-counterfeiting sub-model, and the trained deep unimodal anti-counterfeiting sub-model are used as inputs to train the multimodal anti-counterfeiting sub-model, resulting in the trained multimodal anti-counterfeiting sub-model. Based on the trained IR unimodal anti-spoofing sub-model, the trained RGB unimodal anti-spoofing sub-model, the trained deep unimodal anti-spoofing sub-model, and the trained multimodal anti-spoofing sub-model, a trained multimodal face anti-spoofing model is generated.
[0032] It should be noted that the IR single-modal anti-spoofing sub-model, RGB single-modal anti-spoofing sub-model, and deep single-modal anti-spoofing sub-model have the same structure. This is to ensure consistency in feature fusion, as the three modalities undergo the same feature extraction steps. This guarantees that the fused features do not favor any single modality. The structure used is a general backbone, such as MobileNet or ResNet, with alignment and pruning. Since the data collected is aligned face images, the SE attention mechanism is used to better capture key facial features during feature fusion, improving model performance and robustness. The multimodal anti-spoofing sub-module uses a general backbone and its variants.
[0033] In this embodiment, the IR single-modal anti-spoofing sub-model is trained based on the IR images in the aligned face dataset. Figure 2 (Top left dashed box), to obtain the trained IR single-modal anti-spoofing sub-model; based on the RGB images in the aligned face dataset, train the RGB single-modal anti-spoofing sub-model ( Figure 2(middle dashed box), to obtain the trained RGB unimodal anti-spoofing sub-model; based on the depth images in the aligned face dataset, train the depth unimodal anti-spoofing sub-model ( Figure 2 (The dashed box in the upper right corner) yields the trained deep single-modal anti-counterfeiting sub-model.
[0034] Since the IR feature extraction module, RGB feature extraction module, and Depth feature extraction module in the figure are already basically able to identify real and fake faces, and the anti-counterfeiting recognition results have high credibility, when training the multimodal anti-counterfeiting sub-model, it is necessary to remove the fully connected layer outputs of the IR single-modal anti-counterfeiting sub-model, RGB single-modal anti-counterfeiting sub-model, and deep single-modal anti-counterfeiting sub-model. Then, the feature extraction weights of the IR single-modal anti-counterfeiting sub-model, RGB single-modal anti-counterfeiting sub-model, and deep single-modal anti-counterfeiting sub-model are locked. The multimodal anti-counterfeiting sub-module is then trained based on the aligned face dataset. The specific process is as follows: the IR image of the aligned face dataset is input into the trained IR single-modal anti-counterfeiting sub-model. The following steps are performed: First, the output of the trained IR single-modal anti-spoofing sub-model is obtained. Then, the RGB images of the aligned face dataset are input into the trained RGB single-modal anti-spoofing sub-model to obtain its output. Next, the depth images of the aligned face dataset are input into the trained depth single-modal anti-spoofing sub-model to obtain its output. Finally, the outputs of the trained IR single-modal anti-spoofing sub-model, RGB single-modal anti-spoofing sub-model, and depth single-modal anti-spoofing sub-model are used as inputs to train the multimodal anti-spoofing sub-model, resulting in the trained multimodal anti-spoofing sub-model. Based on these three models, the trained IR single-modal anti-spoofing sub-model, RGB single-modal anti-spoofing sub-model, depth single-modal anti-spoofing sub-model, and multimodal anti-spoofing sub-model are used to generate... Figure 3 The trained multimodal face anti-spoofing model is shown.
[0035] In a preferred embodiment, the loss functions of the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, the deep single-modal anti-counterfeiting sub-model, and the multimodal anti-counterfeiting sub-model are all binary classification loss functions.
[0036] In this embodiment, the loss function of the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, the deep single-modal anti-counterfeiting sub-model, and the multimodal anti-counterfeiting sub-model is the cross-entropy loss function.
[0037] In a preferred embodiment, please refer to Figure 3This is a schematic diagram of another multimodal face anti-spoofing model provided in an embodiment of the present invention, including: an IR single-modal anti-spoofing sub-model, an RGB single-modal anti-spoofing sub-model, a depth single-modal anti-spoofing sub-model, and a multimodal anti-spoofing sub-model; wherein, the IR single-modal anti-spoofing sub-model, the RGB single-modal anti-spoofing sub-model, and the depth single-modal anti-spoofing sub-model have the same structure; the input of the multimodal anti-spoofing sub-model is the output of the IR single-modal anti-spoofing sub-model, the RGB single-modal anti-spoofing sub-model, and the depth single-modal anti-spoofing sub-model; The step of training a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model includes: The IR image, RGB image, and depth image from the aligned face dataset are input into the IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, and depth unimodal anti-spoofing sub-model, respectively. The outputs of the obtained IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, and depth unimodal anti-spoofing sub-model are input into the multimodal anti-spoofing sub-model. The IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, depth unimodal anti-spoofing sub-model, and multimodal anti-spoofing sub-model are trained simultaneously to obtain the trained multimodal face anti-spoofing model.
[0038] In this embodiment, it is not necessary to train the IR unimodal anti-spoofing sub-model, the RGB unimodal anti-spoofing sub-model, and the deep unimodal anti-spoofing sub-model separately. Instead, the model is trained based on the aligned face dataset. Figure 3 The entire model described above.
[0039] In a preferred embodiment, the loss function of the multimodal face anti-spoofing model for: ; in, The loss value of the IR single-modal anti-counterfeiting sub-model is... The loss value is for the RGB single-modal anti-counterfeiting sub-model. The loss value of the deep single-modal anti-counterfeiting sub-model is given. The loss value of the multimodal anti-counterfeiting sub-model. These are the weighting coefficients for the preset IR single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset RGB single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset depth single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the pre-defined multimodal sub-model loss values.
[0040] In this embodiment, the weighting coefficient It is 0.1. It is 0.1. It is 0.1. It is 0.7.
[0041] Example 2 Please refer to Figure 4 The above is a flowchart illustrating a face anti-counterfeiting recognition method according to an embodiment of the present invention, comprising: Acquire facial images captured by a binocular camera; wherein the binocular camera includes an IR lens and an RGB lens; the facial image set includes several IR images and an RGB image captured at the same time and in the same scene corresponding to each IR image; The face image is input into a multimodal face anti-spoofing model so that the multimodal face anti-spoofing model can perform anti-spoofing recognition on the face image and obtain anti-spoofing recognition results; wherein, the multimodal face anti-spoofing model is trained according to the multimodal face anti-spoofing model training method described above.
[0042] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for training a multimodal face anti-spoofing model, characterized in that, include: A set of face images is formed by acquiring several face images using a binocular camera; wherein, the binocular camera includes an IR lens and an RGB lens arranged horizontally; the set of face images includes several IR images and an RGB image acquired at the same time and in the same scene corresponding to each IR image; Based on each group of IR images and corresponding RGB images in the face image set, calculate the corresponding depth image, and add the obtained depth image to the face image set to obtain the updated face image set; Perform face alignment on all images in the updated face image set to obtain an aligned face dataset; A multimodal anti-spoofing model is trained based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model; wherein, the multimodal anti-spoofing model includes: an IR single-modal anti-spoofing sub-model, an RGB single-modal anti-spoofing sub-model, a deep single-modal anti-spoofing sub-model, and a multimodal anti-spoofing sub-model; the IR single-modal anti-spoofing sub-model, the RGB single-modal anti-spoofing sub-model, and the deep single-modal anti-spoofing sub-model have the same structure; Specifically, the IR single-modal anti-counterfeiting sub-model is trained based on the IR images in the aligned face dataset to obtain the trained IR single-modal anti-counterfeiting sub-model; Based on the RGB images in the aligned face dataset, the RGB unimodal anti-counterfeiting sub-model is trained to obtain the trained RGB unimodal anti-counterfeiting sub-model; Based on the depth images in the aligned face dataset, the deep unimodal anti-spoofing sub-model is trained to obtain the trained deep unimodal anti-spoofing sub-model. The IR images of the aligned face dataset are input into the trained IR single-modal anti-counterfeiting sub-model to obtain the output of the trained IR single-modal anti-counterfeiting sub-model. The RGB images of the aligned face dataset are input into the trained RGB unimodal anti-counterfeiting sub-model to obtain the output of the trained RGB unimodal anti-counterfeiting sub-model. Input the depth image of the aligned face dataset into the trained deep unimodal anti-spoofing sub-model to obtain the output of the trained deep unimodal anti-spoofing sub-model; The outputs of the trained IR unimodal anti-counterfeiting sub-model, the trained RGB unimodal anti-counterfeiting sub-model, and the trained deep unimodal anti-counterfeiting sub-model are used as inputs to train the multimodal anti-counterfeiting sub-model, resulting in the trained multimodal anti-counterfeiting sub-model. Based on the trained IR unimodal anti-spoofing sub-model, the trained RGB unimodal anti-spoofing sub-model, the trained deep unimodal anti-spoofing sub-model, and the trained multimodal anti-spoofing sub-model, a trained multimodal face anti-spoofing model is generated.
2. The multimodal face anti-spoofing model training method as described in claim 1, characterized in that, The step of calculating the corresponding depth image based on each group of IR images and the corresponding RGB images in the face image set includes: The IR image and the RGB image are preprocessed to obtain the processed IR image and RGB image; The processed IR image and the RGB image are subjected to stereoscopic image correction to obtain the corrected IR image and RGB image; The feature points of each corrected IR image and its corresponding RGB image are obtained through a facial feature point detection algorithm. Based on the feature points of the IR image and the corresponding RGB image, calculate the matching matrix of the IR image and the corresponding RGB image, and obtain the pixel correspondence between the IR image and the corresponding RGB image based on the matching matrix; Based on the pixel correspondence between the IR image and the corresponding RGB image, calculate the disparity map of the IR image and the corresponding RGB image; Calculate the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image.
3. The multimodal face anti-spoofing model training method as described in claim 2, characterized in that, The step of calculating the corresponding depth map based on the disparity map of the IR image and the corresponding RGB image includes: The disparity values of corresponding pixels in the IR image and the corresponding RGB image are determined based on the disparity map of the IR image and the corresponding RGB image. Obtain the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinates of the pixels in the IR image and the corresponding RGB image; The corresponding depth map is calculated based on the disparity value of the corresponding pixel, the focal length of the binocular camera, the baseline distance between the left and right cameras, and the horizontal coordinate of the pixel.
4. The multimodal face anti-spoofing model training method as described in claim 1, characterized in that, The step of performing face alignment on all images in the updated face image set to obtain an aligned face dataset includes: Facial feature point detection is performed on all images in the updated face image set to obtain the feature point coordinates corresponding to each face image and the standard face image; wherein, the standard face image is a preset face image with specified feature points; Based on the feature point coordinates of each face image and the standard face, calculate the corresponding perspective transformation matrix; based on the perspective transformation matrix, calculate the aligned face image of each face image. The aligned face images are cropped to the same size as the standard face images to obtain the aligned face dataset.
5. The multimodal face anti-spoofing model training method as described in claim 1, characterized in that, The loss functions of the IR single-modal anti-counterfeiting sub-model, RGB single-modal anti-counterfeiting sub-model, deep single-modal anti-counterfeiting sub-model, and multimodal anti-counterfeiting sub-model are all binary classification loss functions.
6. The multimodal face anti-spoofing model training method as described in claim 1, characterized in that, The multimodal anti-counterfeiting model includes: an IR single-modal anti-counterfeiting sub-model, an RGB single-modal anti-counterfeiting sub-model, a depth single-modal anti-counterfeiting sub-model, and a multimodal anti-counterfeiting sub-model; wherein, the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, and the depth single-modal anti-counterfeiting sub-model have the same structure; the input of the multimodal anti-counterfeiting sub-model is the output of the IR single-modal anti-counterfeiting sub-model, the RGB single-modal anti-counterfeiting sub-model, and the depth single-modal anti-counterfeiting sub-model; The step of training a multimodal anti-spoofing model based on the aligned face dataset to obtain the trained multimodal face anti-spoofing model includes: The IR image, RGB image, and depth image from the aligned face dataset are input into the IR unimodal anti-spoofing sub-model, the RGB unimodal anti-spoofing sub-model, and the depth unimodal anti-spoofing sub-model, respectively. The outputs of the obtained IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, and depth unimodal anti-spoofing sub-model are input into the multimodal anti-spoofing sub-model. The IR unimodal anti-spoofing sub-model, RGB unimodal anti-spoofing sub-model, depth unimodal anti-spoofing sub-model, and multimodal anti-spoofing sub-model are trained simultaneously to obtain the trained multimodal face anti-spoofing model.
7. The multimodal face anti-spoofing model training method as described in claim 6, characterized in that, The loss function of the multimodal face anti-spoofing model for: ; in, The loss value of the IR single-modal anti-counterfeiting sub-model is... The loss value is for the RGB single-modal anti-counterfeiting sub-model. The loss value of the deep single-modal anti-counterfeiting sub-model is given. The loss value of the multimodal anti-counterfeiting sub-model. These are the weighting coefficients for the preset IR single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset RGB single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the preset depth single-modal anti-counterfeiting sub-model loss values. These are the weighting coefficients for the pre-defined multimodal sub-model loss values.
8. A face anti-counterfeiting recognition method, characterized in that, include: Acquire facial images captured by a binocular camera; wherein the binocular camera includes an IR lens and an RGB lens; the facial image set includes several IR images and an RGB image captured at the same time and in the same scene corresponding to each IR image; The face image is input into a multimodal face anti-spoofing model so that the multimodal face anti-spoofing model can perform anti-spoofing recognition on the face image and obtain anti-spoofing recognition results; wherein, the multimodal face anti-spoofing model is trained by the multimodal face anti-spoofing model training method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Face verification method and device, computer equipment and storage medium
CN112232323A
Face biopsy method, system and equipment based on binocular camera distance measurement and medium
CN115063339A
Anti-counterfeiting facial detection method, system and apparatus based on cross-modality conversion assistance
WO2022032549A1
