CROSS-REFERENCE TO RELATED APPLICATION

This application is a 371 of international application of PCT application serial no. PCT/CN2018/126069, filed on Dec. 31, 2018, which claims the priority benefit of China application no. 201810194207.5, filed on Mar. 9, 2018. The entirety of each of the above mentioned patent applications is hereby incorporated by reference herein and made a part of this specification.

TECHNICAL FIELD

The present invention belongs to the technical field of biological recognition, and more particularly, relates to an angle interference resistant and occlusion interference resistant fast face recognition method.

BACKGROUND

Started from 1970s, the development of face recognition technologies has been one of the hottest research topics in the field of computer vision up to now. In recent years, with the rapid development of modern information technologies and an urgent need of people for automatic identity verification, biological feature recognition technologies have been developed rapidly in recent years. Modern biological recognition technologies mainly recognize and identify a personal identity by using inherent physiological and behavioral features of a human body through combination of a computer and an advanced technology. The modern biological recognition technologies mainly comprise: fingerprint recognition, retina recognition, iris recognition, vein recognition, gait recognition, face recognition, etc., wherein the face recognition is the most popular biological feature recognition technology and has many application scenarios. The most traditional scenarios of the face recognition comprise security, access control and monitoring fields. The face recognition appears in entrance and exit gates of customs border inspection as well as in safety door locks of safe boxes of a bank. Compared with traditional security means such as a password, a certificate, a key card, and the like, the face recognition is a natural “ID Card” attached to a face, and according to the distribution of five sense organs and contours of the face, these distributed features vary from person to person and are innate, thus being extremely difficult to be faked. Therefore, the face recognition is being accepted by users in a natural, intuitive and non-invasive manner.

Most traditional face recognition methods use a shallow structure to extract features of a face image. These methods have a limited ability to extract hidden features of the face image, and recognition effects of these methods are unsatisfactory. In the past two years, the great improvement on performances of computing devices and the appearance and development of deep learning have greatly improved an accuracy and a precision of the face recognition.

SUMMARY

Aiming at the shortcomings of a traditional face recognition method, the present invention provides an angle interference resistant and occlusion interference resistant fast face recognition method. An objective of the present invention is to compare two given face images to judge whether the two face images are from the same person, and two parts are needed to achieve the solution: one is to use a large number of datasets to train a face recognition model, and the other is to use the model to compare the two face images.

In order to achieve the above objective, the technical solutions used in the present invention are as follows.

An angle interference resistant and occlusion interference resistant fast face recognition method according to the present invention comprises the following steps:

(a) taking a training set of a large number of face images which have been detected and cropped, and adjusting the training set to make images of side faces and faces with glasses occupy 10% to 20% of a dataset;

(b) reading in the training set of face images in the step (a), expanding the training set by randomly cropping and randomly flipping, expanding a single-channel image into a three-channel RGB image, scaling the image to a set size, and standardizing the image;

(c) constructing a neural network for training a face dataset by combining and adjusting various effective structures, and inputting the dataset in the step (b) into the neural network and using a GPU to accelerate training the neural network, so as to obtain a trained network parametric model file;

(d) extracting a partial structure from the trained neural network constructed in the step (c) to form a neural network for extracting face features for prediction, and using the prediction network to load the network parametric model file obtained in the step (c);

(e) scaling the detected and cropped face images to be compared to the set size in the step (b), and converting a single-channel image therein into a three-channel RGB image;

(f) inputting the training set in the step (b) into the prediction network, calculating feature vectors of the images, sampling the training set and calculating a distance, testing different thresholds as a standard to judge whether two images are from the same person, and selecting a threshold with a highest accuracy as a final threshold; and

(g) inputting test images of in the step (e) into the prediction network in the step (d), calculating the feature vectors of the test images, calculating a Euclidean distance between the feature vectors corresponding to two face images to be compared, and judging whether the two faces are from the same person according to the final threshold calculated in the step (f), and using the final threshold as a judgment standard for face comparison.

As a preferred technical solution, in the step (b), a method for expanding the single-channel image into the three-channel RGB image comprises:

assigning a RGB three-channel value of each pixel in the image as a value of the pixel of the single-channel image, wherein a standardized processing method is:

image_xstd=(x-mean)adjusted_stddev,adjusted_stddev=max⁡(stddev,1.numpixels),

wherein x is a pixel value of the image, image_xstdis a standardized pixel value, mean is an average value of all the RGB three-channel pixel values in the image, stddev is a standard deviation of the image, and numpixels is a number of image pixels.

As a preferred technical solution, the step (c) comprises the following steps:

(c-1) using Inception-Resnet V1 as a topmost basic network structure, and setting a number of nodes of a last fully connected layer of the Inception-Resnet V1 as 128;

(c-2) adding a fully connected layer under the basic network structure, the number of the nodes being a number of persons constituting the training set of the face images;

(c-3) constructing a loss function, and using a softmax loss function and a center loss function as a final loss function used for training the network; and

(c-4) using an Adagrad method as an optimizer to train the neural network and starting to use the GPU to accelerate training the neural network, and saving the network parametric model file after network convergence.

As a preferred technical solution, in the step (c-1) and the step (c-2), network model parameters are initialized by truncated normal distribution with a standard deviation of 0.1, wherein weight decay is set as 0.00005, and a retention rate of a dropout layer in the network is set as 0.8.

As a preferred technical solution, the softmax loss function in the step (c-3) is

Ls=-∑i=1mlog⁢eWyi⁢xi+byjT∑j=1neWjT⁢xi+bj,
wherein xi∈Rdis a feature vector of an ithimage, which belongs to a yithclass, d is a feature dimension of the feature vector, W∈Rd×nis a weight matrix of the fully connected layer in the step (c-2), Wj∈Rdis a jthcolumn of W, b∈Rnis an offset value, m is a number of images in each batch introduced into the trained neural network, and n is a number of classes, for example, if data introduced into the network comprise face images of Tom, Jack and Mary, then n is 3; and the center loss function in the step (c-3) is Lc=½Σi=1m∥xt−cyt∥22, wherein Cyi∈Rdis a center of the yithclass, xi∈Rdis the feature vector of the ithimage, m is the number of the images in each batch introduced into the trained network, a finally synthesized loss function is

L=Ls+λ⁢Lc=-∑i=1mlog⁢eWyi⁢xi+byjT∑j=1neWjT⁢xi+bj+λ2⁢∑i=1mxi-cyi22,
wherein λ is an influence factor of center loss, which is recommended to be set as 0.01.

As a preferred technical solution, the step (d) comprises the following steps:

(d-1) using Inception-Resnet V1 as a topmost basic network structure, setting a number of nodes of a last fully connected layer of the Inception-Resnet V1 as 128, and adding an L2 norm normalization layer under the basic network structure as an output of the prediction network; and

(d-2) making the prediction network load the network parametric model file.

As a preferred technical solution, the step (d) comprises the following steps:

calculating the L2 norm normalization in the step (d-1) by a method that x∈Rdis a one-dimensional feature vector, xiis an ithcomponent, and then a normalized ithcomponent is

xi′=xix2.

As a preferred technical solution, the step (f) comprises the following steps:

(f-1) inputting the training set in the step (b) into the prediction network, calculating the feature vector of the image, randomly selecting 5000 pairs of positive examples and 5000 pairs of negative examples from the training set, and calculating a distance between feature vectors corresponding to each pair; and

(f-2) selecting a threshold with a highest accuracy in dividing the positive examples and the negative examples from an interval of [0,4] as the standard to judge whether the two face images are from the same person.

As a preferred technical solution, in the step (f-1) and the step (g), a method for calculating the Euclidean distance between the feature vectors is that: if two feature vectors are x, y∈Rd, then the Euclidean distance between the two feature vectors is dist=∥x−y∥2.

As a preferred technical solution, in the step (g), if the Euclidean distance between the feature vectors of the two face images obtained through the prediction network is less than the final threshold calculated in the step (f-2), the two face images are judged to be from the same person; if the Euclidean distance is greater than or equal to the final threshold, the two face images are judged to be from different persons.

Compared with the prior art, the present invention has the following advantages and beneficial effects.

1. Different from the traditional face recognition method, the present invention uses pure data driving, and uses the pixel of the face image as the input instead of an artificially constructed feature. Compared with other deep learning methods, the method uses Inception-Resnet V1, which further improves a classification level by a residual network. The combination of a softmax loss and a center loss is used as the loss function for training, which makes the face features obtained after training have a cohesive characteristic, thus having a good performance even in the absence of massive high-quality training sets, and avoiding phenomena of a slow convergence rate and over-fitting during training.

2. The present invention has no specific requirements on angles of the face images, and has an obvious comparison effect on the images of faces with glasses. Therefore, a problem of side face angles and glasses occlusion influencing the face comparison does not need to be worried about.

3. The comparison method of the present invention is simple, and a GPU is used to accelerate and improve a calculating performance, which may be applied to a real-time environment.

