Summary of the invention
The object of the invention is to overcome the defect of prior art, propose and realized and a kind ofly can, when significantly improving processing speed, keep the facial image recognition method of better discrimination; The object of the invention is also to be provided for implementing the Face Image Recognition System of the method.
For achieving the above object, inventor's face image identifying method is first to set up user template storehouse, then identifies as follows: 1) gather facial image to be identified, 2) extract template to be identified, 3) user's recognition of face; In order to realize complete people's face identification system, need to provide the registration of user people's face and two major functions of recognition of face.
Described user's recognition of face is: first template contrast template to be identified with each user in user template storehouse, obtain the user list A1 that all similarity marks are greater than the first lower threshold, and by similarity mark, arrange from big to small; If A1 is sky, recognition failures, if first user's similarity mark is greater than upper limit threshold in A1, identify and successfully return to respective user, if no, carry out next step: 2-5 the template comparison template to be identified with each user in A1, obtain the user list A2 that all marks are greater than the second lower threshold, by similarity mark, arrange from big to small; If A2 is sky, recognition failures, if first user's similarity mark is greater than upper limit threshold in A2, identify and successfully return to respective user, if no, carry out next step: the 6-15 template contrast template to be identified with each user in A2, obtain the user list A3 that all similarity marks are greater than recognition threshold, if A3 is sky, recognition failures; By similarity mark, arrange from big to small, recognition function is returned to respective user;
Described user template storehouse is when registered user, user converts 5 kinds of attitudes, under each attitude, gather three two field pictures and extract feature templates, obtain 15 feature templates altogether, and sort by the method for concentrating select progressively to go out template from candidate template, the template that sequence is selected based on following two principle: A. represents the non-selected template going out as far as possible, and the candidate template of it and other has maximum similarity; B. the template of selecting is as far as possible away from the template having chosen, and it maintains minimum similarity with modeling plate;
Described upper limit threshold is greater than recognition threshold, and recognition threshold is greater than the second lower threshold, and the second lower threshold is greater than the first lower threshold.It has and can, when significantly improving processing speed, keep the advantage of better discrimination.
As optimization, after identifying successfully, if template to be identified and user's similarity mark are greater than while setting study threshold value than larger one of upper limit threshold, the template of current collection in worksite is treated to learning template learns as follows as one: to user template storehouse, import into and treat learning template, the template for the treatment of learning template and user's registration is formed to new template to be sorted, sequence: if last template is to treat learning template, learn unsuccessfully to return respective user, if no, remove last template, deposit database in, learning success returns to respective user.
As optimization, described setting study threshold value is 100.
As optimization, described the first lower threshold is 43, and upper limit threshold is that 90, the second lower thresholds are 60, and recognition threshold is 80.
As optimization, the sort method of described 15 feature templates is: select first template, make the similarity mark average of itself and other template maximum, then it is moved on in modeling plate, then select the second template, make the similarity mark average of itself and other template maximum, then it is moved on in modeling plate, then select the 3rd template, make the similarity mark average of itself and other template maximum, then it is moved on in modeling plate, the like until there is no candidate template.
As optimization, the similarity mark of selected template and other templates calculates and obtains according to following formula:
C=a1×c1-a2×c2;
In formula: c1 represents the similarity mark average of this template and other candidate template, c2 represents this template and the similarity mark average of modeling plate, and a1, a2 are two parameters.
As optimization, parameter a1 value is 5/9, and parameter a2 value is 4/9.
As optimization, described user template storehouse is built up through the following steps: 1) gather user's facial image, 2) extraction user characteristics template, 3) registered user;
Described 1) gather facial image to be identified and 1) gather user's facial image and be: use infrared LED lighting source to irradiate collected people's face, in gatherer process, also visible ray is filtered;
Described 2) extract template to be identified and 2) step of extracting user characteristics template successively: 1) detect people's face; 2) location eye position; 3) regular facial image; 4) assessment quality of human face image; 5) Gabor feature extraction.
As optimization, described 1) detecting people's face is: on integrogram, detect harr feature, then use AdaBoost algorithm to carry out the detection of people's face; Described 2) location eye position is: by the symmetry of people's face and the darker characteristic of the gray scale of position of human eye, orient in picture the people position of right and left eyes on the face; Described 3) regular facial image is: first, according to the position of right and left eyes, image is rotated, makes right and left eyes in same level line, the whole image of convergent-divergent then, the place normalization to of a right and left eyes fixing width; Further, according to the position of eyes, according to fixing width with highly intercept out the image of whole people's face; Finally image is carried out to local enhancement, in removal of images because the luminance difference that uneven illumination etc. produces; Finally obtain the image of people's face key position; Described 4) assessment quality of human face image is: in the processing procedure in the above image being normalized, calculate acutance, contrast and the gray level of image simultaneously, and these three indexs of having portrayed picture quality only have the threshold value separately that surpasses setting in advance just to carry out next step processing simultaneously; Described 5) Gabor feature extraction is: the image of one group of Two-Dimensional Gabor Wavelets base that we use N frequency range, a M direction after to normalization carries out filtering, thereby obtain the response energy of image under this group wavelet basis, after response energy is normalized, obtain last skin detection.
As optimization, described in obtain people's face key position image be: getting right and left eyes distance is 75 pixels, moves 35 pixels, the position of 38 pixels that move to left starts from above, and getting width is 151, is highly 151 image;
Described N >=8, M >=16.
For realizing the Face Image Recognition System of the method for the invention, be to use embedded microprocessor to connect as CPU (central processing unit), the CPU (central processing unit) of system the cmos sensor that gathers facial image, and the infrared illuminator that is aided with people's face realizes the use function under any light condition, adopt arrowband infrared fileter to filter the interference that visible ray is got rid of surround lighting.It is complete, a reliable face identification system, and its discrimination and recognition speed all reach gratifying level, can be applied in the systems such as work attendance, gate inhibition.Gather user's facial image aspect, a good system, the image of its collection should be got rid of interference and noise clear as far as possible, as far as possible, because this accuracy to identification is extremely important.Consider the service condition of a true application system, this system may be installed under various photoenvironments, even in night, use, so we can not depend on environment suitable, illumination uniformly can be provided.Based on this reason, in the present invention, specialized designs infrared LED lighting source solves this problem, simultaneously because infrared ray can not form harm to user, because its invisibility can not cause interference to user yet.
Adopt after technique scheme, inventor's face image identifying method carries out user's registration and identification, can effectively solve the low and slow problem of recognition speed of discrimination, and can be when significantly improving processing speed, its speed and discrimination all can reach commercial applications level.
Face Image Recognition System of the present invention has the use under any light condition of energy, can get rid of the interference that can fall surround lighting, good reliability, and discrimination and recognition speed all reach the advantage of satisfactory level.
Embodiment
As shown in Fig. 2-7, inventor's face image identifying method is first to set up user template storehouse, then identifies as follows: 1) gather facial image to be identified, 2) extract template to be identified, 3) user's recognition of face;
Described user's recognition of face is: first template contrast template to be identified with each user in user template storehouse, obtain the user list A1 that all similarity marks are greater than 43, and by similarity mark, arrange from big to small; If A1 is sky, recognition failures, if first user's similarity mark is greater than upper limit threshold 90 in A1, identify and successfully return to respective user, if no, carry out next step: 2-5 the template comparison template to be identified with each user in A1, obtain the user list A2 that all marks are greater than 60, by similarity mark, arrange from big to small; If A2 is sky, recognition failures, if first user's similarity mark is greater than upper limit threshold 90 in A2, identify and successfully return to respective user, if no, carry out next step: the 6-15 template contrast template to be identified with each user in A2, obtain the user list A3 that all similarity marks are greater than threshold value 80, if A3 is sky, recognition failures, by similarity mark, arrange from big to small, recognition function is returned to respective user;
Described user template storehouse is when registered user, user converts 5 kinds of attitudes, under each attitude, gather three two field pictures and extract feature templates, obtain 15 feature templates altogether, and sort by the method for concentrating select progressively to go out template from candidate template, the template that sequence is selected based on following two principle: A. represents the non-selected template going out as far as possible, and the candidate template of it and other has maximum similarity; B. the template of selecting is as far as possible away from the template having chosen, and it maintains minimum similarity with modeling plate.
After identifying successfully, when if template to be identified and user's similarity mark are greater than than the larger setting threshold 100 of described upper limit threshold 90, the template of current collection in worksite is treated to learning template learns as follows as one: to user template storehouse, import into and treat learning template, the template for the treatment of learning template and user's registration is formed to new template to be sorted, sequence: if last template is to treat learning template, learn unsuccessfully to return respective user, if no, remove last template, deposit database in, learning success returns to respective user.
The sort method of described 15 feature templates is: select first template, make the similarity mark average of itself and other template maximum, then it is moved on in modeling plate, select again the second template, make the similarity mark average of itself and other template maximum, then it is moved on in modeling plate, select again the 3rd template, make the similarity mark average of itself and other template maximum, then it moved on in modeling plate, the like until there is no candidate template.
The similarity mark of selected template and other templates calculates and obtains according to following formula:
C=a1×c1-a2×c2;
In formula: c1 represents the similarity mark average of this template and other candidate template, c2 represents this template and the similarity mark average of modeling plate, and a1, a2 are two parameters; Wherein parameter a1 value is 5/9, and parameter a2 value is 4/9.
Described user template storehouse is built up through the following steps: 1) gather user's facial image, 2) extraction user characteristics template, 3) registered user;
Described 1) gather facial image to be identified and 1) gather user's facial image and be: use infrared LED lighting source to irradiate collected people's face, in gatherer process, also visible ray is filtered;
Described 2) extract template to be identified and 2) step of extracting user characteristics template successively: 1) detect people's face; 2) location eye position; 3) regular facial image; 4) assessment quality of human face image; 5) Gabor feature extraction.
Described 1) detecting people's face is: on integrogram, detect harr feature, then use AdaBoost algorithm to carry out the detection of people's face; Described 2) location eye position is: by the symmetry of people's face and the darker characteristic of the gray scale of position of human eye, orient in picture the people position of right and left eyes on the face; Described 3) regular facial image is: first, according to the position of right and left eyes, image is rotated, makes right and left eyes in same level line, the whole image of convergent-divergent then, the place normalization to of a right and left eyes fixing width; Further, according to the position of eyes, according to fixing width with highly intercept out the image of whole people's face; Finally image is carried out to local enhancement, in removal of images because the luminance difference that uneven illumination etc. produces; Finally obtain the image of people's face key position; Described 4) assessment quality of human face image is: in the processing procedure in the above image being normalized, calculate acutance, contrast and the gray level of image simultaneously, and these three indexs of having portrayed picture quality only have the threshold value separately that surpasses setting in advance just to carry out next step processing simultaneously; Described 5) Gabor feature extraction is: the image of one group of Two-Dimensional Gabor Wavelets base that we use N frequency range, a M direction after to normalization carries out filtering, thereby obtain the response energy of image under this group wavelet basis, after response energy is normalized, obtain last skin detection.The image of the described people's of obtaining face key position is: getting right and left eyes distance is 75 pixels, moves 35 pixels, the position of 38 pixels that move to left starts from above, and getting width is 151, is highly 151 image; Described N >=8, M >=16.
More specifically: in order to realize complete people's face identification system, need to provide the registration of user people's face and two major functions of recognition of face.
Enrollment process, be the facial image gathering extract a feature templates (in biostatistics biometrics, term " template " and the biological characteristic extracting that template just refers to) after, be saved in database; And comparison process is that the facial image gathering is extracted after feature templates, the template of depositing in database during with registration is compared one by one, until find the template of coupling.
1, gather facial image
The key of these two functions, is the facial image that gathers user, and from this image, extracts the feature of people's face.Gather user's facial image aspect, a good system, the image of its collection should be got rid of interference and noise clear as far as possible, as far as possible, because this accuracy to identification is extremely important.Consider the service condition of a true application system, this system may be installed under various photoenvironments, even in night, use, so we can not depend on environment suitable, illumination uniformly can be provided.Based on this reason, in the present invention, specialized designs infrared LED lighting source solves this problem, simultaneously because infrared ray can not form harm to user, because its invisibility can not cause interference to user yet.
2, extract feature templates
From original image, extract the process of feature templates, biometrics identification technology most critical part normally, face recognition technology is also like this.In the present invention, we are achieved as follows one and extract feature flow process, can extract quickly and efficiently the feature templates of people's face.
1) detect people's face: on integrogram, detect harr feature, then use AdaBoost algorithm to carry out the detection of people's face;
2) location eye position: by the symmetry of people's face and the darker characteristic of the gray scale of position of human eye, orient in picture the people position of right and left eyes on the face;
3) regular facial image: first we according to the position of right and left eyes, be rotated image, makes right and left eyes in same level line, and the whole image of convergent-divergent then, the place normalization to of a right and left eyes fixing width; Further, we are according to the position of eyes, according to fixing width with highly intercept out the image of whole people's face; Finally we carry out local enhancement to image, in removal of images because the luminance difference that uneven illumination etc. produces.We get right and left eyes distance is 75 pixels, moves 35 pixels, the position of 38 pixels that move to left starts from above, and getting width is 151, is highly 151 image, is just in time people's face key component image.
4) assessment quality of human face image: we find, the quality of quality of human face image, has a great impact for identification accuracy.The feature that bad picture quality extracts is just unreliable.Therefore in order to improve the performance of system, we propose suitable requirement to picture quality.In processing procedure image being normalized, calculate acutance, contrast and the gray level of image in the above, these three quality that index has been portrayed image simultaneously simultaneously.We set corresponding threshold value, only have over these threshold values and just carry out next step processing.
5) Gabor feature extraction: the image of one group of Two-Dimensional Gabor Wavelets base that we use 8 frequency ranges, 16 directions after to normalization carries out filtering, thereby obtains the response energy of image under this group wavelet basis.After response energy is normalized, we obtain last skin detection.
3, registered user
Because people's face is three-dimensional, the image difference that people's face gathers under different attitudes can be very large, because the image of an attitude only can be portrayed the two dimensional character of people's face under this attitude, the very difficult three-dimensional feature that gives expression to people's face completely comes.If so we only register a user according to the image of a frame people face, will inevitably obtain very low discrimination.Therefore we need to gather people's face at a plurality of images of a plurality of attitudes, just can obtain people's face three-dimensional feature as much as possible.Only in this way, in actual application, just can obtain acceptable discrimination.
Further process, common face recognition technology is the image that merges a plurality of attitudes, therefrom analyzes the geometric expression of messenger's face three-dimensional feature, carrys out according to this construction feature template, Here it is so-called 3D face recognition technology.Yet this method can be brought very large computing cost, and neither be very accurate, in embedded system, be impossible realize.We find by analyzing people's face picture of these different attitudes, and the similarity of the image that the attitude of same people's face is close is very high, and the similarity of the image of the different people face of different attitudes is very low.The present invention designs a kind of method accordingly, and this method is carried out user's registration and identification, can effectively solve the low and slow problem of recognition speed of discrimination.
We require user to convert 5 kinds of attitudes when registered user, and system can gather three two field pictures and extract feature templates under each attitude.We can obtain 15 feature templates altogether like this.The process gathering converts attitude by voice message user, and system gathers and calculates automatically, and this makes this process can't be difficult to very much use.Due in actual use, often user can strictly not follow the variation of the time generation attitude of voice message, user's attitude also not necessarily meets our requirement completely, so we can not guarantee that 15 templates that finally collect are every kind of 3 templates of 5 kinds of attitudes accurately.This template that makes us can not extract simply every kind of attitude is carried out subsequent treatment as representative.The present invention deposits database in these 15 templates simply, but to they advanced line orderings.
We sort by the method for concentrating select progressively to go out template from candidate template, based on two principles:
A. the template of selecting represents the non-selected template going out as far as possible, and the candidate template of it and other has maximum similarity;
B. the template of selecting is as far as possible away from the template having chosen, and it maintains minimum similarity with modeling plate; These two principles have guaranteed that front 5 templates can represent the face characteristic of 5 attitudes substantially.10 templates are then to the repetition of template above substantially, also have some to supplement.By experiment, we obtain the parameter a1 in flow process above, and the best value of a2 is a1=5/9, a2=4/9.
5, recognition of face
In identifying, the process that gathers facial image and extract feature templates is the same during with registrant's face, and now we just identify after collection one two field picture immediately certainly.
The result of two skin detections coupling is a similarity scope at 0~120 mark.If this mark is 120, just represent that two people's faces match completely; Be that zero expression is not mated completely.In order to improve discrimination, we can be using 120 foundations as the same people's face of judgement, but a selected threshold value, when similarity mark is greater than this threshold value, just concludes that two face templates come from people's face.According to the result of testing in large-scale face database, threshold value is 80 o'clock, and our system can obtain the false recognition rate of 1/100000 left and right.We adopt this threshold value in common application.
The coupling flow process of our design is divided into three phases according to our storage order to user fingerprints template: first identifies in first template of each user, but get a lower threshold value (the first lower threshold), for example 43, we can filter out a part of user out like this, carry out the comparison of subordinate phase.After coupling by first stage, probably have 70% user to be filtered, the user who therefore participates in the comparison of subordinate phase has only been left 30% left and right.In subordinate phase comparison, we choose a higher threshold value (the second lower threshold), and for example 60, to have like this 95% user can be filtered, and therefore participates in user remaining 5% left and right only of the comparison of phase III.Three phases, we in the end the carrying out of all the other 10 templates of select 5% user compare one by one, obtain last result.From this step, can find out, the complexity that the template matches of this flow process is calculated is:
Template matches calculation times=C+C*30%*4+C*30%*4*5%*10=2.8*C
The number that wherein C is database.Take 1000 people as example, and we need to carry out at most 2800 template matches and calculate.In fact, our test shows, mostly finally can not unmatched template in the coupling of subordinate phase, conventionally can not get any possible matching result, therefore can not enter the coupling of phase III.In other words, the computation complexity in actual process can be more much lower than what formula calculated above.
We also set a upper limit threshold, for example 90, in the comparison in each stage, once there be this upper limit threshold that surpasses that a template and our Site Template compare, just can think immediately and to have found the template of coupling, and not need to continue the comparison of next step.Like this in the result that can obtain rapidly coupling.
Therefore, although the present invention has preserved 15 templates for each user in database, but by flow process above, allow 15 templates play a role, greatly improved discrimination, because there is no the number of times of large increase template comparison, whole system finally can also be identified rapidly simultaneously.
6, the study of face template
As time goes on the feature of people's face also can produce some and change, for example fat and thin change.Therefore our system preferably can in use be reflected to these variations in user's registration template.So as time goes by, user's registration template also can that is to say and have autolearn feature along with keeping renewal, is unlikely to cause the final None-identified of system after people's face variation of user runs up to a certain degree.
We set a strategy, in the process of using user, identify in successful situation, if the mark of coupling is greater than a given upper limit threshold, for example 100 minutes, we be sure of that current recognition result is absolutely correct, and we treat that as one learning template learns using the template of current collection in worksite like this.
In this flow process, when we adopt with registration template, the same method sorts together with treating learning template to registered 15 templates of user, then removes and comes a last template.
After learning success, upgrade 15 templates that database writes this user's rearrangement.
Algorithm flow and technical scheme that the present invention describes are applied on our many moneys equipment.These equipment adopt the Embedded Application processor P XA310 of Marvel, and its speed and discrimination have all reached commercial applications level.
As shown in Figure 1-2, the present invention is to use embedded microprocessor to connect as CPU (central processing unit) or microprocessor core core 1, CPU (central processing unit) or the microprocessor core core 1 of system the cmos sensor 2 that gathers facial image for realizing the Face Image Recognition System of said method of the present invention, and the infrared illuminator infrared LED light source 3 that is aided with people's face realizes the use function under any light condition, adopt arrowband infrared fileter 4 to filter the interference that visible rays are got rid of surround lighting.In Fig. 1: user is 5, the infrared light that light source irradiates is 61, and the infrared light of people's face reflection is 62.Wherein: CPU (central processing unit) or microprocessor core core adopt the Embedded Application processor P XA310 of Marvel.
More specifically: the present invention use embedded microprocessor as the CPU (central processing unit) of system, connect cmos sensor and gather facial image, and be aided with infrared illumination and realize night and use, filter the interference that visible ray is got rid of surround lighting.Thereby the present invention realizes complete, a reliable face identification system, and its discrimination and recognition speed all reach gratifying level, can be applied in the systems such as work attendance, gate inhibition.