Facial Anti-counterfeiting method and apparatus, and storage medium
Through the face depth model and three-dimensional anti-counterfeiting model, the image pixel coordinate points and depth factors are obtained using the 2D monocular camera, and converted into 3D spatial information images, which solves the problem that the 2D monocular camera cannot prevent 2D and 3D faces at the same time in the prior art. The problem is to achieve efficient face verification without the need for action coordination of the verifier.
Patent Information
- Application Number
- PCT/CN2023/137680
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-15
- Filing Date
- 2023-12-09
- Publication Date
- 2024-12-19
AI Technical Summary
The existing face anti-counterfeiting technology requires a 2D monocular camera to cooperate with the action of the verified person, and it cannot effectively prevent 2D and 3D face images at the same time, and the hardware requirements are high and the efficiency is low.
Through the preset face depth model and three-dimensional anti-counterfeiting model, the image pixel coordinate points and depth factors are obtained using the 2D monocular camera, converted into a 3D spatial information image, and judged whether it is a plane or a three-dimensional fake face, so as to achieve action without the need for verifiers to be verified Cooperating two-dimensional and three-dimensional face anti-counterfeiting.
It reduces the requirements for camera hardware, speeds up the efficiency of face verification, improves the accuracy of face anti-counterfeiting, and can realize effective recognition of 2D and 3D faces without the need for action cooperation of the verifier.
Smart Images

Figure CN2023137680_19122024_PF_FP_ABST
Abstract
Description
A face anti-counterfeiting method, device and storage medium Technical Field
[0001] The present invention relates to the field of image anti-counterfeiting, and in particular to a face anti-counterfeiting method, device and storage medium. Background Art
[0002] Currently, the faces that face anti-counterfeiting mainly protects against are roughly divided into 2D and 3D faces. Generally, 2D information can identify three-dimensional fake faces, and 3D information can identify two-dimensional fake faces. The current anti-counterfeiting ideas for face anti-counterfeiting are generally as follows:
[0003] 1. 2D camera-based deep learning methods, based on 2D image data captured by a large number of 2D and 3D facial cameras, use traditional image algorithms (PCA, eigenfaces, elastic maps, etc.) or deep learning methods. Currently, the mainstream method in various industries is to use deep learning methods.
[0004] These methods combine deep learning with multi-pose images to achieve facial authentication. During facial recognition, the subject is required to perform actions such as opening their mouth, lowering their head, shaking their head, and blinking. This relies on multiple frames of facial poses for authentication. However, this method requires the subject's cooperation and offers a limited user experience.
[0005] 2. The face anti-counterfeiting method based on binocular cameras uses a binocular vision solution to generate point cloud information for 2D face anti-counterfeiting, and combines one of the binocular eyes for 3D face anti-counterfeiting. This method has higher reliability, but the binocular camera is more expensive and takes up more space in the equipment.
[0006] Summary of the Invention
[0007] The present invention provides a facial anti-counterfeiting method, device and storage medium, which can realize the anti-counterfeiting of 2D and 3D facial images simultaneously based on the use of only a 2D monocular camera, so as to solve the problem that the facial anti-counterfeiting requires the cooperation of the person to be verified when using a 2D monocular camera.
[0008] Firstly, this application provides a face anti-counterfeiting method
[0009] Obtain the image to be detected captured by a 2D monocular camera;
[0010] Obtain the depth factor corresponding to each pixel coordinate point of the image to be detected through the preset face depth model;
[0011] Converting the image to be detected into a 3D spatial information image according to the depth factor and preset camera parameters;
[0012] Determine whether the converted 3D spatial information image is a flat false face;
[0013] If the 3D spatial information image is not a planar fake face, a preset three-dimensional anti-counterfeiting model is used to determine whether the image to be detected is a three-dimensional fake face.
[0014] This approach uses a facial depth model and a 3D anti-counterfeiting model to achieve 2D and 3D anti-counterfeiting of images using only a 2D monocular camera. This reduces camera hardware requirements without requiring human interaction, speeds up facial verification, and improves facial anti-counterfeiting accuracy.
[0015] Furthermore, the preset face depth model is specifically:
[0016] Obtain a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model;
[0017] Setting a neural network model, and training the neural network model using the training set;
[0018] Set the trained neural network model as the preset face depth model;
[0019] The face depth model can generate a corresponding depth factor after inputting the image pixel coordinate points.
[0020] In this way, by using a neural network model to adaptively obtain the depth factor of the image to be detected, a 2D monocular camera can be used to generate an appropriate depth factor for different images to be detected. This allows the image to be more accurately converted into a 3D spatial information image.
[0021] Furthermore, the image to be detected is converted into a 3D spatial information image according to the depth factor and camera parameters, specifically:
[0022] Obtaining pixel coordinates of the image to be detected and camera intrinsic parameter matrix parameters in the camera parameters;
[0023] The point cloud coordinate points of the 3D spatial information image are obtained through the pixel coordinate points of the image to be detected, the camera intrinsic parameter matrix parameters and the depth factor corresponding to the pixel coordinate points.
[0024] In this way, the image to be detected is converted into a 3D spatial information image through the adaptively generated depth factor. The point cloud coordinates of the 3D spatial information image are obtained through the formula, which makes it easier and more convenient to obtain 3D spatial information.
[0025] Furthermore, the point cloud coordinates of the 3D spatial information image are obtained by using the pixel coordinates of the image to be detected, the camera intrinsic parameter matrix parameters, and the depth factor corresponding to the pixel coordinates, specifically:
[0026] Calculate the point cloud coordinates of the 3D spatial information image corresponding to the image to be detected according to the following formula:
[0027] Among them, the point cloud coordinates of the 3D spatial information image are (X, Y, Z), the pixel coordinates of the image to be detected are (u, v), the camera intrinsic parameter matrix parameters are (fx, fy, tx, ty), fx and fy in the camera intrinsic parameter matrix parameters are the camera focal lengths, tx and ty are the principal point coordinates relative to the imaging plane, and the depth factor corresponding to the pixel coordinates of the image to be detected is p.
[0028] Furthermore, the determination of whether the converted 3D spatial information image is a planar false face is specifically as follows:
[0029] Obtaining the spatial coordinates of several feature points in the converted 3D spatial information image;
[0030] Determine whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane. If the spatial coordinates of four or more feature points are in the same plane, confirm that the image to be detected is a planar false face; otherwise, confirm that the image to be detected is not a planar false face.
[0031] By determining whether the spatial coordinates of all feature points in the converted 3D spatial information image are on the same plane, the 3D spatial information image can be confirmed to be a flat, fake face. This allows for rapid identification of flat, fake faces, thereby preventing flat images from disguising themselves as real faces and passing through facial recognition.
[0032] Furthermore, the determining whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane is specifically as follows:
[0033] Selecting at least four feature points from all feature points, and obtaining the volume of a polyhedron formed by the spatial coordinates of the at least four feature points;
[0034] If the volume of the polyhedron is greater than a preset threshold, at least four more feature points are selected to form another polyhedron to calculate the volume until all feature points are selected or the volume of the polyhedron is less than the preset threshold;
[0035] If the volume of any polyhedron is smaller than a preset threshold, the spatial coordinates of all feature points are determined to be in the same plane;
[0036] Otherwise, it is determined that the spatial coordinates of all feature points are not in the same plane.
[0037] Based on the principle that three points determine a plane, at least four feature points are selected for coplanarity determination. If the selected feature points are coplanar, additional feature points are selected for volume calculation until all feature points are selected. This eliminates the possibility of missing feature points and allows for a comprehensive determination of whether all feature points in the 3D spatial information image are in the same plane.
[0038] Furthermore, the volume of the polyhedron formed by the spatial coordinates of the at least four feature points is obtained, specifically:
[0039] Based on the at least four feature points, the formula for calculating the volume V of the polyhedron formed by the spatial coordinates of the at least four feature points is:
[0040] Among them, at least four feature points are {A i |(x i ,y i ,z i ), i = 1 ~ n}, Ai is the i-th feature point, and n is the number of selected feature points.
[0041] Furthermore, the acquisition of a three-dimensional face image set consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model is specifically as follows:
[0042] Obtaining pixel coordinate points and point cloud coordinate points of a face image collected by a data acquisition device;
[0043] The depth factor corresponding to each pixel of the face image is obtained by the following formula based on the radar camera extrinsic parameters and the camera intrinsic parameter matrix parameters:
[0044] Among them, the depth factor corresponding to each pixel of the face image is p, the coordinate point of the face image camera coordinate system is (m, n), the pixel coordinate point of the face image is (u, v), the point cloud coordinate point is (x, y, z), and the radar camera external parameter parameter is (R 3*3 cx cy cz), the camera intrinsic matrix parameters are (fx,fy,tx,ty);
[0045] Among them, fx and fy in the camera intrinsic matrix parameters are the camera focal length, tx and ty are the principal point coordinates relative to the imaging plane; R in the radar camera extrinsic parameters is 3*3 The rotation matrix records the direction of the coordinate axis of the world coordinate system relative to the camera coordinate axis. cx, cy, and cz are translation vectors used to record the position of the space origin in the camera coordinate system.
[0046] Set the training set of the face depth model to {Ft j |(uj ,v j ,p j )}, where Ft j is the jth training sample in the training set.
[0047] Wherein, the data acquisition device includes an image acquisition device and a radar camera.
[0048] In this way, the pixel coordinate points and point cloud coordinate points of the facial image are obtained through the data acquisition device, and the 3D spatial information and the two-dimensional plane image information are combined through calculation to obtain an accurate training set of the facial depth model.
[0049] In a second aspect, the present application provides a face anti-counterfeiting device, comprising: an image acquisition module, a depth factor acquisition module, an image conversion module, a planar fake face detection module, and a three-dimensional fake face detection module;
[0050] The image acquisition module is used to acquire the image to be detected collected by the 2D monocular camera;
[0051] The depth factor acquisition module is used to obtain the depth factor corresponding to each pixel coordinate point of the image to be detected through a preset face depth model;
[0052] The image conversion module is used to convert the image to be detected into a 3D spatial information image according to the depth factor and preset camera parameters;
[0053] The plane fake face detection module is used to determine whether the converted 3D spatial information image is a plane fake face;
[0054] The three-dimensional fake face detection module is used to determine whether the image to be detected is a three-dimensional fake face through a preset three-dimensional anti-counterfeiting model if the 3D spatial information image is not a planar fake face.
[0055] In a third aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the face anti-counterfeiting method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] FIG1 is a flow chart of an embodiment of a face anti-counterfeiting method provided by the present invention;
[0057] Figure 2: A module structure diagram of an embodiment of a face anti-counterfeiting device provided by the present invention. DETAILED DESCRIPTION
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] Example 1
[0060] Please refer to FIG1 , which is a flow chart of an embodiment of a face anti-counterfeiting method provided by the present invention, including steps S1 to S5. The details of each step are as follows:
[0061] Step S1: Acquire an image to be detected captured by a 2D monocular camera.
[0062] In this embodiment, the image to be detected captured by the 2D monocular camera only contains the coordinate points of the pixel coordinate system and the image information of each pixel coordinate point. The 2D monocular camera cannot directly capture the depth factor of the image to be detected or the coordinate points of the point cloud coordinate system.
[0063] Step S2: Obtain the depth factor corresponding to each pixel coordinate point of the image to be detected through a preset face depth model.
[0064] Furthermore, the preset face depth model specifically comprises: obtaining a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model;
[0065] Setting a neural network model, and training the neural network model using the training set;
[0066] Set the trained neural network model as the preset face depth model;
[0067] The face depth model can generate a corresponding depth factor after inputting the image pixel coordinate points.
[0068] In this way, by using a neural network model to adaptively obtain the depth factor of the image to be detected, a 2D monocular camera can be used to generate an appropriate depth factor for different images to be detected. This allows the image to be more accurately converted into a 3D spatial information image.
[0069] The neural network model described in this application may be a convolutional neural network model, a Transformer model or any other neural network model.
[0070] In this embodiment, a convolutional neural network model is used in which the layers are stacked three times in the width direction and stacked according to the number of feature points in the height direction.
[0071] The step of obtaining a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model is as follows:
[0072] Obtaining pixel coordinate points and point cloud coordinate points of a face image collected by a data acquisition device;
[0073] The depth factor corresponding to each pixel of the face image is obtained by the following formula based on the radar camera extrinsic parameters and the camera intrinsic parameter matrix parameters:
[0074] Among them, the depth factor corresponding to each pixel of the face image is p, the coordinate point of the face image camera coordinate system is (m, n), the pixel coordinate point of the face image is (u, v), the point cloud coordinate point is (x, y, z), and the radar camera external parameter parameter is (R 3*3 cx cy cz), the camera intrinsic matrix parameters are (fx,fy,tx,ty);
[0075] Among them, fx and fy in the camera internal parameter matrix are focal lengths, tx and ty are the coordinates of the principal point relative to the imaging plane; R in the radar camera external parameter matrix is 3*3 The rotation matrix records the direction of the coordinate axis of the world coordinate system relative to the camera coordinate axis. cx, cy, and cz are translation vectors used to record the position of the space origin in the camera coordinate system.
[0076] Set the training set of the face depth model to {Ft j |(u j ,v j ,p j )}, where Ft j is the jth training sample in the training set.
[0077] Furthermore, the data acquisition device in this embodiment includes an image acquisition device and a radar camera.
[0078] In this way, the pixel coordinate points and point cloud coordinate points of the facial image are obtained through the data acquisition device, and the 3D spatial information and the two-dimensional plane image information are combined through calculation to obtain an accurate training set of the facial depth model.
[0079] Step S3: converting the image to be detected into a 3D spatial information image according to the depth factor and preset camera parameters.
[0080] Furthermore, the image to be detected is converted into a 3D spatial information image according to the depth factor and camera parameters, specifically:
[0081] Obtaining pixel coordinates of the image to be detected and camera intrinsic parameter matrix parameters in the camera parameters;
[0082] The point cloud coordinate points of the 3D spatial information image are obtained through the pixel coordinate points of the image to be detected, the camera intrinsic parameter matrix parameters and the depth factor corresponding to the pixel coordinate points.
[0083] Furthermore, the point cloud coordinates of the 3D spatial information image are obtained by using the pixel coordinates of the image to be detected, the camera intrinsic parameter matrix parameters, and the depth factor corresponding to the pixel coordinates, specifically:
[0084] Calculate the point cloud coordinates of the 3D spatial information image corresponding to the image to be detected according to the following formula:
[0085] Among them, the point cloud coordinates of the 3D spatial information image are (X, Y, Z), the pixel coordinates of the image to be detected are (u, v), the camera intrinsic parameter matrix parameters are (fx, fy, tx, ty), fx and fy in the camera intrinsic parameter matrix parameters are the camera focal lengths, tx and ty are the principal point coordinates relative to the imaging plane, and the depth factor corresponding to the pixel coordinates of the image to be detected is p.
[0086] Based on this idea, this application combines the fixed spatial morphological features of the face and can learn a large amount of data through deep learning methods. Finally, the complex transformation relationship between the 2D monocular camera and the facial features is fitted through a neural network model to obtain the depth factor P. Combined with the known camera intrinsic parameters, the 3D spatial information image of the facial feature points is finally obtained.
[0087] Step S4: Determine whether the converted 3D spatial information image is a planar false face.
[0088] Furthermore, the determination of whether the converted 3D spatial information image is a planar false face is specifically as follows:
[0089] Obtaining the spatial coordinates of several feature points in the converted 3D spatial information image;
[0090] Determine whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane. If the spatial coordinates of four or more feature points are in the same plane, confirm that the image to be detected is a planar false face; otherwise, confirm that the image to be detected is not a planar false face.
[0091] By determining whether the spatial coordinates of all feature points in the converted 3D spatial information image are on the same plane, the 3D spatial information image can be confirmed to be a flat, fake face. This allows for rapid identification of flat, fake faces, thereby preventing flat images from disguising themselves as real faces and passing through facial recognition.
[0092] Furthermore, the determining whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane is specifically as follows:
[0093] Selecting at least four feature points from all feature points, and obtaining the volume of a polyhedron formed by the spatial coordinates of the at least four feature points;
[0094] If the volume of the polyhedron is greater than a preset threshold, at least four more feature points are selected to form another polyhedron to calculate the volume until all feature points are selected or the volume of the polyhedron is less than the preset threshold;
[0095] If the volume of any polyhedron is smaller than a preset threshold, the spatial coordinates of all feature points are determined to be in the same plane;
[0096] Otherwise, it is determined that the spatial coordinates of all feature points are not in the same plane.
[0097] Based on the principle that three points determine a plane, at least four feature points are selected for coplanarity determination. If the selected feature points are coplanar, additional feature points are selected for volume calculation until all feature points are selected. This eliminates the possibility of missing feature points and allows for a comprehensive determination of whether all feature points in the 3D spatial information image are in the same plane.
[0098] Furthermore, the volume of the polyhedron formed by the spatial coordinates of the at least four feature points is obtained, specifically:
[0099] Based on the at least four feature points, the formula for calculating the volume V of the polyhedron formed by the spatial coordinates of the at least four feature points is:
[0100] Among them, at least four feature points are {A i |(x i ,y i ,z i ), i = 1 ~ n}, Ai is the i-th feature point, and n is the number of selected feature points.
[0101] In this embodiment, the spatial coordinates of five feature points in the converted 3D spatial information image are obtained. These five feature points are located at the left eye, right eye, nose bridge, left corner of the mouth, and right corner of the mouth of the face in the 3D spatial information image. Any four of these five feature points are selected, and the volume of the tetrahedron defined by these four points is calculated. The calculation method is as follows:
[0102] The volume of the tetrahedron is V, and the four feature points are {A i |(x i ,yi ,z i ),i=1~4}, Ai is the i-th feature point.
[0103] If the tetrahedron volume V is less than a threshold, the four feature points are coplanar. In this embodiment, the threshold is set to 0.5, and the closer the tetrahedron volume V is to 0, the greater the coplanarity of the four feature points.
[0104] If the volumes of all tetrahedrons are greater than the threshold, it is determined that the spatial coordinates of all feature points are not in the same plane, and the 3D spatial information image is not a planar false face.
[0105] Step S5: If the 3D spatial information image is not a planar fake face, a preset three-dimensional anti-counterfeiting model is used to determine whether the image to be detected is a three-dimensional fake face.
[0106] The three-dimensional anti-counterfeiting model in this embodiment is specifically:
[0107] Obtaining three-dimensional fake face image data as a three-dimensional anti-counterfeiting model training set;
[0108] Setting a deep learning model, and training the deep learning model using the three-dimensional anti-counterfeiting model training set;
[0109] Set the trained deep learning model as a three-dimensional anti-counterfeiting model.
[0110] The obtaining of three-dimensional fake face image data specifically includes: using a 2D monocular camera to collect image data of three-dimensional fake faces and three-dimensional real faces as positive and negative samples for training data of the three-dimensional anti-counterfeiting model, thereby completing the training of the three-dimensional anti-counterfeiting model.
[0111] This approach uses a facial depth model and a 3D anti-counterfeiting model to achieve 2D and 3D anti-counterfeiting of images using only a 2D monocular camera. This reduces camera hardware requirements without requiring human interaction, speeds up facial verification, and improves facial anti-counterfeiting accuracy.
[0112] Furthermore, in this embodiment, the face depth model in step S2 and the three-dimensional anti-counterfeiting model in step S5 can be combined to achieve one-step detection of planar fake faces and three-dimensional fake faces.
[0113] A new training set is set, and the new training set has the same structure as the training set of the face depth model.
[0114] The new training set requires both real faces and 3D fake face models to be collected and labeled to distinguish them. The face depth model is replaced with a face anti-counterfeiting model, and the new training set is input into the face anti-counterfeiting model to obtain the depth factor and the result of whether the face is a 3D fake face.
[0115] This embodiment uses a facial depth model and a 3D fake face model to convert a 2D image into a 3D spatial information image by obtaining the depth factor. This allows for facial recognition of both flat and 3D fake faces without requiring any human interaction. This reduces camera hardware requirements, increases the success rate of facial verification, and improves facial anti-counterfeiting accuracy.
[0116] Example 2
[0117] Please refer to FIG. 2 , which is a module structure diagram of an embodiment of a face anti-counterfeiting device provided by the present invention.
[0118] A face anti-counterfeiting device includes: an image acquisition module 210, a depth factor acquisition module 220, an image conversion module 230, a planar fake face detection module 240, and a three-dimensional fake face detection module 250;
[0119] The image acquisition module 210 is used to acquire the image to be detected captured by a 2D monocular camera;
[0120] The depth factor acquisition module 220 is used to obtain the depth factor corresponding to each pixel coordinate point of the image to be detected through a preset face depth model;
[0121] The image conversion module 230 is used to convert the image to be detected into a 3D spatial information image according to the depth factor and preset camera parameters;
[0122] The plane fake face detection module 240 is used to determine whether the converted 3D spatial information image is a plane fake face;
[0123] The three-dimensional fake face detection module 250 is used to determine whether the image to be detected is a three-dimensional fake face by using a preset three-dimensional anti-counterfeiting model if the 3D spatial information image is not a planar fake face.
[0124] Furthermore, the image conversion module 230 further includes a parameter acquisition unit 231 and a point cloud coordinate point acquisition unit 232;
[0125] The parameter acquisition unit 231 is used to obtain the pixel coordinate points of the image to be detected and the camera intrinsic parameter matrix parameters in the camera parameters;
[0126] The point cloud coordinate point acquisition unit 232 is used to obtain the point cloud coordinate points of the 3D spatial information image through the pixel coordinate points of the image to be detected, the camera intrinsic parameter matrix parameters and the depth factor corresponding to the pixel coordinate points.
[0127] Furthermore, the point cloud coordinate point acquisition unit 232 is used to obtain the point cloud coordinate points of the 3D spatial information image through the pixel coordinate points of the image to be detected, the camera intrinsic parameter matrix parameters, and the depth factor corresponding to the pixel coordinate points, specifically:
[0128] Calculate the point cloud coordinates of the 3D spatial information image corresponding to the image to be detected according to the following formula:
[0129] Among them, the point cloud coordinates of the 3D spatial information image are (X, Y, Z), the pixel coordinates of the image to be detected are (u, v), the camera intrinsic parameter matrix parameters are (fx, fy, tx, ty), fx and fy in the camera intrinsic parameter matrix parameters are the camera focal lengths, tx and ty are the principal point coordinates relative to the imaging plane, and the depth factor corresponding to the pixel coordinates of the image to be detected is p.
[0130] Furthermore, the planar fake face detection module 240 further includes a feature point acquisition unit 241 and a coplanar detection unit 242;
[0131] The feature point acquisition unit 241 is used to obtain the spatial coordinates of several feature points in the converted 3D spatial information image;
[0132] The coplanarity detection unit 242 is used to determine whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane. If the spatial coordinates of four or more feature points are in the same plane, it is confirmed that the image to be detected is a planar false face; otherwise, it is confirmed that the image to be detected is not a planar false face.
[0133] Furthermore, the coplanarity detection unit 242 is used to determine whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane, specifically:
[0134] Selecting at least four feature points from all feature points, and obtaining the volume of a polyhedron formed by the spatial coordinates of the at least four feature points;
[0135] If the volume of the polyhedron is greater than a preset threshold, at least four more feature points are selected to form another polyhedron to calculate the volume until all feature points are selected or the volume of the polyhedron is less than the preset threshold;
[0136] If the volumes of the polyhedrons are all smaller than the preset threshold, it is determined that the spatial coordinates of four or more feature points are in the same plane;
[0137] Otherwise, it is determined that the spatial coordinates of all feature points are not in the same plane.
[0138] Furthermore, the volume of the polyhedron formed by the spatial coordinates of the at least four feature points is obtained, specifically:
[0139] Based on the at least four feature points, the formula for calculating the volume V of the polyhedron formed by the spatial coordinates of the at least four feature points is:
[0140] Among them, at least four feature points are {A i |(x i ,y i ,z i ), i = 1 ~ n}, Ai is the i-th feature point, and n is the number of selected feature points.
[0141] Furthermore, the preset face depth model includes a training set acquisition module, a neural network model setting module and a depth factor calculation module:
[0142] The training set acquisition module is used to acquire a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model;
[0143] The neural network model setting module is used to set the neural network model and train the neural network model using the training set;
[0144] Set the trained neural network model as the preset face depth model;
[0145] The depth factor calculation module is used for the face depth model to generate a corresponding depth factor after inputting image pixel coordinate points.
[0146] Furthermore, the training set acquisition module also includes a data acquisition unit, a coordinate calculation unit and a training set setting unit:
[0147] The data acquisition unit is used to obtain pixel coordinate points and point cloud coordinate points of the face image acquired by the data acquisition device;
[0148] The coordinate calculation unit is used to obtain the depth factor corresponding to each pixel of the face image according to the radar camera extrinsic parameter and the camera intrinsic parameter matrix parameter by the following formula:
[0149] Among them, the depth factor corresponding to each pixel of the face image is p, the coordinate point of the face image camera coordinate system is (m, n), the pixel coordinate point of the face image is (u, v), the point cloud coordinate point is (x, y, z), and the radar camera external parameter parameter is (R 3*3 cx cy cz), the camera intrinsic matrix parameters are (fx,fy,tx,ty);
[0150] Among them, fx and fy in the camera intrinsic matrix parameters are the camera focal length, tx and ty are the principal point coordinates relative to the imaging plane, and R in the radar camera extrinsic parameters is 3*3 The rotation matrix records the direction of the coordinate axis of the world coordinate system relative to the camera coordinate axis. cx, cy, and cz are translation vectors used to record the position of the space origin in the camera coordinate system.
[0151] The training set setting unit is used to set the training set of the face depth model as {Ft j |(u j ,v j ,p j )}, where Ft j is the jth training sample in the training set.
[0152] This embodiment uses a facial depth model and a 3D anti-counterfeiting model to achieve 2D and 3D anti-counterfeiting of images using only a 2D monocular camera. This reduces the hardware requirements for the camera, speeds up facial verification, and improves the accuracy of facial anti-counterfeiting without requiring human interaction.
[0153] Example 3
[0154] One embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the face anti-counterfeiting method as described above.
[0155] The specific embodiments described above further illustrate the objectives, technical solutions, 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 face anti-counterfeiting method, characterized in that: The following steps are involved: Obtain the image to be detected collected by a 2D monocular camera; Using the preset face depth model, the depth factor corresponding to each pixel coordinate point of the image to be detected is obtained; According to the depth factor and preset camera parameters, the image to be detected is converted into a 3D spatial information image; Determine whether the converted 3D spatial information image is a flat false face; If the 3D space information image is not a planar fake face, a preset three-dimensional anti-counterfeiting model is used to determine whether the image information image to be detected is a three-dimensional fake face.
2. The face anti-counterfeiting method according to claim 1, characterized in that: The preset face depth model is specifically: Obtain a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model; Setting a neural network model, and training the neural network model using the training set; Set the trained neural network model as the preset face depth model; The face depth model can generate a corresponding depth factor after inputting the image pixel coordinate points.
3. The face anti-counterfeiting method according to claim 1, characterized in that: The step of converting the image to be detected into a 3D spatial information image according to the depth factor and the camera parameters is specifically as follows: Obtaining pixel coordinate points of the image to be detected and camera intrinsic parameter matrix parameters in camera parameters; Through the pixel coordinate points of the image to be detected, the camera internal parameter matrix parameters and the pixel coordinate point pair The corresponding depth factor is used to obtain the point cloud coordinate points of the 3D spatial information image.
4. The face anti-counterfeiting method according to claim 3, characterized in that: The point cloud coordinate points of the 3D space information image are obtained by using the pixel coordinate points of the image to be detected, the camera intrinsic parameter matrix parameters and the depth factor corresponding to the pixel coordinate points, specifically: The point cloud coordinates of the 3D spatial information image corresponding to the image to be detected are calculated according to the following formula: Among them, the point cloud coordinate point of the 3D spatial information image is (X, Y, Z), the pixel coordinate point coordinate point of the image to be detected is (u, v), the camera intrinsic parameter matrix parameters are (fx, fy, tx, ty), fx and fy in the camera intrinsic parameter matrix parameters are the focal length of the camera, tx and ty are the coordinates of the principal point relative to the imaging plane, and the depth factor corresponding to the pixel coordinate point of the image to be detected is p.
5. The face anti-counterfeiting method according to claim 1, characterized in that: The step of judging whether the converted 3D spatial information image is a flat false face is as follows: Obtaining the spatial coordinates of several feature points in the converted 3D spatial information image; It is determined whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane. If the spatial coordinates of four or more feature points are in the same plane, it is confirmed that the image to be detected is a planar false face; otherwise, it is confirmed that the image to be detected is not a planar false face.
6. The face anti-counterfeiting method according to claim 5, characterized in that: The determining whether the spatial coordinates of four or more feature points in the converted 3D spatial information image are in the same plane is specifically as follows: Select at least four feature points from all feature points, and obtain the spatial coordinates of the at least four feature points. The volume of the polyhedron formed by the marks; If the volume of the polyhedron is greater than a preset threshold, at least four more feature points are selected to form another polyhedron to calculate the volume, until all feature points are selected or the volume of the polyhedron appears to be less than the preset threshold; If the volumes of the polyhedrons are all smaller than the preset threshold, it is determined that the spatial coordinates of four or more feature points are in the same plane; Otherwise, it is determined that the spatial coordinates of all feature points are not in the same plane.
7. The face anti-counterfeiting method according to claim 6, characterized in that: The obtaining of the volume of the polyhedron formed by the spatial coordinates of the at least four feature points is specifically: According to the at least four feature points, the formula for calculating the volume V of the polyhedron formed by the spatial coordinates of the at least four feature points is: Among them, at least four feature points are {A i |(x i ,y i ,z i ),i=1~n},A i is the i-th feature point, and n is the number of selected feature points.
8. The face anti-counterfeiting method according to claim 2, characterized in that: The step of obtaining a set of three-dimensional face images consisting of pixel coordinate points and corresponding depth factors as a training set for the face depth model is as follows: Obtain pixel coordinate points and point cloud coordinate points of a face image collected by a data acquisition device; The depth factor corresponding to each pixel of the face image is obtained by the following formula according to the radar camera external parameter parameters and the camera internal parameter matrix parameters: Among them, the depth factor corresponding to each pixel of the face image is p, the coordinate point of the face image camera coordinate system is (m, n), the pixel coordinate point of the face image is (u, v), the point cloud coordinate point is (x, y, z), and the radar camera external parameter parameter is (R 3*3 cx cy cz), the camera intrinsic matrix parameters are (fx,fy,tx,ty); Among them, fx and fy in the camera intrinsic matrix parameters are the camera focal length, tx and ty are the principal point coordinates relative to the imaging plane, and R in the radar camera extrinsic parameters is 3*3 is the rotation matrix, which records the direction of the coordinate axis of the world coordinate system relative to the camera coordinate axis. cx, cy, and cz are translation vectors used to record the position of the space origin in the camera coordinate system. Set the training set of the face depth model to {Ft j |(u j ,v j ,p j )}, where Ft j is the jth training sample in the training set.
9. A face anti-counterfeiting device, characterized in that: include: Image acquisition module, depth factor acquisition module, image conversion module, planar false face detection module, three-dimensional false face detection module; The image acquisition module is used to acquire the image to be detected collected by the 2D monocular camera; The depth factor acquisition module is used to obtain the depth factor corresponding to each pixel coordinate point of the image to be detected through a preset face depth model; The image conversion module is used to convert the image to be detected into a 3D space information image according to the depth factor and the preset camera parameters; The plane false face detection module is used to determine whether the converted 3D space information image is a plane false face; The three-dimensional fake face detection module is used to determine whether the image to be detected is a three-dimensional fake face through a preset three-dimensional anti-counterfeiting model if the 3D spatial information image is not a planar fake face.
10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the face anti-counterfeiting method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Face living body detection method and system
CN105023010A
Human face living body detection method and device, computer device and readable medium
CN108319901A
Face depth image generation method and device, electronic equipment and storage medium
CN111738988A
Face recognition security defense method and system based on multi-modal visual information
CN114419710A
Face anti-counterfeiting method and device and storage medium
CN116798130A
