Specific embodiment
In order to which the technical solution of the application and advantage is more clearly understood, below in conjunction with attached drawing to the exemplary of the application
Embodiment is described in more detail, it is clear that described embodiment be only the application part of the embodiment rather than
The exhaustion of all embodiments.And in the absence of conflict, the feature in the embodiment and embodiment in the application can be mutual
It is combined.
Face recognition technology is directly acquired compared with other biological feature identification technique by camera, can be non-contact
Mode complete identification process, it is convenient and efficient, but also bring some information security issues, for example human face photo can be passed through
Or face video deception face identification system.
Based on this, the embodiment of the present application provides a kind of human face in-vivo detection method, and continuous collecting image is tracked in image
The face of each frame determines image as live body image, and when the tracking result of each frame face is same face, face In vivo detection
Pass through, by each frame face in lasting tracking image, effectively prevent substituting for another surreptitiously during face In vivo detection photo, video or
The deceptive practices of other people faces, by whether being that live body image judges to image, effectively prevent through human face photo or
Face video cheats the behavior of face identification system, realizes the function of distinguishing true man dummy, ensures information security.
Referring to Fig. 1, human face in-vivo detection method provided in this embodiment, including:
101, continuous collecting image.
102, track the face of each frame in image.
The specific implementation of this step includes but not limited to:
1, determine that each frame image whether there is human face region in image.
2, if there is no human face regions there are a frame, subsequent step is no longer performed, face In vivo detection does not pass through.Together
When, empty queue, which detects for subsequent human face action, and the foundation of the queue refers to step 104, by the queue into
The content of pedestrian's face motion detection refers to step 105.
3, otherwise, then track the human face region in each frame image.
The specific implementation for tracking the human face region in each frame image includes:
3.1, Face datection is carried out to the human face region of each frame image, obtains face characteristic.
Wherein, it is achieved by the following scheme and Face datection is carried out to the human face region of each frame image:
3.1.1, the face key point of the human face region of each frame image is extracted.
3.1.2, Face datection is carried out to the human face region of each frame image based on face key point.
3.2, the face characteristic of adjacent two needle is compared, determines whether front and rear two needles are same face.
In concrete practice, step 102 can be used trained human-face detector and carry out Face datection, for example, using and
Haar feature combination adaboost graders carry out Face datection or use the method for detecting human face based on deep learning, than
Face datection is such as carried out using faster-rcnn networks;After detecting face, can according to face characteristic carry out face tracking or
Person first extracts face key point, then is same face with two frames before and after guarantee to these key points into line trace.
103, if there are the non-same face of front and rear two frame, subsequent step is no longer performed, face In vivo detection does not pass through.
Meanwhile queue is emptied, which detects for subsequent human face action, and the foundation of the queue refers to step 104, leads to
The content for crossing queue progress human face action detection refers to step 105.
104, image detection is carried out to each frame in image.
The human face region of each frame image is detected, judges whether each frame is photo or video.
Since photo and video image are during secondary imaging, on the image details such as illumination, frame with real human face
There is deviation in imaging process, this step can be used such as the methods of deep learning image classification algorithms, realize to photo, video figure
As the differentiation with real human face.
For any frame image, if judging any frame image non-photograph or video, it is determined that any frame is examined by image
It surveys, it will be in the feature deposit queue of any frame image;If judge any frame image for photo or video, it is determined that any frame is not
By image detection, subsequent step is no longer performed, empties queue, face In vivo detection does not pass through.
Wherein, which detects for subsequent human face action, refers to step 105.
In addition, before step 105 is performed, meeting sending action content, user to be guided to be acted according to the movement content.
After sending action content, user makees the image acted and can be arrived in a step 101 by continuous collecting, by step 102
To step 104, associated picture is stored into queue, i.e., the image in queue includes the image after sending action content.
105, according to image detection as a result, carrying out human face action detection.
When in the queue, when the frame number of the image after sending action content reaches predetermined threshold value;To in the queue, sending out
The human face region of the image after movement content is sent to do face critical point detection;Determine face critical point detection result whether with action
Content matching.
If face critical point detection result is matched with movement content, it is determined that is detected by human face action.If face
Critical point detection result is mismatched with movement content, it is determined that is not detected by human face action.
Below by movement content for its human face action testing process is described for opening one's mouth.
If movement content is opens one's mouth, 1) in queue, each frame image after sending action content does the inspection of face key point
It surveys, specially:To in queue, each frame image after sending action content does normalized;According to face key point, at calculating
The distance between distance and lip up and down of lip in each frame image after reason.2) determine face critical point detection result whether with moving
Make content matching, specially:According to the distance between distance and lip up and down of lip in treated each frame image, lip is judged
Whether open;It determines that face critical point detection result is matched with movement content if lip opens, is detected by human face action.
Detection such as to the action opened one's mouth is normalized to continuous per frame image, according to face key point, is calculated up and down
Distance, in the time-continuing process opened one's mouth, between lip the transformation of distance be also in continuous state, thus judge lip
Opening and closing.
The wherein method of determination of movement content, including but not limited to:One group of random action built-up sequence is generated, prompts user
How much the step of completion corresponding actions composition, action can be applicable in scene according to specific, be increased and decreased.
By carrying out human face action detection to image, it can detect multiple human face actions and micro- expression, be subject to random groups
It closes, postsearch screening has been done to photo and video image.
106, determine whether image is live body image according to human face action testing result.
If detected by human face action, it is determined that image is live body image;
If it not being detected by human face action, it is determined that image non-living body image no longer performs subsequent step, empties queue,
Face In vivo detection does not pass through.
107, image is determined as live body image, and when the tracking result of each frame face is same face, face In vivo detection
Pass through.
The human face in-vivo detection method realized by above-mentioned steps 101 to 107 has following features:
1) since photo and video are when identifying, there are problems that secondary imaging, the identification image with normal person
Compared to there is deviation, it can be distinguished by using the methods of such as deep learning sorting algorithm, realize the filtering to photo and video.
2) by that doing face critical point detection per frame image in image, can identify and shake the head, nod, blinking, opening one's mouth, wrinkling
A variety of micro- facial expressions and acts such as eyebrow are subject to these action recognitions the mode of random combine, also can be to photo and video fraud situation
It is filtered.
The application is by every frame image, carrying out photo and video filtering, not passing through, then restart whole flow process;
To the sequential frame image by photo or video filtering, face motion detection is done, during detection, if there is nobody
Face, be not same face, detect image for photo or video, detection time is overtime situations such as, all restart live body
Testing process realizes the secondary filter to photo and video.It is double-deck in this way to examine, probability of false detection can be effectively reduced, is ensured
Face information authenticity.
Below by taking function shown in Fig. 2 is formed as an example, the human face in-vivo detection method provided the application is said again
It is bright.
1) continuous Face datection:
Face and locating human face region are detected the presence of, using track algorithm, prevents the switching of two people or people and photo
Switching.
2) photo, video detection:
Verify whether collected be photo or video, carries out screening and filtering.
3) human face action detects:
Judge whether user is normal operating, random action (shake the head, nod, open one's mouth) and micro- table are done by designated user
Feelings (blink, frown), prevent the attack of video attack, improper action.
Flow shown in Figure 3, for the face characteristic of adjacent multiframe is stored with queue.
1) by carrying out Face datection to every frame image and same face being tracked, if during detection, hair
It is not now that there are face loss for same face or centre, then restarts to detect, and empty the face characteristic queue of storage;
2) photo and video detection are carried out to the facial image detected, the situation of photo and video is filtered out, if deposited
It is photo or video in a frame, restarts, and empties the face characteristic queue of storage;If by detection, it is stored in people
Face feature buffer queue.
3) the continuous face characteristic sequence got from queue, does face motion detection, within the limited time, completes
Several groups of human face actions randomly generated by system.Only by more than Vivo Studies on Screening process, face recognition module can be just carried out.
Advantageous effect:
The embodiment of the present application, continuous collecting image track the face of each frame in image, determine image as live body image,
And the tracking result of each frame face be same face when, face In vivo detection passes through, pass through it is lasting tracking image in each frame
Face effectively prevent face In vivo detection to substitute the deceptive practices of photo, video or other people faces for another surreptitiously in the process, by being to image
It is no to be judged for live body image, it effectively prevent cheating the behavior of face identification system by human face photo or face video,
It realizes the function of distinguishing true man dummy, ensures information security.
Based on same design, the embodiment of the present application additionally provides a kind of electronic equipment, and referring to Fig. 4, electronic equipment includes:
Memory 401, one or more processors 402;And transmitting-receiving subassembly 403, memory, processor and transmitting-receiving group
Part 403 is connected by communication bus (be in the embodiment of the present application carried out using communication bus as I/O buses explanation);The storage
The instruction for performing following each steps is stored in medium:
Continuous collecting image;
Track the face of each frame in image;
Image is determined as live body image, and when the tracking result of each frame face is same face, face In vivo detection passes through.
Optionally, the face of each frame in image is tracked, including:
Determine that each frame image whether there is human face region in image;
If there are a frame, there is no human face regions, no longer perform subsequent step, face In vivo detection does not pass through;
Otherwise, then the human face region in each frame image is tracked.
Optionally, the human face region in each frame image is tracked, including:
Face datection is carried out to the human face region of each frame image, obtains face characteristic;
The face characteristic of adjacent two needle is compared, determines whether front and rear two needles are same face.
Optionally, Face datection is carried out to the human face region of each frame image, including:
Extract the face key point of the human face region of each frame image;
Face datection is carried out to the human face region of each frame image based on face key point.
Optionally it is determined that image is before live body image, further includes:
Image detection is carried out to each frame in image;
According to image detection as a result, carrying out human face action detection;
Determine whether image is live body image according to human face action testing result.
Optionally, image detection is carried out to each frame in image, including:
The human face region of each frame image is detected, judges whether each frame is photo or video.
Optionally, the human face region of each frame image is detected, after judging whether each frame is photo or video, is also wrapped
It includes:
For any frame image,
If judge any frame image non-photograph or video, it is determined that any frame is by image detection, by any frame image
Feature deposit queue in;
If judge any frame image for photo or video, it is determined that any frame is not by image detection, after no longer performing
Continuous step, empties queue, face In vivo detection does not pass through.
Optionally, it is further included according to image detection as a result, before carrying out human face action detection:
Sending action content;
Image in queue includes the image after sending action content.
Optionally, according to image detection as a result, carry out human face action detection, including:
When in queue, when the frame number of the image after sending action content reaches predetermined threshold value;
To in queue, the human face region of the image after sending action content does face critical point detection;
Determine whether face critical point detection result matches with movement content.
Optionally, movement content is opens one's mouth;
To in queue, the human face region of the image after sending action content does face critical point detection, including:
To in queue, each frame image after sending action content does normalized;
According to face key point, the distance between distance and lip up and down of lip in each frame image after calculation processing;
Determine whether face critical point detection result matches with movement content, including:
According to the distance between distance and lip up and down of lip in treated each frame image, judge whether lip opens;
Determine that face critical point detection result is matched with movement content if lip opens.
Optionally, it is further included according to image detection as a result, after carrying out human face action detection:
If detected by human face action, it is determined that image is live body image;
If it not being detected by human face action, it is determined that image non-living body image no longer performs subsequent step, empties queue,
Face In vivo detection does not pass through.
Optionally, it is further included after the face of each frame in tracking image:
If there are the non-same face of front and rear two frame, subsequent step is no longer performed, empties queue, face In vivo detection is obstructed
It crosses.
It is understandable to be, in the specific implementation, for the basic object in order to realize the application, it is above-mentioned not necessarily
Right needs comprising above-mentioned transmitting-receiving subassembly 403.
Advantageous effect:
The embodiment of the present application, continuous collecting image track the face of each frame in image, determine image as live body image,
And the tracking result of each frame face be same face when, face In vivo detection passes through, pass through it is lasting tracking image in each frame
Face effectively prevent face In vivo detection to substitute the deceptive practices of photo, video or other people faces for another surreptitiously in the process, by being to image
It is no to be judged for live body image, it effectively prevent cheating the behavior of face identification system by human face photo or face video,
It realizes the function of distinguishing true man dummy, ensures information security.
In another aspect, the embodiment of the present application additionally provides a kind of calculating being used in combination with the electronic equipment including display
Machine program product, the computer program product include computer-readable storage medium and are embedded in computer program therein
Mechanism, the computer program mechanism include the instruction for performing following each steps:
Continuous collecting image;
Track the face of each frame in image;
Image is determined as live body image, and when the tracking result of each frame face is same face, face In vivo detection passes through.
Optionally, the face of each frame in image is tracked, including:
Determine that each frame image whether there is human face region in image;
If there are a frame, there is no human face regions, no longer perform subsequent step, face In vivo detection does not pass through;
Otherwise, then the human face region in each frame image is tracked.
Optionally, the human face region in each frame image is tracked, including:
Face datection is carried out to the human face region of each frame image, obtains face characteristic;
The face characteristic of adjacent two needle is compared, determines whether front and rear two needles are same face.
Optionally, Face datection is carried out to the human face region of each frame image, including:
Extract the face key point of the human face region of each frame image;
Face datection is carried out to the human face region of each frame image based on face key point.
Optionally it is determined that image is before live body image, further includes:
Image detection is carried out to each frame in image;
According to image detection as a result, carrying out human face action detection;
Determine whether image is live body image according to human face action testing result.
Optionally, image detection is carried out to each frame in image, including:
The human face region of each frame image is detected, judges whether each frame is photo or video.
Optionally, the human face region of each frame image is detected, after judging whether each frame is photo or video, is also wrapped
It includes:
For any frame image,
If judge any frame image non-photograph or video, it is determined that any frame is by image detection, by any frame image
Feature deposit queue in;
If judge any frame image for photo or video, it is determined that any frame is not by image detection, after no longer performing
Continuous step, empties queue, face In vivo detection does not pass through.
Optionally, it is further included according to image detection as a result, before carrying out human face action detection:
Sending action content;
Image in queue includes the image after sending action content.
Optionally, according to image detection as a result, carry out human face action detection, including:
When in queue, when the frame number of the image after sending action content reaches predetermined threshold value;
To in queue, the human face region of the image after sending action content does face critical point detection;
Determine whether face critical point detection result matches with movement content.
Optionally, movement content is opens one's mouth;
To in queue, the human face region of the image after sending action content does face critical point detection, including:
To in queue, each frame image after sending action content does normalized;
According to face key point, the distance between distance and lip up and down of lip in each frame image after calculation processing;
Determine whether face critical point detection result matches with movement content, including:
According to the distance between distance and lip up and down of lip in treated each frame image, judge whether lip opens;
Determine that face critical point detection result is matched with movement content if lip opens.
Optionally, it is further included according to image detection as a result, after carrying out human face action detection:
If detected by human face action, it is determined that image is live body image;
If it not being detected by human face action, it is determined that image non-living body image no longer performs subsequent step, empties queue,
Face In vivo detection does not pass through.
Optionally, it is further included after the face of each frame in tracking image:
If there are the non-same face of front and rear two frame, subsequent step is no longer performed, empties queue, face In vivo detection is obstructed
It crosses.
Advantageous effect:
The embodiment of the present application, continuous collecting image track the face of each frame in image, determine image as live body image,
And the tracking result of each frame face be same face when, face In vivo detection passes through, pass through it is lasting tracking image in each frame
Face effectively prevent face In vivo detection to substitute the deceptive practices of photo, video or other people faces for another surreptitiously in the process, by being to image
It is no to be judged for live body image, it effectively prevent cheating the behavior of face identification system by human face photo or face video,
It realizes the function of distinguishing true man dummy, ensures information security.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the application
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the application
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, those skilled in the art once know basic creation
Property concept, then additional changes and modifications may be made to these embodiments.So appended claims be intended to be construed to include it is excellent
It selects embodiment and falls into all change and modification of the application range.