The content of the invention
It is an object of the invention to provide a kind of human face in-vivo detection method and system based on silent formula, to solve above-mentioned lackPoint.
To achieve these goals, the present invention provides following technical scheme:
The invention provides a kind of human face in-vivo detection method based on silent formula, comprise the following steps:
Obtain decision model,
The decision model comprises at least:Face accounting, SVMs, mobile phone frame pattern and false proof model;
Multistage live body judgement is carried out to picture to be detected according to the decision model,
If it is determined that being face live body, then the picture input next stage to be detected is subjected to live body judgement, be otherwise determined asNon-face live body.
Above-mentioned human face in-vivo detection method, the acquisition of the face accounting comprise the following steps:
Position to obtain the face frame of the picture to be detected by Face datection;
Percentage of the area of the face frame in the area of the picture to be detected is calculated, as the faceAccounting.
Above-mentioned human face in-vivo detection method, the training of the SVMs comprise the following steps:
Collection obtains the positive negative sample clearly and obscured, and with the reflective reflective sample of minute surface;
Study is trained to the SVMs by above-mentioned sample, obtains Fuzzy Threshold and reflective threshold value.
Above-mentioned human face in-vivo detection method, the acquisition of the mobile phone frame pattern comprise the following steps:
Collection obtains the frame sample with bounding box features;
Deep learning is carried out according to the frame sample, obtains mobile phone frame pattern.
Above-mentioned human face in-vivo detection method, the acquisition of the false proof model comprise the following steps:
Collection obtains the dielectric sample with dielectric attribute;
Deep learning is carried out according to the dielectric sample, obtains false proof model.
Above-mentioned human face in-vivo detection method, picture to be detected progress live body judgement is included according to the face accounting followingStep:
Accounting threshold value is set, and the face accounting is compared with accounting threshold value;
If being more than or equal to the accounting threshold value, it is determined as face live body, and is inputted next stage and carries out live body judgement,If being less than the accounting threshold value, it is determined as non-face live body.
Above-mentioned human face in-vivo detection method, according to the SVMs to picture to be detected carry out live body judge include withLower step:
Laplace transform is carried out to the picture to be detected, and the mean square deviation of pixel value is calculated;
By the mean square deviation with by training Fuzzy Threshold that the SVMs obtains and reflective threshold value to be compared;
If being more than above-mentioned threshold value, it is determined as face live body, and is inputted next stage and carries out live body judgement, if less than upperThreshold value is stated, then is determined as face live body.
Above-mentioned human face in-vivo detection method, live body is carried out to picture to be detected according to the mobile phone frame pattern and judges to includeFollowing steps:
Judge whether there is mobile phone frame in the picture to be detected by the mobile phone frame pattern;
If nothing, it is determined as face live body, and is inputted next stage and carries out live body judgement, if so, is then determined as faceLive body.
Above-mentioned human face in-vivo detection method, picture to be detected progress live body judgement is included according to the false proof model followingStep:
Judge in the picture to be detected whether to be face in medium by the false proof model;
If it is not, being then determined as face live body, and it is inputted next stage and carries out live body judgement, if so, is then determined as inhumanFace live body.
In above-mentioned technical proposal, the invention provides the human face in-vivo detection method based on silent formula, has beneficial belowEffect:1) realize that detection speed is fast, and amount of calculation is small, cost is low, coordinates (silent formula), without by hardware device without userIt just can voluntarily carry out face In vivo detection;2) the face In vivo detection technology can be installed and mobile phone or electricity in the form of softwareBrain, and then face In vivo detection simply is realized, have a wide range of applications meaning;3) instructed by SVMs and deep learningPractice and obtain corresponding decision model, it is possible to achieve threshold value differentiates and two discriminant classifications, it is achieved thereby that entering to the face in photoRow live body judges;4) realize that multistage face live body judges by judgment models, and then realize that picture surface is analyzed, and improveThe confidence level that live body judges.
Present invention also offers a kind of face In vivo detection system based on silent formula, including:
Model acquiring unit, to obtain decision model,
The decision model comprises at least:Face accounting, SVMs, mobile phone frame and false proof model;
Judging unit, to carry out multistage live body judgement to picture to be detected according to the decision model,
If it is determined that being face live body, then the picture input next stage to be detected is subjected to live body judgement, be otherwise determined asNon-face live body.
In above-mentioned technical proposal, present invention also offers the face In vivo detection system based on silent formula, has with followingBeneficial effect:1) realize that detection speed is fast, and amount of calculation is small, cost is low, coordinates (silent formula), without being set by hardware without userIt is standby just voluntarily to carry out face In vivo detection;2) the system can be installed and mobile phone or computer, Jin Erjian in the form of softwareSingle realizes face In vivo detection, has a wide range of applications meaning;3) phase is obtained by SVMs and deep learning trainingThe decision model answered, it is possible to achieve threshold value differentiates and two discriminant classifications, sentences it is achieved thereby that carrying out live body to the face in photoIt is disconnected;4) realize that multistage face live body judges by judgment models, and then realize that picture surface is analyzed, and improve live body judgementConfidence level.
Embodiment
In order that those skilled in the art more fully understands technical scheme, below in conjunction with accompanying drawing to this hairIt is bright to be further detailed.
It is a kind of human face in-vivo detection method based on silent formula provided in an embodiment of the present invention as shown in Fig. 1,11, bagInclude following steps:
S101, decision model is obtained,
S1011, the decision model comprise at least:Face accounting, SVMs, mobile phone frame pattern and anti-pseudonormType;
The mode of the acquisition of decision model can be to be obtained by calculating, or by training grader to obtain.It is specific andSpeech, face accounting obtains by calculating area accounting of the face in whole photo, SVMs be by clearly obscuring,Minute surface it is reflective wait photo training grader and obtain, mobile phone frame pattern for by the photo training grader with mobile phone frame andObtain, false proof model is to be obtained by the photo training grader with medium;Above-mentioned each model is to be directed to In vivo detectionDuring the attack meanses being commonly encountered and the processing model generated, each means is filtered by above-mentioned model.It is preferred that, it is in the present embodiment the human face in-vivo detection method based on single width photo, when the sample to be detected of input is collection of photographsWhen, priority treatment is carried out to the picture inputted at first on the time according to input principle at first, then handle other pictures successively;When defeatedWhen the sample to be detected entered is video data, the image of each frame can be handled according to the playing sequence of video, until arriving video countsAccording to last frame embody;When the sample to be detected of input is single picture, is directly handled according to step, judge that it isNo is face live body.Further, to picture carry out attack meanses filtration treatment when, according to above-mentioned model order successivelyHandled.
As shown in Fig. 2 in step S101 and S1011, the acquisition of the face accounting comprises the following steps:
S201, position by Face datection to obtain the face frame of the picture to be detected;
S202, percentage of the area of the face frame in the area of the picture to be detected is calculated, as instituteState face accounting.
Specifically, be directed to some hand-held photos, identity card picture, the photo in work card photo or mobile phone etc., lead toCross the face accounting analyzed in above-mentioned photo and obtain a decision model;A photo to be detected is inputted, can be determined by Face datectionPosition is to the face frame position in the photo to be detected, then calculates the area of the face frame and account for the percentage of photo to be detected, asFace accounting.
As shown in figure 3, in step S101 and S1011, the training of the SVMs comprises the following steps:
S301, collection obtain clear and fuzzy positive negative sample, and with the reflective reflective sample of minute surface;
S302, study is trained to the SVMs by above-mentioned sample, obtains Fuzzy Threshold and reflective threshold value.
Specifically, for some attack meanses, for example human face photo, during the camera, common web takes the photographAs head does not have a focusing function, obtain picture and have distortion, smudgy, by gathering picture distortion, fuzzy positive negative sample, thenDepth training study is carried out to the SVMs, obtains Fuzzy Threshold;Attacked for papery photo, the liquid crystal such as mobile phone screenScreen attack, it is contemplated that above-mentioned attack meanses for photo reflective it is relatively good, the picture surface of acquisition has one layer of mirrorFace is reflective;Collection has reflective reflective sample, then depth training study is carried out to the SVMs, obtains reflective thresholdValue.Further, for photograph print, black-and-white photograph etc., because this kind of attack meanses have obvious color character, Wo MengenThe feature of this kind of attack is counted as a judgement according to pixel value.
As shown in figure 4, in step S101 and S1011, the acquisition of the mobile phone frame pattern comprises the following steps:
S401, collection obtain the frame sample with bounding box features;
S402, according to the frame sample carry out deep learning, obtain mobile phone frame pattern.
Specifically, this step is the reinforcement again for mobile phone attack, because some mobile phones attack picture face areaIt is very big, and reflecting effect also unobvious, but this kind of attack graph piece has mobile phone bounding box features, we pass through oneself shooting and receivedCollect the photo of mobile phone attack, using deep learning, train two disaggregated models, judge whether there is the presence of mobile phone in photo.
As shown in figure 5, in step S101 and S1011, the acquisition of the false proof model comprises the following steps:
S501, collection obtain the dielectric sample with dielectric attribute;
S502, according to the dielectric sample carry out deep learning, obtain false proof model.
Specifically, by collecting various photograph prints, mobile phone screen do not have the photo of frame, computer screen photo etc. theseDifferent medium, learn the feature of dielectric surface by deep learning, obtain a false proof model, and then judge that the face in photo isFace in true man's face or these media.
S102, multistage live body judgement carried out to picture to be detected according to the decision model,
S1021, if it is determined that be face live body, then the picture input next stage to be detected is subjected to live body judgement, otherwiseIt is determined as non-face live body.
As shown in fig. 6, in step S102 and S1021, live body is carried out to picture to be detected according to the face accounting and sentencedIt is disconnected to comprise the following steps:
S601, setting accounting threshold value, and the face accounting is compared with accounting threshold value;
If S602, being more than or equal to the accounting threshold value, it is determined as face live body, and is inputted next stage and carries out live bodyJudge, if being less than the accounting threshold value, be determined as non-face live body.
Specifically, as preferable in the present embodiment, accounting threshold value set according to the photo of different resolution, resolutionRate is bigger, and accounting threshold value is smaller, and as resolution ratio is into multiple increase, accounting threshold value can be in the reduction of identical multiple;ThanSuch as, for the photo of 320 × 240 this resolution ratio, if face accounts for the threshold value that screen gives than being less than us, it is determined as inhumanFace live body, we are just construed as attacking;If being more than the threshold value, be determined as face live body, then and enter next stage live bodyJudge.
As shown in fig. 7, in step S102 and S1021, live body is carried out to picture to be detected according to the SVMsJudgement comprises the following steps:
S701, Laplace transform is carried out to the picture to be detected, and the mean square deviation of pixel value is calculated;
S702, by the mean square deviation with by training Fuzzy Threshold that the SVMs obtains and reflective threshold value to carry outCompare;
If S703, being more than above-mentioned threshold value, it is determined as face live body, and is inputted next stage and carries out live body judgement, ifLess than above-mentioned threshold value, then it is determined as face live body.
Specifically, by doing Laplace transform to photo to be detected, the picture after being converted, the photo is then calculatedThe mean square deviation of pixel value, by the mean square deviation with by training Fuzzy Threshold that the SVMs obtains and reflective threshold value to enterRow compares, if being more than above-mentioned threshold value, is determined as face live body, and is inputted next stage and carries out live body judgement, if less than upperThreshold value is stated, then is determined as face live body.
As shown in figure 8, in step S102 and S1021, picture to be detected is lived according to the mobile phone frame patternBody judges to comprise the following steps:
S801, by the mobile phone frame pattern judge whether there is mobile phone frame in the picture to be detected;
If S802, nothing, being determined as face live body, and it is inputted next stage and carries out live body judgement, if so, is then determined asFace live body.
As shown in figure 9, in step S102 and S1021, live body is carried out to picture to be detected according to the false proof model and sentencedIt is disconnected to comprise the following steps:
S901, by the false proof model judge in the picture to be detected whether to be face in medium;
S902, if it is not, be then determined as face live body, and be inputted next stage and carry out live body judgement, if so, being then determined asNon-face live body.
Specifically, the biopsy method in the present invention, at least require that all detections in above-mentioned steps will be by,The face just calculated in photo to be detected is determined as live body, has reached the confidence level lifting for being determined as face live body or non-face live bodyPurpose.Further, other decision models can also be introduced in an iterative manner, are carried out human body live body judgement, are made to be judged asThe confidence level of face live body or non-face live body is further lifted.
As shown in figure 11, as preferably, unlatching camera obtains a photo to be detected first, uses in the present embodimentFace datection detects face, obtains the position of face frame, calculates the ratio that human face region accounts for whole photo, obtains face accounting,Continue next judgement if the face accounting is more than accounting threshold value, if less than returning result non-living body if accounting threshold value;It is nextStep, according to the face frame detected before, face is intercepted, do Laplace transform, the image after calculating Laplace transformPixel value mean square deviation, compared with the Fuzzy Threshold and reflex threshold got continuously respectively with grandson, if both greater than above-mentioned threshold value, under continuingOne judgement, otherwise, returning result non-living body;Then, the photo to be detected is zoomed into certain yardstick, such as 64 × 64, lead toMobile phone frame pattern is crossed, is differentiated with the presence or absence of there is mobile phone frame in photo, if mobile phone frame in judgment result displays photo be present,Then returning result non-living body;If there is no mobile phone frame, continue the judgement of next step.The human face region picture that will be intercepted before,Incoming dielectric model, judgement are true man's picture or non-true man's picture of some attack types, returning result.Finally, treat for onePicture is detected all by above-mentioned judgement, is just calculated and is determined as face live body.
In above-mentioned technical proposal, a kind of human face in-vivo detection method based on silent formula provided by the invention, have followingBeneficial effect:
1) realize that detection speed is fast, and amount of calculation is small, cost is low, coordinates (silent formula), without by hardware without userEquipment just can voluntarily carry out face In vivo detection;
2) the face In vivo detection technology can install in the form of software with mobile phone or computer, and then simply realize peopleFace In vivo detection, has a wide range of applications meaning;
3) corresponding decision model is obtained by SVMs and deep learning training, it is possible to achieve threshold value differentiates and twoDiscriminant classification, it is achieved thereby that carrying out live body judgement to the face in photo;
4) realize that multistage face live body judges by judgment models, and then realize that picture surface is analyzed, and improve workThe confidence level that body judges.
As shown in Figure 10, it is a kind of face In vivo detection system based on silent formula provided in an embodiment of the present invention, including:Model acquiring unit, to obtain decision model, the decision model comprises at least:Face accounting, SVMs, mobile phone sideFrame and false proof model;Judging unit, to carry out multistage live body judgement to picture to be detected according to the decision model, if sentencingIt is set to face live body, then the picture input next stage to be detected is subjected to live body judgement, is otherwise determined as non-face live body.
Specifically, the mode of the acquisition of decision model can be to be obtained by calculating, or by training grader to obtain.Specifically, face accounting is obtained by calculating area accounting of the face in whole photo, and SVMs is by clearClear fuzzy, the photo training grader such as minute surface is reflective and obtain, mobile phone frame pattern is to pass through the photo training with mobile phone frameGrader and obtain, false proof model is obtains by the photo training grader with medium;Above-mentioned each model is to be directed toEach means was carried out by the attack meanses being commonly encountered during In vivo detection and the processing model generated by above-mentioned modelFilter.Preferably, it is in the present embodiment the human face in-vivo detection method based on single width photo, when the sample to be detected of input is photographDuring piece set, priority treatment is carried out to the picture inputted at first on the time according to input principle at first, then handle other figures successivelyPiece;When the sample to be detected of input is video data, the image of each frame can be handled according to the playing sequence of video, until arrivingThe last frame of video data embodies;When the sample to be detected of input is single picture, is directly handled, sentenced according to stepBreaking, whether it is face live body.Further, when carrying out the filtration treatment of attack meanses to picture, according to the suitable of above-mentioned modelSequence is handled successively.After obtaining face accounting, accounting threshold value is set, and the face accounting is compared with accounting threshold valueIt is right;If being more than or equal to the accounting threshold value, it is determined as face live body, and is inputted next stage and carries out live body judgement, if smallIn the accounting threshold value, then it is determined as non-face live body;Obscured, after reflective threshold value, the picture to be detected is drawnLaplace transform, and the mean square deviation of pixel value is calculated;By the mean square deviation and by training the SVMs to obtainFuzzy Threshold and reflective threshold value be compared;If being more than above-mentioned threshold value, it is determined as face live body, and be inputted next stageLive body judgement is carried out, if being less than above-mentioned threshold value, is determined as face live body;After obtaining mobile phone frame pattern, pass through the mobile phoneFrame pattern judges whether there is mobile phone frame in the picture to be detected;If nothing, it is determined as face live body, and be inputted downOne-level carries out live body judgement, if so, being then determined as face live body;After obtaining false proof model, institute is judged by the false proof modelWhether state in picture to be detected is face in medium;If it is not, then it is determined as face live body, if so, being then determined as non-face workBody.
In above-mentioned technical proposal, a kind of face In vivo detection system based on silent formula provided by the invention, have followingBeneficial effect:
1) realize that detection speed is fast, and amount of calculation is small, cost is low, coordinates (silent formula), without by hardware without userEquipment just can voluntarily carry out face In vivo detection;
2) the system can install in the form of software with mobile phone or computer, and then simply realize face In vivo detection,Have a wide range of applications meaning;
3) corresponding decision model is obtained by SVMs and deep learning training, it is possible to achieve threshold value differentiates and twoDiscriminant classification, it is achieved thereby that carrying out live body judgement to the face in photo;
4) realize that multistage face live body judges by judgment models, and then realize that picture surface is analyzed, and improve workThe confidence level that body judges.
Some one exemplary embodiments of the present invention are only described by way of explanation above, undoubtedly, for abilityThe those of ordinary skill in domain, without departing from the spirit and scope of the present invention, can be with a variety of modes to instituteThe embodiment of description is modified.Therefore, above-mentioned accompanying drawing and description are inherently illustrative, should not be construed as to the present inventionThe limitation of claims.