CN111695462A - Face recognition method, face recognition device, storage medium and server - Google Patents

Face recognition method, face recognition device, storage medium and server Download PDF

Info

Publication number
CN111695462A
CN111695462A CN202010475456.9A CN202010475456A CN111695462A CN 111695462 A CN111695462 A CN 111695462A CN 202010475456 A CN202010475456 A CN 202010475456A CN 111695462 A CN111695462 A CN 111695462A
Authority
CN
China
Prior art keywords
face
image
frontal
face recognition
sample images
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
CN202010475456.9A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010475456.9A priority Critical patent/CN111695462A/en
Publication of CN111695462A publication Critical patent/CN111695462A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Abstract

The application belongs to the technical field of artificial intelligence and provides a face recognition method, a face recognition device, a storage medium and a server. The method comprises the following steps: acquiring a face image to be recognized; and inputting the face image into a preset face recognition model to obtain a face recognition result. The face recognition model is obtained by pre-training the following steps: acquiring a human face sample data set, wherein the human face sample data set comprises a plurality of front face sample images and a plurality of non-front face sample images; performing face key point detection processing on each non-frontal face sample image to obtain key point characteristics of each non-frontal face sample image; correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image; and taking the corrected images of the plurality of front face sample images and the non-front face sample images as front faces as a training set, and training to obtain the face recognition model.

Description

Face recognition method, face recognition device, storage medium and server
Technical Field
The application belongs to the technical field of artificial intelligence, and particularly relates to a face recognition method, a face recognition device, a storage medium and a server.
Background
Face recognition is a biometric technology for identity recognition based on facial feature information of a person. At present, face recognition is usually completed by adopting a mode of constructing a face recognition model. However, the conventional face recognition model has a weak generalization capability, and when faces with different poses (e.g., faces with different angles, different scales, or different distances) are faced, the accuracy of the obtained face recognition result is low.
Disclosure of Invention
In view of this, the present application provides a face recognition method, an apparatus, a storage medium, and a server, which can improve accuracy of an obtained face recognition result when facing various faces with different postures.
In a first aspect, an embodiment of the present application provides a face recognition method, including:
acquiring a face image to be recognized;
inputting the face image into a preset face recognition model to obtain a face recognition result;
the face recognition model is obtained by pre-training the following steps:
acquiring a human face sample data set, wherein the human face sample data set comprises a plurality of front face sample images and a plurality of non-front face sample images;
performing face key point detection processing on each non-frontal face sample image to obtain key point characteristics of each non-frontal face sample image;
correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image;
and training to obtain the face recognition model by taking the corrected images of the plurality of front face sample images and the non-front face sample images as a front face image as a training set.
When the face recognition model is trained, the face sample images and the non-face sample images are used as a training set, key point detection processing of the face is carried out on the non-face sample images to obtain key point features, and then the non-face sample images are corrected into the face images based on the key point features. When the face sample data is ensured, non-face sample data in different postures of translation, multi-angle and the like is added, the recognition deviation caused by the inconsistency of the face detection and the face alignment model can be overcome, the translation invariance of the model structure is ensured, and the accuracy of the obtained face recognition result is improved.
Further, the plurality of non-frontal face sample images may be generated by:
acquiring an original face image which is acquired in advance;
processing the original front face image by adopting a pre-constructed StarGAN neural network model to obtain a plurality of side face images with different angles of the original front face image;
determining the plurality of side face images at different angles as the plurality of non-frontal sample images.
In order to ensure the reliability of sample data, the method for generating the multi-angle side face by the front face image is adopted.
Further, the modifying each non-frontal face sample image based on the keypoint features may include:
based on the key point features, carrying out zoom adjustment and then translation adjustment on each non-frontal face sample image;
or
And carrying out rotation adjustment and translation adjustment on each non-frontal face sample image based on the key point features.
When each non-frontal face sample image is corrected based on the key point features, a processing mode of firstly zooming and then translating adjustment can be adopted, and a processing mode of firstly rotating and then translating adjustment can also be adopted. The non-frontal sample image can be corrected to a frontal image by performing processing such as scaling, rotation, and translation on the non-frontal sample image.
Further, after obtaining the key point features of each non-frontal face sample image, the method may further include:
and inputting the key point features of the non-frontal face sample images into a low-pass filter to eliminate abnormal values in the key point features.
The extracted key feature points of the non-frontal face sample image can be input into a low-pass filter to eliminate abnormal key feature points (numerical values are obviously too large and too small), so that the accuracy of the non-frontal face sample image which is corrected into the frontal face image subsequently is improved.
Further, after the face recognition model is obtained through training, the method may further include:
acquiring a face test data set, wherein the face test data set comprises a plurality of face sample images with labels distributed;
inputting the face test data set into the face recognition model, and counting the accuracy of the face recognition model in recognizing the face test data set;
and if the accuracy is smaller than a preset threshold, continuously performing optimization training on the face recognition model by adopting a new face sample data set until the accuracy of the face recognition model for recognizing the face test data set is greater than or equal to the preset threshold.
After the face recognition model is obtained by training the face sample data set, the face recognition model can be verified by adopting a face test data set, the recognition accuracy of the face recognition model is counted, if the recognition accuracy is low, the face recognition model is continuously subjected to optimization training until the recognition accuracy of the face recognition model meets the requirement.
Furthermore, the counting the accuracy of the face recognition model for recognizing the face test data set may include:
inputting the face sample images with the distributed labels into the face recognition model to respectively obtain the predicted labels of the face sample images with the distributed labels;
counting a first number of the human face sample images with the same predicted labels and assigned labels in the human face sample images with the assigned labels;
counting a second number of the face sample images with different predicted labels and assigned labels in the plurality of face sample images with assigned labels;
and calculating the accuracy of the face recognition model for recognizing the face test data set according to the total number of the face sample images with the plurality of distributed labels, the first number and the second number.
Specifically, the calculating the accuracy of the face recognition model for recognizing the face test data set according to the total number of the face sample images with the assigned labels, the first number and the second number may include:
the accuracy was calculated using the following formula:
Acrt=N1/(N1+N2)
wherein A iscrtRepresenting said accuracy, N1Representing said first number, N2Representing said second number.
For example, the total number of the face sample images to which the labels are assigned is N, and after the face recognition model recognizes, the number of the face sample images in which the labels predicted by the model in the N face sample images are the same as the original assigned labels is a first number N1The number of the face sample images with different labels of model prediction and the original assigned labels in the N face sample images is a second number N2Then according to N, N1And N2And calculating to obtain the accuracy rate of the face recognition model for recognizing the face test data set. The specific calculation formula can be Acrt=N1/(N1+N2) Wherein A iscrtRepresenting said accuracy, N1Representing said first number, N2Denotes said second number, N ═ N1+N2The total number is denoted.
In a second aspect, an embodiment of the present application provides a face recognition apparatus, including:
the face image acquisition module is used for acquiring a face image to be recognized;
the face recognition module is used for inputting the face image into a preset face recognition model to obtain a face recognition result;
the system comprises a face sample acquisition module, a face detection module and a face detection module, wherein the face sample acquisition module is used for acquiring a face sample data set which comprises a plurality of front face sample images and a plurality of non-front face sample images;
the key point detection module is used for respectively carrying out face key point detection processing on each non-frontal face sample image to obtain the key point characteristics of each non-frontal face sample image;
the sample image correction module is used for correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image;
and the face recognition model training module is used for training the plurality of face sample images and the images of the non-face sample images which are corrected into the face to obtain the face recognition model by taking the images as a training set.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the face recognition method as set forth in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the face recognition method as set forth in the first aspect of the embodiment of the present application when executing the computer program.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the steps of the face recognition method according to the first aspect.
The advantageous effects achieved by the second aspect to the fifth aspect described above can be referred to the description of the first aspect described above.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an embodiment of a face recognition method according to an embodiment of the present application;
fig. 2 is a flow chart of a training process of a face recognition model adopted by the face recognition method according to the embodiment of the present application;
FIG. 3 is a schematic diagram of adding a low-pass filter to a network structure of a face recognition model according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an optimization training process of a face recognition model according to an embodiment of the present application;
fig. 5 is a block diagram of an embodiment of a face recognition apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a server according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail. Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
The application provides a face recognition method, a face recognition device, a storage medium and a server, which can improve the accuracy of an obtained face recognition result. It should be understood that the execution subjects of the face recognition method proposed in the embodiments of the present application are various types of servers or terminal devices.
Referring to fig. 1, an embodiment of a face recognition method in an embodiment of the present application includes:
101. acquiring a face image to be recognized;
102. and inputting the face image into a preset face recognition model to obtain a face recognition result.
According to the embodiment of the application, a face recognition model is constructed in advance, and after a face image to be recognized is input into the face recognition model, a face recognition result can be obtained, namely, labels such as the identity or the type of the face image are obtained.
As shown in fig. 2, the face recognition model is obtained by pre-training through the following steps:
201. acquiring a human face sample data set, wherein the human face sample data set comprises a plurality of front face sample images and a plurality of non-front face sample images;
in order to overcome the recognition deviation caused by the inconsistency of the face detection and the face alignment model and ensure the translation invariance of the model structure, the embodiment of the application improves the sample data set of the model training, and increases the non-frontal face sample data in different postures of translation, multi-angle and the like while ensuring the frontal face data volume.
The face sample images and the non-face sample images in the face sample data set can be various face images which are acquired in advance and distributed with labels, the quantity proportion of the face sample images and the non-face sample images can be set according to requirements, and the quantity proportion of the face sample images is generally set to be larger.
For example, in an embodiment of the present application, the number ratio of the front face sample images to the non-front face sample images may be set to 7:3, that is, the front face sample images account for 70% of all the face sample images, and the non-front face sample images account for 30% of all the face sample images. In addition, of the 30% non-frontal face sample images, 10% are non-frontal face sample images that can be adjusted to a frontal face by rotation; 10% are non-frontal sample images that can be adjusted to the frontal face by scaling, and 10% are non-frontal sample images that can be adjusted to the frontal face by translation.
In another embodiment of the present application, the number ratio of the front face sample images to the non-front face sample images may be set to 6:4, that is, the front face sample images account for 60% of all the face sample images, and the non-front face sample images account for 40% of all the face sample images. In the 40% of the non-frontal sample images, 10% are non-frontal sample images that can be adjusted to the frontal face by rotation, 10% are non-frontal sample images that can be adjusted to the frontal face by scaling, 10% are non-frontal sample images that can be adjusted to the frontal face by translation, 5% are non-frontal sample images that can be adjusted to the frontal face by rotation and translation, and 5% are non-frontal sample images that can be adjusted to the frontal face by scaling and translation.
Specifically, the plurality of non-frontal face sample images may be generated by:
(1) acquiring an original face image which is acquired in advance;
(2) processing the original front face image by adopting a pre-constructed StarGAN neural network model to obtain a plurality of side face images with different angles of the original front face image;
(3) determining the plurality of side face images at different angles as the plurality of non-frontal sample images.
Generative Adaptive Networks (GAN) is a deep learning model that passes through (at least) two modules in a framework: the mutual game learning of the generation Model (Generative Model) and the discriminant Model (discriminant Model) generates output. According to the method and the device, the StarGAN type in the GAN network is adopted, the acquired original front face image is processed, a plurality of side face images of different angles of the original front face image are obtained, and the side face images can be used as non-front face sample images.
Because there is certain danger with other angle side faces of side face generation, so the mode that this application adopted the face to generate multi-angle side face can guarantee the reliability of non-face sample data. In addition, for the problem of facial expression, sample faces with other expressions such as joy, anger, sadness and the like can be generated based on natural expressions, and because natural and smile expressions in the monitoring scene occupy a large ratio, the sample faces with the two expressions can be generated in a biased manner.
202. Performing face key point detection processing on each non-frontal face sample image to obtain key point characteristics of each non-frontal face sample image;
after the face sample data set is obtained, the key point detection (namely, the landworks detection of the face) processing of the face is respectively carried out on each non-frontal face sample image, and the key point characteristics of each non-frontal face sample image are obtained. Specifically, an ASM algorithm or an AAM algorithm may be used to perform keypoint detection on each non-frontal face sample image to obtain keypoint features. In general, the key feature points refer to the outer contour of the human face and edge feature points of various organs, such as the edge feature points of eyes, mouth, or nose. It should be noted that the calibration order of the feature points in each non-frontal face sample image is consistent in the training set.
Further, after obtaining the key point features of each non-frontal face sample image, the method may further include:
and inputting the key point features of the non-frontal face sample images into a low-pass filter to eliminate abnormal values in the key point features.
The extracted key point features of the non-frontal face sample image can be input into a low-pass filter to eliminate abnormal values (numerical values are obviously too large or too small) in the key point features. Some interference information is mixed in the detected key point features, and the interference information is removed by adopting a low-pass filter, so that the face recognition model obtained by subsequent training has better generalization capability and robustness.
In practical operation, low-pass filters may be added to each layer in the network structure of the face recognition model. Most convolutional networks have no translation invariance, mainly because the downsampling method adopted by the Pooling layer (Pooling) does not conform to the sampling theorem, namely, the high-frequency component aliases the low-frequency component, and the simple insertion of the maxpool layer structure can cause the loss of the expression capability of the model part. However, this problem can be solved by adding a low pass filter before down-sampling, as shown in fig. 3, the MaxPool layer structure of the model can be replaced by the layer structure of Max and BlurPool (low pass filter), BlurPool can be inserted after the Conv + Relu layer structure (i.e. the convolutional layer and the modified linear unit), the AvgPool layer structure can be replaced by BlurPool, and so on.
Furthermore, a Spatial-Temporal orientation, i.e. an Attention mechanism, can be introduced into the face recognition model, so that the model is more concerned about features and descriptions beneficial to recognition, for example, for a person with a mole on the face, the mole is a very important feature and needs to be paid special Attention to. The model learning features are assumed to have C layers, the model generally considers that the importance degree of each layer is the same, and after an attention mechanism is added, the important features of the layers can be distinguished, the important features of the layers are relatively less important, the important features can be extracted to learn and train the model, and therefore the feature extraction capability of the model is effectively improved.
203. Correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image;
after obtaining the key point features of each of the non-frontal face sample images, the non-frontal face sample images may be corrected based on the key point features, so as to obtain corrected frontal face images of the non-frontal face sample images.
Specifically, the non-frontal face sample image may be corrected by image enhancement processing such as translation, scaling, or rotation of the image. The translation enhancement mode is that the face image is randomly moved for a certain distance along any direction, and the maximum moving distance can be 20 pixel points; the zooming enhancement mode is to reduce or enlarge the face image by a certain proportion (for example, 10%), and then randomly cut the face image into an image with a fixed size; the rotation enhancement mode is that the face image is randomly rotated by a certain angle along any direction, and the rotating angle is generally not more than 60 degrees. The embodiment of the application adopts two image correction modes, wherein one mode is that the non-frontal face sample images are firstly subjected to zoom adjustment and then subjected to translation adjustment on the basis of the key point characteristics; and secondly, performing rotation adjustment and then translation adjustment on each non-frontal face sample image based on the key point features. Zooming or rotation adjustment is carried out firstly, and then translation adjustment is carried out, so that the obtained image correction effect is superior to that of the image correction effect of the image correction method of firstly carrying out translation adjustment and then carrying out zooming or rotation adjustment. Moreover, scaling and rotation are generally not suitable to occur simultaneously, otherwise, the processing process of the model is too complex, and certain identification accuracy cannot be guaranteed.
204. And training to obtain the face recognition model by taking the corrected images of the plurality of front face sample images and the non-front face sample images as a front face image as a training set.
And finally, taking the images of the plurality of front face sample images and the images of the non-front face sample images which are corrected into front faces as a training set, and training to obtain the face recognition model. The method and the device have the advantages that when the front face sample data is ensured, the non-front face sample data in different postures such as translation and multi-angle posture is added, the recognition deviation caused by the inconsistency of the face detection and the face alignment model can be overcome, and the translation invariance of the model structure is ensured.
Furthermore, after the face recognition model is obtained through training, parameters of the model can be adjusted by calculating a training loss value of the model. The original model parameter of the face recognition model is assumed to be W1After the training loss value of the model is obtained by adopting the loss function calculation, the training loss value is adopted to carry out back propagation to modify W1And a modified parameter W2 is obtained. And after the parameters are modified, the optimization training process of the model is continuously executed until the preset training condition is met. The training condition may be that the training frequency reaches a preset frequency threshold, for example 100000 times, or the face recognition model converges.
Further, as shown in fig. 4, after step 204, the method may further include:
401. acquiring a face test data set, wherein the face test data set comprises a plurality of face sample images with labels distributed;
the face test data set contains a plurality of face sample images, and the face sample images are images of known tags that have been identified.
402. Inputting the face test data set into the face recognition model, and counting the accuracy of the face recognition model in recognizing the face test data set;
after a face test data set is obtained, the face sample images of all the labels distributed in the face test data set are respectively input into the face recognition model, a face recognition result of the face test data set is obtained, and the accuracy rate of the face recognition model for recognizing the face test data set is counted based on the face recognition result.
Specifically, step 402 may include:
(1) inputting the face sample images with the distributed labels into the face recognition model to respectively obtain the predicted labels of the face sample images with the distributed labels;
(2) counting a first number of the human face sample images with the same predicted labels and assigned labels in the human face sample images with the assigned labels;
(3) counting a second number of the face sample images with different predicted labels and assigned labels in the plurality of face sample images with assigned labels;
(4) and calculating the accuracy of the face recognition model for recognizing the face test data set according to the total number of the face sample images with the plurality of distributed labels, the first number and the second number.
For example, the total number of the face sample images to which the labels are assigned is N, and after the face recognition model recognizes, the number of the face sample images in which the labels predicted by the model in the N face sample images are the same as the original assigned labels is a first number N1The N in-person face sample imagesThe number of the predicted face sample images with different labels from the original assigned labels is a second number N2Then according to N, N1And N2And calculating to obtain the accuracy rate of the face recognition model for recognizing the face test data set. The specific calculation formula can be Acrt=N1/(N1+N2) Wherein A iscrtRepresenting said accuracy, N1Representing said first number, N2Denotes said second number, N ═ N1+N2The total number is denoted.
403. Judging whether the accuracy is smaller than a preset threshold value:
after counting the accuracy rate of the face recognition model for recognizing the face test data set, determining whether the accuracy rate is less than a preset threshold (for example, 75%), if the accuracy rate is less than the threshold, performing step 404; if the accuracy is greater than or equal to the threshold, go to step 405.
404. Adopting a new face sample data set to continue to carry out optimization training on the face recognition model until the accuracy rate of the face recognition model for recognizing the face test data set is greater than or equal to the preset threshold value;
if the accuracy is less than the threshold, it indicates that the accuracy of the face recognition model is low, and the optimization training needs to be continued, at this time, the model can be continued to be optimized and trained by using a new face sample data set, then the accuracy of the face recognition model is counted by using the face test data set until the counted accuracy is greater than or equal to the threshold, and step 405 is executed, that is, the optimization training process of the face recognition model is completed.
405. And finishing the optimization training process of the face recognition model.
The accuracy is greater than or equal to the threshold value, which indicates that the accuracy of the face recognition model meets the requirements, and the optimization training process of the face recognition model is completed at the moment.
When the face recognition model is trained, the face sample images and the non-face sample images are used as a training set, key point detection processing of the face is carried out on the non-face sample images to obtain key point features, and then the non-face sample images are corrected into the face images based on the key point features. Through the arrangement, when the face sample data is ensured, the non-face sample data in different postures such as translation and multi-angle are added, the recognition deviation caused by the inconsistency of the face detection and the face alignment model can be overcome, the translation invariance of the model structure is ensured, and the accuracy of the obtained face recognition result is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 5 shows a block diagram of a face recognition apparatus according to an embodiment of the present application, which corresponds to the face recognition method described in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 5, the apparatus includes:
a face image obtaining module 501, configured to obtain a face image to be recognized;
a face recognition module 502, configured to input the face image into a preset face recognition model to obtain a face recognition result;
a face sample acquisition module 503, configured to acquire a face sample data set, where the face sample data set includes a plurality of front face sample images and a plurality of non-front face sample images;
a key point detection module 504, configured to perform face key point detection processing on each non-frontal face sample image, to obtain a key point feature of each non-frontal face sample image;
a sample image modification module 505, configured to modify each non-frontal face sample image based on the key point features, so as to obtain a modified frontal face image of each non-frontal face sample image;
and a face recognition model training module 506, configured to train the plurality of front face sample images and the images modified into front faces by the non-front face sample images to obtain the face recognition model.
Further, the face recognition apparatus may further include:
the original image acquisition module is used for acquiring an original face image which is acquired in advance;
the side face image generating module is used for processing the original front face image by adopting a pre-constructed StarGAN neural network model to obtain a plurality of side face images with different angles of the original front face image;
and the non-frontal face sample determining module is used for determining the side face images at the different angles as the non-frontal face sample images.
Further, the sample image modification module may include:
the first correction unit is used for carrying out scaling adjustment and then translation adjustment on each non-frontal face sample image based on the key point characteristics;
and the second correction unit is used for performing processing of firstly rotating and then translating adjustment on each non-frontal face sample image based on the key point characteristics.
Further, the face recognition apparatus may further include:
and the abnormal feature removing module is used for inputting the key point features of the non-frontal face sample images into a low-pass filter so as to remove abnormal values in the key point features.
Further, the face recognition apparatus may further include:
the system comprises a test data set acquisition module, a label distribution module and a label distribution module, wherein the test data set acquisition module is used for acquiring a face test data set which comprises a plurality of face sample images with distributed labels;
the recognition accuracy rate counting module is used for inputting the face test data set into the face recognition model and counting the accuracy rate of the face recognition model for recognizing the face test data set;
and the model optimization module is used for continuing to carry out optimization training on the face recognition model by adopting a new face sample data set if the accuracy is less than a preset threshold value until the accuracy of the face recognition model for recognizing the face test data set is greater than or equal to the preset threshold value.
Further, the identification accuracy statistic module may include:
a predicted label generating unit, configured to input the face sample images to which the labels are allocated into the face recognition model, and obtain a predicted label of each face sample image to which the label is allocated;
a first number counting unit, configured to count a first number of face sample images with the same prediction tag and assigned tags in the plurality of assigned face sample images;
a second quantity counting unit, configured to count a second quantity of the face sample images with different predicted labels and assigned labels in the plurality of label-assigned face sample images;
and the identification accuracy calculation unit is used for calculating the accuracy of the face identification model for identifying the face test data set according to the total number of the face sample images with the plurality of distributed labels, the first number and the second number.
Further, the identification accuracy calculation unit may be specifically configured to:
the accuracy was calculated using the following formula:
Acrt=N1/(N1+N2)
wherein A iscrtRepresenting said accuracy, N1Representing said first number, N2Representing said second number.
Embodiments of the present application further provide a computer-readable storage medium, which stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of any one of the face recognition methods shown in fig. 1 are implemented.
Embodiments of the present application further provide a server, which includes a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, where the processor executes the computer readable instructions to implement any one of the steps of the face recognition method shown in fig. 1.
Embodiments of the present application further provide a computer program product, which when run on a server, causes the server to execute the steps of implementing any one of the face recognition methods as shown in fig. 1.
Fig. 6 is a schematic diagram of a server according to an embodiment of the present application. As shown in fig. 6, the server 6 of this embodiment includes: a processor 60, a memory 61, and computer readable instructions 62 stored in the memory 61 and executable on the processor 60. The processor 60, when executing the computer readable instructions 62, implements the steps in the various embodiments of the face recognition method described above, such as the steps 101-102 shown in fig. 1. Alternatively, the processor 60, when executing the computer readable instructions 62, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 501 to 506 shown in fig. 5.
Illustratively, the computer readable instructions 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to accomplish the present application. The one or more modules/units may be a series of computer-readable instruction segments capable of performing specific functions, which are used to describe the execution of the computer-readable instructions 62 in the server 6.
The server 6 may be a computing device such as a smart phone, a notebook, a palm computer, and a cloud server. The server 6 may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a server 6 and does not constitute a limitation of the server 6, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server 6 may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a CentraL Processing Unit (CPU), other general purpose Processor, a DigitaL SignaL Processor (DSP), an AppLication Specific Integrated Circuit (ASIC), an off-the-shelf ProgrammabLe Gate Array (FPGA) or other ProgrammabLe logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the server 6, such as a hard disk or a memory of the server 6. The memory 61 may also be an external storage device of the server 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure DigitaL (SD) Card, a FLash memory Card (FLash Card), or the like, provided on the server 6. Further, the memory 61 may also include both an internal storage unit of the server 6 and an external storage device. The memory 61 is used to store the computer readable instructions and other programs and data required by the server. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A face recognition method, comprising:
acquiring a face image to be recognized;
inputting the face image into a preset face recognition model to obtain a face recognition result;
the face recognition model is obtained by pre-training the following steps:
acquiring a human face sample data set, wherein the human face sample data set comprises a plurality of front face sample images and a plurality of non-front face sample images;
performing face key point detection processing on each non-frontal face sample image to obtain key point characteristics of each non-frontal face sample image;
correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image;
and training to obtain the face recognition model by taking the corrected images of the plurality of front face sample images and the non-front face sample images as a front face image as a training set.
2. The face recognition method of claim 1, wherein the plurality of non-frontal sample images are generated by:
acquiring an original face image which is acquired in advance;
processing the original front face image by adopting a pre-constructed StarGAN neural network model to obtain a plurality of side face images with different angles of the original front face image;
determining the plurality of side face images at different angles as the plurality of non-frontal sample images.
3. The face recognition method of claim 1, wherein the modifying each of the non-frontal face sample images based on the keypoint features comprises:
based on the key point features, carrying out zoom adjustment and then translation adjustment on each non-frontal face sample image;
or
And carrying out rotation adjustment and translation adjustment on each non-frontal face sample image based on the key point features.
4. The face recognition method according to claim 1, further comprising, after obtaining the keypoint features of each of the non-frontal face sample images:
and inputting the key point features of the non-frontal face sample images into a low-pass filter to eliminate abnormal values in the key point features.
5. The face recognition method according to any one of claims 1 to 4, further comprising, after the training of the face recognition model, the steps of:
acquiring a face test data set, wherein the face test data set comprises a plurality of face sample images with labels distributed;
inputting the face test data set into the face recognition model, and counting the accuracy of the face recognition model in recognizing the face test data set;
and if the accuracy is smaller than a preset threshold, continuously performing optimization training on the face recognition model by adopting a new face sample data set until the accuracy of the face recognition model for recognizing the face test data set is greater than or equal to the preset threshold.
6. The method of claim 5, wherein the counting the accuracy rate of the face recognition model recognizing the face test data set comprises:
inputting the face sample images with the distributed labels into the face recognition model to respectively obtain the predicted labels of the face sample images with the distributed labels;
counting a first number of the human face sample images with the same predicted labels and assigned labels in the human face sample images with the assigned labels;
counting a second number of the face sample images with different predicted labels and assigned labels in the plurality of face sample images with assigned labels;
and calculating the accuracy of the face recognition model for recognizing the face test data set according to the total number of the face sample images with the plurality of distributed labels, the first number and the second number.
7. The method of claim 6, wherein the calculating the accuracy with which the face recognition model recognizes the face test data set according to the total number of the plurality of labeled face sample images, the first number, and the second number comprises:
the accuracy was calculated using the following formula:
Acrt=N1/(N1+N2)
wherein A iscrtRepresenting said accuracy, N1Representing said first number, N2Representing said second number.
8. A face recognition apparatus, comprising:
the face image acquisition module is used for acquiring a face image to be recognized;
the face recognition module is used for inputting the face image into a preset face recognition model to obtain a face recognition result;
the system comprises a face sample acquisition module, a face detection module and a face detection module, wherein the face sample acquisition module is used for acquiring a face sample data set which comprises a plurality of front face sample images and a plurality of non-front face sample images;
the key point detection module is used for respectively carrying out face key point detection processing on each non-frontal face sample image to obtain the key point characteristics of each non-frontal face sample image;
the sample image correction module is used for correcting each non-frontal face sample image based on the key point characteristics to obtain a corrected frontal face image of each non-frontal face sample image;
and the face recognition model training module is used for training the plurality of face sample images and the images of the non-face sample images which are corrected into the face to obtain the face recognition model by taking the images as a training set.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the face recognition method according to any one of claims 1 to 7.
10. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the face recognition method according to any one of claims 1 to 7 when executing the computer program.
CN202010475456.9A 2020-05-29 2020-05-29 Face recognition method, face recognition device, storage medium and server Pending CN111695462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010475456.9A CN111695462A (en) 2020-05-29 2020-05-29 Face recognition method, face recognition device, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010475456.9A CN111695462A (en) 2020-05-29 2020-05-29 Face recognition method, face recognition device, storage medium and server

Publications (1)

Publication Number Publication Date
CN111695462A true CN111695462A (en) 2020-09-22

Family

ID=72478828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010475456.9A Pending CN111695462A (en) 2020-05-29 2020-05-29 Face recognition method, face recognition device, storage medium and server

Country Status (1)

Country Link
CN (1) CN111695462A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112270747A (en) * 2020-11-10 2021-01-26 杭州海康威视数字技术股份有限公司 Face recognition method and device and electronic equipment
CN112699799A (en) * 2020-12-30 2021-04-23 杭州趣链科技有限公司 Face recognition method, device, equipment and storage medium based on block chain
CN112766423A (en) * 2021-03-15 2021-05-07 平安科技(深圳)有限公司 Training method and device of face recognition model, computer equipment and storage medium
CN113486807A (en) * 2021-07-08 2021-10-08 网易(杭州)网络有限公司 Face detection model training method, face detection model recognition device, face detection medium and face detection equipment
CN113918131A (en) * 2021-12-09 2022-01-11 成都泰盟软件有限公司 Face recognition method and system
WO2022082401A1 (en) * 2020-10-20 2022-04-28 深圳市悦保科技有限公司 Noseprint recognition method and apparatus for pet, computer device, and storage medium
CN116453194A (en) * 2023-04-21 2023-07-18 无锡车联天下信息技术有限公司 Face attribute discriminating method and device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022082401A1 (en) * 2020-10-20 2022-04-28 深圳市悦保科技有限公司 Noseprint recognition method and apparatus for pet, computer device, and storage medium
CN112270747A (en) * 2020-11-10 2021-01-26 杭州海康威视数字技术股份有限公司 Face recognition method and device and electronic equipment
CN112699799A (en) * 2020-12-30 2021-04-23 杭州趣链科技有限公司 Face recognition method, device, equipment and storage medium based on block chain
CN112766423A (en) * 2021-03-15 2021-05-07 平安科技(深圳)有限公司 Training method and device of face recognition model, computer equipment and storage medium
CN112766423B (en) * 2021-03-15 2023-12-19 平安科技(深圳)有限公司 Training method and device for face recognition model, computer equipment and storage medium
CN113486807A (en) * 2021-07-08 2021-10-08 网易(杭州)网络有限公司 Face detection model training method, face detection model recognition device, face detection medium and face detection equipment
CN113486807B (en) * 2021-07-08 2024-02-27 网易(杭州)网络有限公司 Face detection model training method, face detection model recognition device, face detection model training medium and face detection model training equipment
CN113918131A (en) * 2021-12-09 2022-01-11 成都泰盟软件有限公司 Face recognition method and system
CN113918131B (en) * 2021-12-09 2022-07-19 成都泰盟软件有限公司 Face recognition method and system
CN116453194A (en) * 2023-04-21 2023-07-18 无锡车联天下信息技术有限公司 Face attribute discriminating method and device
CN116453194B (en) * 2023-04-21 2024-04-12 无锡车联天下信息技术有限公司 Face attribute discriminating method and device

Similar Documents

Publication Publication Date Title
CN111695462A (en) Face recognition method, face recognition device, storage medium and server
CN110147717B (en) Human body action recognition method and device
WO2021004112A1 (en) Anomalous face detection method, anomaly identification method, device, apparatus, and medium
US10713532B2 (en) Image recognition method and apparatus
CN110569756B (en) Face recognition model construction method, recognition method, device and storage medium
CN105917353B (en) Feature extraction and matching for biological identification and template renewal
CN109829448B (en) Face recognition method, face recognition device and storage medium
CN112419170B (en) Training method of shielding detection model and beautifying processing method of face image
CN111598038B (en) Facial feature point detection method, device, equipment and storage medium
CN109829396B (en) Face recognition motion blur processing method, device, equipment and storage medium
CN108229301B (en) Eyelid line detection method and device and electronic equipment
CN111310705A (en) Image recognition method and device, computer equipment and storage medium
CN110852310A (en) Three-dimensional face recognition method and device, terminal equipment and computer readable medium
US11893773B2 (en) Finger vein comparison method, computer equipment, and storage medium
CN112651380A (en) Face recognition method, face recognition device, terminal equipment and storage medium
CN111898571A (en) Action recognition system and method
CN108734127B (en) Age identification value adjusting method, age identification value adjusting device, age identification value adjusting equipment and storage medium
CN113298158A (en) Data detection method, device, equipment and storage medium
CN112069887A (en) Face recognition method, face recognition device, terminal equipment and storage medium
CN111723688B (en) Human body action recognition result evaluation method and device and electronic equipment
CN110210425B (en) Face recognition method and device, electronic equipment and storage medium
Lau et al. Semi-supervised landmark-guided restoration of atmospheric turbulent images
CN111488811A (en) Face recognition method and device, terminal equipment and computer readable medium
CN113012030A (en) Image splicing method, device and equipment
CN113421317B (en) Method and system for generating image and electronic equipment

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