WO2018218839A1 - Living body recognition method and system - Google Patents

Living body recognition method and system Download PDF

Info

Publication number
WO2018218839A1
WO2018218839A1 PCT/CN2017/104612 CN2017104612W WO2018218839A1 WO 2018218839 A1 WO2018218839 A1 WO 2018218839A1 CN 2017104612 W CN2017104612 W CN 2017104612W WO 2018218839 A1 WO2018218839 A1 WO 2018218839A1
Authority
WO
WIPO (PCT)
Prior art keywords
living body
motion
face
movement
score
Prior art date
Application number
PCT/CN2017/104612
Other languages
French (fr)
Chinese (zh)
Inventor
陈�全
Original Assignee
广州视源电子科技股份有限公司
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 广州视源电子科技股份有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2018218839A1 publication Critical patent/WO2018218839A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/64Three-dimensional objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Definitions

  • the present invention relates to the field of face recognition, and in particular, to a living body recognition method and system.
  • the human face detection can detect that the person currently performing face recognition is a living face rather than a face in a photo or video, thereby ensuring the security of the face recognition system.
  • the infrared camera is used to obtain the face temperature to perform the human face detection.
  • the drawback of this type of solution is that it has higher hardware requirements.
  • An object of the embodiments of the present invention is to provide a living body identification method and system, which have low hardware requirements and high security.
  • an embodiment of the present invention provides a living body identification method, and the living body identification method includes the following steps:
  • the face to be tested whose living body recognition score is not less than a preset threshold is determined to be a living body.
  • a living body identification method disclosed in the embodiment of the present invention obtains a motion score of at least two parts on the face of the person to be tested, and weights the part motion score and then sums it as a living body. Identifying the score, using the living body recognition score as a technical solution for determining whether the face to be tested is a living body; using the detection of at least two parts of the motion solves the problem that the algorithm in the prior art is single and the security is not high, The scalability is strong, and the detection based on the motion of the face part can be realized by the two-dimensional image, and the hardware requirements are not high.
  • the weight of the different parts is weighted and then the score fusion is performed, the accuracy of the living body recognition is high, and the living body identification method is accurate. High rate, low hardware requirements and high security.
  • the at least two parts of the movement include eye movement, mouth movement, head movement, eyebrow movement, forehead movement and face At least two parts of the movement in the movement.
  • the motion of the part corresponding to the detection may be several of a plurality of parts on the face part, so that when the living body detection is performed, the selectivity is wide, and the malicious attack is largely resisted, which greatly increases safety.
  • the detecting the movement of at least two parts of the face to be tested includes the following steps:
  • the motion of the part is determined by the degree of change in the position of the key point of each of the extracted video frames.
  • the motion of the part motion is determined by detecting the degree of change of the position of the key point corresponding to the motion of the part by detecting each video frame that is extracted, and the detection method can be implemented only by using a two-dimensional image, and The algorithm is simple, the requirements on the device are not high, and the recognition efficiency is high.
  • the weight corresponding to each part of the motion is set according to the visibility of each part of the motion; or, the weight corresponding to each part of the motion is according to each of the current application scenarios.
  • the accuracy of the movement of the part is set.
  • determining that the living body identification score is not less than a preset threshold comprises the steps of:
  • determining that the living body recognition score is not less than a preset threshold When the living body recognition confidence is not less than a preset value, determining that the living body recognition score is not less than a preset threshold.
  • the living body recognition score can be normalized to the living body confidence level, thereby performing living body judgment, and the living body confidence level can also be used for living body grading, and the recognition result is richer than the prior art.
  • the embodiment of the present invention further provides a living body identification system for identifying whether the face to be tested is a living body, and the living body identification system includes:
  • each of the part motion detecting units is configured to detect a part motion corresponding to the face to be tested, and obtain a corresponding motion score
  • a living body recognition score calculation unit configured to calculate a weighted sum of motion scores corresponding to each of the part motions, and use the calculated sum as a living body recognition score; wherein the living body recognition score calculation unit The weight corresponding to each of the part movements has been preset;
  • the living body judging unit is configured to determine that the human face to be tested whose living body recognition score is not less than a preset threshold is a living body.
  • the living body identification system disclosed in the embodiment of the present invention acquires the motion scores of at least two parts of the face of the person to be tested through at least two parts motion detecting unit, and uses the living body identification score calculation unit.
  • the part motion score is weighted and summed as a living body recognition score
  • the living body judgment unit uses the living body recognition score as a criterion for determining whether the face to be tested is a living body.
  • At least two of the at least two part motion detection units in the at least two part motion detection units include at least two parts of the eye movement, the mouth movement, the head movement, the eyebrow movement, the forehead movement, and the facial movement.
  • each of the part motion detecting units includes:
  • a part detecting module configured to detect a key point position of the part corresponding to the part motion for each video frame extracted by the face video of the face to be tested;
  • the part motion condition obtaining module is configured to determine a motion of the part by using a degree of change of a position of a key point of each of the extracted video frames, and obtain a corresponding motion score according to the motion of the part.
  • the weight corresponding to each part of the motion in the living body recognition score calculation unit is set according to the visibility of each part of the motion; or, the living body recognition score calculation unit is The weight corresponding to each part of the motion is set according to the accuracy of each part of the motion in the current application scenario.
  • the living body determining unit includes:
  • a biometric recognition confidence calculation module configured to calculate a living body recognition confidence of the human face to be tested by using a ratio of the living body recognition score to a living body recognition total score
  • a living body judging module configured to determine that the living body identification score is not less than a preset threshold when the living body recognition confidence is not less than a preset value, and determine that the living body recognition score is not less than a preset threshold
  • the face is a living body.
  • Embodiment 1 is a schematic flow chart of Embodiment 1 of a living body identification method according to the present invention.
  • FIG. 2 is a schematic flow chart of step S1 of Embodiment 1 provided by a living body identification method according to the present invention
  • FIG. 3 is a schematic diagram of a 68-point model of a face to be tested
  • step S3 of Embodiment 1 of the living body identification method provided by the present invention is a schematic flow chart of step S3 of Embodiment 1 of the living body identification method provided by the present invention.
  • Fig. 5 is a schematic structural view showing an embodiment of a living body recognition system according to the present invention.
  • FIG. 1 is a schematic flowchart of Embodiment 1 of a living body identification method according to the present invention, including the steps:
  • the face to be tested that determines that the living body recognition score is not less than a preset threshold is a living body.
  • detecting at least two parts of the face to be tested in step S1 of the embodiment comprises detecting eye movement, mouth movement and head movement; generally, eye movement, mouth movement and head of the face
  • the degree of exercise is obvious, which is conducive to detection, and the calculation is simple and efficient.
  • FIG. 2 is a schematic flowchart of step S1 of the first embodiment, where step S1 includes:
  • the face position of the part corresponding to the motion of each video frame extracted by the face video of the face to be tested is detected every preset frame number;
  • FIG. 3 is a 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be tested uses the dlib library to perform face detection and face key of the face to be tested.
  • Point detection the dlib library here is a cross-platform general library written in C++ technology; 68 key points of each video frame can be obtained; it can be obtained from the 68 key points of the acquired face to be tested. The position of the key point corresponding to the desired part movement.
  • a preferred embodiment of setting the weight corresponding to each part of motion in step S3 of the first embodiment is based on the visibility of each part of motion.
  • the general strategy is adopted, the mouth movement is relatively obvious, so the weight is the largest, the head motion simulation accuracy is the lowest, and the weight is the smallest.
  • the weighting strategy of the part motion in the first embodiment is: mouth movement>eye movement> Head movement
  • another preferred embodiment for setting the weight corresponding to the motion of each part in step S3 is set by automatically performing weight adjustment of the part motion according to different application scenarios, in a specific scenario: Collect the normal input video of the motion of various parts of the face to be tested as a positive sample, and attack the video as a negative sample, taking (positive sample pass number + negative sample reject number) / (positive sample total + negative sample total) as the part motion
  • the accuracy rate then the accuracy of each part of the movement is sorted in descending order, the weight of each part of the movement is also in this order from large to small, to re-adjust the weight of each part of the movement.
  • the re-adjusted weight is used to calculate the living body recognition score, and the recognition result can adapt the accuracy of the part motion detection in different scenarios, and increase the accuracy of the living body recognition result of the embodiment.
  • FIG. 4 is a schematic flowchart of step S4, including steps:
  • the face to be tested that determines that the living body recognition score is not less than a preset threshold is a living body.
  • the living body recognition total score is the maximum value that can be obtained after the face to be tested is identified in the embodiment, and the living body recognition confidence of the face to be tested is calculated by the following formula:
  • s_max represents the total score of the living body recognition
  • f represents the confidence of the living body recognition
  • f ⁇ e that is, the living body recognition confidence is not less than the preset value
  • the face is a living body; when f ⁇ e, that is, the living body recognition confidence is less than the preset value, it is determined that the living body recognition score is less than the preset threshold, and the face to be tested whose living body recognition score is less than the preset threshold is determined to be inactive.
  • the living body recognition confidence obtained by using the living body recognition score can be further expanded, and is used in the present embodiment to establish a classification system for living body judgment and living body classification to obtain rich living body recognition results.
  • a specific process of determining the motion of the part from the degree of change in the position of the key point of the acquisition portion in step S12 is as follows:
  • the detection process of the mouth movement the 8 key points of 61-68 in the obtained 68-point model of the face represent the mouth of the face to be tested.
  • the maximum value of the x coordinate in the 8 key points minus the minimum value of the x coordinate, which is the length of the mouth.
  • the mouth length is divided by the mouth width to represent the mouth value, and the thresholds a1 and a2 are set, wherein a1 ⁇ a2; when the mouth value is less than a1, the mouth is opened, and when the mouth value is greater than a2, The mouth is closed.
  • the detection process of the eye movement using the obtained key points of 37-48 in the 68-point model of the face to represent the eye of the face to be tested; wherein, the 37-42 key points represent the right eye
  • the four key points of 43-48 represent the left eye.
  • the maximum value of the x coordinate of the six key points representing the right eye minus the minimum value of the x coordinate is the length of the right eye
  • the maximum value of the y coordinate of the six key points of the right eye minus the minimum value of the y coordinate is The width of the right eye; dividing the length of the right eye by the width of the right eye to represent the value of the right eye, the same as the value of the left eye; preferably, defining the average of the value of the left eye and the value of the right eye as the eye value, setting the threshold b1 and B2, where b1 ⁇ b2, when the eye value is less than b1, it means that the eye is open, and when the eye value is greater than b2, it means that the eye is closed.
  • the eye movement determined by the partial frame is the eye opening, and the eye movement determined by the other partial frame is When the eye is closed, it is determined that the eye has motion.
  • the average value of the left eye value and the right eye value is defined as the eye value to determine the motion condition by the eye value
  • the eye value determines the corresponding right eye motion and/or left eye motion, that is, changes the eye motion into the left eye-right eye, the right eye-left eye, and only the left eye and only the right eye. As the movement process increases, the whole living body is more variability, which can increase the safety of living body detection.
  • the detection process of the head movement using the six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49 and 55 in the obtained 68-point model of the face to detect the face Head movement; wherein, the average value of the x coordinate of the six key points representing the left eye is defined as the x coordinate of point A, and the average value of the y coordinate of the six key points of the left eye is the y coordinate of point A, the same
  • the right eye B point is defined, and the key points 34, 49, and 55 in the 68-point model are defined as C point, D point, and E point, respectively.
  • the A to E points obtained above are five-point models representing facial feature points.
  • the angle value of the face in the three-dimensional space-the yaw angle yaw value and the pitch angle pitch value are obtained according to the five-point model of the face feature point described above.
  • Thresholds c1 and c2 are set, where c1 ⁇ c2; when yaw ⁇ c1, it means that the head turns left, and when yaw > c2, it means that the head turns right.
  • Thresholds d1 and d2 are set, where d1 ⁇ d2; when pitch ⁇ d1, it means that the head is head down, and when pitch > d2, it means that the head is headed up. When the yaw value is between c1 and c2, and d1 ⁇ pitch ⁇ d2, it means that the head is facing forward.
  • the head of the face to be tested has a head-up motion, that is, it is determined that the head has motion; and so on, by detecting the head of the face to be tested, there is a head movement, a left-hand movement, and a right-hand movement. It is determined that the head has motion.
  • the step S2 acquires the corresponding motion score according to the situation of the part motion determined by the part motion detection process, which specifically includes:
  • the condition of the mouth movement to obtain the corresponding motion score includes: the mouth has motion, the obtained motion score of the mouth movement is 1 point; the mouth has no motion, and the obtained motion score of the mouth movement is 0 points.
  • the case of eye movement to obtain the corresponding exercise score includes:
  • the condition of the head movement obtains the corresponding motion score includes: if the head of the face to be tested has any one of a head movement, a head movement, a left-hand movement, and a right-hand movement, the head is determined Exercise, the obtained motor movement has a score of 1 point. If the head of the person to be tested has no head movement, head movement, left-hand movement and right-hand movement, the head is Without exercise, the obtained head movement has a motion score of 0.
  • each video frame extracted by the preset number of frames of the face video of the face is first acquired with 68 key points of the face, thereby acquiring the eye movement, the mouth movement and the to-be-detected respectively.
  • Eye key position corresponding to head movement, mouth key position and head a key point position to determine the state of the eye, mouth, and head of the video frame; then determining the eye movement, mouth motion, and the state of the eye, mouth, and head from the plurality of extracted video frames, respectively
  • the condition of the head movement; the corresponding motion score is obtained according to the motion of each part, specifically, if the part has motion, the obtained exercise score is 1 point, otherwise the obtained exercise score is 0 points; then the above calculation is performed Obtaining a weighted sum of the motion scores of each part, the sum represents a living body identification score; finally, the living body identification confidence is calculated by using the ratio of the living body recognition score to the total score of the living body recognition, wherein the confidence of the living body recognition is not less than When the preset value is determined
  • This embodiment can be applied to a variety of device terminals.
  • the implementation scenario of the mobile phone terminal is taken as an example.
  • a sequence of living action requests is randomly generated, for example, the face to be tested is required to be separately performed.
  • the score of the open mouth is 1 point
  • the score of the blink is 1 point
  • the score of the left head of the head is 0
  • the score of the living body recognition is the sum of the weights of each part
  • the exercise score of the above part is calculated to calculate the living body.
  • the embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high; In the present embodiment, the detection of eye movement, mouth movement and head movement is used for living body recognition, and the motion effects of these parts are obvious, and the accuracy of motion judgment is high; Score fusion, high accuracy of living recognition; detection of multiple parts of motion is conducive to improving safety.
  • a second embodiment of the present invention provides a second embodiment of the present invention.
  • the main process of the second embodiment can be referred to the steps S1 to S4 of the first embodiment of the present invention.
  • step S1 of the second embodiment can be referred to the first embodiment of FIG. 2, and the steps S11-S12 are also included:
  • the face position of the part corresponding to the motion of each video frame extracted by the face video of the face to be tested is detected every preset frame number;
  • FIG. 3 is a 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be tested uses the dlib library to perform face detection and face key of the face to be tested.
  • Point detection the dlib library here is a cross-platform general library written in C++ technology; 68 key points of each video frame can be obtained; it can be obtained from the 68 key points of the acquired face to be tested. The position of the key point corresponding to the desired part movement.
  • the detection process of the mouth movement using the obtained key points of 61-68 in the 68-point model of the face to represent the mouth of the face to be tested, using the mouth that has been trained by the SVM classifier in advance
  • the state classification model predicts the mouth state of each frame of the face video of the face to be tested, wherein the pre-training process of the mouth state classification model trained by the SVM classifier is: 61 in the 68-point model of the face -68
  • These 8 key points indicate the mouth features of the face to be tested, manually select a certain number of face photos of the mouth, and mark the mouth state of these faces as 1; manually select a certain number of mouths
  • the part is a closed face photo, and the face state of these face photos is marked as 0, and then the SVM classifier is used to train the mouth state classification model. If the mouth state of the extracted video frames has both 0 and 1, it is determined that the mouth has motion, otherwise it is determined that the mouth has no motion.
  • the 8 key points of 61-68 in the obtained 68-point model of the face are used to represent the mouth of the face to be tested, and the mouth state is trained by the soft-max regression classifier.
  • the model predicts the mouth state score of each frame of the face video of the face to be tested, wherein the pre-training process of the trained mouth state classification model by the soft-max regression classifier is: according to the mouth opening difference Degrees are marked on a number of face photos, that is, the state score is marked on the mouth according to the degree of opening of the mouth: the score can be set to 10 levels, and the value is between 0 and 1; then, the mouth is closed for 0 points.
  • the maximum opening mouth is 1 point, and the half opening mouth is 0.5 points.
  • the mouth state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the mouth state scores When the difference between the values is greater than the preset threshold, the mouth is considered to have motion, otherwise the mouth has no motion.
  • the detection process of the eye movement using the obtained key points of 37-48 in the 68-point model of the face to represent the eye of the face to be tested; wherein, the 37-42 key points represent the right eye
  • the four key points of 43-48 represent the left eye.
  • Predicting the eye state of each frame of the face video of the face to be tested with the eye state classification model trained in advance by the SVM classifier, wherein the pre-training of the eye state classification model trained by the SVM classifier The process is as follows: the 12 key points of 37-48 in the 68-point model of the face represent the eye features of the face to be tested, and manually select a certain number of face images of the eyes in the blinking state, and mark the faces of the faces.
  • the eye state is 1; manually select a certain number of eyes as the face photos of the eye closed state, mark the eye state of these face photos as 0, and then train with the SVM classifier as the eye state classification model. If the eye state of the extracted video frames has both 0 and 1, it is determined that the eye has motion, otherwise it is determined that the eye has no motion.
  • the 12 key points of 37-48 in the obtained 68-point model of the face are used to represent the eye of the face to be tested, and the eye state classification trained by the soft-max regression classifier is used in advance.
  • the model predicts an eye state score of each frame of the face video of the face to be tested, wherein the pre-training process of the eye state classification model trained by the soft-max regression classifier is: according to the difference of the eye opening Degrees are marked on a number of face photos, that is, the state score is marked on the eye according to the degree of opening of the eye: the score can be set to 10 levels, and the value is between 0 and 1; then, the eye is closed to 0. Points, the maximum blink is 1 point, and the half blink is 0.5 points.
  • the eye state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the eye state scores When the difference between the values is greater than the preset threshold, the eye is considered Have exercise, otherwise there is no movement in the eyes.
  • the average value of the left eye value and the right eye value is defined as the eye value to determine the motion condition by the eye value
  • it is also possible to directly pass the right eye value and/or The left eye value is used to determine the corresponding right eye motion and/or left eye motion, that is, the eye motion is changed to the left eye-right eye, the right eye-left eye, and only the left eye and only the right eye.
  • the whole living body is more variability, which can increase the safety of living body detection.
  • the movement of the head movement is four kinds: the left side of the head, the right turn of the head, the head of the head and the head of the head.
  • the head raising is taken as an example to illustrate the detection process of the head movement:
  • the head state of each frame of the face video of the face to be tested is predicted by the SVM classifier trained head state classification model, wherein the pre-training process of the head state classification model trained by the SVM classifier is:
  • the six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49, and 55 in the 68-point model of the face represent the head features of the face to be tested; Select a certain number of face photos with the head as the heading state, and mark the head state of these face photos as 1; manually select a certain number of heads to face the face in the normal forward state, and mark the head of these face photos
  • the state is 0; then the SVM classifier is trained to classify the head state. If the head states of the extracted video frames have both 0 and 1, it
  • the six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49, and 55 in the obtained 68-point model represent the person to be tested.
  • the head of the face predicts the head state score of each frame of the face video of the face to be tested using the head state classification model that has been trained in advance by the soft-max regression classifier, wherein the soft-max regression classification is performed.
  • the pre-training process of the trained head state classification model is: labeling a number of face photos according to different degrees of head heading, that is, marking the head with a state score according to the head lifting degree: a score can be set For level 10, the value is between 0 and 1; then, the head is normally 0 points forward, the maximum head is 1 point, and the half head is 0.5 points.
  • the head state classification model trained by the soft-max regression classifier in advance, the head state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the head state scores are obtained When the difference between the values is greater than the preset threshold, the head is considered to have motion, otherwise the head has no motion.
  • the detection process of the left head turn, the head right turn, and the head down head three other head movements is similar to the above-described head motion detection process using the head lift as an example, and will not be described here.
  • the step S2 acquires the corresponding motion score according to the motion of the part determined by the part motion detection process, which specifically includes:
  • the motion of the mouth movement obtains the corresponding motion score: it is determined that the mouth has motion, and the obtained motion score of the mouth movement is 1 point; if the mouth has no motion, the obtained motion score of the mouth movement is 0 .
  • the motion of the eye movement obtains the corresponding motion score: it is determined that the eye has motion, and the obtained motion score of the eye movement is 1 point; if the eye has no motion, the obtained motion score of the eye movement is 0. .
  • the motion of the head movement obtains the corresponding motion score: it is determined that the head has motion, and the obtained motion score of the head motion is 1 point. If it is determined that the head has no motion, the obtained motion score of the head motion is 0. Minute.
  • the degree of motion of each part of the motion can also be obtained by step S1, and correspondingly, in step S2, a motion score between 0 and 1 is obtained based on the degree of motion, instead of just getting 1 or 0.
  • the exercise score the alternative embodiment not only indicates whether there is motion, but also the degree of exercise.
  • each video frame extracted by the preset number of frames of the face video of the face is obtained by acquiring 68 key points of the face, thereby respectively acquiring the position of the key point of the eye to be detected, and the mouth.
  • Key position and head key position to determine the state of the eye, mouth and head of the video frame; then determine the eye from the state of the eye, mouth and head in several extracted video frames The movement, the mouth movement and the head movement; the corresponding motion score is obtained according to the motion of each part; then the sum of the weight scores of each part is calculated, and the sum represents the living body recognition score;
  • the living body recognition confidence is calculated by using the ratio of the living body recognition score to the total score of the living body recognition, wherein when the living body recognition confidence is not less than the preset value, determining that the living body recognition score is not less than a preset threshold, thereby determining the person to be tested
  • the face is a living body; otherwise, it is determined that the face to be tested is not a living body.
  • the second embodiment can be applied to multiple device terminals.
  • the implementation scenario of the mobile phone terminal is taken as an example.
  • a sequence of living action requests is randomly generated, for example, to request the faces to be tested.
  • the score of the open mouth is 1 point
  • the score of the blink is 1 point
  • the score of the left head of the head is 0
  • the score of the living body recognition is the sum of the weights of each part
  • the exercise score of the above part is calculated to calculate the living body.
  • the second embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high;
  • the detection of eye movement, mouth movement and head movement is used to perform living body recognition, and the motion effects of these parts are obvious, and the accuracy of motion judgment is high; Fractional fusion is performed, and the accuracy of living body recognition is high; the detection of multiple parts of motion is beneficial to improve safety.
  • the third embodiment of the present invention provides a third embodiment of the present invention.
  • the main process of the third embodiment can be referred to the steps S1 to S4 of the first embodiment of the present invention.
  • the above part may refer to the first embodiment, and details are not described herein.
  • the degree of eye movement, mouth movement and head movement of the human face is obvious, which is advantageous for detection, and the calculation is simple and efficient;
  • the motion of detecting the part of the face to be tested in step S1 is Including the detection of the eye movement, the mouth movement and the head movement; at the same time, the movement of the part detecting the face to be tested in the step S1 of the third embodiment further includes the movement of the three parts of the facial movement, the eyebrow movement and the forehead movement. At least one of them.
  • the at least two parts of the motion for detecting the face to be tested in step S1 include the face video of the face to be measured extracted by the preset number of frames.
  • Each video frame detects the location of the key point corresponding to the motion of the part; see Figure 3, Figure 3 is the 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be measured is dlib
  • the library performs face detection and face key point detection of the face to be tested, and can obtain 68 key points of each video frame extracted; the required part can be obtained from the obtained 68 key points of the face to be tested.
  • step S1 further includes face detection of the face to be tested of each video frame, thereby acquiring a face rectangle, which can be seen in the face rectangle HIJK of FIG.
  • a preferred embodiment of setting the weight corresponding to the motion of each part in step S3 is set according to the visibility of each part of the motion.
  • the general strategy is adopted, and the weight of the part motion is: mouth movement>eye movement>head movement; the weight of at least one part movement of the facial movement, the eyebrow movement, and the forehead movement is smaller than the above mouth. Weight values for exercise, eye movements, and head movements.
  • another preferred embodiment for setting the weight corresponding to the motion of each part in step S3 is set by automatically performing weight adjustment of the part motion according to different application scenarios, in a specific scenario: Collect the normal input video of the motion of various parts of the face to be tested as a positive sample, and attack the video as a negative sample, taking (positive sample pass number + negative sample reject number) / (positive sample total + negative sample total) as the part motion
  • the accuracy rate then the accuracy of each part of the movement is sorted in descending order, the weight of each part of the movement is also in this order from large to small, to re-adjust the weight of each part of the movement.
  • the re-adjusted weight is used to calculate the living body recognition score, and the recognition result can adapt the accuracy of the part motion detection in different scenarios, and increase the accuracy of the living body recognition result of the embodiment.
  • the method for detecting the movement of the mouth of the face to be tested, the movement of the eye and the movement of the head in step S1, and the obtaining the motion score corresponding to the movement of each part of the face to be tested in step S2 may refer to a living body identification method of the present invention.
  • the specific process of detecting the movement of the mouth of the face to be tested, the movement of the eye and the movement of the head, and the motion score corresponding to the movement of each part of the face to be tested, in the first embodiment and the second embodiment Make a statement.
  • the third embodiment of the motion detection of the mouth movement and the eye movement can also adopt other alternative embodiments:
  • the face video of the face to be tested detects the mouth position of the face to be tested for each video frame extracted by the preset number of frames, and calculates the mouth position The gray average value; then it is judged whether the gray level average value of the mouth position is smaller than the preset mouth gray value judgment threshold, and if so, the mouth is in a closed state; if not, the mouth is in an open state.
  • the alternative embodiment utilizes the principle that the mouth is opened to expose the teeth, the teeth are mainly white, and the gray value is relatively large, the average gray value of the mouth opening is large, and the average gray value is small when the mouth is closed,
  • the state of the mouth is recognized by calculating the average gray value of the mouth, thereby determining the condition of the mouth movement.
  • the movement of the mouth movement determined by the partial frame is the mouth opening, and there is another partial frame determined movement of the mouth movement When the mouth is closed, it is determined that the mouth has motion.
  • the alternative embodiment obtains the motion score of the corresponding mouth motion, including: determining that the mouth has motion, and the obtained motion score of the mouth motion is 1 point; otherwise, determining that the mouth has no motion, the acquired mouth motion The exercise score is 0.
  • the movement of the mouth movement may include the movement of the mouth of the mouth angle, in addition to the mouth opening and closing, such as when the face is smiling, two The corners of the mouth will expand to the sides of the cheeks.
  • the key point 55 in the obtained face 68 point model represents the left corner point
  • the key point 49 represents the right corner point. Based on the left and right corner points of the first frame of the face video of the face to be tested, the back extraction is calculated.
  • the distance moved by the left corner of the video frame and the distance moved by the right corner point determines whether the distance moved by the left corner point and the distance moved by the right corner point are greater than a preset threshold, and if so, the state of the mouth motion is determined to be Smile, if not, determine that the state of mouth movement is normal.
  • the movement of the mouth movement determined by the partial frame is a smile state, and the movement of the mouth movement determined by the other partial frame is normal In the state, it is determined that the mouth has motion.
  • an alternative embodiment of the detection process of eye movement the identification object is Asian: the Asian eye color is black, the eyelid color is yellow; the face video of the face is pre-predicted Let each video frame extracted by the number of frames detect the eye position of the face to be tested, determine the position of the eye through the position of the eye, and calculate the average value of the gray of the eye position; then determine whether the average value of the gray of the eye position is less than Set the eyeball gray value judgment threshold. If yes, the eye is in the open state; if not, the eye is closed.
  • This alternative embodiment utilizes the detection of the eyeball position of the eye to identify the difference in the detected average gray value of the closed eye of the eye.
  • the average gray value of the eyeball position of the eye will be relatively small, and when the eye is closed, the average gray value of the eyeball position of the eye will be large.
  • the movement of the eye movement determined by the partial frame is the eye opening, and there is another part of the frame determined movement of the eye movement When the eye is closed, it is determined that the eye has motion.
  • the alternative embodiment obtains the motion condition of the corresponding eye movement, and obtains the corresponding motion score, including: determining that the eye has motion, and the obtained motion score of the eye motion is 1 point; determining that the eye has no motion, obtaining The motor score for the eye movement is 0.
  • the face video of the face to be tested detects the center position of the eye of the eye of the face to be tested for each video frame extracted by the preset number of frames, And calculating a relative position of the center position of the eyeball in the eye; and then determining whether the distance between the relative position of the center position of the eyeball position in the eye and the normal position of the center position of the eyeball position in the eye is greater than a preset value, If yes, the eyeball position is not in the normal position, and if not, the eyeball position is in the normal position.
  • the eye movement determined by the partial frame is that the eyeball position is not in the normal position, and the eye movement determined by the other partial frame is When the eyeball is in the normal position, the movement of the eye of the face to be tested is that the eyeball rotates, that is, the eye is determined to have motion; otherwise, the eye is determined to have no motion.
  • the detecting part motion of the face to be tested in step S1 of the third embodiment further includes detecting at least one of facial motion, eyebrow motion, and forehead movement, and the process of detecting facial motion, eyebrow motion, and forehead motion of the face to be tested includes :
  • the process of detecting the facial motion determining the eye, the mouth and the face region of the face to be tested; and calculating the ratio of the sum of the eye area and the mouth area to the area of the face region; and then determining whether the ratio is Within the preset range value, if yes, it indicates that the face state is normal, and if not, it indicates that the face state is a ghost face state.
  • the facial movement here includes ghost face movements.
  • the ratio of the sum of the eye area and the mouth area of the face to the area of the face area exceeds a preset range value; otherwise, it is a normal state; when it is detected that the face has both a ghost state and a normal state, It is determined that the face has a ghost face movement, that is, the face has motion.
  • An example is to calculate the eye area, the mouth area, and the face area: the eye area is obtained by multiplying the eye length by the eye width, and the mouth area is obtained by multiplying the mouth length by the mouth width, through the face rectangle HI JK The area gets the area of the face area.
  • obtaining the facial motion to obtain the exercise score includes: the facial score of the facial motion obtained by the motion is 1 point; otherwise, the facial motion is determined to be no motion, and the obtained facial motion has a motion score of 0.
  • the detection process of eyebrow movement the 5 key points of 18-22 in the obtained 68-point model of the face represent the right eyebrow point, and the 5 key points of 23-27 represent the left eyebrow point;
  • the method fits the curve of each eyebrow and calculates the curvature of the key point 20 of the right eyebrow as the characteristic value of the right eyebrow and the curvature of the key point 25 of the left eyebrow as the characteristic value of the left eyebrow, the characteristic value of the right eyebrow and the characteristic value of the left eyebrow.
  • the average value is the eyebrow eigenvalue; then it is judged whether the eyebrow eigenvalue is greater than a preset threshold, and if so, the condition indicating the eyebrow is the eyebrow, and if not, the eyebrow is normal.
  • each video frame of the face video extracted from the face to be tested if some frames determine that the state of the eyebrows is an eyebrow, and another partial frame determines that the state of the eyebrows is normal, it is determined that the eyebrows have motion, otherwise Determine that there is no movement of the eyebrows.
  • obtaining the eyebrow movement to obtain the exercise score includes: determining that the eyebrow has motion, and obtaining the exercise score of the eyebrow motion is 1 point; determining that the eyebrow has no motion, and obtaining the exercise score of the eyebrow motion is 0.
  • the detection process of the forehead movement the forehead position is determined by the obtained 68-point model of the face, wherein the forehead is determined and then the sobel value of the forehead area is calculated by the sobel operator, and the variance of the sobel value of the forehead area is taken as the forehead wrinkle value.
  • the sobel value here is the result of the convolution operation of the convolution of the pixel of the area containing the same size as the convolution kernel at the center of the current pixel; the extraction of the face video of the face to be tested In a video frame, if the forehead wrinkle value of the partial frame is greater than the first preset threshold, and the forehead wrinkle value of the other partial frame is less than the second predetermined threshold, it is determined that the forehead has motion; otherwise, the forehead is determined to have no motion.
  • the example determines the position of the forehead area: usually the forehead area refers to the area above the eyebrow in the face of the face, based on this definition, the position of the eyebrow key point can be obtained first, and then the forehead area is determined according to the position of the face rectangle and the key point of the eyebrow. As shown in the rectangular box HOPK of Figure 3.
  • obtaining the forehead movement to obtain the exercise score includes: determining that the forehead has motion, and the obtained forehead motion has a motion score of 1; determining that the forehead has no motion, and obtaining the forehead motion has a motion score of 0.
  • the third embodiment in addition to the above-mentioned embodiment of whether or not there is a motion score according to whether or not the motion of each part is motioned, it is also possible to obtain a motion score of 0 according to the degree of motion of each part.
  • This alternative embodiment not only indicates whether there is motion, but also the degree of motion.
  • the third embodiment implemented by this alternative embodiment is also within the scope of the present invention.
  • the face video of the face to be tested is detected for each video frame extracted by the preset number of frames, and the key points of the face are acquired, thereby obtaining the key point positions of each part of the motion, thereby The characteristics of the corresponding part, according to the location of several video frames
  • the characteristic condition determines the motion of each part of the motion, and obtains the corresponding motion score; then calculates the sum of the weighted each part of the motion score, and the sum represents the living body recognition score; and finally uses the living body identification score
  • the value of the living body recognition total score is used to calculate the living body recognition confidence, wherein when the living body recognition confidence is not less than the preset value, it is determined that the living body recognition score is not less than the preset threshold, thereby determining that the face to be tested is a living body; otherwise , to determine that the face to be tested is not a living body.
  • the third embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high;
  • the detection of eye movement, mouth movement and head movement is used to perform living body recognition, and the motion effects of these parts are obvious, the accuracy of motion judgment is high, and the facial motion is expanded.
  • the detection of the movement of the eyebrows and forehead movements improves the accuracy of the recognition results; the weighting of the different parts is used to perform the score fusion, and the accuracy of the living body recognition is high; the detection of the movement of various parts is beneficial to improve the safety. .
  • FIG. 5 is a schematic structural diagram of the embodiment.
  • the embodiment includes:
  • each part motion detecting unit 1 is used for detecting the motion of the part corresponding to the face to be tested.
  • the part motion detecting unit 1a and the part motion detecting unit 1b indicate that two different parts are detected.
  • the two-part motion detection unit 1 of the movement is used for detecting the motion of the part corresponding to the face to be tested.
  • the part motion score unit 2 is configured to obtain a motion score corresponding to each part of the motion of the face to be tested based on the motion of each part;
  • the living body recognition score calculation unit 3 is configured to calculate the weighted sum of the motion scores corresponding to each part motion obtained, and use the calculated sum as a living body recognition score; wherein the living body recognition score calculation unit 3 has Preset the weight corresponding to each part of the movement.
  • the living body judging unit 4 is configured to determine that the human face to be tested whose living body recognition score is not less than a preset threshold is a living body.
  • the motion of at least two parts corresponding to the detected at least two parts of the motion detecting unit 1 includes at least two parts of the movements of the eye movement, the mouth movement, the head movement, the eyebrow movement, the forehead movement and the facial movement.
  • each part of the motion detecting unit 1 comprises:
  • the part detecting module 11 is configured to detect a key point position of the part corresponding to the movement of the part of each video frame extracted by the face video of the face to be tested;
  • the part motion condition obtaining module 12 is configured to determine the motion of the part by the degree of change of the position of the key point of each video frame extracted.
  • the weight corresponding to the motion of each part in the living body recognition score calculation unit 3 is set according to the visibility of the motion of each part; or the weight corresponding to the motion of each part in the living body recognition score calculation unit 3 It is set according to the accuracy of the movement of each part in the current application scenario.
  • the living body judging unit 4 includes:
  • the living body recognition confidence calculation module 41 is configured to calculate a living body recognition confidence of the face to be tested by using a ratio of the living body recognition score to the total score of the living body recognition;
  • the living body judging module 42 is configured to determine that the living body recognition score is not less than a preset threshold when the living body recognition confidence is not less than the preset value, and determine that the living face whose living body recognition score is not less than the preset threshold is a living body.
  • the part detecting module 11 of each part of the motion detecting unit 1 detects the key point position of the corresponding part in each of the extracted video frames, and determines the motion of the part motion by the motion score obtaining module 12, Then, the motion score of the part motion is obtained by the part motion score unit 2 based on the motion of the part; then, the motion score of each part motion obtained by the vital body recognition score calculation unit 3 is weighted and summed as the living body recognition.
  • the biometric recognition confidence calculation module 41 of the living body judging unit 4 calculates the biometric recognition confidence of the face to be tested using the wallpaper of the living body recognition score in the living body recognition score, and determines by the living body judging module 42 when calculating The obtained living body recognition confidence is not less than the preset threshold, and the face to be tested is a living body.
  • the detection of at least two parts motion detecting unit solves the problem that the algorithm in the prior art is single and the security is not high, and the scalability is strong, and the detection of the part motion based on the face can be realized by the two-dimensional image,
  • the hardware requirements are not high.
  • the living body recognition score calculation unit weights the motion of different parts and then performs score fusion. The accuracy of living body recognition is high, and the beneficial effects of high recognition accuracy, low hardware requirements and high safety are obtained.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)

Abstract

A living body recognition method, comprising the steps: detecting the movement of at least two parts of a face to be detected (S1); on the basis of the movement of each part, acquiring a movement score corresponding to the movement of each part of the face to be detected (S2); calculating the weighted sum of the movement scores corresponding to the movement of each part, and using the calculated sum as a living body recognition score (S3), wherein the movement of each part already has a preset corresponding weighting; and determining that a face to be detected having a living body recognition score not less than a preset threshold is a living body (S4). A corresponding living body recognition system, comprising at least two part movement detection units, a part movement score acquisition unit, a living body recognition score calculation unit, and a living body determining unit. The present method and system have low device hardware requirements, can assure effective recognition of a living body, have strong scalability and high security, and are not vulnerable to attack.

Description

一种活体识别方法和系统Living body identification method and system 技术领域Technical field
本发明涉及人脸识别领域,尤其涉及一种活体识别方法和系统。The present invention relates to the field of face recognition, and in particular, to a living body recognition method and system.
背景技术Background technique
随着人脸识别技术的发展,越来越多的场景需要用到人脸检测去快速的识别一个人的身份。但是有不法份子会利用图片或者视频代替真人去进行人脸识别,这样整个人脸识别系统的安全性就得不到保证。而人脸活体检测可以检测出当前进行人脸识别的人是活体人脸而非照片或者视频中的人脸,从而保证了人脸识别系统的安全性。With the development of face recognition technology, more and more scenes need to use face detection to quickly identify a person's identity. However, there are unscrupulous members who use pictures or videos instead of real people to perform face recognition, so that the security of the entire face recognition system cannot be guaranteed. The human face detection can detect that the person currently performing face recognition is a living face rather than a face in a photo or video, thereby ensuring the security of the face recognition system.
下述为现有的几种活体识别技术方案及其不足:The following are several existing biometric identification technology solutions and their shortcomings:
方案一,利用红外摄像头得到人脸温度从而进行人脸活体检测。该类方案的弊端在于对硬件要求较高。In the first scheme, the infrared camera is used to obtain the face temperature to perform the human face detection. The drawback of this type of solution is that it has higher hardware requirements.
方案二,只进行一种三维人脸姿态的检测从而判断是否活体。该类方案算法单一,安全性不高。In the second scheme, only one type of three-dimensional face gesture is detected to determine whether it is a living body. This type of scheme has a single algorithm and is not safe.
发明内容Summary of the invention
本发明实施例的目的是提供一种活体识别方法和系统,对设备硬件要求低且安全性高。An object of the embodiments of the present invention is to provide a living body identification method and system, which have low hardware requirements and high security.
为实现上述目的,本发明实施例提供了一种活体识别方法,所述活体识别方法包括步骤:To achieve the above objective, an embodiment of the present invention provides a living body identification method, and the living body identification method includes the following steps:
检测待测人脸的至少两部位运动的情况;Detecting the movement of at least two parts of the face to be tested;
基于每一所述部位运动的情况获取所述待测人脸的每一部位运动对应的运动分值;计算每一所述部位运动对应的运动分值加权后的总和,并将计算得到的所述总和作为活体识别分值;其中,每一所述部位运动已预设相应的权值;Obtaining a motion score corresponding to each part of the motion of the part to be tested based on the motion of each part of the part; calculating a weighted sum of the motion scores corresponding to each part of the motion, and calculating the calculated The sum is used as a living body recognition score; wherein each of the part movements has preset a corresponding weight;
判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。The face to be tested whose living body recognition score is not less than a preset threshold is determined to be a living body.
与现有技术相比,本发明实施例公开的一种活体识别方法通过获取所述待测人脸上的至少两个部位的运动分值,并对部位运动分值进行加权后求和作为活体识别分值,利用活体识别分值作为所述待测人脸是否为活体的判断标准的技术方案;采用检测至少两种部位运动解决了现有技术中算法单一,安全性不高的问题,可扩展性强,且基于人脸部位运动的检测可以通过二维图像实现,对硬件要求不高,另外,采用对不同部位运动加权再进行分数融合,活体识别准确度高,本活体识别方法准确率高、硬件要求低和安全性高。Compared with the prior art, a living body identification method disclosed in the embodiment of the present invention obtains a motion score of at least two parts on the face of the person to be tested, and weights the part motion score and then sums it as a living body. Identifying the score, using the living body recognition score as a technical solution for determining whether the face to be tested is a living body; using the detection of at least two parts of the motion solves the problem that the algorithm in the prior art is single and the security is not high, The scalability is strong, and the detection based on the motion of the face part can be realized by the two-dimensional image, and the hardware requirements are not high. In addition, the weight of the different parts is weighted and then the score fusion is performed, the accuracy of the living body recognition is high, and the living body identification method is accurate. High rate, low hardware requirements and high security.
进一步地,所述至少两部位运动包括眼部运动、嘴部运动、头部运动、眉毛运动、额头运动和面 部运动中的至少两部位运动。Further, the at least two parts of the movement include eye movement, mouth movement, head movement, eyebrow movement, forehead movement and face At least two parts of the movement in the movement.
作为进一步方案,对应检测的所述部位运动可以为人脸部位上的多个部位中的几种,使得在进行活体检测时,可选择性广,很大程度上能够抵制恶意攻击,大大增加了安全性。As a further solution, the motion of the part corresponding to the detection may be several of a plurality of parts on the face part, so that when the living body detection is performed, the selectivity is wide, and the malicious attack is largely resisted, which greatly increases safety.
进一步地,所述检测待测人脸的至少两部位运动的情况包括步骤:Further, the detecting the movement of at least two parts of the face to be tested includes the following steps:
对所述待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测所述部位运动对应的部位关键点位置;Detecting a key point position of the part corresponding to the part motion for each video frame extracted by the face video of the face to be tested;
通过所述抽取的每一视频帧的部位关键点位置的变化程度来确定所述部位运动的情况。The motion of the part is determined by the degree of change in the position of the key point of each of the extracted video frames.
作为进一步方案,通过检测抽取的每一视频帧检测所述部位运动对应的部位关键点位置的变化程度来确定所述部位运动的运动情况,该检测方法只需通过二维图像即可实现,且算法简单,对设备的要求不高,识别效率高。As a further solution, the motion of the part motion is determined by detecting the degree of change of the position of the key point corresponding to the motion of the part by detecting each video frame that is extracted, and the detection method can be implemented only by using a two-dimensional image, and The algorithm is simple, the requirements on the device are not high, and the recognition efficiency is high.
进一步地,每一所述部位运动相对应的权值为根据所述每一部位运动的明显度设定;或,每一所述部位运动相对应的权值为根据在当前应用场景下每一所述部位运动的准确率设定。Further, the weight corresponding to each part of the motion is set according to the visibility of each part of the motion; or, the weight corresponding to each part of the motion is according to each of the current application scenarios. The accuracy of the movement of the part is set.
进一步地,确定所述活体识别分值不小于预设阈值包括步骤:Further, determining that the living body identification score is not less than a preset threshold comprises the steps of:
通过所述活体识别分值占活体识别总分的比值计算所述待测人脸的活体识别置信度;Calculating, by the ratio of the living body recognition score to the total score of the living body recognition, the living body recognition confidence of the face to be tested;
当所述活体识别置信度不小于预设值时,确定所述活体识别分值不小于预设阈值。When the living body recognition confidence is not less than a preset value, determining that the living body recognition score is not less than a preset threshold.
作为进一步方案,所述活体识别分值可以归一化为活体置信度,从而进行活体判断,该活体置信度还可以用于活体分级,与现有技术相比,识别结果更丰富。As a further solution, the living body recognition score can be normalized to the living body confidence level, thereby performing living body judgment, and the living body confidence level can also be used for living body grading, and the recognition result is richer than the prior art.
相应地,本发明实施例还提供一种活体识别系统,用于识别待测人脸是否为活体,所述活体识别系统包括:Correspondingly, the embodiment of the present invention further provides a living body identification system for identifying whether the face to be tested is a living body, and the living body identification system includes:
至少两部位运动检测单元,每一所述部位运动检测单元用于检测待测人脸对应的部位运动,并获取对应的运动分值;At least two parts motion detecting units, each of the part motion detecting units is configured to detect a part motion corresponding to the face to be tested, and obtain a corresponding motion score;
活体识别分值计算单元,用于计算每一所述部位运动对应的运动分值加权后的总和,并将计算得到的所述总和作为活体识别分值;其中,所述活体识别分值计算单元已预设与每一所述部位运动相对应的权值;a living body recognition score calculation unit, configured to calculate a weighted sum of motion scores corresponding to each of the part motions, and use the calculated sum as a living body recognition score; wherein the living body recognition score calculation unit The weight corresponding to each of the part movements has been preset;
活体判断单元,用于判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。The living body judging unit is configured to determine that the human face to be tested whose living body recognition score is not less than a preset threshold is a living body.
与现有技术相比,本发明实施例公开的一种活体识别系统通过至少两部位运动检测单元获取所述待测人脸上的至少两个部位的运动分值,通过活体识别分值计算单元对部位运动分值进行加权后求和作为活体识别分值,通过活体判断单元利用活体识别分值作为所述待测人脸是否为活体的判断标准的 技术方案;采用检测至少两种部位运动解决了现有技术中算法单一,安全性不高的问题,可扩展性强,且基于人脸部位运动的检测可以通过二维图像实现,对硬件要求不高,另外,采用对不同部位运动加权再进行分数融合,活体识别准确度高,获得了活体识别准确率高、硬件要求低和安全性高的有益效果。Compared with the prior art, the living body identification system disclosed in the embodiment of the present invention acquires the motion scores of at least two parts of the face of the person to be tested through at least two parts motion detecting unit, and uses the living body identification score calculation unit. The part motion score is weighted and summed as a living body recognition score, and the living body judgment unit uses the living body recognition score as a criterion for determining whether the face to be tested is a living body. The technical solution solves the problem that the algorithm in the prior art is single and the security is not high, and the scalability is strong, and the detection based on the movement of the face part can be realized by the two-dimensional image, and the hardware requirement is required. It is not high. In addition, the weight of the different parts is weighted and then the score fusion is performed. The accuracy of the living body recognition is high, and the beneficial effects of high recognition accuracy, low hardware requirements and high safety are obtained.
进一步地,至少2个所述部位运动检测单元中对应检测的至少两所述部位运动包括眼部运动、嘴部运动、头部运动、眉毛运动、额头运动和面部运动中的至少两部位运动。Further, at least two of the at least two part motion detection units in the at least two part motion detection units include at least two parts of the eye movement, the mouth movement, the head movement, the eyebrow movement, the forehead movement, and the facial movement.
进一步地,每一所述部位运动检测单元包括:Further, each of the part motion detecting units includes:
部位检测模块,用于对所述待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测所述部位运动对应的部位关键点位置;a part detecting module, configured to detect a key point position of the part corresponding to the part motion for each video frame extracted by the face video of the face to be tested;
部位运动情况获取模块,用于通过所述抽取的每一视频帧的部位关键点位置的变化程度来确定所述部位运动的情况,并根据所述部位运动的情况获取对应的运动分值。The part motion condition obtaining module is configured to determine a motion of the part by using a degree of change of a position of a key point of each of the extracted video frames, and obtain a corresponding motion score according to the motion of the part.
进一步地,所述活体识别分值计算单元中与每一所述部位运动相对应的权值为根据所述每一部位运动的明显度设定;或,所述活体识别分值计算单元中与每一所述部位运动相对应的权值为根据在当前应用场景下每一所述部位运动的准确率设定。Further, the weight corresponding to each part of the motion in the living body recognition score calculation unit is set according to the visibility of each part of the motion; or, the living body recognition score calculation unit is The weight corresponding to each part of the motion is set according to the accuracy of each part of the motion in the current application scenario.
进一步地,所述活体判断单元包括:Further, the living body determining unit includes:
活体识别置信度计算模块,用于通过所述活体识别分值占活体识别总分的比值计算所述待测人脸的活体识别置信度;a biometric recognition confidence calculation module, configured to calculate a living body recognition confidence of the human face to be tested by using a ratio of the living body recognition score to a living body recognition total score;
活体判断模块,用于当所述活体识别置信度不小于预设值时,确定所述活体识别分值不小于预设阈值,判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。a living body judging module, configured to determine that the living body identification score is not less than a preset threshold when the living body recognition confidence is not less than a preset value, and determine that the living body recognition score is not less than a preset threshold The face is a living body.
附图说明DRAWINGS
图1是本发明一种活体识别方法提供的实施例一的流程示意图;1 is a schematic flow chart of Embodiment 1 of a living body identification method according to the present invention;
图2是本发明一种活体识别方法提供的实施例一的步骤S1的流程示意图;2 is a schematic flow chart of step S1 of Embodiment 1 provided by a living body identification method according to the present invention;
图3是待测人脸的68点模型示意图;3 is a schematic diagram of a 68-point model of a face to be tested;
图4是本发明一种活体识别方法提供的实施例一的步骤S3的流程示意图;4 is a schematic flow chart of step S3 of Embodiment 1 of the living body identification method provided by the present invention;
图5是本发明一种活体识别系统提供的实施例的结构示意图。Fig. 5 is a schematic structural view showing an embodiment of a living body recognition system according to the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域 普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. Based on embodiments in the present invention, the field All other embodiments obtained by a person of ordinary skill in the art without creative efforts are within the scope of the invention.
本发明一种活体识别方法提供实施例一,参见图1,图1是本发明一种活体识别方法提供的实施例一的流程示意图,包括步骤:A living body identification method of the present invention provides a first embodiment. Referring to FIG. 1, FIG. 1 is a schematic flowchart of Embodiment 1 of a living body identification method according to the present invention, including the steps:
S1、检测待测人脸的至少两部位运动;S1. Detecting movement of at least two parts of the face to be tested;
S2、基于每一所述部位运动的情况获取所述待测人脸的每一部位运动对应的运动分值;S2. Obtain a motion score corresponding to each part of the motion of the face to be tested based on the motion of each of the parts;
S3、计算每一部位运动对应的运动分值加权后的总和,并将计算得到的总和作为活体识别分值;其中,每一部位运动已预设相应的权值;S3, calculating a sum of weighted motion scores corresponding to each part of the motion, and using the calculated sum as a living body recognition score; wherein each part of the motion has preset a corresponding weight;
S4、判定活体识别分值不小于预设阈值的待测人脸为活体。S4. The face to be tested that determines that the living body recognition score is not less than a preset threshold is a living body.
优选,本实施例步骤S1中的检测待测人脸的至少两部位运动包括检测眼部运动、嘴部运动和头部运动;通常来说,人脸的眼部运动、嘴部运动和头部运动运动程度明显,有利于进行检测,且计算简单高效。Preferably, detecting at least two parts of the face to be tested in step S1 of the embodiment comprises detecting eye movement, mouth movement and head movement; generally, eye movement, mouth movement and head of the face The degree of exercise is obvious, which is conducive to detection, and the calculation is simple and efficient.
具体地,参见图2,图2是本实施例一的步骤S1的流程示意图,步骤S1包括:Specifically, referring to FIG. 2, FIG. 2 is a schematic flowchart of step S1 of the first embodiment, where step S1 includes:
S11、对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测部位运动对应的部位关键点位置;S11. The face position of the part corresponding to the motion of each video frame extracted by the face video of the face to be tested is detected every preset frame number;
参见图3,图3是待测人脸的68点模型;具体,对待测人脸的人脸视频的抽取的连续帧/跳帧采用dlib库做待测人脸的人脸检测和人脸关键点检测,此处的dlib库是一个使用C++技术编写的跨平台的通用库;可以得到抽取的每一视频帧的68点关键点;从获取的待测人脸的68点关键点中可以获取所需的部位运动对应的部位关键点位置。Referring to FIG. 3, FIG. 3 is a 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be tested uses the dlib library to perform face detection and face key of the face to be tested. Point detection, the dlib library here is a cross-platform general library written in C++ technology; 68 key points of each video frame can be obtained; it can be obtained from the 68 key points of the acquired face to be tested. The position of the key point corresponding to the desired part movement.
S12、通过抽取的每一视频帧的部位关键点位置的变化程度来确定部位运动的情况。S12. Determine the motion of the part by the degree of change of the position of the key point of each video frame extracted.
本实施例一的步骤S3中设定每一部位运动相对应的权值的优选实施方式为根据每一部位运动的明显度设定。本实施例一采用通常的策略,嘴部运动比较明显,故权重最大,头部运动模拟精度最低,故权重最小,本实施例一的部位运动的权重策略为:嘴部运动>眼部运动>头部运动;A preferred embodiment of setting the weight corresponding to each part of motion in step S3 of the first embodiment is based on the visibility of each part of motion. In the first embodiment, the general strategy is adopted, the mouth movement is relatively obvious, so the weight is the largest, the head motion simulation accuracy is the lowest, and the weight is the smallest. The weighting strategy of the part motion in the first embodiment is: mouth movement>eye movement> Head movement
或,步骤S3中设定每一部位运动相对应的权值的另一优选实施方式为根据不同应用场景自动进行部位运动的权值调整而设定的,具体做法:在某一种场景下,收集待测人脸的各种部位运动的正常输入视频作为正样本,攻击视频作为负样本,取(正样本通过数+负样本拒绝数)/(正样本总数+负样本总数)作为该部位运动的准确率,然后把每一部位运动的准确率按照从大到小的顺序进行排序,每一部位运动的权重也按照此顺序从大到小,重新调整每一部位运动的权重。重新调整后的权重用以计算活体识别分值,该识别结果可以自适应不同场景下的部位运动检测的准确率,增加本实施例的活体识别结果的准确率。 Or, another preferred embodiment for setting the weight corresponding to the motion of each part in step S3 is set by automatically performing weight adjustment of the part motion according to different application scenarios, in a specific scenario: Collect the normal input video of the motion of various parts of the face to be tested as a positive sample, and attack the video as a negative sample, taking (positive sample pass number + negative sample reject number) / (positive sample total + negative sample total) as the part motion The accuracy rate, then the accuracy of each part of the movement is sorted in descending order, the weight of each part of the movement is also in this order from large to small, to re-adjust the weight of each part of the movement. The re-adjusted weight is used to calculate the living body recognition score, and the recognition result can adapt the accuracy of the part motion detection in different scenarios, and increase the accuracy of the living body recognition result of the embodiment.
上述两种设定每一部位运动相对应的权值的任一种优选实施方式均在本实施例的保护范围内。Any of the above two preferred embodiments for setting the weight corresponding to the motion of each part is within the scope of protection of the present embodiment.
具体地,参见图4,图4是步骤S4的流程示意图,包括步骤:Specifically, referring to FIG. 4, FIG. 4 is a schematic flowchart of step S4, including steps:
S41、通过活体识别分值占活体识别总分的比值计算待测人脸的活体识别置信度;S41. Calculate a living body recognition confidence of the face to be tested by using a ratio of the living body recognition score to the total score of the living body recognition;
S42、当活体识别置信度不小于预设值时,确定活体识别分值不小于预设阈值;S42. When the living body recognition confidence is not less than a preset value, determining that the living body recognition score is not less than a preset threshold;
S43、判定活体识别分值不小于预设阈值的待测人脸为活体。S43. The face to be tested that determines that the living body recognition score is not less than a preset threshold is a living body.
具体地,在步骤S41中,活体识别总分即为本实施例对待测人脸进行识别后能获得的最大值,待测人脸的活体识别置信度通过下述公式计算:Specifically, in step S41, the living body recognition total score is the maximum value that can be obtained after the face to be tested is identified in the embodiment, and the living body recognition confidence of the face to be tested is calculated by the following formula:
f=(s/s_max)*100%f=(s/s_max)*100%
其中,s_max表示活体识别总分,f表示活体识别置信度,且0<f<1;Where s_max represents the total score of the living body recognition, and f represents the confidence of the living body recognition, and 0<f<1;
用e表示预设值,当f≥e,即活体识别置信度不小于预设值时,则确定活体识别分值不小于预设阈值,判定活体识别分值不小于预设阈值的待测人脸为活体;当f<e,即活体识别置信度小于预设值时,则确定活体识别分值小于预设阈值,判定活体识别分值小于预设阈值的待测人脸为非活体。Use e to indicate the preset value. When f≥e, that is, the living body recognition confidence is not less than the preset value, it is determined that the living body recognition score is not less than the preset threshold, and the person whose living body recognition score is not less than the preset threshold is determined. The face is a living body; when f<e, that is, the living body recognition confidence is less than the preset value, it is determined that the living body recognition score is less than the preset threshold, and the face to be tested whose living body recognition score is less than the preset threshold is determined to be inactive.
利用活体识别分值所获得的活体识别置信度,还可以进一步扩展,用于本实施例建立分级制度进行活体判断和活体分级,以获得丰富的活体识别结果。The living body recognition confidence obtained by using the living body recognition score can be further expanded, and is used in the present embodiment to establish a classification system for living body judgment and living body classification to obtain rich living body recognition results.
详细地,结合图3,在步骤S12中从获取部位关键点位置的变化程度来确定部位运动的情况的具体过程:In detail, in conjunction with FIG. 3, a specific process of determining the motion of the part from the degree of change in the position of the key point of the acquisition portion in step S12 is as follows:
其中,对嘴部运动的检测过程:用得到的人脸68点模型中的61-68这8个关键点表示待测人脸的嘴部。定义这8个关键点中的x坐标的最大值减去x坐标的最小值即为嘴部长度,定义这8个关键点中的y坐标的最大值减去y坐标的最小值即为嘴部宽度。用嘴部长度除以嘴部宽度代表嘴部数值,设定阈值a1和a2,其中,a1<a2;当嘴部数值小于a1时,表示嘴部张开,当嘴部数值大于a2时,表示嘴部闭合。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的嘴部运动的运动情况为嘴部张开,并且有另外的部分帧确定的嘴部运动的情况为嘴部闭合,则判定嘴部有运动。Among them, the detection process of the mouth movement: the 8 key points of 61-68 in the obtained 68-point model of the face represent the mouth of the face to be tested. Define the maximum value of the x coordinate in the 8 key points minus the minimum value of the x coordinate, which is the length of the mouth. Define the maximum value of the y coordinate among the 8 key points minus the minimum value of the y coordinate. width. The mouth length is divided by the mouth width to represent the mouth value, and the thresholds a1 and a2 are set, wherein a1 < a2; when the mouth value is less than a1, the mouth is opened, and when the mouth value is greater than a2, The mouth is closed. In each video frame of the face video extracted from the face to be tested, if the movement of the mouth movement determined by the partial frame is that the mouth is opened, and the movement of the mouth determined by the other partial frame is When the mouth is closed, it is determined that the mouth has motion.
其中,对眼部运动的检测过程:用得到的人脸68点模型中的37-48这12个关键点表示待测人脸的眼部;其中,37-42这6个关键点表示右眼,43-48这6个关键点表示左眼。定义表示右眼的6个关键点中的x坐标的最大值减去x坐标的最小值即为右眼长度,右眼6个关键点的y坐标的最大值减去y坐标的最小值即为右眼宽度;用右眼长度除以右眼宽度代表右眼数值,同理可得左眼数值;优选地,定义左眼数值与右眼数值的平均数为眼部数值,设定阈值b1和b2,其中,b1<b2,当眼部数值小于b1时,表示眼部睁开,当眼部数值大于b2时,表示眼部闭合。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的眼部运动的情况为眼部睁开,并且有另外的部分帧确定的眼部运动的情况为 眼部闭合,则判定眼部有运动。Among them, the detection process of the eye movement: using the obtained key points of 37-48 in the 68-point model of the face to represent the eye of the face to be tested; wherein, the 37-42 key points represent the right eye The four key points of 43-48 represent the left eye. The maximum value of the x coordinate of the six key points representing the right eye minus the minimum value of the x coordinate is the length of the right eye, and the maximum value of the y coordinate of the six key points of the right eye minus the minimum value of the y coordinate is The width of the right eye; dividing the length of the right eye by the width of the right eye to represent the value of the right eye, the same as the value of the left eye; preferably, defining the average of the value of the left eye and the value of the right eye as the eye value, setting the threshold b1 and B2, where b1 < b2, when the eye value is less than b1, it means that the eye is open, and when the eye value is greater than b2, it means that the eye is closed. In each video frame of the face video extracted from the face to be tested, if the eye movement determined by the partial frame is the eye opening, and the eye movement determined by the other partial frame is When the eye is closed, it is determined that the eye has motion.
在本实施例中,除了采用定义左眼数值与右眼数值的平均数为眼部数值,来通过眼部数值来判定运动情况的优选实施方式,还可以采用直接通过右眼数值和/或左眼数值来判定对应的右眼运动和/或左眼运动,即,将眼部运动变为左眼-右眼,右眼-左眼,仅左眼和仅右眼这4个流程,这样眼部运动流程增多,则整个活体的可变化性更强,这样更能增加活体检测的安全性。In the present embodiment, in addition to the preferred embodiment in which the average value of the left eye value and the right eye value is defined as the eye value to determine the motion condition by the eye value, it is also possible to directly pass the right eye value and/or the left. The eye value determines the corresponding right eye motion and/or left eye motion, that is, changes the eye motion into the left eye-right eye, the right eye-left eye, and only the left eye and only the right eye. As the movement process increases, the whole living body is more variability, which can increase the safety of living body detection.
其中,对头部运动的检测过程:用得到的人脸68点模型中的表示左眼的6个关键点、表示右眼的6个关键点和关键点34,49和55来检测人脸的头部运动;其中,定义表示左眼的6个关键点的x坐标的平均值为A点的x坐标,表示左眼的6个关键点的y坐标的平均值为A点的y坐标,同理定义右眼B点,定义人脸68点模型中关键点34,49和55分别为C点,D点和E点,上述得到的A至E点为表示人脸特征点五点模型。然后应用开源图像库中opencv中的小孔相机模型根据上述的人脸特征点五点模型得到人脸在三维空间中的角度值--偏航角yaw数值和俯仰角pitch数值。头部运动的运动情况为4种:头部左转,头部右转,头部抬头,头部低头。设定阈值c1和c2,其中,c1<c2;当yaw<c1时,表示头部左转,当yaw>c2时,表示头部右转。设定阈值d1和d2,其中,d1<d2;当pitch<d1时,表示头部低头,当pitch>d2时,表示头部抬头。当yaw数值在c1和c2之间,并且d1<pitch<d2时,表示头部正面朝前。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的头部运动的情况为抬头,并且有另外的部分帧确定的头部运动的情况为正常头部朝前,则待测人脸的头部有抬头动作,即判定头部有运动;以此类推,可以通过检测待测人脸的头部有低头动作、左转头动作和右转头动作,来判定头部有运动。Among them, the detection process of the head movement: using the six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49 and 55 in the obtained 68-point model of the face to detect the face Head movement; wherein, the average value of the x coordinate of the six key points representing the left eye is defined as the x coordinate of point A, and the average value of the y coordinate of the six key points of the left eye is the y coordinate of point A, the same The right eye B point is defined, and the key points 34, 49, and 55 in the 68-point model are defined as C point, D point, and E point, respectively. The A to E points obtained above are five-point models representing facial feature points. Then, using the small hole camera model in opencv in the open source image library, the angle value of the face in the three-dimensional space-the yaw angle yaw value and the pitch angle pitch value are obtained according to the five-point model of the face feature point described above. There are four types of movements of the head movement: the left head turns, the head turns right, the head rises, and the head bows. Thresholds c1 and c2 are set, where c1 < c2; when yaw < c1, it means that the head turns left, and when yaw > c2, it means that the head turns right. Thresholds d1 and d2 are set, where d1 < d2; when pitch < d1, it means that the head is head down, and when pitch > d2, it means that the head is headed up. When the yaw value is between c1 and c2, and d1 <pitch < d2, it means that the head is facing forward. In each video frame of the face video extracted from the face to be tested, if the condition of the head motion determined by the partial frame is head-up, and the condition of the head movement determined by the other partial frame is normal head toward Before, the head of the face to be tested has a head-up motion, that is, it is determined that the head has motion; and so on, by detecting the head of the face to be tested, there is a head movement, a left-hand movement, and a right-hand movement. It is determined that the head has motion.
对应地,步骤S2根据上述部位运动检测过程所确定的部位运动的情况,获取对应的运动分值,具体包括:Correspondingly, the step S2 acquires the corresponding motion score according to the situation of the part motion determined by the part motion detection process, which specifically includes:
嘴部运动的情况获取对应的运动分值包括:嘴部有运动,获取的嘴部运动的运动分值为1分;嘴部无运动,获取的嘴部运动的运动分值为0分。The condition of the mouth movement to obtain the corresponding motion score includes: the mouth has motion, the obtained motion score of the mouth movement is 1 point; the mouth has no motion, and the obtained motion score of the mouth movement is 0 points.
眼部运动的情况获取对应的运动分值包括:The case of eye movement to obtain the corresponding exercise score includes:
判定眼部有运动,获取的眼部运动的运动分值为1分;判定眼部无运动,获取的眼部运动的运动分值为0分。It is determined that there is motion in the eye, and the obtained motion score of the eye movement is 1 point; if the eye is not motioned, the obtained motion score of the eye movement is 0.
头部运动的情况获取对应的运动分值包括:若待测人脸的头部有抬头动作、低头动作、左转头动作和右转头动作中任意一种头部动作,即判定头部有运动,获取的头部运动的运动分值为1分,若待测人脸的头部没有抬头动作、低头动作、左转头动作和右转头动作中任意一种头部动作,即头部无运动,获取的头部运动的运动分值为0分。The condition of the head movement obtains the corresponding motion score includes: if the head of the face to be tested has any one of a head movement, a head movement, a left-hand movement, and a right-hand movement, the head is determined Exercise, the obtained motor movement has a score of 1 point. If the head of the person to be tested has no head movement, head movement, left-hand movement and right-hand movement, the head is Without exercise, the obtained head movement has a motion score of 0.
具体实施时,先对待测人脸的人脸视频每个预设帧数所抽取的每一视频帧获取人脸的68点关键点,由此分别获取待检测的眼部运动、嘴部运动和头部运动对应的眼部关键点位置、嘴部关键点位置和头 部关键点位置,从而确定视频帧的眼部、嘴部和头部的状态;然后从若干抽取的视频帧中的眼部、嘴部和头部的状态分别确定眼部运动、嘴部运动和头部运动的情况;根据每一部位运动的情况获取对应的运动分值,具体为该部位有运动,则获取的运动分值为1分,否则获取的运动分值为0分;接着计算上述得到每一部位运动分值进行加权后的总和,该总和表示活体识别分值;最后用该活体识别分值占活体识别总分的比值计算活体识别置信度,其中,当活体识别置信度不小于预设值时,确定活体识别分值不小于预设阈值,从而判定待测人脸为活体;否则,判定待测人脸为非活体。In the specific implementation, each video frame extracted by the preset number of frames of the face video of the face is first acquired with 68 key points of the face, thereby acquiring the eye movement, the mouth movement and the to-be-detected respectively. Eye key position corresponding to head movement, mouth key position and head a key point position to determine the state of the eye, mouth, and head of the video frame; then determining the eye movement, mouth motion, and the state of the eye, mouth, and head from the plurality of extracted video frames, respectively The condition of the head movement; the corresponding motion score is obtained according to the motion of each part, specifically, if the part has motion, the obtained exercise score is 1 point, otherwise the obtained exercise score is 0 points; then the above calculation is performed Obtaining a weighted sum of the motion scores of each part, the sum represents a living body identification score; finally, the living body identification confidence is calculated by using the ratio of the living body recognition score to the total score of the living body recognition, wherein the confidence of the living body recognition is not less than When the preset value is determined, it is determined that the living body recognition score is not less than the preset threshold, thereby determining that the face to be tested is a living body; otherwise, determining that the face to be tested is not a living body.
本实施例可运用于多种设备端,此处以运用于移动手机端的实施场景为例进行说明:在手机端活体识别时,随机出现一种活体动作要求顺序,例如为要求待测人脸分别进行头部左转、眨眼和张嘴的活体动作;此时若预设的部位运动的权重为张嘴对应的嘴部运动的权重w1=3,眨眼对应的眼部运动的权重w2=2,头部左转对应的头部运动的权重w3=1;计算活体识别总分,即活体识别最高分s_max为3*1+2*1+1*1=6分。假设检测出张嘴得分为1分,眨眼得分为1分,头部左转得分为0分,活体识别分值s为每一部位运动加权后的总和,代入上述部位运动的运动分值,计算活体识别分值s=3*1+2*1+1*0=5分;最后,计算活体识别置信度f=s/s_max=5/6=83.33%。若设定此时设定值e为80%,则判定该待测人脸为活体,且活体置信度为83.33%。This embodiment can be applied to a variety of device terminals. The implementation scenario of the mobile phone terminal is taken as an example. When the mobile phone is in vivo recognition, a sequence of living action requests is randomly generated, for example, the face to be tested is required to be separately performed. The left side of the head, the blinking of the eye and the opening of the mouth; at this time, if the weight of the preset part motion is the weight of the mouth movement corresponding to the mouth mouth w1=3, the weight of the eye movement corresponding to the blinking is w2=2, the head left The weight of the corresponding head movement is w3=1; the total score of the living body recognition is calculated, that is, the highest score of the living body recognition s_max is 3*1+2*1+1*1=6 points. Assume that the score of the open mouth is 1 point, the score of the blink is 1 point, the score of the left head of the head is 0, the score of the living body recognition is the sum of the weights of each part, and the exercise score of the above part is calculated to calculate the living body. The recognition score s=3*1+2*1+1*0=5 points; finally, the living body recognition confidence f=s/s_max=5/6=83.33% is calculated. If the set value e is set to 80% at this time, it is determined that the face to be tested is a living body, and the living body confidence is 83.33%.
本实施例解决了现有技术中算法单一,安全性不高的问题,可扩展性强;对于待测人脸的部位运动的检测可以通过二维图像实现,对设备的硬件要求不高;另外,在本实施例中采用对眼部运动、嘴部运动和头部运动的检测来进行活体识别,这几个部位的运动效果明显,运动判断的准确度高;采用对不同部位运动加权再进行分数融合,活体识别准确度高;多种部位运动的检测,有利于提高安全性。The embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high; In the present embodiment, the detection of eye movement, mouth movement and head movement is used for living body recognition, and the motion effects of these parts are obvious, and the accuracy of motion judgment is high; Score fusion, high accuracy of living recognition; detection of multiple parts of motion is conducive to improving safety.
本发明一种活体识别方法提供的实施例二,本实施例二的主要流程可参见图1的实施一的步骤S1-S4,本实施例二的步骤S4包括的步骤流程可参见图4中实施例一的步骤S41-S43流程示意图,以及步骤S3中的运动权重的设定也可以参见实施例一;此处不做赘述。A second embodiment of the present invention provides a second embodiment of the present invention. The main process of the second embodiment can be referred to the steps S1 to S4 of the first embodiment of the present invention. For the flowcharts of the steps S41-S43 in the first embodiment and the setting of the motion weights in the step S3, refer to the first embodiment; the details are not described herein.
本实施例二的步骤S1包括的步骤流程可参见图2实施例一,同样包括步骤S11-S12:The flow of the steps included in the step S1 of the second embodiment can be referred to the first embodiment of FIG. 2, and the steps S11-S12 are also included:
S11、对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测部位运动对应的部位关键点位置;S11. The face position of the part corresponding to the motion of each video frame extracted by the face video of the face to be tested is detected every preset frame number;
参见图3,图3是待测人脸的68点模型;具体,对待测人脸的人脸视频的抽取的连续帧/跳帧采用dlib库做待测人脸的人脸检测和人脸关键点检测,此处的dlib库是一个使用C++技术编写的跨平台的通用库;可以得到抽取的每一视频帧的68点关键点;从获取的待测人脸的68点关键点中可以获取所需的部位运动对应的部位关键点位置。Referring to FIG. 3, FIG. 3 is a 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be tested uses the dlib library to perform face detection and face key of the face to be tested. Point detection, the dlib library here is a cross-platform general library written in C++ technology; 68 key points of each video frame can be obtained; it can be obtained from the 68 key points of the acquired face to be tested. The position of the key point corresponding to the desired part movement.
S12、通过抽取的每一视频帧的部位关键点位置的变化程度来确定部位运动的情况。S12. Determine the motion of the part by the degree of change of the position of the key point of each video frame extracted.
其中,不同的是,在本实施例二中,结合图3,本实施例的步骤S12中从获取部位关键点位置的变 化程度来确定部位运动的情况的具体实施过程为:The difference is that in the second embodiment, in combination with FIG. 3, the position of the key point of the acquisition part is changed in step S12 of the embodiment. The specific implementation process to determine the movement of the site is:
其中,对嘴部运动的检测过程:用得到的人脸68点模型中的61-68这8个关键点位置表示待测人脸的嘴部,用已预先通过SVM分类器训练好的嘴部状态分类模型预测待测人脸的人脸视频的每一帧的嘴部状态,其中,通过SVM分类器训练好的嘴部状态分类模型的预先训练过程为:以人脸68点模型中的61-68这8个关键点位置表示待测人脸的嘴部特征,人工选择一定数量嘴部为张嘴状态的人脸照片,标注这些人脸照片的嘴部状态为1;人工选择一定数量的嘴部为闭合状态的人脸照片,标注这些人脸照片嘴部状态为0,然后用SVM分类器训练为嘴部状态分类模型。若抽取的若干视频帧的嘴部状态既有0也有1,则判定嘴部有运动,否则判定嘴部无运动。Among them, the detection process of the mouth movement: using the obtained key points of 61-68 in the 68-point model of the face to represent the mouth of the face to be tested, using the mouth that has been trained by the SVM classifier in advance The state classification model predicts the mouth state of each frame of the face video of the face to be tested, wherein the pre-training process of the mouth state classification model trained by the SVM classifier is: 61 in the 68-point model of the face -68 These 8 key points indicate the mouth features of the face to be tested, manually select a certain number of face photos of the mouth, and mark the mouth state of these faces as 1; manually select a certain number of mouths The part is a closed face photo, and the face state of these face photos is marked as 0, and then the SVM classifier is used to train the mouth state classification model. If the mouth state of the extracted video frames has both 0 and 1, it is determined that the mouth has motion, otherwise it is determined that the mouth has no motion.
另一实施方式,用得到的人脸68点模型中的61-68这8个关键点位置表示待测人脸的嘴部,用已预先通过soft-max回归分类器训练好的嘴部状态分类模型预测待测人脸的人脸视频的每一帧的嘴部状态分数,其中,通过soft-max回归分类器训练好的嘴部状态分类模型的预先训练过程为:根据嘴部张开的不同程度对若干人脸照片进行标注,即按照嘴部的张开程度给嘴部标注状态分数:可以设定分数分为10级,取值在0到1之间;则,嘴部闭合为0分,最大张嘴为1分,半张开嘴部为0.5分。根据已预先通过soft-max回归分类器训练好的嘴部状态分类模型可以获取待测人脸的人脸视频抽取的若干视频帧中嘴部状态分数;当嘴部状态分数中的最大值与最小值之间的差值大于预设阈值时则认为嘴部有运动,否则嘴部无运动。In another embodiment, the 8 key points of 61-68 in the obtained 68-point model of the face are used to represent the mouth of the face to be tested, and the mouth state is trained by the soft-max regression classifier. The model predicts the mouth state score of each frame of the face video of the face to be tested, wherein the pre-training process of the trained mouth state classification model by the soft-max regression classifier is: according to the mouth opening difference Degrees are marked on a number of face photos, that is, the state score is marked on the mouth according to the degree of opening of the mouth: the score can be set to 10 levels, and the value is between 0 and 1; then, the mouth is closed for 0 points. The maximum opening mouth is 1 point, and the half opening mouth is 0.5 points. According to the mouth state classification model that has been trained by the soft-max regression classifier in advance, the mouth state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the mouth state scores When the difference between the values is greater than the preset threshold, the mouth is considered to have motion, otherwise the mouth has no motion.
其中,对眼部运动的检测过程:用得到的人脸68点模型中的37-48这12个关键点表示待测人脸的眼部;其中,37-42这6个关键点表示右眼,43-48这6个关键点表示左眼。用已预先通过SVM分类器训练好的眼部状态分类模型预测待测人脸的人脸视频的每一帧的眼部状态,其中,通过SVM分类器训练好的眼部状态分类模型的预先训练过程为:以人脸68点模型中的37-48这12个关键点位置表示待测人脸的眼部特征,人工选择一定数量眼部为睁眼状态的人脸照片,标注这些人脸照片的眼部状态为1;人工选择一定数量的眼部为眼部闭合状态的人脸照片,标注这些人脸照片的眼部状态为0,然后用SVM分类器训练为眼部状态分类模型。若抽取的若干视频帧的眼部状态既有0也有1,则判定眼部有运动,否则判定眼部无运动。Among them, the detection process of the eye movement: using the obtained key points of 37-48 in the 68-point model of the face to represent the eye of the face to be tested; wherein, the 37-42 key points represent the right eye The four key points of 43-48 represent the left eye. Predicting the eye state of each frame of the face video of the face to be tested with the eye state classification model trained in advance by the SVM classifier, wherein the pre-training of the eye state classification model trained by the SVM classifier The process is as follows: the 12 key points of 37-48 in the 68-point model of the face represent the eye features of the face to be tested, and manually select a certain number of face images of the eyes in the blinking state, and mark the faces of the faces. The eye state is 1; manually select a certain number of eyes as the face photos of the eye closed state, mark the eye state of these face photos as 0, and then train with the SVM classifier as the eye state classification model. If the eye state of the extracted video frames has both 0 and 1, it is determined that the eye has motion, otherwise it is determined that the eye has no motion.
另一实施方式,用得到的人脸68点模型中的37-48这12个关键点位置表示待测人脸的眼部,用已预先通过soft-max回归分类器训练好的眼部状态分类模型预测待测人脸的人脸视频的每一帧的眼部状态分数,其中,通过soft-max回归分类器训练好的眼部状态分类模型的预先训练过程为:根据眼部张开的不同程度对若干的人脸照片进行标注,即按照眼部的张开程度给眼部标注状态分数:可以设定分数分为10级,取值在0到1之间;则,眼部闭合为0分,最大睁眼为1分,半睁眼为0.5分。根据已预先通过soft-max回归分类器训练好的眼部状态分类模型可以获取待测人脸的人脸视频抽取的若干视频帧中眼部状态分数;当眼部状态分数中的最大值与最小值之间的差值大于预设阈值时则认为眼部 有运动,否则眼部无运动。In another embodiment, the 12 key points of 37-48 in the obtained 68-point model of the face are used to represent the eye of the face to be tested, and the eye state classification trained by the soft-max regression classifier is used in advance. The model predicts an eye state score of each frame of the face video of the face to be tested, wherein the pre-training process of the eye state classification model trained by the soft-max regression classifier is: according to the difference of the eye opening Degrees are marked on a number of face photos, that is, the state score is marked on the eye according to the degree of opening of the eye: the score can be set to 10 levels, and the value is between 0 and 1; then, the eye is closed to 0. Points, the maximum blink is 1 point, and the half blink is 0.5 points. According to the eye state classification model trained by the soft-max regression classifier in advance, the eye state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the eye state scores When the difference between the values is greater than the preset threshold, the eye is considered Have exercise, otherwise there is no movement in the eyes.
在本实施例二中,除了采用定义左眼数值与右眼数值的平均数为眼部数值,来通过眼部数值来判定运动情况的优选实施方式,还可以采用直接通过右眼数值和/或左眼数值来判定对应的右眼运动和/或左眼运动,即,将眼部运动变为左眼-右眼,右眼-左眼,仅左眼和仅右眼这4个流程,这样眼部运动流程增多,则整个活体的可变化性更强,这样更能增加活体检测的安全性。In the second embodiment, in addition to the preferred embodiment in which the average value of the left eye value and the right eye value is defined as the eye value to determine the motion condition by the eye value, it is also possible to directly pass the right eye value and/or The left eye value is used to determine the corresponding right eye motion and/or left eye motion, that is, the eye motion is changed to the left eye-right eye, the right eye-left eye, and only the left eye and only the right eye. As the eye movement process increases, the whole living body is more variability, which can increase the safety of living body detection.
其中,头部运动的运动情况为4种:头部左转,头部右转,头部抬头和头部低头,此处以头部抬头为例,说明对头部运动的检测过程:用已预先通过SVM分类器训练好的头部状态分类模型预测待测人脸的人脸视频的每一帧的头部状态,其中,通过SVM分类器训练好的头部状态分类模型的预先训练过程为:以人脸68点模型中的表示左眼的6个关键点、表示右眼的6个关键点和关键点34,49和55这15个关键点位置表示待测人脸的头部特征;人工选择一定数量头部为抬头状态的人脸照片,标注这些人脸照片的头部状态为1;人工选择一定数量的头部为正常朝前状态的人脸照片,标注这些人脸照片的头部状态为0;然后用SVM分类器训练为头部状态分类模型。若抽取的若干视频帧的头部状态既有0也有1,则判定头部有运动,否则判定头部无运动。Among them, the movement of the head movement is four kinds: the left side of the head, the right turn of the head, the head of the head and the head of the head. Here, the head raising is taken as an example to illustrate the detection process of the head movement: The head state of each frame of the face video of the face to be tested is predicted by the SVM classifier trained head state classification model, wherein the pre-training process of the head state classification model trained by the SVM classifier is: The six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49, and 55 in the 68-point model of the face represent the head features of the face to be tested; Select a certain number of face photos with the head as the heading state, and mark the head state of these face photos as 1; manually select a certain number of heads to face the face in the normal forward state, and mark the head of these face photos The state is 0; then the SVM classifier is trained to classify the head state. If the head states of the extracted video frames have both 0 and 1, it is determined that the head has motion, otherwise it is determined that the head has no motion.
另一实施方式,用得到的人脸68点模型中的表示左眼的6个关键点、表示右眼的6个关键点和关键点34,49和55这15个关键点位置表示待测人脸的头部,用已预先通过soft-max回归分类器训练好的头部状态分类模型预测待测人脸的人脸视频的每一帧的头部状态分数,其中,通过soft-max回归分类器训练好的头部状态分类模型的预先训练过程为:根据头部抬头的不同程度对若干的人脸照片进行标注,即按照头部的抬头程度给头部标注状态分数:可以设定分数分为10级,取值在0到1之间;则,头部正常朝前为0分,最大程度抬头为1分,半抬头为0.5分。根据已预先通过soft-max回归分类器训练好的头部状态分类模型可以获取待测人脸的人脸视频抽取的若干视频帧中头部状态分数;当头部状态分数中的最大值与最小值之间的差值大于预设阈值时则认为头部有运动,否则头部无运动。In another embodiment, the six key points representing the left eye, the six key points representing the right eye, and the key points 34, 49, and 55 in the obtained 68-point model represent the person to be tested. The head of the face predicts the head state score of each frame of the face video of the face to be tested using the head state classification model that has been trained in advance by the soft-max regression classifier, wherein the soft-max regression classification is performed. The pre-training process of the trained head state classification model is: labeling a number of face photos according to different degrees of head heading, that is, marking the head with a state score according to the head lifting degree: a score can be set For level 10, the value is between 0 and 1; then, the head is normally 0 points forward, the maximum head is 1 point, and the half head is 0.5 points. According to the head state classification model trained by the soft-max regression classifier in advance, the head state scores of several video frames extracted by the face video of the face to be tested can be obtained; when the maximum and minimum of the head state scores are obtained When the difference between the values is greater than the preset threshold, the head is considered to have motion, otherwise the head has no motion.
类似地,对头部左转,头部右转和头部低头其他三种头部运动的检测过程与上述以头部抬头为例的头部运动检测过程相似,此处不做赘述。Similarly, the detection process of the left head turn, the head right turn, and the head down head three other head movements is similar to the above-described head motion detection process using the head lift as an example, and will not be described here.
对应地,步骤S2根据上述部位运动检测过程所确定的部位运动情况,获取对应的运动分值,具体包括:Correspondingly, the step S2 acquires the corresponding motion score according to the motion of the part determined by the part motion detection process, which specifically includes:
嘴部运动的运动情况获取对应的运动分值:判定嘴部有运动,获取的嘴部运动的运动分值为1分;判定嘴部无运动,获取的嘴部运动的运动分值为0分。The motion of the mouth movement obtains the corresponding motion score: it is determined that the mouth has motion, and the obtained motion score of the mouth movement is 1 point; if the mouth has no motion, the obtained motion score of the mouth movement is 0 .
眼部运动的运动情况获取对应的运动分值:判定眼部有运动,获取的眼部运动的运动分值为1分;判定眼部无运动,获取的眼部运动的运动分值为0分。The motion of the eye movement obtains the corresponding motion score: it is determined that the eye has motion, and the obtained motion score of the eye movement is 1 point; if the eye has no motion, the obtained motion score of the eye movement is 0. .
头部运动的运动情况获取对应的运动分值:判定头部有运动,获取的头部运动的运动分值为1分,若判定头部无运动,获取的头部运动的运动分值为0分。 The motion of the head movement obtains the corresponding motion score: it is determined that the head has motion, and the obtained motion score of the head motion is 1 point. If it is determined that the head has no motion, the obtained motion score of the head motion is 0. Minute.
在本实施例中还可以通过步骤S1获取每一部位运动的运动程度,则对应在步骤S2中基于运动程度获取一个在0到1之间的运动分值,而不只是得1或者0这两个运动分值,该替代实施方式不仅能表示是否有运动,还能体现运动的程度。In this embodiment, the degree of motion of each part of the motion can also be obtained by step S1, and correspondingly, in step S2, a motion score between 0 and 1 is obtained based on the degree of motion, instead of just getting 1 or 0. The exercise score, the alternative embodiment not only indicates whether there is motion, but also the degree of exercise.
具体实施时,先对待测人脸的人脸视频每个预设帧数所抽取的每一视频帧获取人脸的68点关键点,由此分别获取待检测对应的眼部关键点位置、嘴部关键点位置和头部关键点位置,从而确定视频帧的眼部、嘴部和头部的状态;然后从若干抽取的视频帧中的眼部、嘴部和头部的状态分别确定眼部运动、嘴部运动和头部运动的情况;根据每一部位运动的情况获取对应的运动分值;接着计算上述得到每一部位运动分值进行加权后的总和,该总和表示活体识别分值;最后用该活体识别分值占活体识别总分的比值计算活体识别置信度,其中,当活体识别置信度不小于预设值时,确定活体识别分值不小于预设阈值,从而判定待测人脸为活体;否则,判定待测人脸为非活体。In a specific implementation, each video frame extracted by the preset number of frames of the face video of the face is obtained by acquiring 68 key points of the face, thereby respectively acquiring the position of the key point of the eye to be detected, and the mouth. Key position and head key position to determine the state of the eye, mouth and head of the video frame; then determine the eye from the state of the eye, mouth and head in several extracted video frames The movement, the mouth movement and the head movement; the corresponding motion score is obtained according to the motion of each part; then the sum of the weight scores of each part is calculated, and the sum represents the living body recognition score; Finally, the living body recognition confidence is calculated by using the ratio of the living body recognition score to the total score of the living body recognition, wherein when the living body recognition confidence is not less than the preset value, determining that the living body recognition score is not less than a preset threshold, thereby determining the person to be tested The face is a living body; otherwise, it is determined that the face to be tested is not a living body.
本实施例二可运用于多种设备端,此处以运用于移动手机端的实施场景为例进行说明:在手机端活体识别时,随机出现一种活体动作要求顺序,例如为要求待测人脸分别进行头部左转、眨眼和张嘴的活体动作;此时若预设的部位运动的权重为张嘴对应的嘴部运动的权重w1=3,眨眼对应的眼部运动的权重w2=2,头部左转对应的头部运动的权重w3=1;计算活体识别总分,即活体识别最高分s_max为3*1+2*1+1*1=6分。假设检测出张嘴得分为1分,眨眼得分为1分,头部左转得分为0分,活体识别分值s为每一部位运动加权后的总和,代入上述部位运动的运动分值,计算活体识别分值s=3*1+2*1+1*0=5分;最后,计算活体识别置信度f=s/s_max=5/6=83.33%。若设定此时设定值e为80%,则判定该待测人脸为活体,且活体置信度为83.33%。The second embodiment can be applied to multiple device terminals. The implementation scenario of the mobile phone terminal is taken as an example. When the mobile phone is in vivo recognition, a sequence of living action requests is randomly generated, for example, to request the faces to be tested. Performing a living movement of the left turn of the head, blinking, and opening the mouth; at this time, if the weight of the preset part motion is the weight of the mouth movement corresponding to the mouth opening w1=3, the weight of the eye movement corresponding to the blinking is w2=2, the head The weight of the head movement corresponding to the left turn is w3=1; the total score of the living body recognition is calculated, that is, the highest score of the living body recognition s_max is 3*1+2*1+1*1=6 points. Assume that the score of the open mouth is 1 point, the score of the blink is 1 point, the score of the left head of the head is 0, the score of the living body recognition is the sum of the weights of each part, and the exercise score of the above part is calculated to calculate the living body. The recognition score s=3*1+2*1+1*0=5 points; finally, the living body recognition confidence f=s/s_max=5/6=83.33% is calculated. If the set value e is set to 80% at this time, it is determined that the face to be tested is a living body, and the living body confidence is 83.33%.
本实施例二解决了现有技术中算法单一,安全性不高的问题,可扩展性强;对于待测人脸的部位运动的检测可以通过二维图像实现,对设备的硬件要求不高;另外,在本实施例中采用对眼部运动、嘴部运动和头部运动的检测来进行活体识别,这几个部位的运动效果明显,运动判断的准确度高;采用对不同部位运动加权再进行分数融合,活体识别准确度高;多种部位运动的检测,有利于提高安全性。The second embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high; In addition, in the present embodiment, the detection of eye movement, mouth movement and head movement is used to perform living body recognition, and the motion effects of these parts are obvious, and the accuracy of motion judgment is high; Fractional fusion is performed, and the accuracy of living body recognition is high; the detection of multiple parts of motion is beneficial to improve safety.
本发明一种活体识别方法提供的实施例三,本实施例三的主要流程可参见图1的实施一的步骤S1-S4,本实施例二的步骤S4包括的步骤流程可参见图4中实施例一的步骤S41-S43流程示意图,上述部分可参照上述实施例一,此处不做赘述。The third embodiment of the present invention provides a third embodiment of the present invention. The main process of the third embodiment can be referred to the steps S1 to S4 of the first embodiment of the present invention. For a flowchart of the steps S41-S43 in the first embodiment, the above part may refer to the first embodiment, and details are not described herein.
通常来说,人脸的眼部运动、嘴部运动和头部运动运动程度明显,有利于进行检测,且计算简单高效;在本实施三,步骤S1中的检测待测人脸的部位运动除了包括检测眼部运动、嘴部运动和头部运动;同时,本实施例三的步骤S1中的检测待测人脸的部位运动还包括了面部运动、眉毛运动和额头运动这三种部位运动中的至少一种。Generally speaking, the degree of eye movement, mouth movement and head movement of the human face is obvious, which is advantageous for detection, and the calculation is simple and efficient; in the third embodiment, the motion of detecting the part of the face to be tested in step S1 is Including the detection of the eye movement, the mouth movement and the head movement; at the same time, the movement of the part detecting the face to be tested in the step S1 of the third embodiment further includes the movement of the three parts of the facial movement, the eyebrow movement and the forehead movement. At least one of them.
对于步骤S1中检测待测人脸的至少两部位运动包括对待测人脸的人脸视频每隔预设帧数所抽取的 每一视频帧检测部位运动对应的部位关键点位置;参见图3,图3是待测人脸的68点模型;具体,对待测人脸的人脸视频的抽取的连续帧/跳帧采用dlib库做待测人脸的人脸检测和人脸关键点检测,可以得到抽取的每一视频帧的68点关键点;从获取的待测人脸的68点关键点中可以获取所需的部位运动对应的部位关键点位置。除此之外,步骤S1还包括对每一视频帧的待测人脸的人脸检测,从而获取人脸矩形框,可参见图3的人脸矩形框HIJK。The at least two parts of the motion for detecting the face to be tested in step S1 include the face video of the face to be measured extracted by the preset number of frames. Each video frame detects the location of the key point corresponding to the motion of the part; see Figure 3, Figure 3 is the 68-point model of the face to be tested; specifically, the continuous frame/jump frame of the face video of the face to be measured is dlib The library performs face detection and face key point detection of the face to be tested, and can obtain 68 key points of each video frame extracted; the required part can be obtained from the obtained 68 key points of the face to be tested. The key point position of the part corresponding to the movement. In addition, step S1 further includes face detection of the face to be tested of each video frame, thereby acquiring a face rectangle, which can be seen in the face rectangle HIJK of FIG.
本实施例三中,步骤S3中设定每一部位运动相对应的权值的优选实施方式为根据每一部位运动的明显度设定。本实施例三采用通常的策略,部位运动权重策略为:嘴部运动>眼部运动>头部运动;面部运动、眉毛运动、额头运动的至少一种部位运动设定的权重均小于上述嘴部运动、眼部运动和头部运动的权重值。In the third embodiment, a preferred embodiment of setting the weight corresponding to the motion of each part in step S3 is set according to the visibility of each part of the motion. In the third embodiment, the general strategy is adopted, and the weight of the part motion is: mouth movement>eye movement>head movement; the weight of at least one part movement of the facial movement, the eyebrow movement, and the forehead movement is smaller than the above mouth. Weight values for exercise, eye movements, and head movements.
或,步骤S3中设定每一部位运动相对应的权值的另一优选实施方式为根据不同应用场景自动进行部位运动的权值调整而设定的,具体做法:在某一种场景下,收集待测人脸的各种部位运动的正常输入视频作为正样本,攻击视频作为负样本,取(正样本通过数+负样本拒绝数)/(正样本总数+负样本总数)作为该部位运动的准确率,然后把每一部位运动的准确率按照从大到小的顺序进行排序,每一部位运动的权重也按照此顺序从大到小,重新调整每一部位运动的权重。重新调整后的权重用以计算活体识别分值,该识别结果可以自适应不同场景下的部位运动检测的准确率,增加本实施例的活体识别结果的准确率。Or, another preferred embodiment for setting the weight corresponding to the motion of each part in step S3 is set by automatically performing weight adjustment of the part motion according to different application scenarios, in a specific scenario: Collect the normal input video of the motion of various parts of the face to be tested as a positive sample, and attack the video as a negative sample, taking (positive sample pass number + negative sample reject number) / (positive sample total + negative sample total) as the part motion The accuracy rate, then the accuracy of each part of the movement is sorted in descending order, the weight of each part of the movement is also in this order from large to small, to re-adjust the weight of each part of the movement. The re-adjusted weight is used to calculate the living body recognition score, and the recognition result can adapt the accuracy of the part motion detection in different scenarios, and increase the accuracy of the living body recognition result of the embodiment.
上述两种设定每一部位运动相对应的权值的任一种优选实施方式均在本实施例的保护范围内。Any of the above two preferred embodiments for setting the weight corresponding to the motion of each part is within the scope of protection of the present embodiment.
在步骤S1检测待测人脸的嘴部运动、眼部运动和头部运动的情况,以及步骤S2获取待测人脸的每一部位运动对应的运动分值可以参照本发明一种活体识别方法的实施例一和实施例二中的检测待测人脸的嘴部运动、眼部运动和头部运动以及获取待测人脸的每一部位运动对应的运动分值的具体过程,此处不做赘述。除了上述实施方式外,本实施例三对嘴部运动和眼部运动的运动检测还可以采用其它替代的实施方式:The method for detecting the movement of the mouth of the face to be tested, the movement of the eye and the movement of the head in step S1, and the obtaining the motion score corresponding to the movement of each part of the face to be tested in step S2 may refer to a living body identification method of the present invention. The specific process of detecting the movement of the mouth of the face to be tested, the movement of the eye and the movement of the head, and the motion score corresponding to the movement of each part of the face to be tested, in the first embodiment and the second embodiment, Make a statement. In addition to the above embodiments, the third embodiment of the motion detection of the mouth movement and the eye movement can also adopt other alternative embodiments:
其中,对嘴部运动的检测过程的替代实施方式:对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测待测人脸的嘴部位置,并计算嘴部位置的灰度平均值;然后判断嘴部位置的灰度平均值是否小于预设嘴部灰度值判断阈值,若是,嘴部为闭合状态;若否,嘴部为张开状态。该替代实施方式利用嘴部张开露出牙齿,牙齿主要偏白色,则灰度值比较大,则嘴部张开的平均灰度值较大,嘴部闭合时平均灰度值较小的原理,通过计算嘴部的平均灰度值来识别嘴部状态,进而判断嘴部运动的情况。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的嘴部运动的运动情况为嘴部张开,并且有另外的部分帧确定的嘴部运动的运动情况为嘴部闭合,则判定嘴部有运动。Wherein, an alternative embodiment of the detection process of the mouth movement: the face video of the face to be tested detects the mouth position of the face to be tested for each video frame extracted by the preset number of frames, and calculates the mouth position The gray average value; then it is judged whether the gray level average value of the mouth position is smaller than the preset mouth gray value judgment threshold, and if so, the mouth is in a closed state; if not, the mouth is in an open state. The alternative embodiment utilizes the principle that the mouth is opened to expose the teeth, the teeth are mainly white, and the gray value is relatively large, the average gray value of the mouth opening is large, and the average gray value is small when the mouth is closed, The state of the mouth is recognized by calculating the average gray value of the mouth, thereby determining the condition of the mouth movement. In each video frame of the face video extracted from the face to be tested, if the movement of the mouth movement determined by the partial frame is the mouth opening, and there is another partial frame determined movement of the mouth movement When the mouth is closed, it is determined that the mouth has motion.
对应地,该替代实施方式获取对应的嘴部运动的运动分值包括:判定嘴部有运动,获取的嘴部运动的运动分值为1分;否则判定嘴部无运动,获取的嘴部运动的运动分值为0分。 Correspondingly, the alternative embodiment obtains the motion score of the corresponding mouth motion, including: determining that the mouth has motion, and the obtained motion score of the mouth motion is 1 point; otherwise, determining that the mouth has no motion, the acquired mouth motion The exercise score is 0.
其中,对眼部运动的检测过程的另一替代实施方式:嘴部运动的运动情况除了嘴部张开和闭合外,还可以包括嘴角移动的嘴部运动情况,如人脸微笑时,两个嘴角会向脸颊两侧外扩。用得到的人脸68点模型中的关键点55表示左嘴角点,关键点49表示右嘴角点,根据待测人脸的人脸视频的第一帧的左右嘴角点为基准,计算后面抽取的若干视频帧的左嘴角点移动的距离和右嘴角点移动的距离,然后判断左嘴角点移动的距离和右嘴角点移动的距离是否同时大于预设阈值,若是,则判定嘴部运动的状态为微笑,若否,则判定嘴部运动的状态为正常状态。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的嘴部运动的运动情况为微笑状态,并且有另外的部分帧确定的嘴部运动的运动情况为正常状态,则判定嘴部有运动。Wherein, another alternative embodiment of the detection process of the eye movement: the movement of the mouth movement may include the movement of the mouth of the mouth angle, in addition to the mouth opening and closing, such as when the face is smiling, two The corners of the mouth will expand to the sides of the cheeks. The key point 55 in the obtained face 68 point model represents the left corner point, and the key point 49 represents the right corner point. Based on the left and right corner points of the first frame of the face video of the face to be tested, the back extraction is calculated. The distance moved by the left corner of the video frame and the distance moved by the right corner point, and then determines whether the distance moved by the left corner point and the distance moved by the right corner point are greater than a preset threshold, and if so, the state of the mouth motion is determined to be Smile, if not, determine that the state of mouth movement is normal. In each video frame of the face video extracted from the face to be tested, if the movement of the mouth movement determined by the partial frame is a smile state, and the movement of the mouth movement determined by the other partial frame is normal In the state, it is determined that the mouth has motion.
其中,对眼部运动的检测过程的一替代实施方式:识别对象为亚洲人进行说明:亚洲人一般眼部的眼珠颜色为黑色,眼皮颜色为黄色;对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测待测人脸的眼部位置,通过眼部位置确定眼珠位置;并计算眼珠位置的灰度平均值;然后判断眼珠位置的灰度平均值是否小于预设眼珠灰度值判断阈值,若是,眼部为睁开状态;若否,眼部为闭合状态。该替代实施方式利用检测眼部的眼珠位置在眼部睁眼闭眼的所检测的平均灰度值不同进行识别。一般亚洲人睁眼时眼部的眼珠位置的平均灰度值会比较小,眼睛闭合时,眼部的眼珠位置的平均灰度值灰度平均值会大。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的眼部运动的运动情况为眼部睁开,并且有另外的部分帧确定的眼部运动的运动情况为眼部闭合,则判定眼部有运动。Among them, an alternative embodiment of the detection process of eye movement: the identification object is Asian: the Asian eye color is black, the eyelid color is yellow; the face video of the face is pre-predicted Let each video frame extracted by the number of frames detect the eye position of the face to be tested, determine the position of the eye through the position of the eye, and calculate the average value of the gray of the eye position; then determine whether the average value of the gray of the eye position is less than Set the eyeball gray value judgment threshold. If yes, the eye is in the open state; if not, the eye is closed. This alternative embodiment utilizes the detection of the eyeball position of the eye to identify the difference in the detected average gray value of the closed eye of the eye. Generally, when the Asian eyes blink, the average gray value of the eyeball position of the eye will be relatively small, and when the eye is closed, the average gray value of the eyeball position of the eye will be large. In each video frame of the face video extracted from the face to be tested, if the movement of the eye movement determined by the partial frame is the eye opening, and there is another part of the frame determined movement of the eye movement When the eye is closed, it is determined that the eye has motion.
对应地,该替代实施方式获取对应的眼部运动的运动情况获取对应的运动分值包括:判定眼部有运动,获取的眼部运动的运动分值为1分;判定眼部无运动,获取的眼部运动的运动分值为0分。Correspondingly, the alternative embodiment obtains the motion condition of the corresponding eye movement, and obtains the corresponding motion score, including: determining that the eye has motion, and the obtained motion score of the eye motion is 1 point; determining that the eye has no motion, obtaining The motor score for the eye movement is 0.
其中,对眼部运动的检测过程的另一替代实施方式:对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测待测人脸的眼部的眼珠中心位置,并计算眼珠的中心位置在眼部中的相对位置;然后判断眼珠位置的中心位置在眼部中的相对位置与眼珠位置的中心位置在眼部中的正常相对位置的距离是否大于预设值,若是,眼珠位置不在正常位置,若否,眼珠位置在正常位置。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定的眼部运动的情况为眼珠位置不在正常位置,并且有另外的部分帧确定的眼部运动的情况为眼珠位置在正常位置,则待测人脸的眼部的运动情况为眼珠发生转动,即判定眼部有运动;否则判定眼部无运动。Wherein, another alternative embodiment of the detection process of the eye movement: the face video of the face to be tested detects the center position of the eye of the eye of the face to be tested for each video frame extracted by the preset number of frames, And calculating a relative position of the center position of the eyeball in the eye; and then determining whether the distance between the relative position of the center position of the eyeball position in the eye and the normal position of the center position of the eyeball position in the eye is greater than a preset value, If yes, the eyeball position is not in the normal position, and if not, the eyeball position is in the normal position. In each video frame of the face video extracted from the face to be tested, if the eye movement determined by the partial frame is that the eyeball position is not in the normal position, and the eye movement determined by the other partial frame is When the eyeball is in the normal position, the movement of the eye of the face to be tested is that the eyeball rotates, that is, the eye is determined to have motion; otherwise, the eye is determined to have no motion.
本实施例三的步骤S1中的检测待测人脸的部位运动还包括检测面部运动、眉毛运动和额头运动的至少一种,检测待测人脸的面部运动、眉毛运动和额头运动的过程包括:The detecting part motion of the face to be tested in step S1 of the third embodiment further includes detecting at least one of facial motion, eyebrow motion, and forehead movement, and the process of detecting facial motion, eyebrow motion, and forehead motion of the face to be tested includes :
其中,对面部运动的检测过程:确定待测人脸的眼部、嘴部和人脸区域;并计算眼部面积和嘴部面积之和与人脸区域面积的比值;然后判断该比值是否在预设范围值内,若是,表示人脸状态为正常状态,若否,表示人脸状态为鬼脸状态。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定面部的状态为鬼脸状态,并且有另外的部分帧确定面部的状态为正常状态,则判定面部有运动, 此处的面部运动包括鬼脸动作。本实施例定义鬼脸状态为人脸的眼部面积和嘴巴面积之和与人脸区域面积的比值超过预设范围值;否则为正常状态;当检测到人脸既有鬼脸状态也有正常状态,即可判定人脸有鬼脸动作,即面部有运动。示例计算眼部面积、嘴部面积和人脸区域面积:通过眼部长度乘以眼部宽度获取眼部面积,通过嘴部长度乘以嘴部宽度获取嘴部面积,通过人脸矩形框HI JK的面积获取人脸区域面积。Wherein, the process of detecting the facial motion: determining the eye, the mouth and the face region of the face to be tested; and calculating the ratio of the sum of the eye area and the mouth area to the area of the face region; and then determining whether the ratio is Within the preset range value, if yes, it indicates that the face state is normal, and if not, it indicates that the face state is a ghost face state. In each video frame of the face video extracted from the face to be tested, if a part of the frame determines that the state of the face is a ghost state, and another partial frame determines that the state of the face is a normal state, it is determined that the face has motion. The facial movement here includes ghost face movements. In this embodiment, the ratio of the sum of the eye area and the mouth area of the face to the area of the face area exceeds a preset range value; otherwise, it is a normal state; when it is detected that the face has both a ghost state and a normal state, It is determined that the face has a ghost face movement, that is, the face has motion. An example is to calculate the eye area, the mouth area, and the face area: the eye area is obtained by multiplying the eye length by the eye width, and the mouth area is obtained by multiplying the mouth length by the mouth width, through the face rectangle HI JK The area gets the area of the face area.
对应地,获取面部运动获得运动分值包括:面部有运动获取的面部运动的运动分值为1分;否则判定面部无运动,获取的面部运动的运动分值为0分。Correspondingly, obtaining the facial motion to obtain the exercise score includes: the facial score of the facial motion obtained by the motion is 1 point; otherwise, the facial motion is determined to be no motion, and the obtained facial motion has a motion score of 0.
其中,对眉毛运动的检测过程:用得到的人脸68点模型中的18-22这5个关键点表示右眉毛点,23-27这5个关键点表示左眉毛点;用数值拟合的方法拟合每一眉毛的曲线,并分别计算右眉毛的关键点20的曲率作为右眉毛特征值和计算左眉毛的关键点25的曲率作为左眉毛特征值,右眉毛特征值和左眉毛特征值的平均值为眉毛特征值;然后判断眉毛特征值是否大于预设阈值,若是,表示眉毛的情况为抖眉,若否,表示眉毛的情况为正常。在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧确定眉毛的状态为抖眉,并且有另外的部分帧确定眉毛的状态为正常,则判定眉毛有运动,否则判定眉毛无运动。Among them, the detection process of eyebrow movement: the 5 key points of 18-22 in the obtained 68-point model of the face represent the right eyebrow point, and the 5 key points of 23-27 represent the left eyebrow point; The method fits the curve of each eyebrow and calculates the curvature of the key point 20 of the right eyebrow as the characteristic value of the right eyebrow and the curvature of the key point 25 of the left eyebrow as the characteristic value of the left eyebrow, the characteristic value of the right eyebrow and the characteristic value of the left eyebrow. The average value is the eyebrow eigenvalue; then it is judged whether the eyebrow eigenvalue is greater than a preset threshold, and if so, the condition indicating the eyebrow is the eyebrow, and if not, the eyebrow is normal. In each video frame of the face video extracted from the face to be tested, if some frames determine that the state of the eyebrows is an eyebrow, and another partial frame determines that the state of the eyebrows is normal, it is determined that the eyebrows have motion, otherwise Determine that there is no movement of the eyebrows.
对应地,获取眉毛运动获得运动分值包括:判定眉毛有运动,获取的眉毛运动的运动分值为1分;判定眉毛无运动,获取的眉毛运动的运动分值为0分。Correspondingly, obtaining the eyebrow movement to obtain the exercise score includes: determining that the eyebrow has motion, and obtaining the exercise score of the eyebrow motion is 1 point; determining that the eyebrow has no motion, and obtaining the exercise score of the eyebrow motion is 0.
其中,对额头运动的检测过程:用得到的人脸68点模型确定额头位置,其中,确定额头然后用sobel算子计算额头区域的sobel值,取额头区域sobel值的方差作为额头皱纹值。此处的sobel值为以当前像素中心所包含的与卷积核大小相同的区域像素与竖直方向的卷积做卷积运算的结果值;在待测人脸的人脸视频的抽取的每一视频帧中,若有部分帧的额头皱纹值大于第一预设阈值,并且有另外的部分帧的额头皱纹值小于第二预设阈值时,则判定额头有运动;否则判定额头无运动。其中,示例确定额头区域位置:通常额头区域指的是人脸中眉毛以上的区域,基于此定义可以先获取的眉毛关键点位置,然后根据人脸矩形框与眉毛关键点位置来确定额头区域,如图3的矩形框HOPK所示。Among them, the detection process of the forehead movement: the forehead position is determined by the obtained 68-point model of the face, wherein the forehead is determined and then the sobel value of the forehead area is calculated by the sobel operator, and the variance of the sobel value of the forehead area is taken as the forehead wrinkle value. The sobel value here is the result of the convolution operation of the convolution of the pixel of the area containing the same size as the convolution kernel at the center of the current pixel; the extraction of the face video of the face to be tested In a video frame, if the forehead wrinkle value of the partial frame is greater than the first preset threshold, and the forehead wrinkle value of the other partial frame is less than the second predetermined threshold, it is determined that the forehead has motion; otherwise, the forehead is determined to have no motion. The example determines the position of the forehead area: usually the forehead area refers to the area above the eyebrow in the face of the face, based on this definition, the position of the eyebrow key point can be obtained first, and then the forehead area is determined according to the position of the face rectangle and the key point of the eyebrow. As shown in the rectangular box HOPK of Figure 3.
对应地,获取额头运动获得运动分值包括:判定额头有运动,获取的额头运动的运动分值为1分;判定额头无运动,获取的额头运动的运动分值为0分。Correspondingly, obtaining the forehead movement to obtain the exercise score includes: determining that the forehead has motion, and the obtained forehead motion has a motion score of 1; determining that the forehead has no motion, and obtaining the forehead motion has a motion score of 0.
在本实施例三中除上述根据每一部位运动的是否有运动的情况而直接获得一个是否有运动的运动分值的实施方式,还可以根据每一部位运动的运动程度而获取一个在0到1之间的运动分值,而不只是得1或者0这两个运动分值,该替代实施方式不仅能表示是否有运动,还能体现运动的程度。该替换实施式所实现的本实施例三也在本发明的保护范围内。In the third embodiment, in addition to the above-mentioned embodiment of whether or not there is a motion score according to whether or not the motion of each part is motioned, it is also possible to obtain a motion score of 0 according to the degree of motion of each part. The motion score between 1 and not just the two motion scores of 1 or 0. This alternative embodiment not only indicates whether there is motion, but also the degree of motion. The third embodiment implemented by this alternative embodiment is also within the scope of the present invention.
具体实施时,先对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧进行检测,获取人脸关键点,由此分别获取每一部位运动的关键点位置,由此对应部位的特征情况,根据若干视频帧的部位 的特征情况判断每一部位运动的运动情况,并获取对应的运动分值;接着计算上述得到每一部位运动分值进行加权后的总和,该总和表示活体识别分值;最后用该活体识别分值占活体识别总分的比值来计算活体识别置信度,其中,当活体识别置信度不小于预设值时,确定活体识别分值不小于预设阈值,从而判定待测人脸为活体;否则,判定待测人脸为非活体。In the specific implementation, the face video of the face to be tested is detected for each video frame extracted by the preset number of frames, and the key points of the face are acquired, thereby obtaining the key point positions of each part of the motion, thereby The characteristics of the corresponding part, according to the location of several video frames The characteristic condition determines the motion of each part of the motion, and obtains the corresponding motion score; then calculates the sum of the weighted each part of the motion score, and the sum represents the living body recognition score; and finally uses the living body identification score The value of the living body recognition total score is used to calculate the living body recognition confidence, wherein when the living body recognition confidence is not less than the preset value, it is determined that the living body recognition score is not less than the preset threshold, thereby determining that the face to be tested is a living body; otherwise , to determine that the face to be tested is not a living body.
本实施例三解决了现有技术中算法单一,安全性不高的问题,可扩展性强;对于待测人脸的部位运动的检测可以通过二维图像实现,对设备的硬件要求不高;另外,在本实施例三中采用对眼部运动、嘴部运动和头部运动的检测来进行活体识别,这几个部位的运动效果明显,运动判断的准确度高;同时扩展了面部运动、眉毛运动和额头运动这几个部位运动的检测,提高了识别结果的准确性;采用对不同部位运动加权再进行分数融合,活体识别准确度高;多种部位运动的检测,有利于提高安全性。The third embodiment solves the problem that the algorithm is single and the security is not high in the prior art, and the scalability is strong; the detection of the motion of the part of the face to be tested can be realized by the two-dimensional image, and the hardware requirement of the device is not high; In addition, in the third embodiment, the detection of eye movement, mouth movement and head movement is used to perform living body recognition, and the motion effects of these parts are obvious, the accuracy of motion judgment is high, and the facial motion is expanded. The detection of the movement of the eyebrows and forehead movements improves the accuracy of the recognition results; the weighting of the different parts is used to perform the score fusion, and the accuracy of the living body recognition is high; the detection of the movement of various parts is beneficial to improve the safety. .
本发明一种活体识别系统提供的实施例,参见图5,图5为本实施例的结构示意图,本实施例包括:An embodiment of the present invention provides a living body identification system. Referring to FIG. 5, FIG. 5 is a schematic structural diagram of the embodiment. The embodiment includes:
至少2个部位运动检测单元1,每一部位运动检测单元1用于检测待测人脸对应的部位运动的情况,图5中,部位运动检测单元1a和部位运动检测单元1b表示检测两不同部位运动的两部位运动检测单元1。At least two parts motion detecting unit 1, each part motion detecting unit 1 is used for detecting the motion of the part corresponding to the face to be tested. In FIG. 5, the part motion detecting unit 1a and the part motion detecting unit 1b indicate that two different parts are detected. The two-part motion detection unit 1 of the movement.
部位运动分值单元2,用于基于每一部位运动的情况获取待测人脸的每一部位运动对应的运动分值;The part motion score unit 2 is configured to obtain a motion score corresponding to each part of the motion of the face to be tested based on the motion of each part;
活体识别分值计算单元3,用于计算所获取的每一部位运动对应的运动分值加权后的总和,并将计算得到的总和作为活体识别分值;其中,活体识别分值计算单元3已预设与每一部位运动相对应的权值。The living body recognition score calculation unit 3 is configured to calculate the weighted sum of the motion scores corresponding to each part motion obtained, and use the calculated sum as a living body recognition score; wherein the living body recognition score calculation unit 3 has Preset the weight corresponding to each part of the movement.
活体判断单元4,用于判定活体识别分值不小于预设阈值的待测人脸为活体。The living body judging unit 4 is configured to determine that the human face to be tested whose living body recognition score is not less than a preset threshold is a living body.
其中,至少2个部位运动检测单元1对应检测的至少两部位运动包括眼部运动、嘴部运动、头部运动、眉毛运动、额头运动和面部运动中的至少两部位运动。The motion of at least two parts corresponding to the detected at least two parts of the motion detecting unit 1 includes at least two parts of the movements of the eye movement, the mouth movement, the head movement, the eyebrow movement, the forehead movement and the facial movement.
优选的,每一部位运动检测单元1包括:Preferably, each part of the motion detecting unit 1 comprises:
部位检测模块11,用于对待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测部位运动对应的部位关键点位置;The part detecting module 11 is configured to detect a key point position of the part corresponding to the movement of the part of each video frame extracted by the face video of the face to be tested;
部位运动情况获取模块12,用于通过抽取的每一视频帧的部位关键点位置的变化程度来确定部位运动的情况。The part motion condition obtaining module 12 is configured to determine the motion of the part by the degree of change of the position of the key point of each video frame extracted.
活体识别分值计算单元3中与每一部位运动相对应的权值为根据每一部位运动的明显度设定;或,活体识别分值计算单元3中与每一部位运动相对应的权值为根据在当前应用场景下每一部位运动的准确率设定。 The weight corresponding to the motion of each part in the living body recognition score calculation unit 3 is set according to the visibility of the motion of each part; or the weight corresponding to the motion of each part in the living body recognition score calculation unit 3 It is set according to the accuracy of the movement of each part in the current application scenario.
活体判断单元4包括:The living body judging unit 4 includes:
活体识别置信度计算模块41,用于通过活体识别分值占活体识别总分的比值计算待测人脸的活体识别置信度;The living body recognition confidence calculation module 41 is configured to calculate a living body recognition confidence of the face to be tested by using a ratio of the living body recognition score to the total score of the living body recognition;
活体判断模块42,用于当活体识别置信度不小于预设值时,确定活体识别分值不小于预设阈值,判定活体识别分值不小于预设阈值的待测人脸为活体。The living body judging module 42 is configured to determine that the living body recognition score is not less than a preset threshold when the living body recognition confidence is not less than the preset value, and determine that the living face whose living body recognition score is not less than the preset threshold is a living body.
具体实施时,首先,通过每一部位运动检测单元1的部位检测模块11检测所抽取的每一视频帧中对应部位的关键点位置,并通过运动分值获取模块12确定部位运动的运动情况,然后通过部位运动分值单元2基于部位运动的情况获取部位运动的运动分值;然后,通过活体识别分值计算单元3对获取的每一部位运动的运动分值进行加权后求和作为活体识别分值,最后,通过活体判断单元4的活体识别置信度计算模块41利用活体识别分值占活体识别总分的壁纸计算待测人脸的活体识别置信度,并通过活体判断模块42判定当计算所得的活体识别置信度不小于预设阈值的待测人脸为活体。In a specific implementation, first, the part detecting module 11 of each part of the motion detecting unit 1 detects the key point position of the corresponding part in each of the extracted video frames, and determines the motion of the part motion by the motion score obtaining module 12, Then, the motion score of the part motion is obtained by the part motion score unit 2 based on the motion of the part; then, the motion score of each part motion obtained by the vital body recognition score calculation unit 3 is weighted and summed as the living body recognition. In the last, the biometric recognition confidence calculation module 41 of the living body judging unit 4 calculates the biometric recognition confidence of the face to be tested using the wallpaper of the living body recognition score in the living body recognition score, and determines by the living body judging module 42 when calculating The obtained living body recognition confidence is not less than the preset threshold, and the face to be tested is a living body.
本实施例采用检测至少2个部位运动检测单元解决了现有技术中算法单一,安全性不高的问题,可扩展性强,且基于人脸的部位运动的检测可以通过二维图像实现,对硬件要求不高,另外,通过活体识别分值计算单元对不同部位运动加权再进行分数融合,活体识别准确度高,获得了活体识别准确率高、硬件要求低和安全性高的有益效果。In this embodiment, the detection of at least two parts motion detecting unit solves the problem that the algorithm in the prior art is single and the security is not high, and the scalability is strong, and the detection of the part motion based on the face can be realized by the two-dimensional image, The hardware requirements are not high. In addition, the living body recognition score calculation unit weights the motion of different parts and then performs score fusion. The accuracy of living body recognition is high, and the beneficial effects of high recognition accuracy, low hardware requirements and high safety are obtained.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。 The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It is the scope of protection of the present invention.

Claims (10)

  1. 一种活体识别方法,其特征在于,所述活体识别方法包括步骤:A living body identification method, characterized in that the living body identification method comprises the steps of:
    检测待测人脸的至少两部位运动的情况;Detecting the movement of at least two parts of the face to be tested;
    基于每一所述部位运动的情况获取所述待测人脸的每一部位运动对应的运动分值;Acquiring a motion score corresponding to each part of the motion of the face to be tested based on the motion of each of the parts;
    计算每一所述部位运动对应的运动分值加权后的总和,并将计算得到的所述总和作为活体识别分值;其中,每一所述部位运动已预设相应的权值;Calculating a weighted sum of the motion scores corresponding to each of the part motions, and using the calculated sum as a living body recognition score; wherein each of the part motions has preset a corresponding weight;
    判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。The face to be tested whose living body recognition score is not less than a preset threshold is determined to be a living body.
  2. 如权利要求1所述的一种活体识别方法,其特征在于,所述至少两部位运动包括眼部运动、嘴部运动、头部运动、眉毛运动、额头运动和面部运动中的至少两部位运动。A living body recognition method according to claim 1, wherein said at least two parts of motion include at least two parts of eye movement, mouth movement, head movement, eyebrow movement, forehead movement, and facial movement .
  3. 如权利要求1所述的一种活体识别方法,其特征在于,所述检测待测人脸的至少两部位运动的情况包括步骤:The living body identification method according to claim 1, wherein the detecting the movement of at least two parts of the face to be tested comprises the steps of:
    对所述待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测所述部位运动对应的部位关键点位置;Detecting a key point position of the part corresponding to the part motion for each video frame extracted by the face video of the face to be tested;
    通过所述抽取的每一视频帧的部位关键点位置的变化程度来确定所述部位运动的情况。The motion of the part is determined by the degree of change in the position of the key point of each of the extracted video frames.
  4. 如权利要求1所述的一种活体识别方法,其特征在于,每一所述部位运动相对应的权值为根据所述每一部位运动的明显度设定;或,每一所述部位运动相对应的权值为根据在当前应用场景下每一所述部位运动的准确率设定。A living body identification method according to claim 1, wherein a weight corresponding to each of said part movements is set according to a degree of visibility of said each part movement; or each of said part movements The corresponding weights are set according to the accuracy of each part of the motion in the current application scenario.
  5. 如权利要求1所述的一种活体识别方法,其特征在于,确定所述活体识别分值不小于预设阈值包括步骤:The living body identification method according to claim 1, wherein the determining that the living body recognition score is not less than a preset threshold comprises the steps of:
    通过所述活体识别分值占活体识别总分的比值计算所述待测人脸的活体识别置信度;Calculating, by the ratio of the living body recognition score to the total score of the living body recognition, the living body recognition confidence of the face to be tested;
    当所述活体识别置信度不小于预设值时,确定所述活体识别分值不小于预设阈值。When the living body recognition confidence is not less than a preset value, determining that the living body recognition score is not less than a preset threshold.
  6. 一种活体识别系统,其特征在于,所述活体识别系统包括: A living body identification system, characterized in that the living body identification system comprises:
    至少2个部位运动检测单元,每一所述部位运动检测单元用于检测待测人脸对应的部位运动的情况;At least two parts motion detecting units, each of the part motion detecting units is configured to detect a motion of a part corresponding to the face to be tested;
    部位运动分值获取单元,用于基于每一所述部位运动的情况获取所述待测人脸的每一部位运动对应的运动分值;a part motion score obtaining unit, configured to acquire a motion score corresponding to each part of the motion of the face to be tested based on the motion of each of the parts;
    活体识别分值计算单元,用于计算每一所述部位运动对应的运动分值加权后的总和,并将计算得到的所述总和作为活体识别分值;其中,所述活体识别分值计算单元已预设与每一所述部位运动相对应的权值;a living body recognition score calculation unit, configured to calculate a weighted sum of motion scores corresponding to each of the part motions, and use the calculated sum as a living body recognition score; wherein the living body recognition score calculation unit The weight corresponding to each of the part movements has been preset;
    活体判断单元,用于判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。The living body judging unit is configured to determine that the human face to be tested whose living body recognition score is not less than a preset threshold is a living body.
  7. 如权利要求6所述的一种活体识别系统,其特征在于,至少2个所述部位运动检测单元中对应检测的至少两所述部位运动包括眼部运动、嘴部运动、头部运动、眉毛运动、额头运动和面部运动中的至少两部位运动。A living body identification system according to claim 6, wherein at least two of said at least two of said part motion detecting units correspondingly detected movements including eye movement, mouth movement, head movement, eyebrows At least two parts of the movement, forehead movement and facial movement.
  8. 如权利要求6所述的一种活体识别系统,其特征在于,每一所述部位运动检测单元包括:A living body identification system according to claim 6, wherein each of said part motion detecting units comprises:
    部位检测模块,用于对所述待测人脸的人脸视频每隔预设帧数所抽取的每一视频帧检测所述部位运动对应的部位关键点位置;a part detecting module, configured to detect a key point position of the part corresponding to the part motion for each video frame extracted by the face video of the face to be tested;
    部位运动情况获取模块,用于通过所述抽取的每一视频帧的部位关键点位置的变化程度来确定所述部位运动的情况。The part motion condition obtaining module is configured to determine the motion of the part by the degree of change of the position of the key point of each part of the extracted video frame.
  9. 如权利要求6所述的一种活体识别系统,其特征在于,所述活体识别分值计算单元中与每一所述部位运动相对应的权值为根据所述每一部位运动的明显度设定;或,所述活体识别分值计算单元中与每一所述部位运动相对应的权值为根据在当前应用场景下每一所述部位运动的准确率设定。The living body identification system according to claim 6, wherein the weight corresponding to each of the part movements in the living body recognition score calculation unit is set according to the visibility of each part of the movement Or; the weight corresponding to each of the part motions in the living body recognition score calculation unit is set according to an accuracy rate of each of the part motions in the current application scenario.
  10. 如权利要求6所述的一种活体识别系统,其特征在于,所述活体判断单元包括:The living body identification system according to claim 6, wherein the living body determining unit comprises:
    活体识别置信度计算模块,用于通过所述活体识别分值占活体识别总分的比值计算所述待测人脸的活体识别置信度;a biometric recognition confidence calculation module, configured to calculate a living body recognition confidence of the human face to be tested by using a ratio of the living body recognition score to a living body recognition total score;
    活体判断模块,用于当所述活体识别置信度不小于预设值时,确定所述活体识别分值不小于预设阈值,判定所述活体识别分值不小于预设阈值的所述待测人脸为活体。 a living body judging module, configured to determine that the living body identification score is not less than a preset threshold when the living body recognition confidence is not less than a preset value, and determine that the living body recognition score is not less than a preset threshold The face is a living body.
PCT/CN2017/104612 2017-06-02 2017-09-29 Living body recognition method and system WO2018218839A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710406488.1 2017-06-02
CN201710406488.1A CN107358152B (en) 2017-06-02 2017-06-02 Living body identification method and system

Publications (1)

Publication Number Publication Date
WO2018218839A1 true WO2018218839A1 (en) 2018-12-06

Family

ID=60272209

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/104612 WO2018218839A1 (en) 2017-06-02 2017-09-29 Living body recognition method and system

Country Status (2)

Country Link
CN (1) CN107358152B (en)
WO (1) WO2018218839A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321849A (en) * 2019-07-05 2019-10-11 腾讯科技(深圳)有限公司 Image processing method, device and computer readable storage medium
CN111523344A (en) * 2019-02-01 2020-08-11 上海看看智能科技有限公司 Human body living body detection system and method
CN113221771A (en) * 2021-05-18 2021-08-06 北京百度网讯科技有限公司 Living body face recognition method, living body face recognition device, living body face recognition equipment, storage medium and program product

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740429A (en) * 2017-11-30 2019-05-10 沈阳工业大学 Smiling face's recognition methods based on corners of the mouth coordinate mean variation
CN107977640A (en) * 2017-12-12 2018-05-01 成都电科海立科技有限公司 A kind of acquisition method based on vehicle-mounted recognition of face image collecting device
CN108446690B (en) * 2018-05-31 2021-09-14 北京工业大学 Human face in-vivo detection method based on multi-view dynamic features
CN109582139A (en) * 2018-11-21 2019-04-05 广东智媒云图科技股份有限公司 A kind of machine is interactive to start triggering method and system
CN109784302B (en) * 2019-01-28 2023-08-15 深圳信合元科技有限公司 Face living body detection method and face recognition device
TWI734454B (en) * 2020-04-28 2021-07-21 鴻海精密工業股份有限公司 Identity recognition device and identity recognition method
CN111860455B (en) * 2020-08-04 2023-08-18 中国银行股份有限公司 Living body detection method and device based on HTML5 page

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440479A (en) * 2013-08-29 2013-12-11 湖北微模式科技发展有限公司 Method and system for detecting living body human face
CN104794464A (en) * 2015-05-13 2015-07-22 上海依图网络科技有限公司 In vivo detection method based on relative attributes
CN105224921A (en) * 2015-09-17 2016-01-06 桂林远望智能通信科技有限公司 A kind of facial image preferentially system and disposal route
CN105243378A (en) * 2015-11-13 2016-01-13 清华大学 Method and device of living body face detection on the basis of eyes information
CN105426815A (en) * 2015-10-29 2016-03-23 北京汉王智远科技有限公司 Living body detection method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100514353C (en) * 2007-11-26 2009-07-15 清华大学 Living body detecting method and system based on human face physiologic moving
CN104951730B (en) * 2014-03-26 2018-08-31 联想(北京)有限公司 A kind of lip moves detection method, device and electronic equipment
CN105989264B (en) * 2015-02-02 2020-04-07 北京中科奥森数据科技有限公司 Biological characteristic living body detection method and system
CN105335719A (en) * 2015-10-29 2016-02-17 北京汉王智远科技有限公司 Living body detection method and device
CN105243376A (en) * 2015-11-06 2016-01-13 北京汉王智远科技有限公司 Living body detection method and device
CN105740688B (en) * 2016-02-01 2021-04-09 腾讯科技(深圳)有限公司 Unlocking method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440479A (en) * 2013-08-29 2013-12-11 湖北微模式科技发展有限公司 Method and system for detecting living body human face
CN104794464A (en) * 2015-05-13 2015-07-22 上海依图网络科技有限公司 In vivo detection method based on relative attributes
CN105224921A (en) * 2015-09-17 2016-01-06 桂林远望智能通信科技有限公司 A kind of facial image preferentially system and disposal route
CN105426815A (en) * 2015-10-29 2016-03-23 北京汉王智远科技有限公司 Living body detection method and device
CN105243378A (en) * 2015-11-13 2016-01-13 清华大学 Method and device of living body face detection on the basis of eyes information

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111523344A (en) * 2019-02-01 2020-08-11 上海看看智能科技有限公司 Human body living body detection system and method
CN111523344B (en) * 2019-02-01 2023-06-23 上海看看智能科技有限公司 Human body living body detection system and method
CN110321849A (en) * 2019-07-05 2019-10-11 腾讯科技(深圳)有限公司 Image processing method, device and computer readable storage medium
CN110321849B (en) * 2019-07-05 2023-12-22 腾讯科技(深圳)有限公司 Image data processing method, device and computer readable storage medium
CN113221771A (en) * 2021-05-18 2021-08-06 北京百度网讯科技有限公司 Living body face recognition method, living body face recognition device, living body face recognition equipment, storage medium and program product
CN113221771B (en) * 2021-05-18 2023-08-04 北京百度网讯科技有限公司 Living body face recognition method, device, apparatus, storage medium and program product

Also Published As

Publication number Publication date
CN107358152A (en) 2017-11-17
CN107358152B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
WO2018218839A1 (en) Living body recognition method and system
CN108182409B (en) Living body detection method, living body detection device, living body detection equipment and storage medium
CN107346422B (en) Living body face recognition method based on blink detection
WO2020119450A1 (en) Risk identification method employing facial image, device, computer apparatus, and storage medium
JP5010905B2 (en) Face recognition device
KR20220150868A (en) Method of motion vector and feature vector based fake face detection and apparatus for the same
US8891819B2 (en) Line-of-sight detection apparatus and method thereof
CN103440479B (en) A kind of method and system for detecting living body human face
US11715231B2 (en) Head pose estimation from local eye region
CN106682578B (en) Weak light face recognition method based on blink detection
CN111767900B (en) Face living body detection method, device, computer equipment and storage medium
CN110223322B (en) Image recognition method and device, computer equipment and storage medium
US20210271865A1 (en) State determination device, state determination method, and recording medium
CN107330370B (en) Forehead wrinkle action detection method and device and living body identification method and system
JP6822482B2 (en) Line-of-sight estimation device, line-of-sight estimation method, and program recording medium
CN109978884A (en) More people&#39;s image methods of marking, system, equipment and medium based on human face analysis
Rezaei et al. 3D cascade of classifiers for open and closed eye detection in driver distraction monitoring
Singh et al. Lie detection using image processing
CN104008364A (en) Face recognition method
CN103544478A (en) All-dimensional face detection method and system
CN111860394A (en) Gesture estimation and gesture detection-based action living body recognition method
CN108108651B (en) Method and system for detecting driver non-attentive driving based on video face analysis
Zhang et al. A novel efficient method for abnormal face detection in ATM
WO2023068956A1 (en) Method and system for identifying synthetically altered face images in a video
CN113408389A (en) Method for intelligently recognizing drowsiness action of driver

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17911871

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 03.04.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17911871

Country of ref document: EP

Kind code of ref document: A1