Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a face image recognition method according to some embodiments of the present disclosure.
As shown in fig. 1, after receiving a to-be-processed face image 101, in order to ensure accuracy and validity of face recognition, an electronic device 100 may first detect a sharpness 102 of the to-be-processed face image 101. When the definition 102 is greater than or equal to the set definition threshold, it is indicated that accurate face recognition can be performed on the face image 101 to be processed. When the definition 102 is smaller than the set definition threshold, it indicates that accurate and effective face recognition information cannot be obtained when the face image 101 to be processed is directly subjected to face recognition. At this time, the electronic apparatus 100 may generate a face simulation image 103 based on the face image 101 to be processed. The face simulation image 103 is an image with the same image content as the face image 101 to be processed, but with a definition higher than a set definition threshold. On the basis, the electronic device 100 directly performs face recognition on the face simulation image 103, and the obtained face recognition information has higher accuracy and effectiveness.
It should be understood that the number of electronic devices 100 in FIG. 1 is merely illustrative. There may be any number of electronic devices 100, as desired for implementation.
With continued reference to fig. 2, fig. 2 illustrates a flow 200 of some embodiments of a face image recognition method according to the present disclosure. The face image recognition method comprises the following steps:
step 201, detecting the definition of the face image to be processed.
In some embodiments, the executing subject of the facial image recognition method (for example, the electronic device 100 shown in fig. 1) may receive the facial image to be processed through a wired connection or a wireless connection. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
The execution subject can detect the definition of the face image to be processed. For example, the executing subject may convert the face image to be processed into a gray-scale image, and perform noise reduction processing on the gray-scale image to obtain a noise-reduced image. Then, edge points within the noise-reduced image are acquired. The edge points can represent various lines related to the face image in the noise reduction image. And performing low-pass filtering processing on the noise-reduced image by the execution main body to obtain a blurred image, then calculating the definition characteristic quantity of each edge point in the noise-reduced image and the blurred image, and further calculating the definition value of each edge point. And finally, taking the mean value of the definition values of all the edge points as the definition of the face image to be processed. The execution subject may also detect the contrast of pixels within the face image to be processed. When the contrast is smaller than the set threshold, the pixel difference in the face image to be processed is considered to be too small, and the face image to be processed is not easy to be subjected to face recognition. On the contrary, when the contrast is greater than or equal to the set threshold, the face image to be processed can be subjected to face recognition.
And 202, responding to the situation that the definition is smaller than a set definition threshold value, and generating a human face simulation image based on the human face image to be processed.
In some embodiments, when the sharpness is less than the set sharpness threshold, the execution subject may generate a face simulation image corresponding to the face image to be processed by a variety of methods. For example, the execution subject may perform image processing on the face image to be processed, and acquire the face simulation image in a manner of improving the brightness of the face image to be processed, increasing the contrast, and the like. The face simulation image may be an image with the same content as the face image to be processed and with a definition greater than the definition threshold.
And 203, recognizing the face simulation image to obtain face recognition information corresponding to the face image to be processed.
After the face simulation image is obtained, the execution main body can perform face recognition on the face simulation image to obtain face recognition information corresponding to the face image to be processed. Therefore, the accuracy and the effectiveness of the identification of the face image to be processed can be improved.
According to the face image recognition method disclosed by some embodiments of the disclosure, the definition of a face image to be processed is detected at first, so that the preprocessing of the image quality is realized. And then generating a face simulation image corresponding to the face image to be processed under the condition that the definition is less than a set definition threshold value. The definition of the face simulation image is greater than a definition threshold value, and the face simulation image reserves the face characteristics of the face image to be processed. Therefore, the accuracy of face image recognition is improved. And finally, identifying the human face simulation image to obtain human face identification information. Therefore, the accuracy of the identification of the face image to be processed is improved.
With continued reference to fig. 3, fig. 3 illustrates a flow 300 of some embodiments of a face image recognition method according to the present disclosure. The face image recognition method comprises the following steps:
step 301, detecting the definition of the face image to be processed.
The content of step 301 is the same as that of step 201, and is not described in detail here.
Step 302, importing the face image to be processed into a face image generation model to obtain the face simulation image.
The execution main body can lead the face image to be processed into a face image generation model to obtain the face simulation image. The face image generation model may be a deep learning model, a genetic algorithm model, or any other model, which is not described herein any more.
In some optional implementations of some embodiments, the face image generation model is obtained by:
the method comprises the steps of firstly, obtaining a plurality of sample face input images and sample face target images corresponding to each sample face input image in the plurality of sample face input images.
The execution subject may obtain a plurality of sample face input images and a plurality of sample face target images. And the definition of the sample face target image is equal to or less than the definition threshold, the image content of the sample face target image is the same as that of the sample face input image, and the definition of the sample face target image is greater than the definition threshold. The sample face target image may be an artificially labeled image containing a plurality of face key points. The sample face input image and the corresponding sample face target image can be face images under various angles and distances.
Optionally, the execution subject may further obtain a clear sample face target image, and then process the sample face target image to obtain a sample face input image with the definition smaller than the definition threshold. The execution subject may also obtain the sample face input image and the sample face target image in other manners, which is not described herein any more.
And secondly, extracting a pre-established generative countermeasure network.
In this embodiment, the execution agent may extract a pre-established Generative Adaptive Networks (GAN). The generation type countermeasure network comprises a generation network and a discrimination network, wherein the generation network is used for generating a face target image by using a face input image, and the discrimination network is used for determining whether the image input into the discrimination network is the image output by the generation network.
The generation network may be a convolutional neural network (e.g., various convolutional neural network structures including a convolutional layer, a pooling layer, an anti-pooling layer, and an anti-convolutional layer) for performing image processing. The discriminative network may be a convolutional neural network (e.g., various convolutional neural network structures that include a fully-connected layer, where the fully-connected layer may perform a classification function). In addition, the above-mentioned discriminant network may be another model structure for realizing the classification function, such as a Support Vector Machine (SVM). For example, if the determination network determines that the input image is an image (from the generated data) output by the generation network, 1 may be output; if it is determined that the input image is not an image output by the generation network, 0 may be output. It should be noted that the discriminant network may also output other values, such as a value between 0 and 1, which characterizes the probability that the image input to the discriminant network is from the real data.
And thirdly, using a machine learning method to take each sample face input image in the plurality of sample face input images as the input of a generation network, taking an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as the input of a discrimination network, training the generation network and the discrimination network, and determining the trained generation network as a face image generation model.
In this embodiment, based on the above-mentioned generative confrontation network, the executing agent may train the generative network and the discrimination network by using a machine learning method, with each of the plurality of sample face input images as an input of the generative network, and with a sample face target image corresponding to an image output from the generative network and the sample face input image input to the generative network as an input of the discrimination network. And then, determining the trained generation network as a face image generation model.
In some optional implementation manners of some embodiments, the training of the generation network and the discriminant network to determine the trained generation network as the face image generation model may perform the following training steps:
firstly, fixing parameters of the generated network, taking each sample face input image in the plurality of sample face input images as the input of the generated network, taking an image output by the generated network and a sample face target image corresponding to the sample face input image input into the generated network as the input of a discrimination network, and training the discrimination network by using a machine learning method. The machine learning method may be supervised learning, unsupervised learning, semi-supervised learning, reinforcement learning, or the like.
And secondly, fixing the parameters of the trained discrimination network, taking each sample face input image in the plurality of sample face input images as the input of a generated network, and training the generated network by using a machine learning method. The executive agent may also train the generating network by combining a machine learning method with a back propagation algorithm, a gradient descent algorithm, and the like.
And thirdly, determining the accuracy of the discrimination result output by the trained discrimination network, and determining the generation network trained most recently as the face image generation model in response to the determination accuracy being greater than an accuracy threshold (for example, 80%).
In some embodiments, in response to determining that the accuracy is less than or equal to the accuracy threshold, the training step is re-performed using the most recently trained generation network and discrimination network. Therefore, parameters of the face image generation model obtained by the generative confrontation network training can be obtained based on the training samples and can be determined based on the back propagation of the discrimination network, and the training of the generation model can be realized without depending on a large number of labeled samples, so that the face image generation model is obtained, the labor cost is reduced, and the accuracy and the effectiveness of generating the face simulation image are improved.
In some optional implementations of some embodiments, the sample face target image may be obtained by:
firstly, acquiring the face characteristics of the sample face input image.
In order to obtain an accurate and effective sample face target image, the execution subject may first obtain the face features of the sample face input image. The human face features may be a round face, a long face, a square face, and the like.
And secondly, determining a face prediction key point based on the face features.
Each facial organ (such as eyes, eyebrows, nose, mouth, etc.) on the face has a relatively fixed position. The execution subject may determine face prediction key points from the face features. Therefore, the corresponding relation between the face prediction key point and the face features is favorable for ensuring that the subsequent sample face target image and the sample face input image have the same face features.
And thirdly, constructing a sample human face target image through the human face prediction key points.
After the face prediction key points are obtained, the execution subject may construct a sample face target image based on the face prediction key points. That is, the sample face target image may be a false face image that is constructed by performing a main body and that includes a face prediction key point of the sample face input image.
In some optional implementations of some embodiments, the determining the face prediction key point based on the face feature may include:
the method comprises the following steps of firstly, determining position information of a face prediction key point and an initial image of the face prediction key point based on the face structure information.
In practice, the face may face in various directions, and the faces are different from each other. Therefore, the face features may include spatial gradient of the face and face structure information. The execution subject may determine face prediction keypoint location information based on the face structure information. Then, the execution subject may further determine a face prediction keypoint initial image according to the face prediction keypoint position information. The initial image of the face prediction key point can be an image of a face organ corresponding to the face prediction key point.
And secondly, adjusting the position information of the human face prediction key points and the initial image of the human face prediction key points based on the human face spatial gradient, and determining the human face prediction key points.
Each facial organ may present different images at different spatial inclinations. The execution main body can adjust the position information of the face prediction key points and the initial image of the face prediction key points according to the spatial gradient of the face, and further determine the face prediction key points. Therefore, the accuracy and the effectiveness of the key points of the face prediction are greatly improved.
In some optional implementation manners of some embodiments, the constructing a sample face target image by using the face prediction key points may include the following steps:
firstly, constructing an initial face image based on the face prediction key points.
After the face prediction key points are obtained, the execution subject can refer to the face structure information to construct an initial face image. At this time, the initial face image only contains the face prediction key points and the face structure information, and is not infected by factors such as ambient light and the like. Therefore, the sharpness of the initial face image can be high.
And secondly, rendering the initial face image to obtain a sample face target image.
And finally, the execution subject can render the initial face image to obtain a sample face target image. At this time, the obtained sample face target image may be an image that includes the face key points of the sample face input image and has high sharpness (higher than the sharpness threshold).
Step 303, recognizing the face simulation image to obtain face recognition information corresponding to the face image to be processed.
The content of step 303 is the same as that of step 203, and is not described in detail here.
Further reference is made to fig. 4, which shows a schematic view of another application scenario of the face image recognition method.
In fig. 4, the electronic device first receives a to-be-processed face image 401, and determines a plurality of face prediction key points 402 according to face features in the to-be-processed face image 401 when the definition of the to-be-processed face image 401 is smaller than a set definition threshold. Thereafter, a face simulation image 403 is generated from the face prediction key points 402. The face simulation image 403 may be a false face image which contains the face features in the face image 401 to be processed and has the definition greater than the definition threshold. Then, the electronic device performs face recognition on the face simulation image 403, and the obtained face recognition information 404 is the face recognition information of the face image 401 to be processed.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a face image recognition apparatus, which correspond to those shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 5, the face image recognition apparatus 500 of some embodiments includes: an image sharpness detection unit 501, a face simulation image generation unit 502, and a face recognition unit 503. The image definition detection unit 501 is configured to detect the definition of a face image to be processed; a face simulation image generation unit 502, responsive to the sharpness being less than a set sharpness threshold, configured to generate a face simulation image based on the face image to be processed, the sharpness of the face simulation image being greater than the sharpness threshold; the face recognition unit 503 is configured to recognize the face simulation image to obtain face recognition information corresponding to the face image to be processed.
In an optional implementation manner of some embodiments, the face simulation image generation unit 502 may include: and a face simulation image generation subunit (not shown in the figure) configured to import the to-be-processed face image into a face image generation model, so as to obtain the face simulation image.
In an optional implementation manner of some embodiments, the face simulation image generation subunit may include a face image generation model module (not shown in the figure) configured to train a face image generation model, and the face image generation model module may include: a sample acquisition sub-module (not shown in the figure), a network extraction sub-module (not shown in the figure) and a face image generation model training sub-module (not shown in the figure). The system comprises a sample acquisition submodule and a processing submodule, wherein the sample acquisition submodule is configured to acquire a plurality of sample face input images and a sample face target image corresponding to each sample face input image in the plurality of sample face input images, the definition of each sample face input image is less than or equal to a definition threshold value, the image content of each sample face target image is the same as that of each sample face input image, and the definition of each sample face target image is greater than the definition threshold value; a network extraction submodule configured to extract a pre-established generative confrontation network, wherein the generative confrontation network comprises a generation network and a discrimination network, the generation network is used for generating a face target image by using a face input image, and the discrimination network is used for determining whether an image input into the discrimination network is an image output by the generation network; and the face image generation model training sub-module is configured to use a machine learning method to take each sample face input image in the plurality of sample face input images as the input of a generation network, take an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as the input of a discrimination network, train the generation network and the discrimination network, and determine the trained generation network as the face image generation model.
In an optional implementation manner of some embodiments, the facial image generation model training sub-module may include: a face image generation model training module (not shown in the figure) configured to fix parameters of the generation network, take each sample face input image of the plurality of sample face input images as an input of the generation network, take an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as an input of a discrimination network, and train the discrimination network by using a machine learning method; fixing the parameters of the trained discrimination network, taking each sample face input image in the plurality of sample face input images as the input of a generated network, and training the generated network by using a machine learning method; and determining the accuracy of the discrimination result output by the trained discrimination network, and determining the generation network trained most recently as a face image generation model in response to the determination accuracy being greater than an accuracy threshold.
In an optional implementation manner of some embodiments, the face image generation model training sub-module further includes: and the adjusting module (not shown in the figure) is used for responding to the determination that the accuracy rate is less than or equal to the accuracy rate threshold value, and is configured to return to the facial image generation model training module by using the generation network and the judgment network which are trained last time.
In an optional implementation manner of some embodiments, the sample obtaining sub-module includes a sample face target image construction module (not shown in the figure), and the sample face target image construction module may include: a face feature acquisition sub-module (not shown in the figure), a face prediction key point determination sub-module (not shown in the figure) and a sample face target image construction sub-module (not shown in the figure). The face feature acquisition sub-module is configured to acquire the face features of the sample face input image; a face prediction key point determination sub-module configured to determine a face prediction key point based on the face features; and the sample human face target image construction sub-module is configured to construct a sample human face target image through the human face prediction key points.
In an optional implementation manner of some embodiments, the face features include a face spatial gradient and face structure information, and the face prediction keypoint determination submodule may include: a prediction component (not shown) and a face prediction keypoint determination component (not shown). The face structure information is configured to be used for determining face structure information of a user; and the face prediction key point determining component is configured to adjust the position information of the face prediction key point and the initial image of the face prediction key point based on the face spatial gradient to determine the face prediction key point.
In an optional implementation manner of some embodiments, the sample face target image construction sub-module may include: an initial face image construction component (not shown) and a sample face target image generation component (not shown). The initial face image construction component is configured to construct an initial face image based on the face prediction key points; and the sample face target image generation component is configured to render the initial face image to obtain a sample face target image.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: detecting the definition of a face image to be processed; responding to the definition smaller than a set definition threshold value, and generating a face simulation image based on the face image to be processed, wherein the definition of the face simulation image is larger than the definition threshold value; and identifying the face simulation image to obtain face identification information corresponding to the face image to be processed.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code 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).
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 code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, 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.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an image sharpness detection unit, a face simulation image generation unit, and a face recognition unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the face simulation image generation unit may also be described as a "unit that generates a false face image corresponding to a face image to be processed".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided a face image recognition method including: detecting the definition of a face image to be processed; responding to the definition smaller than a set definition threshold value, and generating a face simulation image based on the face image to be processed, wherein the definition of the face simulation image is larger than the definition threshold value; and identifying the face simulation image to obtain face identification information corresponding to the face image to be processed.
According to one or more embodiments of the present disclosure, the generating a face simulation image based on the face image to be processed includes: and importing the face image to be processed into a face image generation model to obtain the face simulation image.
According to one or more embodiments of the present disclosure, the face image generation model is obtained by: acquiring a plurality of sample face input images and a sample face target image corresponding to each sample face input image in the plurality of sample face input images, wherein the definition of the sample face input images is less than or equal to the definition threshold, the image content of the sample face target images is the same as that of the sample face input images, and the definition of the sample face target images is greater than the definition threshold; extracting a pre-established generative confrontation network, wherein the generative confrontation network comprises a generation network and a discrimination network, the generation network is used for generating a face target image by using a face input image, and the discrimination network is used for determining whether the image input into the discrimination network is an image output by the generation network; and training the generation network and the discrimination network by using a machine learning method and taking each sample face input image in the plurality of sample face input images as the input of a generation network, taking an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as the input of the discrimination network, and determining the trained generation network as a face image generation model.
According to one or more embodiments of the present disclosure, the training the generation network and the discrimination network, and determining the trained generation network as the face image generation model includes: the following training steps are performed: fixing parameters of the generated network, taking each sample face input image in the plurality of sample face input images as the input of the generated network, taking an image output by the generated network and a sample face target image corresponding to the sample face input image input into the generated network as the input of a judgment network, and training the judgment network by using a machine learning method; fixing the parameters of the trained discrimination network, taking each sample face input image in the plurality of sample face input images as the input of a generated network, and training the generated network by using a machine learning method; and determining the accuracy of the discrimination result output by the trained discrimination network, and determining the generation network trained most recently as a face image generation model in response to the determination accuracy being greater than an accuracy threshold.
According to one or more embodiments of the present disclosure, the training the generation network and the discrimination network, and determining the trained generation network as the face image generation model further includes: and in response to determining that the accuracy is less than or equal to the accuracy threshold, re-executing the training step using the generated network and the discriminative network of the last training.
According to one or more embodiments of the present disclosure, the sample human face target image is obtained by: acquiring the face characteristics of the sample face input image; determining a face prediction key point based on the face features; and constructing a sample human face target image through the human face prediction key points.
According to one or more embodiments of the present disclosure, the determining a face prediction key point based on the face features includes: determining position information of a face prediction key point and an initial image of the face prediction key point based on the face structure information; and adjusting the position information of the face prediction key points and the initial image of the face prediction key points based on the face space gradient to determine the face prediction key points.
According to one or more embodiments of the present disclosure, the constructing a sample human face target image by the above-mentioned human face prediction key point includes: constructing an initial face image based on the face prediction key points; and rendering the initial face image to obtain a sample face target image.
According to one or more embodiments of the present disclosure, there is provided a face image recognition apparatus including: the image definition detection unit is configured to detect the definition of a face image to be processed; a face simulation image generation unit, which is used for responding to the definition smaller than a set definition threshold value and generating a face simulation image based on the face image to be processed, wherein the definition of the face simulation image is larger than the definition threshold value; and the face recognition unit is configured to recognize the face simulation image to obtain face recognition information corresponding to the face image to be processed.
According to one or more embodiments of the present disclosure, the face simulation image generation unit includes: and the human face simulation image generation subunit is configured to introduce the human face image to be processed into a human face image generation model to obtain the human face simulation image.
According to one or more embodiments of the present disclosure, the face simulation image generation subunit includes a face image generation model module configured to train a face image generation model, and the face image generation model module includes: a sample obtaining sub-module configured to obtain a plurality of sample face input images and a sample face target image corresponding to each of the plurality of sample face input images, wherein the sharpness of the sample face input image is less than or equal to the sharpness threshold, the sample face target image has the same image content as the sample face input image, and the sharpness of the sample face target image is greater than the sharpness threshold; a network extraction submodule configured to extract a pre-established generative confrontation network, wherein the generative confrontation network comprises a generation network and a discrimination network, the generation network is used for generating a face target image by using a face input image, and the discrimination network is used for determining whether an image input into the discrimination network is an image output by the generation network; and the face image generation model training sub-module is configured to use a machine learning method to take each sample face input image in the plurality of sample face input images as the input of a generation network, take an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as the input of a discrimination network, train the generation network and the discrimination network, and determine the trained generation network as the face image generation model.
According to one or more embodiments of the present disclosure, the face image generation model training submodule includes: a face image generation model training module configured to fix parameters of the generation network, use each sample face input image of the plurality of sample face input images as an input of the generation network, use an image output by the generation network and a sample face target image corresponding to the sample face input image input into the generation network as an input of a discrimination network, and train the discrimination network by using a machine learning method; fixing the parameters of the trained discrimination network, taking each sample face input image in the plurality of sample face input images as the input of a generated network, and training the generated network by using a machine learning method; and determining the accuracy of the discrimination result output by the trained discrimination network, and determining the generation network trained most recently as a face image generation model in response to the determination accuracy being greater than an accuracy threshold.
According to one or more embodiments of the present disclosure, the above-mentioned face image generation model training submodule further includes: and the adjusting module is used for responding to the accuracy rate smaller than or equal to the accuracy rate threshold value and returning to the face image generation model training module by using the generation network and the discrimination network which are trained last time.
According to one or more embodiments of the present disclosure, the sample obtaining sub-module includes a sample human face target image constructing module, and the sample human face target image constructing module includes: a face feature obtaining sub-module configured to obtain face features of the sample face input image; a face prediction key point determination sub-module configured to determine a face prediction key point based on the face features; and the sample human face target image construction sub-module is configured to construct a sample human face target image through the human face prediction key points.
According to one or more embodiments of the present disclosure, the face features include a face spatial gradient and face structure information, and the face prediction keypoint determination sub-module includes:
a prediction component configured to determine face prediction key point position information and a face prediction key point initial image based on the face structure information; and the face prediction key point determining component is configured to adjust the position information of the face prediction key point and the initial image of the face prediction key point based on the face spatial gradient to determine the face prediction key point.
According to one or more embodiments of the present disclosure, the sample human face target image constructing sub-module includes: an initial face image construction component configured to construct an initial face image based on the face prediction key points; and the sample face target image generation component is configured to render the initial face image to obtain a sample face target image.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.