CN116168428A - Face image living body detection method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN116168428A
CN116168428A CN202111404746.5A CN202111404746A CN116168428A CN 116168428 A CN116168428 A CN 116168428A CN 202111404746 A CN202111404746 A CN 202111404746A CN 116168428 A CN116168428 A CN 116168428A
Authority
CN
China
Prior art keywords
preset
action
face
image
living body
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111404746.5A
Other languages
Chinese (zh)
Inventor
林上青
蒋宁
杨洋
夏溧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongguancun Kejin Technology Co Ltd
Original Assignee
Beijing Zhongguancun Kejin Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhongguancun Kejin Technology Co Ltd filed Critical Beijing Zhongguancun Kejin Technology Co Ltd
Priority to CN202111404746.5A priority Critical patent/CN116168428A/en
Publication of CN116168428A publication Critical patent/CN116168428A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

The invention provides a human face image living body detection method, a device, computer equipment and a storage medium, wherein the method comprises the steps of acquiring at least two frames of continuous human face images of a user; amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification; extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm; detecting whether the action corresponding to the texture feature is matched with a preset action or not; and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image. The motion amplification is carried out on the face image at first, so that the extraction of the texture features of the face image is more accurate, whether the motion of the face is matched with the preset motion or not is detected according to the texture features, whether the face is a living body or not is detected accurately, and the accuracy of the living body detection of the face is improved effectively.

Description

Face image living body detection method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of human face image living body detection technology, and in particular, to a human face image living body detection method, device, computer equipment, and storage medium.
Background
With the rapid development of the mobile internet, network security is further paid attention to. When transacting business on the network, real-name authentication is required.
The general real-name authentication flow includes: identification card OCR (Optical Character Recognition ), in vivo detection, identity verification. The common living body detection mode comprises action living body detection and digital lip language identification, wherein an APP end adopts the action living body detection, and an H5 end adopts the digital lip language identification.
Whether through action living body recognition or lip language digital recognition mode, the final algorithm analysis is based on a two-dimensional picture, so that the accuracy of the existing face recognition technology is still lower for whether the camera is a real person or a photo.
With the increasing diversity of means and methods for counterfeiting and stealing the biological features of others for identity authentication, such as: photo printing, video replay attack, 3D face masks, etc. … … pose a serious threat to the security of real name authentication systems, affecting the fund and property security of users.
Based on the above reasons, an accurate face image living body detection scheme is urgently needed to improve the accuracy of living body detection and solve the risks and the loopholes existing in the real-name authentication link.
Disclosure of Invention
Based on the above, it is necessary to provide a face image living body detection method, apparatus, computer device, and storage medium in order to solve the above-mentioned technical problems.
A face image living body detection method, comprising:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
In one embodiment, the step of detecting whether the action corresponding to the texture feature matches the preset action includes:
determining the position coordinate value of at least one preset part of the facial organ in the enlarged image according to the texture characteristics;
comparing whether the displacement of the position coordinate values of the preset part in at least two frames of continuous amplified images is larger than a preset position offset threshold value or not;
When the displacement of the position coordinate value of the preset part is larger than a preset position deviation threshold, determining that the action of the facial organ is a first action, and when the displacement of the position coordinate value of the preset part is smaller than or equal to the preset position deviation threshold, determining that the action of the facial organ is a second action, and detecting whether the first action and the second action are matched with the preset action;
when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps:
and when the first action and/or the second action are matched with the preset action, judging that the face image is a living body image.
In one embodiment, the step of detecting whether the action corresponding to the texture feature matches the preset action includes:
determining position coordinate values of preset organs under the condition of a front face and the width of the face according to the texture characteristics;
determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the face condition;
detecting whether the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold value in at least two frames of continuous amplified images;
In the at least two continuous enlarged images, when the distance between the preset organ and the first side edge of the human face is smaller than a preset offset threshold, determining that the action of the human face is a third action, and when the distance between the preset organ and the second side edge of the human face is smaller than the preset offset threshold, determining that the action of the human face is a fourth action, and detecting whether the third action and the fourth action are matched with the preset action;
when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps:
and when the third action and/or the fourth action are matched with the preset action, judging that the face image is a living body image.
In one embodiment, the preset amplification algorithm comprises an euler motion algorithm.
In one embodiment, the preset feature extraction algorithm includes a directional optical flow histogram;
the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps:
and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
In one embodiment, the predetermined feature extraction algorithm comprises an LBP-TOP algorithm;
The step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps:
and extracting texture features of the amplified images of each frame based on the LBP-TOP algorithm.
In one embodiment, the method further comprises the steps of:
extracting face images of one frame from face images of users with continuous frames to serve as silence detection images;
detecting the silence detection image based on a preset silence living body detection algorithm, and detecting whether a face in the silence detection image is a living body or not;
when the face in the silence detection image is detected to be a living body, the face image is judged to be a living body image.
A face image living body detection apparatus comprising:
the face image acquisition module is used for acquiring face images of multiple continuous users;
the motion amplifying module is used for amplifying the motion of the preset position in each face image by adopting a preset amplifying algorithm to obtain a plurality of frames of continuous amplified images after motion amplification;
the texture feature extraction module is used for extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
the action detection module is used for detecting whether the action corresponding to the texture feature is matched with a preset action or not;
And the living body image judging module is used for judging that the face image is a living body image when the action corresponding to the texture feature is matched with the preset action.
A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor when executing the computer program performs the steps of:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
Extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
According to the method, the device, the computer equipment and the storage medium for detecting the human face image living body, the human face image is subjected to motion amplification, so that the texture features of the human face image are extracted more accurately, whether the actions of the human face are matched with the preset actions or not is detected according to the texture features, whether the human face is a living body or not is detected accurately, and the accuracy of detecting the human face living body is improved effectively.
Drawings
FIG. 1 is a schematic view of an application scenario of a face image living body detection method in an embodiment;
FIG. 2A is a flow chart of a face image in-vivo detection method in one embodiment;
FIG. 2B is a flowchart of a face image in-vivo detection method according to another embodiment;
FIG. 3 is a block diagram of a face image living body detection apparatus in one embodiment;
FIG. 4 is an internal block diagram of a computer device in one embodiment;
fig. 5 is a flowchart of a face image living body detection method in yet another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Example 1
The method for detecting the human face image living body can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, servers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers. The terminal 102 shoots a face image of the user through the camera, and sends the face image of the user to the server 104. The server 104 acquires face images of at least two continuous frames of users; amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification; extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm; detecting whether the action corresponding to the texture feature is matched with a preset action or not; and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
Example two
In this embodiment, as shown in fig. 2A, a method for detecting a living body of a face image is provided, which includes:
step 210, acquiring at least two frames of continuous face images of a user.
In this embodiment, a face of a user is photographed by a camera, and a face image of the user is obtained. And shooting a video for the user, wherein the video comprises a plurality of continuous frames of images, so that the face images of the continuous frames are obtained, and at least two continuous frames of face images of the user are obtained.
And 220, amplifying the motion of the preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification.
In this embodiment, the preset amplifying algorithm is used to amplify the motion of the preset position in the face image, so as to enhance and amplify the motion of the face, and facilitate the recognition of the motion of the face. The preset position may be a position on the face corresponding to an organ, such as the mouth, eyes, eyebrows, etc.
In this embodiment, a face image is detected by adopting a matching living body detection mode, and the face of the user acts according to a prompting action displayed by the terminal, such as mouth opening, head shaking, blink, and the like.
Step 230, extracting texture features of the enlarged image of each frame based on a preset feature extraction algorithm.
In this embodiment, a preset feature extraction algorithm is used to extract texture features in an image. In the last step, the texture features extracted in the step can be more accurate and more efficient by moving the enlarged image.
Step 240, detecting whether the action corresponding to the texture feature is matched with a preset action.
Specifically, when the face of the user is in motion, the texture features of the face images of the continuous multiframes obtained by shooting change along with the motion, so that the action corresponding to the texture features can be determined by detecting the texture features. The preset action is an action displayed on the terminal and used for prompting the user to make, or an action which needs the user to make in cooperation, such as mouth opening, head shaking, blink and the like. In this embodiment, whether the action corresponding to the texture feature is matched with the preset action is detected, and whether the user has performed the action with the same prompting action can be detected.
In some embodiments, detecting whether the action corresponding to the texture feature matches the preset action may also be implemented by detecting whether the texture feature matches a feature of the preset action, and when the texture feature matches the feature, it indicates that the action corresponding to the texture feature matches the preset action.
It should be understood that in this embodiment, whether the motion corresponding to the texture feature matches the preset motion may be detected, or whether the difference between the motion corresponding to the texture feature and the preset motion is smaller than a preset difference threshold.
And step 250, when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
In this embodiment, when the action corresponding to the texture feature matches with a preset action, the face image is determined to be a living body image, that is, the face of the face image provided by the user is a living body face, and the passing is determined. When the action corresponding to the texture feature is not matched with the preset action, the judgment is not passed, so that the false face image can be prevented from passing the identification, and illegal attack is prevented.
In the embodiment, the motion amplification is performed on the face image at first, so that the extraction of the texture features of the face image is more accurate, and whether the action of the face is matched with the preset action or not is detected according to the texture features, so that whether the face is a living body or not is accurately detected, and the accuracy of the living body detection of the face is effectively improved.
In one embodiment, the step of detecting whether the action corresponding to the texture feature matches the preset action includes: determining the position coordinate value of at least one preset part of the facial organ in the enlarged image according to the texture characteristics; comparing whether the displacement of the position coordinate values of the preset part in at least two frames of continuous amplified images is larger than a preset position offset threshold value or not; when the displacement of the position coordinate value of the preset part is larger than a preset position deviation threshold, determining that the action of the facial organ is a first action, and when the displacement of the position coordinate value of the preset part is smaller than or equal to the preset position deviation threshold, determining that the action of the facial organ is a second action, and detecting whether the first action and the second action are matched with the preset action; when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps: and when the first action and/or the second action are matched with the preset action, judging that the face image is a living body image.
In this embodiment, the facial organ is one of the five sense organs on the face, which may be eyes, mouth or nose, and the preset portion is a part on the facial organ, for example, the preset portion is an upper part or a lower part of the facial organ, in one embodiment, the preset portion includes an upper part, a lower part, a left side and a right side of the facial organ, and by comparing displacement of the preset portion in the enlarged images of consecutive frames, the action made by the facial organ is detected, and then whether the action makes an action matched with the preset action is detected, and when the first action and the second action made by the facial organ of the user are detected to be matched with the preset action, it is determined as a living body image.
It should be understood that, since the sizes of faces of different users are different and the proportions of organs on the faces are not equal, different preset positional deviation thresholds need to be set according to each user to improve the detection accuracy. In this embodiment, the preset position offset threshold is determined according to the size of an organ in the face image, in one embodiment, the position coordinate value of at least one preset portion of the face organ in the enlarged image is determined according to the texture feature, and the preset position offset threshold is determined according to the position coordinate values of each preset portion of the face organ in the enlarged image. In this way, the preset position deviation threshold value can be set according to the sizes of organs of different users, so that the detection accuracy is improved.
In one embodiment, the preset actions are opening and closing, the facial organ is the mouth, the preset part is four positions of the upper part, the lower part, the left side and the right side of the lips of the mouth, in this embodiment, according to the distances of the upper part and the lower part of the lips and the distances of the left side and the right side of the lips, the size of the lips is calculated, so that the preset position deviation threshold value is set according to the size of the lips, and then the detection process is as follows:
When the displacement of the upper position in the multi-frame continuous amplified images is larger than the set position deviation threshold, the displacement of the lower position in the multi-frame continuous amplified images is larger than the set position deviation threshold, the mouth is judged to be open, when the displacement of the upper position in the multi-frame continuous amplified images is smaller than the set position deviation threshold, the displacement of the lower position in the multi-frame continuous amplified images is smaller than the set position deviation threshold, the mouth is judged to be closed. In this embodiment, the first action is opening and the second action is closing.
For example, when the user's mouth is determined to be in the first and second motions, the user is determined to be open and closed, and thus, the user is determined to be a living body image in accordance with the preset motions. Otherwise, the image is not matched with the preset action, and the non-living body image is judged.
In one embodiment, the preset action is blinking, the facial organ is eyes, the preset part is four positions of the upper part, the lower part, the left side and the right side of the eyes, in this embodiment, according to the upper part and the lower part of the eyes and the left side and the right side of the eyes, the size of the eyes is calculated, so that the preset position deviation threshold value is set according to the size of the eyes, and then the detection process is as follows:
When the displacement of the upper position in the plurality of continuous amplified images is larger than the set position deviation threshold, the displacement of the lower position in the plurality of continuous amplified images is larger than the set position deviation threshold, the eye opening is judged, when the displacement of the upper position in the plurality of continuous amplified images is smaller than the set position deviation threshold, the displacement of the lower position in the plurality of continuous amplified images is smaller than the set position deviation threshold, the eye closing is judged. In this embodiment, the first action is eye opening and the second action is eye closing.
For example, when the movement of the eyes of the user is determined as the first movement and the second movement, the eye is determined as blinking, and thus, the eye is determined as a living body image in accordance with the preset movement. Otherwise, the image is not matched with the preset action, and the non-living body image is judged.
In one embodiment, the step of detecting whether the action corresponding to the texture feature matches the preset action includes: determining position coordinate values of preset organs under the condition of a front face and the width of the face according to the texture characteristics; determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the face condition; detecting whether the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold value in at least two frames of continuous amplified images; in the at least two continuous enlarged images, when the distance between the preset organ and the first side edge of the human face is smaller than a preset offset threshold, determining that the action of the human face is a third action, and when the distance between the preset organ and the second side edge of the human face is smaller than the preset offset threshold, determining that the action of the human face is a fourth action, and detecting whether the third action and the fourth action are matched with the preset action; when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps: and when the third action and/or the fourth action are matched with the preset action, judging that the face image is a living body image.
In this embodiment, under the condition of a front face, the face of the user faces the camera, the face of the user in the face image is the front face, and when the user rotates the head or shakes the head, the face in the face image is the side face. The preset organ is one of the organs (five sense organs) on the face, the preset organ is located in the middle of two sides of the face, and the preset organ is a nose, glasses or mouth.
In this embodiment, when the nose is in a face, the distance between the nose tip of the nose and both sides of the face may be regarded as equal, and therefore, the width of the face may be determined based on the position coordinate value of the left side of the face and the position coordinate value of the right side of the face, and the distance between the nose and the left side and the distance between the nose and the right side may be determined based on the position coordinate value of the nose tip of the nose and the width of the face.
It should be understood that, since the sizes of faces of different users are different and the proportions of organs on the faces are not equal, different preset offset thresholds need to be set according to each user to improve the detection accuracy. In this embodiment, the preset offset threshold is determined according to the width of the face, in one embodiment, the preset offset threshold is one third to one fourth of the width of the face, when the user shakes the head, the face deflects, and thus the distance between the nose and the edges on both sides also changes, therefore, when the distance between the preset organ and the right edge of the face is smaller than one third of the width of the face, the user is judged to turn the face to the right or shake the head, when the distance between the preset organ and the left edge of the face is smaller than one third of the width of the face, the user is judged to turn the face to the left or shake the head, and whether the face image is a living body image or not is detected by detecting whether the shaking motion and the shaking direction of the user are matched with the preset motion.
For example, when the motion of the face of the user is determined to be the third motion and the fourth motion, the preset motion is determined to be the left motion and the right motion, and thus the motion matches the preset motion, and the living body image is determined. Otherwise, the image is not matched with the preset action, and the non-living body image is judged.
In one embodiment, the preset amplification algorithm comprises an euler motion algorithm.
It should be appreciated that in each frame of image of the video, the small motion may be represented in a change in pixels, although not visible to the human eye. The euler algorithm is just to approximate the substitution of the amplified motion by amplifying the change in brightness. In this embodiment, an euler motion algorithm is adopted to amplify the motion of the preset position in each face image, and the specific process of the euler motion algorithm is as follows:
a. spatial decomposition: and establishing a Laplacian or Gaussian pyramid for each frame of input face image, wherein different levels have different spatial frequencies and signal to noise ratios, and the spatial frequencies are gradually reduced from top to bottom.
b. Time domain filtering: and selecting a fixed pixel point in the face image, and taking the change of the brightness of the fixed pixel point along with time as an input signal to carry out Fourier transform to a frequency domain.
c. Amplifying: and amplifying each stage by the time domain filtered part, and superposing the amplified part to the part before the time domain filtering.
d. Reconstruction: and reconstructing the pyramid after amplifying each stage to obtain a final amplified image.
In this embodiment, by using the euler motion algorithm, the motion of the face image can be accurately amplified, so that the fine motion is easier to identify, thereby being beneficial to improving the precision and efficiency of the subsequent extraction of the texture features.
In one embodiment, the preset feature extraction algorithm includes a directional optical flow histogram; the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps: and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
In this embodiment, the direction optical flow histogram can accurately identify the micro-expression in the face image, so that the texture feature can be accurately extracted from the enlarged image.
In one embodiment, the predetermined feature extraction algorithm comprises an LBP-TOP (Local Binary Pattern from Three Orthogonal Planes) algorithm; the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps: and extracting texture features of the amplified images of each frame based on the LBP-TOP algorithm.
In this embodiment, the LBP-TOP can effectively process illumination changes of a video or an image sequence, and is used for identifying dynamic textures of the video or the image sequence, and facial expression identification can be performed based on the video or the image sequence, so that texture features can be accurately extracted from an enlarged image.
In one embodiment, the preset feature extraction algorithm comprises a directional optical flow histogram and an LBP-TOP algorithm; the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps: and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram and the LBP-TOP algorithm.
In this embodiment, the directional optical flow histogram and the LBP-TOP algorithm are adopted at the same time to extract texture features from the enlarged image of each frame, so that the extraction accuracy of the texture features can be effectively improved.
In one embodiment, as shown in fig. 2B, the face image living body detection method further includes:
step 260, extracting a face image of one frame from face images of users with continuous frames as a silence detection image.
Step 270, detecting whether the face in the silence detection image is a living body or not based on a preset silence living body detection algorithm.
And 280, when the face in the silence detection image is detected to be a living body, judging that the face image is a living body image.
In this embodiment, the living body detection method adopted is a silent living body detection method, which is also called non-cooperative detection. The preset silence living body detection algorithm comprises an infrared image living body detection algorithm, a 3D structured light living body detection algorithm and an RGB image living body detection algorithm. In this embodiment, a preset silence living body detection algorithm is adopted as the RGB image living body detection algorithm.
In this embodiment, an RGB image living body detection algorithm is used to detect the silence detection image, and detect whether the face in the silence detection image is a living body, where the process is to determine whether the face in the silence detection image is a living body by analyzing and collecting information of face images such as moire, imaging deformity, reflectivity, and the like.
It should be noted that, in this embodiment, the silence living body detection method may be combined with the cooperation living body detection method in the above embodiment, and by combining the silence living body detection method with the cooperation living body detection method, the detection accuracy of the living body can be effectively improved. In addition, the silence living body detection method and the matched living body detection method can be executed sequentially or simultaneously, and the face image of the user is judged to be the living body image if and only if the two detection results are living bodies. That is, steps 260 to 280 may be performed after step 250, may be performed after step 210, before step 220, or steps 260 to 280 may be performed simultaneously with steps 220 to 250 after step 210.
In one embodiment, after step 250, steps 260 through 280 are performed. After the face image is determined to be the living body image by the step 250 of the coordinated living body detection, the silence detection image is detected by the RGB image living body detection algorithm, and living body detection is performed twice, so that the accuracy of living body detection is improved.
Example III
In this embodiment, for a user entering a living body detection process, first, coordinated motion activity detection is performed, a display screen prompts the user to perform coordinated motion, and in a random "mouth opening, head shaking and blink" motion process, a front camera of a mobile phone of the user is adjusted to continuously capture a plurality of pictures, and then algorithm processing is performed on the obtained pictures. As shown in fig. 5, the steps are as follows:
1) Calling a mobile phone camera to acquire a plurality of continuous user face images;
2) Amplifying the motion of the corresponding position of the face in the sequence picture, namely amplifying the motion vector in the found time period, and then overlapping the weight values. Mainly through Euler motion algorithm:
a. spatial decomposition-a laplacian or gaussian pyramid is built for each frame of an input picture, different levels have different spatial frequencies and signal to noise ratios, and the spatial frequencies are gradually reduced from top to bottom.
b. Time domain filtering: for a certain fixed pixel, the change of the brightness with time is used as an input signal to carry out Fourier transform to the frequency domain.
c. Amplifying: and amplifying each stage by the time domain filtered part, and superposing the amplified part to the part before the time domain filtering.
d. Reconstruction: and reconstructing the pyramid after amplifying each stage to obtain a final amplified sequence image.
3) And extracting the texture characteristics of each frame of picture of the user through the directional optical flow histogram and LBP-TOP, and judging whether the action of the texture characteristics is consistent with the required action or not:
opening the mouth: finding out the positions of the upper, lower, left and right lips of the mouth through facial features, obtaining a proportion through the absolute distance between the upper, lower, left and right, setting a threshold value, and opening the mouth when the threshold value is larger than the threshold value and closing the mouth when the threshold value is smaller than the threshold value;
blinking: the method comprises the steps of finding out the positions of the eyes up, down, left and right according to facial features, obtaining a proportion by the absolute distance between the eyes up, down/the absolute distance between the eyes left and right, setting a threshold value, and opening eyes if the threshold value is larger than the threshold value and closing eyes if the threshold value is smaller than the threshold value;
shaking head: three points are needed to measure the shake of the left and right faces: the absolute distance from the nose to the leftmost position is left, the absolute distance from the nose to the rightmost position is right, and the total distance on two sides of the face is w=left+right; when left < w/3, it is judged that the face sways leftwards, and when right < w/3, it is judged that the face sways rightwards, otherwise, the face is the front face.
4) When the texture feature action is judged to be consistent with the required action in the steps, the face picture is intercepted aiming at the user detected by the action living body, the RGB image silence detection is carried out on the face picture, the detail information such as the moire pattern, the reflection of the paper photo and the like which appear by combining the screen with shooting is judged, and the detection is completed after the living body image is judged.
It should be understood that, although the steps in the flowcharts of fig. 2A and 2B and the steps in the other embodiments are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2A and 2B may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed sequentially, and which may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps, such as the steps in fig. 2B may be performed after fig. 2A, may be performed before some of the steps in fig. 2A, or may be performed simultaneously with the steps in fig. 2A.
Example IV
In this embodiment, as shown in fig. 3, a living body detection device for a face image is provided, including:
a face image obtaining module 310, configured to obtain face images of multiple continuous users;
the motion amplifying module 320 is configured to amplify the motion of the preset position in each face image by using a preset amplifying algorithm, so as to obtain a multi-frame continuous amplified image after motion amplification;
a texture feature extraction module 330, configured to extract texture features of the enlarged image of each frame based on a preset feature extraction algorithm;
the motion detection module 340 is configured to detect whether a motion corresponding to the texture feature matches a preset motion;
and a living body image judging module 350, configured to judge that the face image is a living body image when the action corresponding to the texture feature matches with a preset action.
In one embodiment, the motion detection module comprises:
a position coordinate value determining unit, configured to determine a position coordinate value of at least one preset portion of a facial organ in the enlarged image according to the texture feature;
a position offset detection unit configured to compare whether a displacement of a position coordinate value of the preset portion in the at least two consecutive enlarged images is greater than a preset position offset threshold;
A first action determining unit configured to determine that an action of the facial organ is a first action when a displacement of the position coordinate value of the preset portion is greater than a preset position deviation threshold, determine that an action of the facial organ is a second action when the displacement of the position coordinate value of the preset portion is less than or equal to the preset position deviation threshold, and detect whether the first action and the second action are matched with the preset action;
the living body image judging module is used for judging that the face image is a living body image when the first action and/or the second action are matched with the preset action.
In one embodiment, the motion detection module comprises:
the frontal face parameter determining unit is used for determining position coordinate values of preset organs and the width of the human face under the frontal face condition according to the texture characteristics;
the preset offset threshold determining unit is used for determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the condition of the front face;
a distance detection unit, configured to detect whether a distance between the preset organ and a first side edge of the face is smaller than a preset offset threshold in at least two consecutive enlarged images;
A second motion determination unit, configured to determine, in the at least two consecutive enlarged images, that the motion of the face is a third motion when the distance between the preset organ and the first side edge of the face is less than a preset offset threshold, and determine that the motion of the face is a fourth motion when the distance between the preset organ and the second side edge of the face is less than the preset offset threshold, and detect whether the third motion and the fourth motion are matched with the preset motion;
the living body image judging module is used for judging that the face image is a living body image when the third action and/or the fourth action are matched with the preset action.
In one embodiment, the preset amplification algorithm comprises an euler motion algorithm.
In one embodiment, the preset feature extraction algorithm includes a directional optical flow histogram;
the texture feature extraction module is used for extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
In one embodiment, the predetermined feature extraction algorithm comprises an LBP-TOP algorithm;
the texture feature extraction module is used for extracting texture features of the enlarged image of each frame based on the LBP-TOP algorithm.
In one embodiment, the face image living body detection apparatus further includes:
the silence detection image extraction module is used for extracting face images of one frame from face images of users with continuous frames to serve as silence detection images;
the silence living body detection module is used for detecting the silence detection image based on a preset silence living body detection algorithm and detecting whether the face in the silence detection image is a living body or not;
and the living body image judging module is used for judging that the face image is a living body image when the face in the silence detection image is detected to be a living body.
The specific definition of the face image living body detection apparatus may be referred to the definition of the face image living body detection method hereinabove, and will not be described herein. The respective units in the above-described face image living body detection apparatus may be realized in whole or in part by software, hardware, and a combination thereof. The units can be embedded in hardware or independent of a processor in the computer equipment, and can also be stored in a memory in the computer equipment in a software mode, so that the processor can call and execute the operations corresponding to the units.
Example five
In this embodiment, a computer device is provided. The internal structure thereof can be shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the non-volatile storage medium is deployed with a database for storing face images of users. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used to communicate with other computer devices in which application software is deployed. The computer program, when executed by a processor, implements a face image living body detection method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
In one embodiment, the processor when executing the computer program further performs the steps of:
Determining the position coordinate value of at least one preset part of the facial organ in the enlarged image according to the texture characteristics;
comparing whether the displacement of the position coordinate values of the preset part in at least two frames of continuous amplified images is larger than a preset position offset threshold value or not;
when the displacement of the position coordinate value of the preset part is larger than a preset position deviation threshold, determining that the action of the face organ is a first action, when the displacement of the position coordinate value of the preset part is smaller than or equal to the preset position deviation threshold, determining that the action of the face organ is a second action, detecting whether the first action and the second action are matched with the preset action, and when the first action and/or the second action are matched with the preset action, determining that the face image is a living body image.
In one embodiment, the processor when executing the computer program further performs the steps of:
determining position coordinate values of preset organs under the condition of a front face and the width of the face according to the texture characteristics;
determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the face condition;
Detecting whether the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold value in at least two frames of continuous amplified images;
in the at least two continuous frames of enlarged images, when the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold, determining that the action of the face is a third action, when the distance between the preset organ and the second side edge of the face is smaller than the preset offset threshold, determining that the action of the face is a fourth action, detecting whether the third action and the fourth action are matched with the preset action, and when the third action and/or the fourth action are matched with the preset action, determining that the face image is a living body image.
In one embodiment, the preset amplification algorithm comprises an euler motion algorithm.
In one embodiment, the preset feature extraction algorithm includes a directional optical flow histogram; the processor when executing the computer program also implements the steps of:
and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
In one embodiment, the predetermined feature extraction algorithm comprises an LBP-TOP algorithm; the processor when executing the computer program also implements the steps of:
And extracting texture features of the amplified images of each frame based on the LBP-TOP algorithm.
In one embodiment, the processor when executing the computer program further performs the steps of:
extracting face images of one frame from face images of users with continuous frames to serve as silence detection images;
detecting the silence detection image based on a preset silence living body detection algorithm, and detecting whether a face in the silence detection image is a living body or not;
when the face in the silence detection image is detected to be a living body, the face image is judged to be a living body image.
Example six
In this embodiment, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
detecting whether the action corresponding to the texture feature is matched with a preset action or not;
And when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the position coordinate value of at least one preset part of the facial organ in the enlarged image according to the texture characteristics;
comparing whether the displacement of the position coordinate values of the preset part in at least two frames of continuous amplified images is larger than a preset position offset threshold value or not;
when the displacement of the position coordinate value of the preset part is larger than a preset position deviation threshold, determining that the action of the face organ is a first action, when the displacement of the position coordinate value of the preset part is smaller than or equal to the preset position deviation threshold, determining that the action of the face organ is a second action, detecting whether the first action and the second action are matched with the preset action, and when the first action and/or the second action are matched with the preset action, determining that the face image is a living body image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining position coordinate values of preset organs under the condition of a front face and the width of the face according to the texture characteristics;
Determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the face condition;
detecting whether the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold value in at least two frames of continuous amplified images;
in the at least two continuous frames of enlarged images, when the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold, determining that the action of the face is a third action, when the distance between the preset organ and the second side edge of the face is smaller than the preset offset threshold, determining that the action of the face is a fourth action, detecting whether the third action and the fourth action are matched with the preset action, and when the third action and/or the fourth action are matched with the preset action, determining that the face image is a living body image.
In one embodiment, the preset amplification algorithm comprises an euler motion algorithm.
In one embodiment, the preset feature extraction algorithm includes a directional optical flow histogram; the computer program when executed by the processor also performs the steps of:
and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
In one embodiment, the predetermined feature extraction algorithm comprises an LBP-TOP algorithm; the computer program when executed by the processor also performs the steps of:
and extracting texture features of the amplified images of each frame based on the LBP-TOP algorithm.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting face images of one frame from face images of users with continuous frames to serve as silence detection images;
detecting the silence detection image based on a preset silence living body detection algorithm, and detecting whether a face in the silence detection image is a living body or not;
when the face in the silence detection image is detected to be a living body, the face image is judged to be a living body image.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A human face image living body detection method, characterized by comprising the following steps:
acquiring face images of at least two continuous users;
amplifying the motion of a preset position in each face image by adopting a preset amplifying algorithm to obtain at least two frames of continuous amplified images after motion amplification;
extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
Detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and when the action corresponding to the texture feature is matched with a preset action, judging that the face image is a living body image.
2. The method of claim 1, wherein the step of detecting whether the action corresponding to the texture feature matches a preset action comprises:
determining the position coordinate value of at least one preset part of the facial organ in the enlarged image according to the texture characteristics;
comparing whether the displacement of the position coordinate values of the preset part in at least two frames of continuous amplified images is larger than a preset position offset threshold value or not;
determining the action of the facial organ as a first action when the displacement of the position coordinate value of the preset part is greater than a preset position deviation threshold, determining the action of the facial organ as a second action when the displacement of the position coordinate value of the preset part is less than or equal to the preset position deviation threshold, detecting whether the first action and the second action are matched with the preset action,
when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps:
And when the first action and/or the second action are matched with the preset action, judging that the face image is a living body image.
3. The method of claim 1, wherein the step of detecting whether the action corresponding to the texture feature matches a preset action comprises:
determining position coordinate values of preset organs under the condition of a front face and the width of the face according to the texture characteristics;
determining a preset offset threshold according to the position coordinate value of the preset organ and the width of the face under the face condition;
detecting whether the distance between the preset organ and the first side edge of the face is smaller than a preset offset threshold value in at least two frames of continuous amplified images;
in the at least two continuous enlarged images, when the distance between the preset organ and the first side edge of the human face is smaller than a preset offset threshold, determining that the action of the human face is a third action, and when the distance between the preset organ and the second side edge of the human face is smaller than the preset offset threshold, determining that the action of the human face is a fourth action, and detecting whether the third action and the fourth action are matched with the preset action;
when the action corresponding to the texture feature is matched with a preset action, the step of judging the face image as a living body image comprises the following steps:
And when the third action and/or the fourth action are matched with the preset action, judging that the face image is a living body image.
4. The method of claim 1, wherein the preset magnification algorithm comprises an euler motion algorithm.
5. The method of claim 1, wherein the predetermined feature extraction algorithm comprises a directional optical flow histogram;
the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps:
and extracting texture features of the enlarged image of each frame based on the direction optical flow histogram.
6. The method of claim 1, wherein the predetermined feature extraction algorithm comprises an LBP-TOP algorithm;
the step of extracting the texture features of the enlarged image of each frame based on a preset feature extraction algorithm comprises the following steps:
and extracting texture features of the amplified images of each frame based on the LBP-TOP algorithm.
7. The method as claimed in any one of claims 1 to 6, further comprising the step of:
extracting face images of one frame from face images of users with continuous frames to serve as silence detection images;
detecting the silence detection image based on a preset silence living body detection algorithm, and detecting whether a face in the silence detection image is a living body or not;
When the face in the silence detection image is detected to be a living body, the face image is judged to be a living body image.
8. A human face image living body detection apparatus, characterized by comprising:
the face image acquisition module is used for acquiring face images of multiple continuous users;
the motion amplifying module is used for amplifying the motion of the preset position in each face image by adopting a preset amplifying algorithm to obtain a plurality of frames of continuous amplified images after motion amplification;
the texture feature extraction module is used for extracting texture features of the amplified images of each frame based on a preset feature extraction algorithm;
the action detection module is used for detecting whether the action corresponding to the texture feature is matched with a preset action or not;
and the living body image judging module is used for judging that the face image is a living body image when the action corresponding to the texture feature is matched with the preset action.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202111404746.5A 2021-11-24 2021-11-24 Face image living body detection method, device, computer equipment and storage medium Pending CN116168428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111404746.5A CN116168428A (en) 2021-11-24 2021-11-24 Face image living body detection method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111404746.5A CN116168428A (en) 2021-11-24 2021-11-24 Face image living body detection method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116168428A true CN116168428A (en) 2023-05-26

Family

ID=86413666

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111404746.5A Pending CN116168428A (en) 2021-11-24 2021-11-24 Face image living body detection method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116168428A (en)

Similar Documents

Publication Publication Date Title
US10896518B2 (en) Image processing method, image processing apparatus and computer readable storage medium
US11783639B2 (en) Liveness test method and apparatus
US10699103B2 (en) Living body detecting method and apparatus, device and storage medium
Patel et al. Secure face unlock: Spoof detection on smartphones
Wen et al. Face spoof detection with image distortion analysis
CN108805047B (en) Living body detection method and device, electronic equipment and computer readable medium
Souza et al. How far did we get in face spoofing detection?
TWI686774B (en) Human face live detection method and device
Raja et al. Video presentation attack detection in visible spectrum iris recognition using magnified phase information
JP7165742B2 (en) LIFE DETECTION METHOD AND DEVICE, ELECTRONIC DEVICE, AND STORAGE MEDIUM
CN106372629B (en) Living body detection method and device
CN108549886A (en) A kind of human face in-vivo detection method and device
Deb et al. Look locally infer globally: A generalizable face anti-spoofing approach
Fourati et al. Anti-spoofing in face recognition-based biometric authentication using image quality assessment
WO2019137178A1 (en) Face liveness detection
WO2019033569A1 (en) Eyeball movement analysis method, device and storage medium
WO2016084072A1 (en) Anti-spoofing system and methods useful in conjunction therewith
CN109299658B (en) Face detection method, face image rendering device and storage medium
EP3644599A1 (en) Video processing method and apparatus, electronic device, and storage medium
WO2019033570A1 (en) Lip movement analysis method, apparatus and storage medium
JP7419080B2 (en) computer systems and programs
JP2007293438A (en) Device for acquiring characteristic quantity
CN111191521B (en) Face living body detection method and device, computer equipment and storage medium
CN110363111B (en) Face living body detection method, device and storage medium based on lens distortion principle
Nikitin et al. Face anti-spoofing with joint spoofing medium detection and eye blinking analysis

Legal Events

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