CN113837932A - Face generation method, face recognition method and device - Google Patents

Face generation method, face recognition method and device Download PDF

Info

Publication number
CN113837932A
CN113837932A CN202111142251.XA CN202111142251A CN113837932A CN 113837932 A CN113837932 A CN 113837932A CN 202111142251 A CN202111142251 A CN 202111142251A CN 113837932 A CN113837932 A CN 113837932A
Authority
CN
China
Prior art keywords
face
face image
image
target
average
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
CN202111142251.XA
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.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology 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 Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN202111142251.XA priority Critical patent/CN113837932A/en
Publication of CN113837932A publication Critical patent/CN113837932A/en
Priority to PCT/CN2022/077557 priority patent/WO2023050695A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/04

Abstract

The disclosure relates to a face generation method, a face recognition method and a face recognition device. The face generation method comprises the steps of determining at least one reference face image; calculating the average value of the pixel values of the corresponding pixel points in each reference face image to obtain a target face image; extracting the features of the reference face images to obtain feature information corresponding to the reference face images; calculating the average value of the characteristic information corresponding to each reference face image to obtain supervision information; extracting the features of the target face image to obtain feature information of a target face; and correcting the target face image based on the difference value between the characteristic information of the target face and the monitoring information to obtain an average face image. The method and the device can obtain high-quality average face images, reduce the dependence on the number of the reference face images, and generate the high-quality average face images even if a small number of reference face images are used.

Description

Face generation method, face recognition method and device
Technical Field
The present disclosure relates to the field of computer vision technologies, and in particular, to a face generation method, a face recognition method, and an apparatus.
Background
With the development of image processing technology, related applications based on image processing are increasing. In many application scenarios, it is necessary to synthesize an average face image based on an existing reference face image. However, the reality of the average face image synthesized at present is common, and there may be problems of face deformation and the like, and the quality of the average face image is greatly affected by the number of the reference face images, and when the data amount of the reference face image is small, the quality of the average face image is obviously reduced.
Disclosure of Invention
In order to solve at least one technical problem, the present disclosure provides a face generation method, a face recognition method and a face recognition device.
According to an aspect of the present disclosure, there is provided a face generation method, including: determining at least one reference face image; calculating the average value of the pixel values of the corresponding pixel points in each reference face image to obtain a target face image; extracting the features of the reference face images to obtain feature information corresponding to the reference face images; calculating the average value of the characteristic information corresponding to each reference face image to obtain supervision information; performing the feature extraction on the target face image to obtain feature information of a target face; and correcting the target face image based on the difference value between the characteristic information of the target face and the supervision information to obtain an average face image. Based on the configuration, not only the pixel value information of the reference face image but also the monitoring information determined based on the characteristic information of the reference face image are fully utilized in the process of generating the average face image, the quality of the obtained average face image is improved by correcting the target face image under the action of the monitoring information, the dependence on the number of the reference face images is reduced, and the high-quality average face image can be generated even if a small number of reference face images are used.
In some possible embodiments, the extracting the features of each of the reference face images to obtain feature information corresponding to the reference face image includes: inputting each reference face image into a feature extraction network for feature extraction processing to obtain feature information corresponding to the reference face image; the feature extraction of the target face image to obtain feature information of the target face comprises: inputting the target face image into the feature extraction network for feature extraction processing to obtain feature information of the target face; the correcting the target face image based on the difference between the feature information of the target face and the supervision information to obtain an average face image, including: determining loss according to the difference value between the feature information of the target face and the supervision information; and adjusting parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached. Based on the configuration, the target face image can be continuously optimized depending on the characteristics of forward propagation and backward feedback of the feature extraction network, so that the high-quality target face image is output.
In some possible embodiments, the adjusting the parameter of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached includes: carrying out reverse feedback on the loss along the feature extraction network to obtain the gradient of the target face image; adjusting parameters of the target face image based on the gradient; if the feedback adjustment stopping condition is not met, inputting the adjusted target face image into the feature extraction network again for feature extraction processing, and continuously adjusting the parameters of the target face image based on the obtained feature information of the target face. Based on the configuration, the target face image can be continuously optimized by circularly adjusting the target face image, so that the capability of expressing an average face is improved.
In some possible embodiments, the method further comprises: determining a weight value corresponding to each reference face image; the calculating the average value of the pixel values of the corresponding pixel points in each reference face image to obtain a target face image includes: calculating a pixel value weighted average value of corresponding pixel points in each reference face image according to the weight value corresponding to each reference face image to obtain the target face image; the calculating an average value of the feature information corresponding to each reference face image to obtain supervision information includes: and calculating the weighted average value of the characteristic information corresponding to each reference face image according to the weight value corresponding to each reference face image to obtain the supervision information. Based on the configuration, the purpose of adjusting the average face image can be achieved by adjusting the contribution degree of each reference face image in the process of generating the average face image.
In some possible embodiments, the method further comprises: and changing the weight value corresponding to each reference face image, and obtaining the average face image based on a change result. Based on the configuration, more average face images are obtained by changing the weight, and the diversified requirements of the average face images are met.
In some possible embodiments, the determining at least one reference face image includes: acquiring at least one face material image and a standard face image; and carrying out face alignment processing on each face material image based on the standard face image to obtain a reference face image corresponding to each face material image. Based on the configuration, the face material images can be aligned based on the standard face images, so that the faces in the corresponding obtained reference face images are corrected to a certain extent and are more standard, and the quality of the average face image generated based on the reference face images is improved.
In some possible embodiments, the performing, based on the standard face image, a face alignment process on each of the face material images to obtain a reference face image corresponding to each of the face material images includes: extracting key points of the standard face image to obtain a first key point coordinate; carrying out face detection processing on each face material image to obtain a corresponding face detection frame; extracting key points in each face material image based on each face material image and the face detection frame corresponding to the face material image to obtain corresponding second key point coordinates; and aligning the face material image corresponding to the second key point coordinate to the standard face image based on the second key point coordinate and the first key point coordinate to obtain a corresponding reference face image. Based on the configuration, the face material images can be aligned based on the key point extraction results of the standard face images and the face material images, so that the reference face images are more standard, and the quality of the average face image is finally improved by improving the quality of the reference face images.
In some possible embodiments, the acquiring at least one face material image and a standard face image includes: determining a first object corresponding to the average face image; determining at least one second object having an associative relationship with the first object, the associative relationship comprising a social relationship or an affinity relationship; and determining the image corresponding to the face of the second object as the face material image. Based on the configuration, the face material image can be determined based on the second object related to the first object, and because the second object has a social relationship or an affinity relationship with the first object, the face material image determined based on the second object can carry more information about the first object, so that the similarity of the real face of the face in the finally obtained average face image and the real face of the first object is higher, and the substitution of the average face image is stronger.
In some possible embodiments, the determining the weight corresponding to each of the reference face images includes: determining a second object corresponding to each reference face image; and determining a weight value corresponding to each reference face image according to the incidence relation between the second object corresponding to each reference face image and the first object. Based on the configuration, the weight corresponding to the reference face image can be adjusted according to the blood relationship or the social relationship, so that the face in the obtained average face image is more similar to the real face of the first object.
According to a second aspect of the present disclosure, there is provided a face recognition method, the method comprising: acquiring at least one average face image and an image to be identified; determining the matching degree corresponding to each average face image, wherein the matching degree characterizes the similarity degree of the average face image and the image to be recognized; in response to the condition that the target matching degree is higher than a preset threshold value, judging that the face included in the image to be recognized belongs to an object pointed by an average face image corresponding to the target matching degree, wherein the target matching degree is the maximum matching degree in the matching degrees corresponding to all the average face images; wherein the average face image is generated based on the face generation method of any one of the first aspect. Based on the configuration, the face data source can be supplemented by generating the average face image under the condition that the face data source is insufficient, so that the face recognition can be performed on the object without the real image, the application space of the face recognition is expanded, and a certain face recognition accuracy can be achieved.
According to a third aspect of the present disclosure, there is provided a face generation apparatus, the apparatus comprising: the reference face image determining module is used for determining at least one reference face image; the target face image acquisition module is used for calculating the pixel value average value of corresponding pixel points in each reference face image to obtain a target face image; the characteristic information acquisition module is used for extracting the characteristics of each reference face image to obtain the characteristic information corresponding to the reference face image; the monitoring information acquisition module is used for calculating the average value of the characteristic information corresponding to each reference face image to obtain monitoring information; the target face feature acquisition module is used for extracting the features of the target face image to obtain feature information of a target face; and the correction module is used for correcting the target face image based on the difference value between the characteristic information of the target face and the supervision information to obtain an average face image.
In some possible embodiments, the feature information obtaining module is configured to input each of the reference face images into a feature extraction network to perform feature extraction processing, so as to obtain the feature information; the target face feature acquisition module is used for inputting the target face image into the feature extraction network for feature extraction processing to obtain feature information of the target face; the correction module is used for determining loss according to the difference value between the characteristic information of the target face and the supervision information; and adjusting parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached.
In some possible embodiments, the modification module is configured to perform reverse feedback on the loss along the feature extraction network to obtain a gradient of the target face image; adjusting parameters of the target face image based on the gradient; if the feedback adjustment stopping condition is not met, inputting the adjusted target face image into the feature extraction network again for feature extraction processing, and continuously adjusting the parameters of the target face image based on the obtained feature information of the target face.
In some possible embodiments, the apparatus further comprises: the weight determination module is used for determining the weight corresponding to each reference face image; the target face image acquisition module is further used for calculating a pixel value weighted average value of corresponding pixel points in each reference face image according to the weight value corresponding to each reference face image to obtain the target face image; the supervision information acquisition module is further configured to calculate a weighted average value of the feature information corresponding to each reference face image according to the weight corresponding to each reference face image, so as to obtain the supervision information.
In some possible embodiments, the apparatus further comprises: and the weight value changing module is used for changing the weight value corresponding to each reference face image and obtaining the average face image based on a changing result.
In some possible embodiments, the reference face image determination module includes: the image material determining unit is used for acquiring at least one face material image and a standard face image; and the alignment unit is used for carrying out face alignment processing on each face material image based on the standard face image to obtain a reference face image corresponding to each face material image.
In some possible embodiments, the alignment unit includes: the first key point extraction unit is used for extracting key points of the standard face image to obtain a first key point coordinate; the detection unit is used for carrying out face detection processing on each face material image to obtain a corresponding face detection frame; a second key point extracting unit, configured to extract key points in each of the face material images based on each of the face material images and the face detection frame corresponding to the face material image, so as to obtain corresponding second key point coordinates; and the alignment processing unit is used for aligning the face material image corresponding to the second key point coordinate to the standard face image based on the second key point coordinate and the first key point coordinate to obtain a corresponding reference face image.
In some possible embodiments, the image material determining unit is configured to determine a first object corresponding to the average face image; determining at least one second object having an associative relationship with the first object, the associative relationship comprising a social relationship or an affinity relationship; and determining the image corresponding to the face of the second object as the face material image.
In some possible embodiments, the weight determination module is configured to determine a second object corresponding to each of the reference face images; and determining a weight value corresponding to each reference face image according to the incidence relation between the second object corresponding to each reference face image and the first object.
According to a fourth aspect of the present disclosure, there is provided a face recognition apparatus, the apparatus comprising: the image acquisition module is used for acquiring at least one average human face image and an image to be identified; the matching degree determining module is used for determining the matching degree corresponding to each average face image, and the matching degree characterizes the similarity degree of the average face image and the image to be recognized; the recognition module is used for responding to the condition that the target matching degree is higher than a preset threshold value, judging that the face included in the image to be recognized belongs to an object pointed by the average face image corresponding to the target matching degree, wherein the target matching degree is the maximum matching degree in the matching degrees corresponding to all the average face images; wherein the average face image is generated based on the face generation method of any one of the first aspect.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the face generation method according to any one of the first aspect or the face recognition method according to any one of the second aspect by executing the instructions stored by the memory.
According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium having at least one instruction or at least one program stored therein, the at least one instruction or at least one program being loaded by a processor and executed to implement the face generation method according to any one of the first aspects or the face recognition method according to any one of the second aspects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive efforts.
Fig. 1 shows a schematic flow diagram of a face generation method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram illustrating a method for obtaining a reference face image according to an embodiment of the disclosure;
fig. 3 is a schematic flow chart of a determination method of a face material image according to an embodiment of the present disclosure;
FIG. 4 shows a schematic flow chart for obtaining a rough image according to an embodiment of the present disclosure;
FIG. 5 shows a flow diagram of a supervisory information calculation method according to an embodiment of the present disclosure;
FIG. 6 is a flow chart of a target face image modification method according to an embodiment of the disclosure;
FIG. 7 is a schematic diagram illustrating a process for correcting a target face image based on a neural network according to an embodiment of the disclosure;
FIG. 8 shows a flow diagram of a face recognition method according to an embodiment of the present disclosure;
FIG. 9 shows a block diagram of a face generation apparatus according to an embodiment of the present disclosure;
FIG. 10 shows a block diagram of a face recognition apparatus according to an embodiment of the present disclosure;
FIG. 11 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 12 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments in the present description, belong to the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
With the rapid development of image processing technology, image-based applications have penetrated various industries, and taking face recognition as an example, the image-based applications can be widely applied to various scenes such as face filters, attitude estimation, video monitoring, trajectory tracking, identity recognition and the like. The face recognition is based on a face image of a user, but in an actual use process, the face image of the user may not be acquired, and the face recognition is difficult to play a role in the situation. In view of this, the embodiments of the present disclosure provide a face generation method, which can use a synthesized average face image to replace a face image of a user when the face image of the user cannot be obtained, so that a related application based on the face image of the user can be normally used.
The embodiment of the disclosure provides a face generation method, which includes obtaining a rough target face image based on pixel values of a reference face image, then improving the quality of the target face image through continuous optimization of the target face, obtaining an average face image according to an optimization result, wherein the average face image has high fidelity and good quality, and the generation process of the average face image has no obvious dependence on the number of the reference face images. The technical scheme provided by the embodiment of the disclosure can be applied to application scenarios such as face detection, face recognition, trajectory tracking and the like of images or videos and extension thereof, and the embodiment of the disclosure does not limit the application scenarios. For example, the technical solution provided by the embodiment of the present disclosure may be applied to a scene in which a face database is used to perform face recognition, and if a face image of a user a does not exist in the face database, at least one average face image may be generated according to a face image of a related relative of the user a, and the average face image is stored in the face database as the face image of the user a, so that the face database may support the face recognition of the user a.
The face generation method and the face recognition method provided by the embodiments of the present disclosure may be executed by a terminal device, a server, or other types of electronic devices, where the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, or the like. In some possible implementations, the face generation method and the face recognition method may be implemented by a processor calling computer readable instructions stored in a memory. The following describes a face generation method and a face recognition method according to the embodiments of the present disclosure, taking an electronic device as an execution subject.
Fig. 1 shows a schematic flow diagram of a face generation method according to an embodiment of the present disclosure, as shown in fig. 1, the method includes:
s101: at least one reference face image is determined.
In the embodiment of the disclosure, the existing face material image can be directly used as the reference face image, and the face material image can also be subjected to face alignment processing to obtain the corresponding reference face image. In the embodiment of the present disclosure, the face material image may be directly obtained through an electronic device, or may be obtained by selecting from an existing face image database. Alternatively, the electronic device may acquire the face material image from another device, for example, the electronic device may acquire the face material image from an image capturing device, a monitoring device, or the like. In some implementations, the face material image can be an image frame in a video.
The embodiment of the disclosure can obtain the average face image through at least one reference face image, so that the face in the average face image can more accurately express the average face of the face in each reference face image. The identity information of the face in the reference face image is not limited in the embodiments of the present disclosure, and in some embodiments, the identity information of the face in the reference face image may have an association relationship with the identity information of the face in the average face image. The relationship may be a social relationship or an affinity relationship.
For example, in order to obtain the face of the user a, a user B and a user C having an affinity with the user a may be searched, a reference face image 1 including the face of the user B and a reference face image 2 including the face of the user C are obtained according to a face material image corresponding to the face of the user B and a face material image corresponding to the face of the user C, an average face image 3 may be obtained based on the reference face image 1 and the reference face image 2, and the face in the average face image 3 may be regarded as a face highly similar to the face of the user a.
The embodiment of the present disclosure considers that the common dietary habits may also have an impact on the appearance, and in some scenarios, the reference face image 3 may also be obtained based on a face material image corresponding to the face of the user with the long-term social relationship with the user a, and the reference face image 3 may also be used to obtain the average face.
In one embodiment, at least one face material image and a standard face image may be obtained; and performing face alignment processing on each face material image based on the standard face image to obtain a reference face image corresponding to each face material image. In the embodiment of the present disclosure, the standard face image may be regarded as a face image meeting a preset requirement, where the preset requirement includes not only a face pose requirement but also a face content requirement. For example, the face pose requirement may limit the face in the standard face image to be the face captured by the camera facing the photographer, and the face content requirement may limit the hair in the face in the standard face image not to cover the ears, and the face may not be worn with glasses or a mask. The number of standard face images is not limited in the embodiment of the present disclosure, and of course, a single standard face image may be used to align each face material image.
In an embodiment, a plurality of images may be obtained by performing face acquisition on a plurality of users based on a face pose requirement and a face content requirement, and any one of the plurality of images may be used as the standard face image, or an average face image obtained based on the plurality of images may be used as the standard face image. In another embodiment, images in a standard image library in the related art can also be directly acquired as the standard face image in the present disclosure. The human face material image may be affected by the shooting angle during shooting, so that the image is deformed. Through the configuration, the face material images can be aligned based on the standard face images, so that the faces in the corresponding obtained reference face images are corrected to a certain extent and are more standard, and the quality of the average face image generated based on the reference face images is improved.
In an embodiment, please refer to fig. 2, which illustrates a flowchart of a method for obtaining a reference face image according to an embodiment of the present disclosure. The above-mentioned human face material image carries on the human face to align and process on the basis of the above-mentioned standard human face image, get the correspondent reference human face image of above-mentioned human face material image, including:
s1: and extracting key points of the standard face image to obtain a first key point coordinate.
In the embodiment of the present disclosure, the key point extraction may be performed based on a key point extraction model, and the embodiment of the present disclosure does not limit the key point extraction model. Illustratively, it may be obtained based on a cascade posture Regression model (CPR), a face keypoint detection Network based on cascade convolution (DCNN), a Multi-task cascade convolution neural Network (MTCNN), or a cascade Deep neural Network (DAN).
And obtaining first key point coordinates corresponding to each object in the standard face image through key point extraction. The object may be a part of the standard face image, such as a face contour, eyebrows, eyes, nose, lips, etc. Accordingly, the first key points obtained for these parts may include face key points, eyebrow key points, eye key points, nose key points, lip key points, and the like in the standard face image.
S2: and carrying out face detection processing on each face material image to obtain a corresponding face detection frame.
In the embodiment of the present disclosure, the face detection may be performed based on a face detection model, and the face detection result is expressed by the face detection frame, and the face detection frame represents the position of the face in the face material image. The embodiments of the present disclosure do not limit the face detection model. Illustratively, it can be obtained based on sliding window technology (sliding window), Deformable component Model (DPM), Multi-task Cascaded Convolutional neural Networks (MTCNN), or Cascaded Deep neural Networks (DAN).
S3: and extracting key points in each face material image based on each face material image and the face detection frame corresponding to the face material image to obtain corresponding second key point coordinates.
The face detection frame in the embodiment of the disclosure can be used as position supervision information of a corresponding face material image, so that the key point extraction model can conveniently extract key points of image contents in the face detection frame, the key point extraction efficiency is improved, and the accuracy of key point extraction is also improved.
The first key point and the second key point in the embodiment of the disclosure can be obtained based on the same key point detection model. Corresponding to the above description of the first key points, the second key points may also include face key points, eyebrow key points, eye key points, nose key points, lip key points, etc. in the face material images, and are not described herein again.
S4: and aligning the face material image corresponding to the second key point coordinate to the standard face image based on the second key point coordinate and the first key point coordinate to obtain a corresponding reference face image.
In one embodiment, for each face material image, the corresponding second keypoint coordinates thereof may be obtained. And obtaining an affine transformation matrix based on the first key point coordinates and the second key point coordinates with the corresponding relation, and transforming the face material image based on the affine transformation matrix to obtain a corresponding reference face image. If the first keypoint and the second keypoint correspond to the same object, the first keypoint coordinate of the first keypoint and the second keypoint coordinate of the second keypoint have the correspondence relationship.
In another embodiment, the first key point coordinates, the second key point coordinates and the face material image may also be input into a preset face alignment model, so as to obtain an aligned reference face image. The embodiment of the present disclosure is not limited to the Face Alignment model, and for example, the Face Alignment model may be obtained based on a Local Binary Features algorithm (LBF), a Convolutional Neural Network (CNN), or a three-dimensional Dense Face Alignment model (3D Dense Face Alignment, 3 DDFA).
Through the configuration, the face material images can be aligned based on the key point extraction results of the standard face images and the face material images, so that the deformation of the obtained reference face images is reduced, the reference face images are more standard, and the quality of the average face image is finally improved by improving the quality of the reference face images.
In some scenarios, it may be necessary to execute a related application based on a face image of a certain first object, but the face image of the first object does not exist in the face database, and in order to enable the related application to be performed normally, in an embodiment of the present invention, an average face image may be generated according to a second object having an association relationship with the first object, and the average face image is used as the face image of the first object to support the normal operation of the related application. Referring to fig. 3, a schematic flow chart of a method for determining a face material image according to an embodiment of the present disclosure is shown, including:
and S10, determining a first object corresponding to the average face image.
The first object may be a user whose face image does not exist in the face database. For example, if there is a user who has not entered a face in time in the entrance guard recognition scene or the public security investigation scene, an average face may be generated for the part of the users, and the part of the users may be the first object in step S10.
S20, determining at least one second object having an association relation with the first object, wherein the association relation comprises a social relation or an affinity relation.
The second object is not limited in the embodiments of the present disclosure, and may be an object having a social relationship or an affinity relationship with the first object, for example, the second object may have the following association with the first object: the same race, the same nationality, the same native place, the same sex, the same age or the similar growing environment. In one embodiment, a user having a relationship with a first object may be determined as a second object, and the face similarity of an object having a closer relationship is considered to be higher by the embodiment of the present disclosure, so that the second object may be determined based on the relationship with the blood. In other embodiments, a user who has a long-term close social relationship with the first object may also be determined as the second object, and the disclosed embodiments consider that the face similarity of objects with long-term similarity or the same lifestyle may also be higher.
And S30, determining the image corresponding to the face of the second object as the face material image.
By the above configuration, the face material image can be determined based on the second object having an association relationship with the first object, so that the similarity between the face corresponding to the average face image finally obtained based on the face material image and the real face of the first object is higher, and the substitution of the average face image is stronger.
And S102, calculating the pixel value average value of the corresponding pixel points in each reference face image to obtain the target face image.
The target face image in this step is obtained according to the average value of the pixel values of the corresponding pixels in each reference face image, and the characteristic information implicit in each reference face image is not considered yet, so that the target face image is a rough image. When calculating the average value of the pixel values of the corresponding pixel points in each of the reference face images, the average value of the pixel points corresponding to the same object in each of the reference face images may be obtained, and the obtained result is determined as the pixel value of the pixel point corresponding to the same object in the average face image. Illustratively, the pixel values of the pixel points representing the left face eyebrow peak in each reference face image can be averaged to obtain the pixel value of the pixel point at the left face eyebrow peak in the average face; the pixel values of the pixel points representing the left face and the eye tail in each reference face image can be averaged to obtain the pixel value of the pixel point at the left face and the eye tail in the average face.
Please refer to fig. 4, which illustrates a flowchart of obtaining the rough image according to an embodiment of the disclosure. In the embodiment of the present disclosure, N face material images may be determined, where N is a positive integer greater than 1, the plurality of face material images are aligned to obtain corresponding reference face images, and the pixel points corresponding to the reference face images are averaged to obtain the target face image (coarse image) in this step.
In one embodiment, the weight corresponding to each of the reference face images may be determined, and a weighted average of pixel values of corresponding pixels in each of the reference face images is calculated according to the weight corresponding to each of the reference face images to obtain the target face image. Each reference face image may have the same weight value or different weight values, the weight values may be set as needed, may also be automatically determined based on a preset rule, and may also obtain more average face images through the transformation of the weight values, which is not limited in the embodiments of the present disclosure. Based on the configuration, the contribution degree of each reference face image in the process of generating the average face image can be adjusted, the purpose of adjusting the average face image is achieved, more average face images can be obtained by changing the weight, and the diversified requirements of the average face images are met. In some scenes, the average face image is required to replace a real face image for relevant application, and a plurality of average face images can be obtained through weight change, so that the average face image can fully play a substitution role, and the relevant application is ensured to be normally carried out.
In one embodiment, in order to obtain an average face image that can replace a real face of the first object, a second object corresponding to each of the reference face images can be determined; and determining the weight value corresponding to each reference face image according to the incidence relation between the second object corresponding to each reference face image and the first object. Illustratively, the weight of the reference face image corresponding to the second object of the orthodox blood relative is greater than the weight of the reference face image corresponding to the second object of the collateral blood relative, and the weight of the reference face image corresponding to the second object of the first generation orthodox blood relative is greater than the weight of the reference face image corresponding to the second object of the second generation orthodox blood relative. And the weight value of the reference face image corresponding to the second object with the genetic relationship is greater than the weight value of the reference face image corresponding to the second object without the genetic relationship but with the social relationship. Based on the configuration, the weight of the reference face image can be adjusted according to the association relationship, so that the face in the obtained average face image is more similar to the real face of the first object.
And S103, extracting the characteristics of each reference face image to obtain the characteristic information corresponding to the reference face image.
The embodiment of the disclosure can use a feature extraction network to extract features of reference face images, and can obtain feature information corresponding to each reference face image by inputting each reference face image into the feature extraction network. The embodiment of the present disclosure does not limit the feature extraction network. For example, the feature extraction network may be obtained based on a Visual Geometry Group model (VGG), a feature pyramid network, or a Convolutional Neural Network (CNN).
And S104, calculating the average value of the characteristic information corresponding to each reference face image to obtain the supervision information.
Please refer to fig. 5, which illustrates a flowchart of a monitoring information calculating method according to an embodiment of the present disclosure. The monitoring information in this step is obtained by averaging the feature information corresponding to each of the above-mentioned reference face images. The embodiment of the present disclosure does not limit the weight in the averaging process, and as described above, on the basis of determining the weight corresponding to each of the reference face images, a weighted average of the feature information corresponding to each of the reference face images may be calculated, and the weighted average is used as the monitoring information.
And S105, performing the feature extraction on the target face image to obtain feature information of the target face.
Step S105 and step S103 in the embodiment of the present disclosure perform feature extraction based on the same method. The target face image in step S102 is a rough image, and the feature extraction is performed on the target face image, so that feature information of the target face can be obtained, and specifically, the target face image can be input to the feature extraction network used in step S103, so that the feature information of the target face can be obtained.
And S106, correcting the target face image based on the difference value between the characteristic information of the target face and the monitoring information to obtain an average face image.
In the embodiment of the present disclosure, the process of correcting the target face image based on the difference between the feature information and the monitoring information may be understood as a process of optimizing a rough image based on the difference, so that the feature information of the target face obtained based on the optimized target face image gradually approaches the monitoring information, and accordingly, the target face image has stronger and stronger expressive force on an average face obtained based on the plurality of reference face images.
In one embodiment, step S106 may be implemented by performing a loop, that is, adjusting parameters of the target face image according to a difference between the extracted feature information of the target face and the monitoring information, and continuing the feature extraction and parameter adjustment process on the adjusted target face image until a loop stop condition is reached. The embodiments of the present disclosure do not limit the specific adjustment method and cycle stop conditions.
In one embodiment, please refer to fig. 6, which shows a flowchart of a target face image modification method according to an embodiment of the present disclosure. The correcting the target face image based on the difference between the feature information of the target face and the monitoring information to obtain an average face image includes:
and S1061, determining loss according to the difference value between the feature information of the target face and the supervision information.
Please refer to fig. 7, which illustrates a flowchart of modifying the target face image based on the feature extraction network according to an embodiment of the present disclosure. The feature extraction network in the disclosed embodiment is a neural network which includes at least one network layer and has forward propagation and backward feedback characteristics. In the embodiment of the present disclosure, the last network layer determined according to the order of forward propagation of information in the feature extraction network is a network layer for outputting the feature information of the target face, and taking the feature extraction network including the network layer 1, the network layer 2, and the network layer 3 as an example, after the target face image is input into the network layer 1, the network layer 3 may output the feature information of the target face, so that the loss generated by the network layer 3 may be characterized by a difference between the feature information of the target face and the supervision information.
The embodiments of the present disclosure do not limit a specific method for determining the loss according to the difference. For example, the loss may be equal to the difference itself or a value of a predetermined loss function using the difference as a parameter. The embodiments of the present disclosure do not limit this.
And S1062, adjusting parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached.
The loss generated by the neural network can be fed back in a reverse direction along a network layer in the neural network to adjust the parameters of the target face image, and the adjusted target face image is used as a new input of the feature extraction network to continue triggering and executing the steps S1061-S1062 until the reverse adjustment stop condition is reached. The number of target face images corrected based on the feature extraction network is not limited in the embodiment of the disclosure, and a single target face image or a plurality of target face images can be corrected based on the feature extraction network, which is not described herein again. Based on the configuration, the target face image can be continuously optimized depending on the characteristics of forward propagation and backward feedback of the feature extraction network, so that the high-quality target face image is output.
In an embodiment, the adjusting the parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached includes:
and S10621, performing reverse feedback on the loss along the feature extraction network to obtain the gradient of the target face image.
In the embodiment of the present disclosure, the last network layer determined according to the order of information reverse feedback in the feature extraction network is a network layer for receiving the target face image, and still taking the feature extraction network including the network layer 1, the network layer 2, and the network layer 3 as an example, after the target face image is input into the network layer 1, the network layer 3 may output the feature information of the target face, and the gradient generated by the network layer 1 may be considered to correspond to the gradient of the target face image.
S10622, adjusting parameters of the target face image based on the gradient.
The parameters of the feature extraction network can be fixed in the process of the reverse feedback, namely, the generated gradient is fed back to the target face image to trigger the parameter adjustment of the target face image. Illustratively, the target face image may be expressed by multidimensional data, which may be regarded as parameters of the target face image, and the purpose of adjusting the parameters of the target face image may be achieved by adjusting the multidimensional data. The embodiments of the present disclosure do not limit the specific method of parameter adjustment.
In one possible embodiment, the parameters of the target face image may be adjusted based on a gradient descent method. The gradient descent method is one of iterative methods, and can be used to solve a least squares problem (both linear and non-linear). In solving the unconstrained optimization problem, the gradient descent method is one of the most commonly employed methods. The Gradient Descent method is not limited in the embodiments of the present disclosure, and a Gradient Descent algorithm (GD), a random Gradient Descent algorithm (SGD), or the like may be used.
And S10623, if the feedback adjustment stopping condition is not met, inputting the adjusted target face image into the feature extraction network again to perform feature extraction processing, and continuously adjusting parameters of the target face image based on the obtained feature information of the target face.
In the embodiment of the present disclosure, the process of re-inputting the adjusted target face image into the feature extraction network for feature extraction processing, and the process of continuing to adjust the parameter of the target face image based on the obtained feature information of the target face may refer to the foregoing, which is not described herein again.
And S10624, if the feedback adjustment stopping condition is met, determining the target face image as the average face image.
Based on the configuration, the target face image can be continuously optimized by circularly adjusting the target face image, so that the capability of expressing an average face obtained based on the reference face image is improved, and the quality of the target face image is improved.
The embodiments of the present disclosure do not limit the feedback adjustment stop condition. In an embodiment, a loss threshold may be set, and in a case where the loss is less than the loss threshold, it may indicate that the adjustment of the target face image meets the requirement, and the adjustment may be performed, and in a case where the loss is greater than or equal to the loss threshold, a parameter of the target face image may be feedback-adjusted. The loss threshold may be a value set according to the requirement, such as 0.1, but is not a specific limitation of the present disclosure. In another embodiment, a threshold value of the number of times of feedback adjustment may be set, and when the number of times of adjustment is greater than the threshold value of times, it may indicate that the adjustment on the target face image meets the requirement, and may be applied, otherwise, the adjustment is continued. The number threshold may be a value set according to needs, and is not a specific limitation of the present disclosure.
The embodiment of the disclosure provides a face generation method, which can obtain a target face image based on an average value of pixel values of a reference face image, correct the target face image by taking an average characteristic of the reference face image as supervision information, and obtain an average face image according to a correction result. In the process of generating the average face image, not only the pixel value information of the reference face image is utilized, but also the monitoring information determined based on the characteristic information of the reference face image is fully utilized, the quality of the obtained average face image is improved by correcting the target face image under the action of the monitoring information, the number dependence on the reference face image can be reduced by fully utilizing the information in the reference face image and fully utilizing the information to carry out image correction, and the high-quality average face image can be generated even if a small number of reference face images are used.
The embodiment of the disclosure can be widely applied to various fields, for example, the field of face recognition, is an application with a higher landing degree in the technology of recognition and retrieval based on image visual characteristics, and can be widely applied to scenes such as security protection, search and the like. The embodiment of the present disclosure further provides a face recognition method, as shown in fig. 8, which shows a schematic flow chart of the face recognition method according to the embodiment of the present disclosure. The method comprises the following steps:
s201: and acquiring at least one average human face image and an image to be recognized.
In the embodiment of the present disclosure, each average face image corresponds to one object, the object corresponding to the average face image is an owner of a face that the average face image is intended to express, and the average face image may be generated based on the face generation method in the embodiment of the present disclosure. In some face recognition scenarios, it may be necessary to locate, troubleshoot or search for an object of known identity, and if there is no real face image of the object, one or more average face images may be generated for the object based on the above-mentioned method provided by the embodiments of the present disclosure, and the average face image is used as a substitute for the real face image to support face recognition of the object. For example, in a scene where the face retrieval deployment system performs face recognition, an average face image of the object may be input into the face retrieval deployment system, so that the face retrieval deployment system may perform face recognition on the object.
For example, the face retrieval control system needs to search the user 1, but does not have the face data of the user 1, but can find other users having an association relationship with the user 1, and then can generate an average face image corresponding to the user 1 based on the faces of the other users. In some embodiments, at least one reference face image may be obtained based on the faces of the other users, and after determining the weight of each reference face image, an average face image corresponding to the user 1 may be generated. Further, the weight of each reference face image can be customized and changed to obtain a plurality of average face images corresponding to the user 1, so that the probability that the face retrieval control system identifies the user 1 is increased.
S202: and determining the matching degree corresponding to each average face image, wherein the matching degree represents the similarity degree between the average face image and the image to be recognized.
The embodiment of the present disclosure does not limit the method for calculating the matching degree, and for example, the matching degree may be calculated based on a face recognition model, or the first feature of the image to be recognized and the second feature of the average face image may be directly extracted, and the matching degree may be calculated according to a distance between the first feature and the second feature.
S203: and in response to the condition that the target matching degree is higher than a preset threshold value, judging that the face included in the image to be recognized belongs to an object pointed by the average face image corresponding to the target matching degree, wherein the target matching degree is the maximum matching degree in the matching degrees corresponding to the average face images.
The preset threshold is not limited in the embodiment of the disclosure, and can be set according to actual conditions. If the target matching degree is higher than the preset threshold, it is determined that the face included in the image to be recognized is the face of an object (third object) pointed by the average face image corresponding to the target matching degree.
In an embodiment, the average face image corresponding to the target matching degree may be further directly used as the face image corresponding to the third object in the next face recognition, and other average face images corresponding to the third object are not needed, so as to improve the face recognition speed.
In another embodiment, if a plurality of average face images are generated for the third object, each average face image may be weighted according to the matching degree corresponding to each average face image in the previous face recognition process, and the matching order of the average face images may be adjusted according to the weights.
Illustratively, an average face image with a good comprehensive matching degree in the previous face recognition process can be given a higher weight, an average face image with a poor comprehensive matching degree can be given a lower weight, images with high weights are sorted in front and are preferentially used for being matched with images to be recognized, and if the matching degree is higher than the preset threshold, a matching result is directly output, so that the face recognition speed is improved.
Based on the configuration, the face data source can be supplemented by generating the average face image under the condition that the face data source is insufficient, so that the face recognition of a user without a real image can be performed, the application space of the face recognition is expanded, and a certain face recognition accuracy can be achieved.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing of the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted.
Fig. 9 shows a block diagram of a face generation apparatus according to an embodiment of the present disclosure. As shown in fig. 9, the above apparatus includes:
a reference face image determining module 101, configured to determine at least one reference face image;
a target face image obtaining module 102, configured to calculate an average value of pixel values of corresponding pixel points in each of the reference face images, so as to obtain a target face image;
a feature information obtaining module 103, configured to perform feature extraction on each reference face image to obtain feature information corresponding to the reference face image;
a monitoring information obtaining module 104, configured to calculate an average value of feature information corresponding to each of the reference face images, so as to obtain monitoring information;
a target face feature obtaining module 105, configured to perform the feature extraction on the target face image to obtain feature information of a target face;
and a correction module 106, configured to correct the target face image based on a difference between the feature information of the target face and the monitoring information, so as to obtain an average face image.
In some possible embodiments, the feature information obtaining module is configured to input each of the reference face images into a feature extraction network to perform feature extraction processing, so as to obtain the feature information; the target face feature acquisition module is used for inputting the target face image into the feature extraction network for feature extraction processing to obtain feature information of the target face; the correction module is used for determining loss according to the difference value between the characteristic information of the target face and the supervision information; and adjusting the parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached.
In some possible embodiments, the modification module is configured to perform reverse feedback on the loss along the feature extraction network to obtain a gradient of the target face image; adjusting parameters of the target face image based on the gradient; if the feedback adjustment stopping condition is not reached, the adjusted target face image is input into the feature extraction network again for feature extraction processing, and parameters of the target face image are continuously adjusted based on the obtained feature information of the target face.
In some possible embodiments, the apparatus further comprises: a weight value determining module, configured to determine a weight value corresponding to each of the reference face images; the target face image obtaining module is further configured to calculate a weighted average of pixel values of corresponding pixel points in each of the reference face images according to a weight corresponding to each of the reference face images, so as to obtain the target face image; the monitoring information obtaining module is further configured to calculate a weighted average of the feature information corresponding to each of the reference face images according to the weight corresponding to each of the reference face images, so as to obtain the monitoring information.
In some possible embodiments, the apparatus further comprises: and the weight value changing module is used for changing the weight value corresponding to each reference face image and obtaining the average face image based on a changing result.
In some possible embodiments, the reference face image determination module includes: the image material determining unit is used for acquiring at least one face material image and a standard face image; and the alignment unit is used for carrying out face alignment processing on each face material image based on the standard face image to obtain a reference face image corresponding to each face material image.
In some possible embodiments, the alignment unit includes: the first key point extraction unit is used for extracting key points of the standard face image to obtain a first key point coordinate; a detection unit, configured to perform face detection processing on each of the face material images to obtain a corresponding face detection frame; a second key point extracting unit, configured to extract key points in each of the face material images based on each of the face material images and the face detection frame corresponding to the face material image, so as to obtain corresponding second key point coordinates; and the alignment processing unit is used for aligning the face material image corresponding to the second key point coordinate to the standard face image based on the second key point coordinate and the first key point coordinate to obtain a corresponding reference face image.
In some possible embodiments, the image material determining unit is configured to determine a first object corresponding to the average face image; determining at least one second object having an association relationship with the first object, wherein the association relationship comprises a social relationship or an affinity relationship; and determining the image corresponding to the face of the second object as the face material image.
In some possible embodiments, the weight determining module is configured to determine a second object corresponding to each of the reference face images; and determining the weight corresponding to each reference face image according to the incidence relation between the second object and the first object.
Fig. 10 shows a block diagram of a face recognition apparatus according to an embodiment of the present disclosure. As shown in fig. 10, the above apparatus includes:
an image obtaining module 201, configured to obtain at least one average face image and an image to be identified;
a matching degree determining module 202, configured to determine a matching degree corresponding to each average face image, where the matching degree represents a similarity degree between the average face image and the image to be recognized;
the recognition module 203 is configured to determine, in response to a situation that a target matching degree is higher than a preset threshold, that a face included in the image to be recognized belongs to an object pointed by an average face image corresponding to the target matching degree, where the target matching degree is a maximum matching degree among matching degrees corresponding to the average face images; wherein, the average face image is generated by the face generation method.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
The embodiment of the present disclosure also provides a computer-readable storage medium, where at least one instruction or at least one program is stored in the computer-readable storage medium, and the at least one instruction or the at least one program is loaded by a processor and executed to implement the method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the method.
The electronic device may be provided as a terminal, server, or other form of device.
FIG. 11 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 11, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user as described above. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the above-mentioned communication component 816 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 12 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 12, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. A method for generating a face, the method comprising:
determining at least one reference face image;
calculating the average value of the pixel values of the corresponding pixel points in each reference face image to obtain a target face image;
extracting the features of the reference face images to obtain feature information corresponding to the reference face images;
calculating the average value of the characteristic information corresponding to each reference face image to obtain supervision information;
performing the feature extraction on the target face image to obtain feature information of a target face;
and correcting the target face image based on the difference value between the characteristic information of the target face and the supervision information to obtain an average face image.
2. The method according to claim 1, wherein the extracting the features of each of the reference face images to obtain the feature information corresponding to the reference face image comprises: inputting each reference face image into a feature extraction network for feature extraction processing to obtain feature information corresponding to the reference face image;
the feature extraction of the target face image to obtain feature information of the target face comprises: inputting the target face image into the feature extraction network for feature extraction processing to obtain feature information of the target face;
the correcting the target face image based on the difference between the feature information of the target face and the supervision information to obtain an average face image, including:
determining loss according to the difference value between the feature information of the target face and the supervision information;
and adjusting parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached.
3. The method according to claim 2, wherein the adjusting the parameters of the target face image based on the loss feedback until a preset feedback adjustment stop condition is reached comprises:
carrying out reverse feedback on the loss along the feature extraction network to obtain the gradient of the target face image;
adjusting parameters of the target face image based on the gradient;
if the feedback adjustment stopping condition is not met, inputting the adjusted target face image into the feature extraction network again for feature extraction processing, and continuously adjusting the parameters of the target face image based on the obtained feature information of the target face.
4. The method according to any one of claims 1 to 3, further comprising:
determining a weight value corresponding to each reference face image;
the calculating the average value of the pixel values of the corresponding pixel points in each reference face image to obtain a target face image includes: calculating a pixel value weighted average value of corresponding pixel points in each reference face image according to the weight value corresponding to each reference face image to obtain the target face image;
the calculating an average value of the feature information corresponding to each reference face image to obtain supervision information includes: and calculating the weighted average value of the characteristic information corresponding to each reference face image according to the weight value corresponding to each reference face image to obtain the supervision information.
5. The method of claim 4, further comprising:
and changing the weight value corresponding to each reference face image, and obtaining the average face image based on a change result.
6. The method according to any one of claims 1 to 5, wherein the determining at least one reference face image comprises:
acquiring at least one face material image and a standard face image;
and carrying out face alignment processing on each face material image based on the standard face image to obtain a reference face image corresponding to each face material image.
7. The method according to claim 6, wherein the performing the face alignment process on each of the face material images based on the standard face image to obtain a reference face image corresponding to each of the face material images comprises:
extracting key points of the standard face image to obtain a first key point coordinate;
carrying out face detection processing on each face material image to obtain a corresponding face detection frame;
extracting key points in each face material image based on each face material image and the face detection frame corresponding to the face material image to obtain corresponding second key point coordinates;
and aligning the face material image corresponding to the second key point coordinate to the standard face image based on the second key point coordinate and the first key point coordinate to obtain a corresponding reference face image.
8. The method according to claim 6 or 7, wherein the acquiring at least one face material image and a standard face image comprises:
determining a first object corresponding to the average face image;
determining at least one second object having an associative relationship with the first object, the associative relationship comprising a social relationship or an affinity relationship;
and determining the image corresponding to the face of the second object as the face material image.
9. The method according to claim 8, wherein the determining the weight corresponding to each of the reference face images comprises:
determining a second object corresponding to each reference face image;
and determining a weight value corresponding to each reference face image according to the incidence relation between the second object corresponding to each reference face image and the first object.
10. A face recognition method, comprising:
acquiring at least one average face image and an image to be identified;
determining the matching degree corresponding to each average face image, wherein the matching degree characterizes the similarity degree of the average face image and the image to be recognized;
in response to the condition that the target matching degree is higher than a preset threshold value, judging that the face included in the image to be recognized belongs to an object pointed by an average face image corresponding to the target matching degree, wherein the target matching degree is the maximum matching degree in the matching degrees corresponding to all the average face images;
wherein the average face image is generated based on the face generation method of any one of claims 1 to 9.
11. An apparatus for generating a human face, the apparatus comprising:
the reference face image determining module is used for determining at least one reference face image;
the target face image acquisition module is used for calculating the pixel value average value of corresponding pixel points in each reference face image to obtain a target face image;
the characteristic information acquisition module is used for extracting the characteristics of each reference face image to obtain the characteristic information corresponding to the reference face image;
the monitoring information acquisition module is used for calculating the average value of the characteristic information corresponding to each reference face image to obtain monitoring information;
the target face feature acquisition module is used for extracting the features of the target face image to obtain feature information of a target face;
and the correction module is used for correcting the target face image based on the difference value between the characteristic information of the target face and the supervision information to obtain an average face image.
12. An apparatus for face recognition, the apparatus comprising:
the image acquisition module is used for acquiring at least one average human face image and an image to be identified;
the matching degree determining module is used for determining the matching degree corresponding to each average face image, and the matching degree characterizes the similarity degree of the average face image and the image to be recognized;
the recognition module is used for responding to the condition that the target matching degree is higher than a preset threshold value, judging that the face included in the image to be recognized belongs to an object pointed by the average face image corresponding to the target matching degree, wherein the target matching degree is the maximum matching degree in the matching degrees corresponding to all the average face images;
wherein the average face image is generated based on the face generation method of any one of claims 1 to 9.
13. A computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded by a processor and executed to implement the face generation method according to any one of claims 1 to 9 or the face recognition method according to claim 10.
14. An electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the face generation method of any one of claims 1-9 or the face recognition method of claim 10 by executing the instructions stored by the memory.
CN202111142251.XA 2021-09-28 2021-09-28 Face generation method, face recognition method and device Pending CN113837932A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111142251.XA CN113837932A (en) 2021-09-28 2021-09-28 Face generation method, face recognition method and device
PCT/CN2022/077557 WO2023050695A1 (en) 2021-09-28 2022-02-24 Face image generation method, face image recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111142251.XA CN113837932A (en) 2021-09-28 2021-09-28 Face generation method, face recognition method and device

Publications (1)

Publication Number Publication Date
CN113837932A true CN113837932A (en) 2021-12-24

Family

ID=78966960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111142251.XA Pending CN113837932A (en) 2021-09-28 2021-09-28 Face generation method, face recognition method and device

Country Status (2)

Country Link
CN (1) CN113837932A (en)
WO (1) WO2023050695A1 (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090232365A1 (en) * 2008-03-11 2009-09-17 Cognimatics Ab Method and device for face recognition
CN109214273A (en) * 2018-07-18 2019-01-15 平安科技(深圳)有限公司 Facial image comparison method, device, computer equipment and storage medium
CN111836058B (en) * 2019-04-22 2023-02-24 腾讯科技(深圳)有限公司 Method, device and equipment for playing real-time video and storage medium
CN110288547A (en) * 2019-06-27 2019-09-27 北京字节跳动网络技术有限公司 Method and apparatus for generating image denoising model
CN113831932A (en) * 2020-06-08 2021-12-24 中国石化工程建设有限公司 Installation device and installation method for cracking furnace radiation coil
CN112052761A (en) * 2020-08-27 2020-12-08 腾讯科技(深圳)有限公司 Method and device for generating confrontation face image
CN112990016B (en) * 2021-03-16 2022-09-02 中国平安人寿保险股份有限公司 Expression feature extraction method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
WO2023050695A1 (en) 2023-04-06

Similar Documents

Publication Publication Date Title
CN109800737B (en) Face recognition method and device, electronic equipment and storage medium
WO2021008195A1 (en) Data updating method and apparatus, electronic device, and storage medium
CN111553864B (en) Image restoration method and device, electronic equipment and storage medium
EP2977956B1 (en) Method, apparatus and device for segmenting an image
CN109934275B (en) Image processing method and device, electronic equipment and storage medium
CN110569777B (en) Image processing method and device, electronic device and storage medium
CN110598504B (en) Image recognition method and device, electronic equipment and storage medium
CN111241887B (en) Target object key point identification method and device, electronic equipment and storage medium
CN109325908B (en) Image processing method and device, electronic equipment and storage medium
CN109840939B (en) Three-dimensional reconstruction method, three-dimensional reconstruction device, electronic equipment and storage medium
CN107944367B (en) Face key point detection method and device
CN111243011A (en) Key point detection method and device, electronic equipment and storage medium
CN110909654A (en) Training image generation method and device, electronic equipment and storage medium
CN110532956B (en) Image processing method and device, electronic equipment and storage medium
CN109685041B (en) Image analysis method and device, electronic equipment and storage medium
CN112188091B (en) Face information identification method and device, electronic equipment and storage medium
CN109344703B (en) Object detection method and device, electronic equipment and storage medium
CN113643356A (en) Camera pose determination method, camera pose determination device, virtual object display method, virtual object display device and electronic equipment
CN112270288A (en) Living body identification method, access control device control method, living body identification device, access control device and electronic device
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
CN107729886B (en) Method and device for processing face image
CN110826463B (en) Face recognition method and device, electronic equipment and storage medium
CN112597944A (en) Key point detection method and device, electronic equipment and storage medium
CN111507131B (en) Living body detection method and device, electronic equipment and storage medium
CN110826045B (en) Authentication method and device, electronic equipment and storage medium

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40062902

Country of ref document: HK