CN114067394A - Face living body detection method and device, electronic equipment and storage medium - Google Patents

Face living body detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114067394A
CN114067394A CN202111320564.XA CN202111320564A CN114067394A CN 114067394 A CN114067394 A CN 114067394A CN 202111320564 A CN202111320564 A CN 202111320564A CN 114067394 A CN114067394 A CN 114067394A
Authority
CN
China
Prior art keywords
face
face image
similarity
living body
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111320564.XA
Other languages
Chinese (zh)
Inventor
岳海潇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111320564.XA priority Critical patent/CN114067394A/en
Publication of CN114067394A publication Critical patent/CN114067394A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The disclosure provides a face in-vivo detection method, a face in-vivo detection device, electronic equipment and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical field of deep learning and computer vision, and can be applied to scenes such as face image processing, face image recognition and the like. The specific implementation scheme is as follows: acquiring a human face image to be detected; carrying out face recognition on the face image to determine a target face identification corresponding to the face image; extracting living body characteristics of the face image to obtain target living body characteristics in the face image; determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification; and determining whether the face image is a living body face image or not according to the first similarity. Therefore, the accuracy of the human face living body detection is improved.

Description

Face living body detection method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to the field of deep learning and computer vision technologies, which can be applied to scenes such as face image processing and face image recognition, and in particular, to a face in-vivo detection method, apparatus, electronic device, and storage medium.
Background
The human face living body detection technology is a technology for judging whether an electronic photo containing a human face is really shot by a person. The human face living body detection technology is one of important components of a human face recognition system as a method for accurately and quickly judging whether an electronic photo is a human face electronic photo copied by paper or a screen, and is widely applied to the fields of video monitoring, building entrance guard, human face gate, financial verification and the like. In the human face living body detection technology, how to improve the accuracy of human face living body detection is very important.
Disclosure of Invention
The disclosure provides a face in-vivo detection method and device, electronic equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a face live body detection method, including: acquiring a human face image to be detected; carrying out face recognition on the face image to determine a target face identification corresponding to the face image; extracting living body characteristics of the face image to obtain target living body characteristics in the face image; determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification; and determining whether the face image is a living body face image or not according to the first similarity.
According to another aspect of the present disclosure, there is provided a face liveness detection apparatus including: the acquisition module is used for acquiring a human face image to be detected; the recognition module is used for carrying out face recognition on the face image so as to determine a target face identification corresponding to the face image; the first extraction module is used for extracting living body characteristics of the face image so as to obtain target living body characteristics in the face image; the first determining module is used for determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification; and the second determining module is used for determining whether the face image is a living body face image according to the first similarity.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of live human face detection as described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the face liveness detection method as described above.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the face liveness detection method as described above.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow chart of a face liveness detection method according to a first embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a face liveness detection method according to a second embodiment of the present disclosure;
fig. 3 is a schematic flow chart of a face liveness detection method according to a third embodiment of the present disclosure;
fig. 4 is another schematic flow chart of a face liveness detection method according to a third embodiment of the present disclosure;
fig. 5 is an exemplary diagram of a face liveness detection method according to a third embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a living human face detection device according to a fourth embodiment of the disclosure;
fig. 7 is a schematic structural diagram of a living human face detection device according to a fifth embodiment of the disclosure;
fig. 8 is a block diagram of an electronic device for implementing a face liveness detection method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the technical solution of the present disclosure, the acquisition, storage, application, and the like of the personal information of the related user all conform to the regulations of the relevant laws and regulations, and do not violate the good custom of the public order.
The disclosure relates to the technical field of artificial intelligence, in particular to the technical field of deep learning and computer vision, and can be applied to scenes such as face image processing, face image recognition and the like.
The following briefly describes the technical field to which the disclosed solution relates:
AI (artificial intelligence) is a subject of research that makes computers simulate some human thinking processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and has both hardware and software technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises computer vision, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge map technology and the like.
DL (deep learning), which is an intrinsic rule and a representation hierarchy of sample data, is learned, and information obtained in these learning processes greatly helps interpretation of data such as text, image, and sound. The final aim of the method is to enable the machine to have the analysis and learning capability like a human, and to recognize data such as characters, images and sounds. Deep learning is a complex machine learning algorithm, and achieves the effect in speech and image recognition far exceeding the prior related art. Deep learning has achieved many achievements in search technology, data mining, machine learning, machine translation, natural language processing, multimedia learning, speech, recommendation and personalization technologies, and other related fields. The deep learning enables the machine to imitate human activities such as audio-visual and thinking, solves a plurality of complex pattern recognition problems, and makes great progress on the artificial intelligence related technology.
CV (Computer Vision) is a science for researching how to make a machine "see", and further refers to using a camera and a Computer to replace human eyes to perform machine Vision such as identification, tracking and measurement on a target, and further performing image processing, so that the Computer processing becomes an image more suitable for human eyes to observe or is transmitted to an instrument to detect. As a scientific discipline, computer vision research-related theories and techniques attempt to build artificial intelligence systems that can acquire 'information' from images or multidimensional data. The information referred to herein refers to information defined by Shannon that can be used to help make a "decision". Because perception can be viewed as extracting information from sensory signals, computer vision can also be viewed as the science of how to make an artificial system "perceive" from images or multidimensional data.
IP (image processing), a technique of analyzing an image with a computer to achieve a desired result. Also known as image processing. Image processing generally refers to digital image processing. Digital images are large two-dimensional arrays of elements called pixels that are captured by industrial cameras, video cameras, scanners, and the like. Image processing techniques generally include image compression, enhancement and restoration, matching, description and identification of 3 parts.
The existing face recognition system usually performs living body detection on a face image, and performs face recognition on the face image when the face image is detected to be a living body face image shot by a real face. When the human face image is subjected to living body detection, a human face living body detection model is generally adopted to carry out secondary classification on the human face image, whether the human face image is an image shot by a real human face is judged according to binary classification scores, the human face living body detection model is generally trained according to attack data such as a large number of human face images shot by the real human face, photos or screen-copied human face images, the detection of the human face living body detection model is easily interfered by human face identification, attributes such as gender and age, and the detection accuracy is low. For example, for a certain person, if the training data of the face live detection model only includes a face image shot by a real face of the person, it is difficult for the face live detection model to detect that the face image is a non-live face image for a photo of the person or a face image shot on a screen.
The method comprises the steps of identifying a face image, determining a face identifier corresponding to the face image, and then determining whether the face image is a living face image according to a first similarity between a living feature extracted from the face image and a known living feature corresponding to the face identifier, wherein interference of other useless information can be eliminated, and whether the face image is the living face image is detected only according to the known living feature corresponding to the determined face identifier, so that the accuracy of face living detection can be improved.
A face liveness detection method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product of the embodiments of the present disclosure are described below with reference to the drawings.
First, a human face living body detection method provided by the present disclosure is described in detail with reference to fig. 1.
Fig. 1 is a schematic flow chart of a face live detection method according to a first embodiment of the present disclosure. It should be noted that, in the face live-body detection method provided in this embodiment, the execution main body is a face live-body detection device, and the face live-body detection device may be an electronic device or may be configured in the electronic device, so as to improve the accuracy of face live-body detection. The embodiment of the present disclosure is described taking as an example that the face live detection apparatus is configured in an electronic device.
The electronic device may be any stationary or mobile computing device capable of performing data processing, for example, a mobile computing device such as a notebook computer, a smart phone, and a wearable device, or a stationary computing device such as a desktop computer, or a server, or other types of computing devices, and the disclosure is not limited thereto.
As shown in fig. 1, the face live detection method may include the following steps:
step 101, obtaining a human face image to be detected.
The face image may be a frame of image acquired by the camera, or any one of multiple frames of images obtained by framing the video stream after the video stream is acquired by the camera, which is not limited in this disclosure.
It should be noted that the face in-vivo detection device in the embodiment of the present disclosure may acquire a face image to be detected through various public and legal compliance manners. For example, in a building entrance guard scene, the human face living body detection device can acquire a human face image of a user as a human face image to be detected after the user passes through the building entrance guard after the user authorization; or in a financial verification scene, the human face living body detection device can acquire the human face image of the user as the human face image to be detected when the identity of the user is verified in the payment process of the user after the authorization of the user; or the face image to be detected may also be acquired in other legal compliance manners, which is not limited in this disclosure.
And 102, carrying out face recognition on the face image to determine a target face identification corresponding to the face image.
The target face identification is used for uniquely identifying the face in the face image, and can indicate the identity corresponding to the face. The target face identifier may be a name, an identification number, a telephone number, a preset number, and the like of a user to which the face belongs, which is not limited in the present disclosure.
In an exemplary embodiment, the face image may be subjected to face recognition through a face recognition model to determine a target face identifier corresponding to the face image.
The face recognition model may be any two-class model of a deep learning structure capable of realizing face recognition, or other neural network models, which is not limited in this disclosure.
And 103, extracting the living body characteristics of the face image to acquire the target living body characteristics in the face image.
The living body feature is a face feature indicating whether the living body feature is a real face. The target living body feature is extracted from a human face image to be detected, and can indicate whether the human face in the human face image is a real human face.
In an exemplary embodiment, the living body feature may be understood as a feature vector encoded according to a preset encoding manner, wherein the dimension of the feature vector may be set according to a requirement, such as 128 dimensions. Through the feature vector, it is possible to indicate features of a plurality of dimensions, such as whether the features are features of a face image photographed for a paper, whether the features are features of a face image photographed through a video, whether the features are features of a 3D (3 dimensional) face image, and the like.
In an exemplary embodiment, the living body feature extraction may be performed on the face image through a face living body model to acquire a target living body feature in the face image.
The living human face model may be any deep learning model capable of extracting living characteristics of a human face, or other neural network models, which is not limited by the present disclosure.
And 104, determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification.
The known living body feature is a living body feature extracted from a face image shot by a real face, and the living body feature can indicate whether the face in the face image is the real face or not.
And the first similarity is used for indicating the similarity degree between the target living characteristics and the known living characteristics corresponding to the target face identification. The first similarity may specifically be a distance between the target living body feature and a known living body feature corresponding to the target face identifier, such as an euclidean distance, a manhattan distance, or the like; alternatively, the correlation coefficient, such as a pearson correlation coefficient, a cosine similarity, etc., between the target living body feature and the known living body feature corresponding to the target face identifier may also be used, which is not limited by this disclosure.
In an exemplary embodiment, the living body features may be extracted from face images respectively captured by a plurality of real faces as known living body features in advance, and the face identifier corresponding to each real face and the known living body features extracted from the face images captured by the real faces may be stored in the face feature library in an associated manner. Therefore, after the target face identification corresponding to the face image to be detected is determined, the known living body characteristics corresponding to the target face identification can be obtained from the known living body characteristics corresponding to the plurality of face identifications stored in advance in the face characteristic library, and the first similarity between the target living body characteristics and the known living body characteristics corresponding to the target face identification is determined.
It should be noted that, in the embodiment of the present disclosure, each known living body feature stored in the face feature library may be obtained in various public and legal compliance manners, for example, after the user is authorized, a real face of the user is photographed to obtain a face image of the user, and then the living body feature is extracted from the photographed face image of the user as the known living body feature.
And 105, determining whether the face image is a living body face image according to the first similarity.
In an exemplary embodiment, whether the face image is a living face image can be determined according to a first similarity between the target living feature and a known living feature corresponding to the target face identification. For example, when the first similarity indicates that the degree of similarity between the target living body feature and the known living body feature corresponding to the target face identifier is high, it may be determined that the face image is a living body face image, that is, the face image is a face image shot by a real face; when the first similarity indicates that the degree of similarity between the target living body feature and the known living body feature corresponding to the target face identification is low, the face image can be determined to be a non-living body face image, namely the face image is a face image shot by a non-real face.
Because the face image is identified, after the face identification corresponding to the face image is determined, the living body characteristic extraction is carried out on the face image to obtain the target living body characteristic in the face image, further determining whether the face image is a living body face image according to a first similarity between the target living body feature and the known living body feature corresponding to the face identification, therefore, the interference of other useless information can be eliminated, such as the interference of attribute information of the age, the sex and the like of other people or the interference of known living body characteristics corresponding to other face identification, and whether the face image is the living body face image is detected only according to the known living body characteristics corresponding to the target face identification, and compared with the method of comprehensively detecting the face living body according to the face images shot by a large number of real faces, the face living body detection by using the attack data such as the face images shot by a picture or the face images shot by a screen, the accuracy of the face living body detection can be improved.
It should be noted that, in practical applications, taking a building access control scene as an example, the face living body detection method of the embodiment of the present disclosure may be adopted to perform face living body detection on a frame of image of a user acquired by a camera, when determining that the frame of image is a face living body image, the user may be released, and when determining that the frame of image is a non-living body face image, the user may be prohibited from passing. Or, the face live detection method of the embodiment of the present disclosure may also be adopted to perform live detection on multiple frames of images in a video stream of a user acquired by a camera, and when it is determined that most of the multiple frames of images are live face images, the user is released, and when it is determined that most of the multiple frames of images are non-live face images, the user is prohibited from passing through.
In summary, according to the face live body detection method provided by the embodiment of the present disclosure, after a face image to be detected is acquired, face recognition is performed on the face image to determine a target face identifier corresponding to the face image, then, live body feature extraction is performed on the face image to acquire a target live body feature in the face image, then, a first similarity between the target live body feature and a known live body feature corresponding to the target face identifier is determined, and then, according to the first similarity, whether the face image is a live body face image is determined, so that accuracy of face live body detection is improved.
As can be seen from the above analysis, in the embodiment of the present disclosure, it may be determined whether the face image to be detected is a living body face image according to the first similarity between the target living body feature in the face image and the known living body feature corresponding to the target face identifier, and the following description, with reference to fig. 2, further explains a process of determining whether the face image to be detected is a living body face image according to the first similarity in the face living body detection method provided by the present disclosure.
Fig. 2 is a schematic flow chart of a living human face detection method according to a second embodiment of the disclosure. As shown in fig. 2, the face live detection method may include the following steps:
step 201, obtaining a face image to be detected.
The face image may be a frame of image acquired by the camera, or any one of multiple frames of images obtained by framing the video stream after the video stream is acquired by the camera, which is not limited in this disclosure.
Step 202, performing face recognition on the face image to determine a target face identifier corresponding to the face image.
In an exemplary embodiment, the face image may be subjected to face recognition through a face recognition model to determine a target face identifier corresponding to the face image. The face recognition model may be any two-class model of a deep learning structure capable of realizing face recognition, or other neural network models, which is not limited in this disclosure.
Specifically, the following method may be adopted to perform face recognition on the face image to determine a target face identifier corresponding to the face image:
extracting identification features of the face image to obtain the identification features in the face image; matching the recognition features with known recognition features corresponding to the plurality of face identifications to obtain target recognition features matched with the recognition features; and determining the face identification corresponding to the target recognition characteristic as the target face identification corresponding to the face image.
The identification features are face features indicating identity information. In an exemplary embodiment, the feature is identified, which may be understood as a feature vector encoded according to a preset encoding manner, wherein the dimension of the feature vector may be set according to a requirement, such as 128 dimensions.
The known identification features are identification features extracted from a face image shot by a face with a known corresponding identity, and the identity corresponding to the face in the face image can be indicated through the identification features.
In an exemplary embodiment, the identification features may be extracted in advance from a plurality of face images captured by a plurality of faces with known corresponding identities, respectively, as known identification features, and face identifiers representing the identities corresponding to the faces in the face images and the known identification features extracted from the corresponding face images may be stored in the face feature library in an associated manner. Therefore, after the identification features in the face image are obtained, the identification features can be matched with the known identification features corresponding to the plurality of face identifications stored in the face feature library, and when the target identification features matched with the identification features are obtained, the face identifications corresponding to the target identification features can be determined as the target face identifications corresponding to the face image.
The method for matching the recognition features in the face image with the known recognition features corresponding to the plurality of face identifiers stored in the face feature library may specifically be to calculate distances between the recognition features in the face image and the known recognition features corresponding to the face identifiers, respectively, and determine that the recognition features in the face image match with the known recognition features when the distance between the recognition features in the face image and a certain known recognition feature is smaller than a preset distance threshold. The preset distance threshold may be set as needed, which is not limited by the present disclosure.
It should be noted that, in the embodiment of the present disclosure, each known identification feature stored in the face feature library may be obtained in various public and legal compliance manners, for example, after the user is authorized, a real face of the user is photographed to obtain a face image of the user, and then an identification feature is extracted from the photographed face image of the user as a known identification feature.
The identification features extracted from the face image are matched with the known identification features corresponding to the face identifications, and the face identification corresponding to the matched target identification feature is determined as the target face identification corresponding to the face image, so that the target face identification corresponding to the face image is accurately determined.
And step 203, extracting the living body characteristics of the face image to acquire the target living body characteristics in the face image.
The specific implementation process and principle of step 203 may refer to the description of the foregoing embodiments, and are not described herein again.
Step 204, determining a first similarity between the target living body feature and a known living body feature corresponding to the target face identification.
It is understood that the living body feature extracted from one face image may be regarded as one living body feature, and then, for one face identifier, one known living body feature corresponding to the face identifier may be stored in the face feature library, where the known living body feature is extracted from one face image captured by one real face, and a plurality of known living body features corresponding to the face identifier may also be stored, where the plurality of known living body features are extracted from the face images captured by a plurality of real faces respectively.
In an exemplary embodiment, when there is one known living body feature corresponding to the target face identification stored in the face feature library, only the first similarity between the target living body feature and the one known living body feature corresponding to the target face identification may be determined.
That is, step 204 may include: and determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification.
In an exemplary embodiment, when the target face identification stored in the face feature library corresponds to a plurality of known living features, a first similarity between the target living feature and a first living feature center, which is a cluster center of the plurality of known living features corresponding to the target face identification, may be determined.
Correspondingly, step 204 may specifically include: and determining a first similarity between the target living body characteristic and a first living body characteristic center corresponding to the target face identification.
For a specific method for determining the cluster centers of a plurality of known living body features corresponding to the target face identifier, reference may be made to related technologies, which are not described herein again.
It can be understood that when a real face is photographed, the quality of a face image photographed by the real face may be poor due to poor illumination or low resolution of a camera, and the accuracy of a known living body feature extracted from the face image with poor quality is also low. If the quality of the face image with the known living body feature corresponding to the extracted target face identifier is poor, only the first similarity between the target living body feature and one known living body feature corresponding to the target face identifier is determined, and then whether the face image to be detected is the living body face image is determined according to the first similarity, which may cause poor accuracy of face living body detection due to the poor quality of the face image with the known living body feature. In the embodiment of the present disclosure, when a plurality of known living body features corresponding to the target face identifier are present, the first similarity between the target living body feature and the cluster centers of the plurality of known living body features is determined, so that it is subsequently possible to accurately detect whether the face image is a living body face image according to the first similarity.
Step 205, compare the first similarity with a first similarity threshold.
And step 206, when the first similarity is greater than the first similarity threshold, determining that the face image is a living face image.
And step 207, when the first similarity is smaller than or equal to the first similarity threshold, determining that the face image is a non-living face image.
The first similarity threshold may be set as needed, for example, set to 80%, 90%, and the like, which is not limited by the present disclosure.
In an exemplary embodiment, the first similarity may be compared with a first similarity threshold, and when the first similarity is greater than the first similarity threshold, the face image is determined to be a live face image, and when the first similarity is less than or equal to the first similarity threshold, the face image is determined to be a non-live face image.
Taking the first similarity as an example, specifically, the first similarity is a first distance between the target living body feature and a known living body feature corresponding to the target face identifier, and the first similarity threshold is a first distance threshold, since a shorter distance between the features indicates a higher similarity between the features, the first distance may be compared with the first distance threshold, when the first distance is smaller than the first distance threshold, the face image is determined to be a living body face image, and when the first distance is greater than or equal to the first distance threshold, the face image is determined to be a non-living body face image.
Therefore, whether the face image is the living body face image or not is accurately determined based on the first similarity between the target living body feature and the known living body feature corresponding to the target face identification and the first similarity threshold value.
It is understood that the human face of the same user may slightly change with age, so that the known living body features extracted from the human face images taken by the same user at different times may change. Then, in an exemplary embodiment, after the face image is determined to be a living face image in step 206, the known living features corresponding to the target face identifiers stored in the face feature library may be updated according to the target living features, so as to ensure timeliness of the known living features corresponding to the target face identifiers stored in the face feature library, and therefore, the living face detection can be performed more accurately according to the known living features corresponding to the updated target face identifiers.
In summary, according to the face live body detection method provided by the embodiment of the present disclosure, a face image to be detected is acquired, a face of the face image is subjected to face recognition to determine a target face identifier corresponding to the face image, a live body feature of the face image is extracted to acquire a target live body feature in the face image, a first similarity between the target live body feature and a known live body feature corresponding to the target face identifier is determined, the first similarity is compared with a first similarity threshold, when the first similarity is greater than the first similarity threshold, the face image is determined to be a live body face image, and when the first similarity is less than or equal to the first similarity threshold, the face image is determined to be a non-live body face image, so that accuracy of face live body detection is improved.
It can be understood that, in practical applications, the known living body feature corresponding to the target face identifier may be extracted from a face image with poor quality, and then, if it is determined whether the face image to be detected is a living body face image only according to the first similarity between the target living body feature and the known living body feature corresponding to the target face identifier, accuracy of face living body detection may be poor. In a possible implementation form, in order to improve the accuracy of face live body detection, it may further be determined comprehensively, in combination with a second similarity between a target live body feature and a second live body feature center, whether the face image to be detected is a live body face image, where the second live body feature center is a cluster center of known live body features corresponding to a plurality of face identifiers. In view of the above situation, the face live detection method provided by the present disclosure is further described with reference to fig. 3.
Fig. 3 is a flowchart illustrating a living human face detection method according to a third embodiment of the present disclosure. As shown in fig. 3, the face live detection method may include the following steps:
step 301, obtaining an image to be detected.
The image to be detected is an image including a face or an image not including a face, and may be a frame of image acquired by a camera, or any frame of image in a plurality of frames of images obtained by framing a video stream after the video stream is acquired by the camera, which is not limited in this disclosure.
It should be noted that the face biopsy device in the embodiment of the present disclosure may acquire an image to be detected through various public and legal compliance manners. For example, in a building entrance guard scene, the human face living body detection device can acquire a human face image of a user as an image to be detected after the user passes through the building entrance guard after the user authorization; or in a financial verification scene, the human face living body detection device can acquire a human face image of the user as an image to be detected when the identity of the user is verified in the payment process of the user after the user is authorized; alternatively, the image to be detected may be obtained by other legal compliance manners, which is not limited in this disclosure.
Step 302, performing face detection on an image to be detected to determine a detection frame including a face, and determining a first position of the detection frame in the image to be detected.
In an exemplary embodiment, step 302 may be implemented using a face detection model. The face detection model may be any two-class model of a deep learning structure capable of implementing face detection, or other neural network models, which is not limited in this disclosure.
For example, the image to be detected may be input into a face detection model for position coordinate prediction of the detection frame, the face detection model may extract the identification features in the image to be detected, and face secondary classification and position coordinate regression of the detection frame may be performed according to different scale feature maps to obtain face secondary classification scores and position coordinates of the detection frame. The two classification scores can be used for determining whether the image to be detected contains the face, for example, when the two classification scores are larger than a preset score threshold value, it is determined that the image to be detected contains the face, and when the two classification scores are smaller than or equal to the preset score threshold value, it is determined that the image to be detected does not contain the face. And the position coordinates of the detection frame are used for representing the first position of the detection frame in the image to be detected.
It should be noted that, in practical applications, when the face detection is performed on the image to be detected and it is determined that the image to be detected includes the face, the subsequent step 303 may be continued, and when it is determined that the image to be detected does not include the face, the subsequent step 303 may not be performed.
And 303, extracting key points of the image to be detected to determine a second position of each key point in the image to be detected.
And 304, adjusting the angle and the position of the face in the image to be detected according to the first position and the second position to obtain a face image, wherein the adjusted face is located in the center of the face image, and the angle of the adjusted face conforms to a set angle.
The key points refer to key points of different parts of the face, such as the eyes, nose, mouth, and the like. The number of the key points may be a preset number, such as 72.
The angle of the face may be an included angle between a connection line between any two preset key points and a preset straight line, for example, an included angle between a connection line between one key point corresponding to the left eye and one key point corresponding to the right eye and a horizontal line.
The setting angle can be set arbitrarily according to needs, and the present disclosure is not limited thereto. For example, when the included angle of the face is the included angle between the horizontal line and the connection line between one key point corresponding to the left eye and one key point corresponding to the right eye, the set angle may be 0 degree.
In an exemplary embodiment, step 303 and step 304 can be implemented by using a face alignment model. The face alignment model may be any deep learning model capable of achieving face alignment, or other neural network models, which is not limited in this disclosure.
Specifically, the image to be detected can be input into the face alignment model to perform key point extraction and second position prediction of each key point in the image to be detected, and then the angle and position of the face in the image to be detected are adjusted according to the first position of the detection frame in the image to be detected and the second position of each key point in the image to be detected, so as to obtain the face image, wherein the adjusted face is located in the center of the face image, and the angle of the adjusted face conforms to the set angle.
The face detection and the key point extraction are carried out on the image to be detected, the angle and the position of the face in the image to be detected are adjusted according to the first position of the determined detection frame in the image to be detected and the second position of the key point in the image to be detected, the face image with the face positioned in the center of the image and the face angle conforming to the set angle is obtained, and the follow-up more accurate face living body detection can be carried out according to the face image.
And 305, performing face recognition on the face image to determine a target face identifier corresponding to the face image.
And step 306, extracting the living body characteristics of the face image to acquire the target living body characteristics in the face image.
Step 307, determining a first similarity between the target living features and the known living features corresponding to the target face identification.
The specific implementation process and principle of steps 305-307 may refer to the description of the foregoing embodiments, and are not described herein again.
At step 308, a second similarity between the target living feature and the center of the second living feature is determined.
And the second living body feature center is a cluster center of known living body features corresponding to the plurality of face identifications. The known living body feature corresponding to one face identifier may include one known living body feature extracted from a face image captured by a real face corresponding to the face identifier, and may also include a plurality of known living body features extracted from a plurality of face images captured by a real face corresponding to the face identifier, which is not limited in this disclosure.
For a specific method for determining the cluster centers of the known living body features corresponding to the face identifiers, reference may be made to related technologies, which are not described herein again.
And a second similarity indicating a degree of similarity between the target living feature and the second living feature center. The second similarity may specifically be a distance between the target living feature and a center of the second living feature, such as a euclidean distance, a manhattan distance, or the like; alternatively, the correlation coefficient between the target living body feature and the center of the second living body feature, such as the pearson correlation coefficient, the cosine similarity, etc., may be used, which is not limited by the present disclosure.
It should be noted that, step 307 and step 308 may be executed simultaneously, or step 307 and then step 308 may be executed, or step 308 and then step 307 may be executed, and the execution timing of step 307 and step 308 is not limited in this disclosure.
Step 309, when the first similarity is greater than the first similarity threshold and the second similarity is greater than the second similarity threshold, determining that the face image is a living face image.
Step 310, when the first similarity is less than or equal to a first similarity threshold and the second similarity is greater than a second similarity threshold, or the first similarity is greater than the first similarity threshold and the second similarity is less than or equal to the second similarity threshold, or the first similarity is less than or equal to the first similarity threshold and the second similarity is less than or equal to the second similarity threshold, determining that the face image is a non-living face image.
The second similarity threshold may be set as needed, for example, set to 80%, 90%, and the like, which is not limited by the present disclosure.
In an exemplary embodiment, whether the face image is a living face image or not can be comprehensively detected according to a first similarity between the target living feature and a known living feature corresponding to the target face identification and a second similarity between the target living feature and a second living feature center. When the first similarity and the second similarity are both greater than the respective corresponding similarity threshold values, the face image can be determined to be a living body face image; when at least one of the first similarity and the second similarity is less than or equal to the respective corresponding similarity threshold, the face image can be determined to be a non-living face image.
Whether the face image is the living body face image or not is comprehensively detected according to the first similarity between the target living body feature and the known living body feature corresponding to the target face identification and the second similarity between the target living body feature and the center of the second living body feature, and the accuracy of face living body detection is improved.
The above process is further explained below with reference to fig. 4 and 5. Fig. 4 is another schematic flow chart of a face live detection method according to a third embodiment of the present disclosure. Fig. 5 is a diagram illustrating a living human face detection method according to a third embodiment of the present disclosure.
As shown in fig. 4, after the image to be detected is obtained, a face detection model may be first adopted according to the method of step 302 to perform face detection on the image to be detected, and determine whether the image to be detected includes a face. When the image to be detected does not contain the human face, the subsequent steps can not be executed, and the image to be detected is obtained again.
When it is determined that the image to be detected contains the face, the face alignment model may be adopted to align the face of the image to be detected in the manner of step 303 and step 304 until the face angle matches the set angle, so as to obtain the face image. It should be noted that, in the process of performing face alignment through the face alignment model, the face alignment model may output a correction probability, the correction probability indicates that the position of the face in the image to be detected may be adjusted to the center of the face image and the angle of the face may be adjusted to meet the set angle, when the probability is lower than a preset probability threshold (the preset probability threshold may be arbitrarily set as required), it may be considered that the face in the image to be detected is not the face actually or the face may not be adjusted to the center of the face image or the angle of the face may not be adjusted to meet the set angle, and then the subsequent steps may not be executed, and the image to be detected is returned to be obtained again.
After the face image is obtained, face recognition may be performed on the face image in the manner of step 305 to obtain a target face identifier corresponding to the face image. If the target face identifier corresponding to the face image is not obtained through face recognition, the subsequent steps are not executed, and the image to be detected is obtained again.
After the target face identifier corresponding to the face image is obtained, the face living body detection may be performed on the face image according to the similarity in the manner of step 306 and step 310, so as to determine whether the face image is a living body face image. When the face image is a living body face image, the target face identification and the result that the face image is the living body face image can be output. And when the face image is a non-living body face image, returning to obtain the image to be detected again.
The processes of performing face recognition on the face image to obtain a target face identifier corresponding to the face image and determining whether the face image is a living body face image according to the similarity can all adopt the following modes of feature extraction and feature retrieval.
Specifically, referring to fig. 5, it is assumed that the face feature library is divided into a face recognition feature library 501 and a face living body feature library 502, where the face recognition feature library 501 includes known recognition features corresponding to a plurality of face identifiers, and the face living body feature library 502 includes known living body features corresponding to a plurality of face identifiers. After the face image is obtained by performing face detection and face alignment on the image to be detected, a face recognition model can be firstly adopted to perform recognition feature extraction on the face image so as to obtain recognition features in the face image, the recognition features in the face image are matched with known recognition features corresponding to a plurality of face identifications in the face recognition feature library 501 so as to obtain target recognition features matched with the recognition features in the face image, and the face identifications corresponding to the target recognition features are determined as target face identifications corresponding to the face image.
After the target face identification corresponding to the face image is determined, a face living body model can be adopted to perform living body feature extraction on the face image so as to obtain the target living body feature in the face image, and calculate a first similarity between the target living body feature and a known living body feature corresponding to the target face identification in the face living body feature library 502 and a second similarity between the target living body feature and a second living body feature center, so as to comprehensively determine whether the face image is a living body face image according to the first similarity and the second similarity.
Taking the known recognition features such as the known recognition features corresponding to the face identifier "zhang san" and the known recognition features corresponding to the face identifier "zhu si" in the face recognition feature library 501, and the known living features such as the known living features corresponding to the face identifier "zhu san" and the known living features corresponding to the face identifier "zhu si" in the face living feature library 502 as examples, after the recognition features in the face image are obtained, the recognition features in the face image can be matched with the known recognition features corresponding to the plurality of face identifiers in the face recognition feature library 501, assuming that the target face identifier corresponding to the matched target recognition feature is "zhu si", the known living features corresponding to the "zhu si" in the face living feature library 502 can be directly selected according to the target face identifier, and after the target living features in the face image are obtained, the first distance between the target living features and the known living features corresponding to the "zhu si" is calculated, and calculating a second distance between the target living body feature and a cluster center (i.e., a second living body feature center) of each known living body feature in the living body feature library 502 of the human face, and further comprehensively determining whether the human face image is a living body human face image according to the first distance and the second distance. When the first distance and the second distance are both smaller than the corresponding distance threshold, the face image can be determined to be a living body face image, and at this time, the known living body feature corresponding to "Liquan" in the face living body feature library 502 can be updated according to the target living body feature corresponding to "Liquan"; when at least one of the first distance and the second distance is greater than or equal to the corresponding distance threshold, the face image may be determined to be a non-living face image.
In summary, after the image to be detected is obtained, the face detection and the face alignment are performed on the image to be detected, so as to obtain a face image with the face located at the center of the image and the face angle according to the set angle, so that the subsequent more accurate living body detection of the face can be performed according to the face image, and the living body detection of the face is performed comprehensively according to the first similarity between the target living body feature in the determined face image and the known living body feature corresponding to the target face identification and the second similarity between the target living body feature and the second living body feature center, thereby further improving the accuracy of the living body detection of the face. In addition, when the face detection is carried out on the image to be detected, the image to be detected does not contain the face, or the face alignment is carried out on the image to be detected, the angle of the face in the image to be detected cannot be adjusted to be in accordance with the set angle, or the face image is subjected to face recognition, and the target face identification is not obtained, the subsequent steps can not be executed, the response speed of the face in-vivo detection can be improved, compared with other face in-vivo detection methods which can be deployed on embedded hardware with lower computing power and power consumption, the computing power and power consumption required by the face in-vivo detection can be further reduced, and the hardware cost is effectively reduced.
The living human face detection device provided by the present disclosure is explained below with reference to fig. 6.
Fig. 6 is a schematic structural diagram of a living human face detection device according to a fourth embodiment of the disclosure.
As shown in fig. 6, the present disclosure provides a living human face detection apparatus 600, including: an acquisition module 601, a recognition module 602, an extraction module 603, a first determination module 604, and a second determination module 605.
The acquiring module 601 is used for acquiring a face image to be detected;
the recognition module 602 is configured to perform face recognition on the face image to determine a target face identifier corresponding to the face image;
an extraction module 603, configured to perform living body feature extraction on the face image to obtain a target living body feature in the face image;
a first determining module 604, configured to determine a first similarity between a target living feature and a known living feature corresponding to the target face identifier;
and a second determining module 605, configured to determine whether the face image is a living face image according to the first similarity.
It should be noted that the living human face detection apparatus provided in this embodiment can execute the living human face detection method of the foregoing embodiment. The face living body detection device can be an electronic device and can also be configured in the electronic device so as to improve the accuracy of face living body detection.
The electronic device may be any stationary or mobile computing device capable of performing data processing, for example, a mobile computing device such as a notebook computer, a smart phone, and a wearable device, or a stationary computing device such as a desktop computer, or a server, or other types of computing devices, and the disclosure is not limited thereto.
It should be noted that the foregoing description of the embodiment of the face live detection method is also applicable to the face live detection device provided in the present disclosure, and details are not repeated here.
The face living body detection device provided by the embodiment of the disclosure performs face recognition on a face image after the face image to be detected is acquired, so as to determine a target face identifier corresponding to the face image, performs living body feature extraction on the face image, so as to acquire a target living body feature in the face image, determines a first similarity between the target living body feature and a known living body feature corresponding to the target face identifier, and further determines whether the face image is a living body face image according to the first similarity, thereby improving the accuracy of face living body detection.
The living human face detection device provided by the present disclosure is explained below with reference to fig. 7.
Fig. 7 is a schematic structural diagram of a living human face detection device according to a fifth embodiment of the disclosure.
As shown in fig. 7, the living human face detection apparatus 700 may specifically include: an acquisition module 701, an identification module 702, an extraction module 703, a first determination module 704, and a second determination module 705. The acquiring module 701, the identifying module 702, the extracting module 703, the first determining module 704 and the second determining module 705 in fig. 7 have the same functions and structures as the acquiring module 601, the identifying module 602, the extracting module 603, the first determining module 604 and the second determining module 605 in fig. 6.
In an exemplary embodiment, the second determining module 705 includes:
a comparison unit for comparing the first similarity with a first similarity threshold;
the first determining unit is used for determining the face image as a living body face image when the first similarity is larger than a first similarity threshold value;
and the second determining unit is used for determining the face image as the non-living body face image when the first similarity is smaller than or equal to the first similarity threshold.
In an exemplary embodiment, the target face identification corresponds to a plurality of known living body features;
accordingly, the first determining module 704 includes:
the third determining unit is used for determining a first similarity between the target living body characteristic and a first living body characteristic center corresponding to the target face identification; wherein, the first living body feature center is a cluster center of a plurality of known living body features.
In an exemplary embodiment, the living human face detection apparatus 700 may further include:
a third determining module 706, configured to determine a second similarity between the target living feature and a second living feature center, where the second living feature center is a cluster center of known living features corresponding to the plurality of face identifiers;
accordingly, the second determining module 705 includes:
the fourth determining unit is used for determining the face image as a living body face image when the first similarity is larger than the first similarity threshold value and the second similarity is larger than the second similarity threshold value;
and a fifth determining unit, configured to determine that the face image is a non-living face image when the first similarity is less than or equal to a first similarity threshold and the second similarity is greater than a second similarity threshold, or the first similarity is greater than the first similarity threshold and the second similarity is less than or equal to the second similarity threshold, or the first similarity is less than or equal to the first similarity threshold and the second similarity is less than or equal to the second similarity threshold.
In the exemplary embodiment, identification module 702 includes:
the extraction unit is used for extracting the identification features of the face image so as to obtain the identification features in the face image;
the matching unit is used for matching the recognition features with the known recognition features corresponding to the plurality of face identifications so as to acquire target recognition features matched with the recognition features;
and the sixth determining unit is used for determining the face identification corresponding to the target recognition characteristic as the target face identification corresponding to the face image.
In an exemplary embodiment, the living human face detection apparatus 700 may further include:
and an updating module 707, configured to update the known living features corresponding to the target face identifier according to the target living features.
In an exemplary embodiment, the obtaining module 701 may include:
the acquisition unit is used for acquiring an image to be detected;
a seventh determining unit, configured to perform face detection on the image to be detected, so as to determine a detection frame including the face, and determine a first position of the detection frame in the image to be detected;
an eighth determining unit, configured to perform key point extraction on the image to be detected to determine a second position of each key point in the image to be detected;
and the adjusting unit is used for adjusting the angle and the position of the face in the image to be detected according to the first position and the second position so as to obtain the face image, wherein the adjusted face is positioned at the center of the face image, and the adjusted angle of the face accords with a set angle.
It should be noted that the foregoing description of the embodiment of the face live detection method is also applicable to the face live detection device provided in the present disclosure, and details are not repeated here.
The face living body detection device provided by the embodiment of the disclosure performs face recognition on a face image after the face image to be detected is acquired, so as to determine a target face identifier corresponding to the face image, performs living body feature extraction on the face image, so as to acquire a target living body feature in the face image, determines a first similarity between the target living body feature and a known living body feature corresponding to the target face identifier, and further determines whether the face image is a living body face image according to the first similarity, thereby improving the accuracy of face living body detection.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the face live detection method. For example, in some embodiments, the face liveness detection method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the above-described face liveness detection method may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the face liveness detection method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A face in-vivo detection method comprises the following steps:
acquiring a human face image to be detected;
carrying out face recognition on the face image to determine a target face identification corresponding to the face image;
extracting living body characteristics of the face image to obtain target living body characteristics in the face image;
determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification;
and determining whether the face image is a living body face image or not according to the first similarity.
2. The method of claim 1, wherein the determining whether the face image is a live face image according to the first similarity comprises:
comparing the first similarity to a first similarity threshold;
when the first similarity is larger than the first similarity threshold, determining that the face image is a living body face image;
and when the first similarity is smaller than or equal to the first similarity threshold, determining that the face image is a non-living face image.
3. The method of claim 1, wherein the target face identification corresponds to a plurality of known living features;
the determining a first similarity between the target living feature and a known living feature corresponding to the target face identification includes:
determining a first similarity between the target living body feature and a first living body feature center corresponding to the target face identification; wherein the first living body feature center is a cluster center of a plurality of the known living body features.
4. The method of claim 1, further comprising, after the determining a first similarity between the target living feature and a known living feature corresponding to the target face identification:
determining a second similarity between the target living body feature and a second living body feature center, wherein the second living body feature center is a cluster center of known living body features corresponding to a plurality of face identifications;
wherein the determining whether the face image is a living body face image according to the first similarity comprises:
when the first similarity is larger than the first similarity threshold value and the second similarity is larger than the second similarity threshold value, determining that the face image is a living face image;
and when the first similarity is smaller than or equal to the first similarity threshold and the second similarity is larger than the second similarity threshold, or the first similarity is larger than the first similarity threshold and the second similarity is smaller than or equal to the second similarity threshold, or the first similarity is smaller than or equal to the first similarity threshold and the second similarity is smaller than or equal to the second similarity threshold, determining that the face image is a non-living face image.
5. The method of claim 1, wherein the performing face recognition on the face image to determine a target face identifier corresponding to the face image comprises:
extracting identification features of the face image to obtain the identification features in the face image;
matching the recognition features with known recognition features corresponding to a plurality of face identifications to obtain target recognition features matched with the recognition features;
and determining the face identification corresponding to the target recognition feature as the target face identification corresponding to the face image.
6. The method of claim 2, further comprising, after the determining that the face image is a live face image:
and updating the known living body characteristics corresponding to the target face identification according to the target living body characteristics.
7. The method according to any one of claims 1 to 6, wherein the acquiring the face image to be detected comprises:
acquiring an image to be detected;
carrying out face detection on the image to be detected so as to determine a detection frame comprising the face, and determining a first position of the detection frame in the image to be detected;
extracting key points of the image to be detected to determine a second position of each key point in the image to be detected;
and adjusting the angle and the position of the face in the image to be detected according to the first position and the second position so as to obtain the face image, wherein the adjusted face is positioned at the center of the face image, and the adjusted angle of the face accords with a set angle.
8. A face liveness detection device, comprising:
the acquisition module is used for acquiring a human face image to be detected;
the recognition module is used for carrying out face recognition on the face image so as to determine a target face identification corresponding to the face image;
the extraction module is used for extracting living body characteristics of the face image so as to obtain target living body characteristics in the face image;
the first determining module is used for determining a first similarity between the target living body characteristic and a known living body characteristic corresponding to the target face identification;
and the second determining module is used for determining whether the face image is a living body face image according to the first similarity.
9. The apparatus of claim 8, wherein the second determining means comprises:
a comparison unit for comparing the first similarity with a first similarity threshold;
a first determining unit, configured to determine that the face image is a living face image when the first similarity is greater than the first similarity threshold;
and the second determining unit is used for determining the face image as a non-living body face image when the first similarity is smaller than or equal to the first similarity threshold.
10. The device of claim 8, wherein the target face identification corresponds to a plurality of known living body features;
the first determining module includes:
a third determining unit, configured to determine a first similarity between the target living feature and a first living feature center corresponding to the target face identifier; wherein the first living body feature center is a cluster center of a plurality of the known living body features.
11. The apparatus of claim 8, further comprising:
a third determining module, configured to determine a second similarity between the target living feature and a second living feature center, where the second living feature center is a cluster center of known living features corresponding to a plurality of face identifications;
wherein the second determining module comprises:
a fourth determining unit, configured to determine that the face image is a living face image when the first similarity is greater than the first similarity threshold and the second similarity is greater than the second similarity threshold;
a fifth determining unit, configured to determine that the face image is a non-living face image when the first similarity is less than or equal to the first similarity threshold and the second similarity is greater than the second similarity threshold, or the first similarity is greater than the first similarity threshold and the second similarity is less than or equal to the second similarity threshold, or the first similarity is less than or equal to the first similarity threshold and the second similarity is less than or equal to the second similarity threshold.
12. The apparatus of claim 8, wherein the identification module comprises:
the extraction unit is used for extracting the identification features of the face image so as to obtain the identification features in the face image;
the matching unit is used for matching the recognition features with known recognition features corresponding to a plurality of face identifications so as to acquire target recognition features matched with the recognition features;
and the sixth determining unit is used for determining the face identifier corresponding to the target recognition feature as the target face identifier corresponding to the face image.
13. The apparatus of claim 9, further comprising:
and the updating module is used for updating the known living body characteristics corresponding to the target face identification according to the target living body characteristics.
14. The apparatus of any of claims 8-13, wherein the means for obtaining comprises:
the acquisition unit is used for acquiring an image to be detected;
a seventh determining unit, configured to perform face detection on the image to be detected, so as to determine a detection frame including the face, and determine a first position of the detection frame in the image to be detected;
an eighth determining unit, configured to perform key point extraction on the image to be detected to determine a second position of each key point in the image to be detected;
and the adjusting unit is used for adjusting the angle and the position of the face in the image to be detected according to the first position and the second position so as to obtain the face image, wherein the adjusted face is positioned at the center of the face image, and the adjusted angle of the face accords with a set angle.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111320564.XA 2021-11-09 2021-11-09 Face living body detection method and device, electronic equipment and storage medium Pending CN114067394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111320564.XA CN114067394A (en) 2021-11-09 2021-11-09 Face living body detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111320564.XA CN114067394A (en) 2021-11-09 2021-11-09 Face living body detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114067394A true CN114067394A (en) 2022-02-18

Family

ID=80273801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111320564.XA Pending CN114067394A (en) 2021-11-09 2021-11-09 Face living body detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114067394A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058742A (en) * 2023-09-26 2023-11-14 腾讯科技(深圳)有限公司 Face counterfeiting detection method and device, electronic equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058742A (en) * 2023-09-26 2023-11-14 腾讯科技(深圳)有限公司 Face counterfeiting detection method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN107545241A (en) Neural network model is trained and biopsy method, device and storage medium
CN112949710A (en) Image clustering method and device
CN113221771B (en) Living body face recognition method, device, apparatus, storage medium and program product
CN113971751A (en) Training feature extraction model, and method and device for detecting similar images
CN113343826A (en) Training method of human face living body detection model, human face living body detection method and device
US11823494B2 (en) Human behavior recognition method, device, and storage medium
CN113177449B (en) Face recognition method, device, computer equipment and storage medium
CN113591566A (en) Training method and device of image recognition model, electronic equipment and storage medium
EP4080470A2 (en) Method and apparatus for detecting living face
CN112561879A (en) Ambiguity evaluation model training method, image ambiguity evaluation method and device
CN111898561A (en) Face authentication method, device, equipment and medium
CN114067394A (en) Face living body detection method and device, electronic equipment and storage medium
CN113435408A (en) Face living body detection method and device, electronic equipment and storage medium
CN113379877A (en) Face video generation method and device, electronic equipment and storage medium
CN113177466A (en) Identity recognition method and device based on face image, electronic equipment and medium
CN111783619A (en) Human body attribute identification method, device, equipment and storage medium
US20220392192A1 (en) Target re-recognition method, device and electronic device
CN115273184A (en) Face living body detection model training method and device
CN113903071A (en) Face recognition method and device, electronic equipment and storage medium
CN113869253A (en) Living body detection method, living body training device, electronic apparatus, and medium
CN114140320A (en) Image migration method and training method and device of image migration model
CN111079704A (en) Face recognition method and device based on quantum computation
CN115205939B (en) Training method and device for human face living body detection model, electronic equipment and storage medium
CN112115740A (en) Method and apparatus for processing image
CN113221920B (en) Image recognition method, apparatus, device, storage medium, and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination