Face editing method and device based on back propagation, equipment and medium

By using a backpropagation-based face editing method to acquire and update face feature vectors, the problem of difficulty in modeling complex attribute correlations and attribute entanglements in existing technologies is solved, thus enabling high-resolution editing of face images.

CN115564870BActive Publication Date: 2026-03-24GUANGDONG VIMICRO +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing face editing methods struggle to model complex attribute correlations at the attribute level, resulting in low clarity of edited face images. Furthermore, attribute distribution biases in the training set lead to attribute entanglement.

Method used

A face editing method based on backpropagation is adopted. The initial feature vector of the target face is obtained and input into a pre-trained attribute fitting model to obtain the feature vector attribute values. These values ​​are then converted into gradient values ​​for gradient updates and finally input into the face editing model to generate the target face image.

Benefits of technology

The modeling of complex attribute correlations was completed, which improved the clarity of face-edited images, solved the attribute entanglement problem, and improved the attribute distribution bias of the dataset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564870B_ABST
    Figure CN115564870B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a face editing method and device based on back propagation, equipment and medium. A specific implementation of the method comprises: obtaining an initial face feature vector of a target face; inputting the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value; converting the initial face feature vector attribute value and a preset attribute value into a face feature vector gradient value, wherein the face feature vector gradient value represents a semantic direction of attribute editing of the face feature vector; performing gradient updating on the initial face feature vector based on the face feature vector gradient value to generate an updated face feature vector; and inputting the updated face feature vector into a pre-trained face editing model to obtain a target face image. The implementation completes modeling of complex attribute correlation and improves the clarity of the face editing image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a face editing method and device based on back propagation, an electronic device, a computer readable medium and a computer program product. BACKGROUND

[0002] Face editing is a very wide application field, which can not only be used to assist other related tasks such as face recognition, but also can be used independently to form several new tasks, and has wide application in the field of human-computer interaction, entertainment and social interaction. Face editing refers to dynamically adjusting the face attributes of a given image by giving a face image. At present, when editing different attributes of a face, the commonly used method is to edit the face based on the semantic direction on the attribute level.

[0003] However, the inventors have found that when the above method is used to edit different attributes of a face, the following technical problems often exist:

[0004] First, the semantic direction used by the face editing method is on the attribute level, which is difficult to model the complex attribute correlation, resulting in low clarity of the edited face image.

[0005] Second, when there is an attribute distribution bias in the training set, there is usually attribute entanglement.

[0006] The above information disclosed in the background section is only used to enhance the understanding of the background of the present inventive concept, and therefore, it can contain information that does not form the prior art known to those skilled in the art in the country. SUMMARY

[0007] The summary section is used to introduce the concepts in a brief form, which will be described in detail in the specific embodiments section. The summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0008] Some embodiments of the present disclosure propose a face editing method and device based on back propagation, an electronic device, a computer readable medium and a computer program product to solve one or more of the technical problems mentioned in the background section.

[0009] In a first aspect, some embodiments of the present disclosure provide a face editing method based on back propagation, comprising: obtaining an initial face feature vector of a target face; inputting the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value; converting the initial face feature vector attribute value and a preset attribute value into a face feature vector gradient value, wherein the face feature vector gradient value represents a semantic direction of attribute editing on the face feature vector; performing gradient update on the initial face feature vector based on the face feature vector gradient value to generate an updated face feature vector; and inputting the updated face feature vector into a pre-trained face editing model to obtain a target face image.

[0010] In a second aspect, some embodiments of the present disclosure provide a face editing device based on back propagation, comprising: an obtaining unit configured to obtain an initial face feature vector of a target face; a first input unit configured to input the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value; a conversion unit configured to convert the initial face feature vector attribute value and a preset attribute value into a face feature vector gradient value, wherein the face feature vector gradient value represents a semantic direction of attribute editing on the face feature vector; an updating unit configured to perform gradient update on the initial face feature vector based on the face feature vector gradient value to generate an updated face feature vector; and a second input unit configured to input the updated face feature vector into a pre-trained face editing model to obtain a target face image.

[0011] In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; and a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the implementations of the first aspect.

[0012] In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method described in any of the implementations of the first aspect.

[0013] In a fifth aspect, some embodiments of the present disclosure provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the method described in any of the implementations of the first aspect.

[0014] The above various embodiments of the present disclosure have the following beneficial effects: through the face editing method based on back propagation of some embodiments of the present disclosure, modeling of complex attribute correlation is completed, and the definition of the edited face image is improved. Specifically, the reason why it is difficult to model complex attribute correlation is that the semantic direction used by the face editing method is at the attribute level, which is difficult to model complex attribute correlation, resulting in a low definition of the edited face image. Based on this, the face editing method based on back propagation of some embodiments of the present disclosure, first, obtains an initial face feature vector of a target face. Thus, the target face image information to be edited for different attributes of the face is obtained. Second, the initial face feature vector is input into the pre-trained attribute fitting model to obtain an initial face feature vector attribute value. Thus, the preparation data for modeling complex attribute correlation is obtained, which provides data support for modeling complex attribute correlation. Then, the initial face feature vector attribute value and the preset attribute value are converted into a face feature vector gradient value. The face feature vector gradient value represents the semantic direction of attribute editing of the face feature vector. Then, based on the face feature vector gradient value, the initial face feature vector is updated by gradient to generate an updated face feature vector. Thus, the optimal semantic direction between the attribute level and the instance-specific direction is found. Finally, the updated face feature vector is input into the pre-trained face editing model to obtain a target face image. Thus, modeling of complex attribute correlation is completed, and the definition of the edited face image is improved. BRIEF DESCRIPTION OF DRAWINGS

[0015] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent upon consideration of the following detailed description, taken in conjunction with the accompanying drawings. In the drawings like reference numerals refer to like elements throughout. It should be understood that the drawings are schematic and elements and features are not necessarily to scale.

[0016] Figure 1 is a flowchart of some embodiments of the face editing method based on back propagation according to the present disclosure;

[0017] Figure 2 is a structural schematic diagram of some embodiments of the face editing device based on back propagation according to the present disclosure;

[0018] Figure 3 is a structural schematic diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0019] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly and completely understood. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.

[0020] It should also be noted that, for ease of description, only parts related to the present application are shown in the drawings. The embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0021] It should be noted that the terms "first", "second", and the like mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.

[0022] It should be noted that the terms "one", "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise explicitly stated in the context, it should be understood as "one or more".

[0023] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0024] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0025] Figure 1 Flow 100 of some embodiments of the face editing method based on back propagation according to the present disclosure is shown. The face editing method based on back propagation includes the following steps:

[0026] Step 101, obtaining an initial face feature vector of a target face.

[0027] In some embodiments, the execution subject (e.g., a server) of the back propagation based face editing method can obtain the initial face feature vector of the target face from an image acquisition device through wired connection or wireless connection. It should be noted that the wireless connection can include, but is not limited to, 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other now known or future developed wireless connection. The image acquisition device can be a device with a shooting function or a screenshot function. For example, the image acquisition device can include, but is not limited to, a mobile phone, a computer, and a video camera. The initial face feature vector can refer to the vector of the image of the target face.

[0028] In step 102, the initial face feature vector is input into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value.

[0029] In some embodiments, the execution subject can input the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value. Here, the attribute fitting model can refer to a neural network model that takes the initial face feature vector as input and outputs the initial face feature vector attribute value. Here, the initial face feature vector attribute value can refer to an attribute value representing the face feature. For example, the initial face feature vector attribute value can represent an age attribute or a gender attribute. For example, the attribute fitting model can be a CNN network (Convolutional Neural Network).

[0030] Optionally, the attribute fitting model is trained by the following steps:

[0031] In the first step, a face feature vector set is obtained. In practice, the face feature vector set can be obtained from a face feature vector library through wired connection or wireless connection.

[0032] In the second step, the face feature vector set is input into a face editing model to obtain a face image set. The face feature vector in the face feature vector set corresponds to the face image in the face image set. The face editing model can refer to a neural network model that takes a face feature vector as input and outputs an edited face image. For example, the face editing model can be a GAN network (Generative Adversarial Networks). In practice, each face feature vector in the face feature vector set can be input into the face editing model to generate a face image, thereby obtaining the face image set.

[0033] In the third step, the face image set is input into a pre-trained attribute classifier to obtain a face image attribute data set. The face images in the face image set correspond to the face image attribute data in the face image attribute data set. Here, the attribute classifier can be a classifier that takes a face image as input and outputs face image attribute data. For example, the attribute classifier can be a decision tree model (DT). In practice, each face image in the face image set can be input into the pre-trained attribute classifier to generate face image attribute data, thereby obtaining the face image attribute data set.

[0034] In the fourth step, each face feature vector in the face feature vector set is combined with the face image attribute data corresponding to the face feature vector in the face image attribute data set to obtain an initial attribute fitting model sample, thereby obtaining an initial attribute fitting model sample set. Here, the combination can be concatenation.

[0035] In the fifth step, the initial attribute fitting model is trained based on the initial attribute fitting model sample set to obtain an attribute fitting model.

[0036] In practice, the fifth step can include the following sub-steps:

[0037] In the first sub-step, the network structure of the initial attribute fitting model is determined, and the network parameters of the initial attribute fitting model are initialized.

[0038] In the second sub-step, the face feature vectors included in the initial attribute fitting model sample set are used as the input of the initial attribute fitting model, the face image attribute data corresponding to the face feature vectors included in the initial attribute fitting model sample set are used as the expected output of the initial attribute fitting model, and the initial attribute fitting model is trained using a deep learning method. The initial attribute fitting model can be a convolutional neural network or a recurrent neural network.

[0039] In the third sub-step, the trained initial attribute fitting model is determined as the trained attribute fitting model.

[0040] The related content in the above first step to fifth step is one of the invention points of the embodiments of the present disclosure, which solves the second technical problem mentioned in the background that attribute entanglement usually exists in the case of attribute distribution deviation in the training set. The factors causing attribute entanglement are usually as follows: attribute entanglement usually exists in the case of attribute distribution deviation in the training set. If the above factors are solved, the effect of effectively eliminating attribute entanglement can be achieved. In order to achieve this effect, first, a face feature vector set is obtained. Thus, the data set of the face editing model is obtained, which provides data support for the training of the face editing model. Second, the face feature vector set is input into the face editing model to obtain a face image set. The face feature vectors in the face feature vector set correspond to the face images in the face image set. Thus, the data set of the attribute classifier is obtained, which provides data support for the training of the attribute classifier. Then, the face image set is input into the pre-trained attribute classifier to obtain a face image attribute data set. The face images in the face image set correspond to the face image attribute data in the face image attribute data set. Each face feature vector in the face feature vector set and the face image attribute data corresponding to the face feature vector in the face image attribute data set are combined as an initial attribute fitting model sample to obtain an initial attribute fitting model sample set. Thus, data support is provided for the training of the initial attribute fitting model. Finally, based on the initial attribute fitting model sample set, the initial attribute fitting model is trained to obtain an attribute fitting model. Thus, the attribute distribution deviation of the data set is improved, and the effect of effectively eliminating attribute entanglement is achieved.

[0041] In step 103, the initial face feature vector attribute value and the preset attribute value are converted into a face feature vector gradient value.

[0042] In some embodiments, the execution subject can convert the initial face feature vector attribute value and the preset attribute value into a face feature vector gradient value. The face feature vector gradient value represents the semantic direction of attribute editing of the face feature vector.

[0043] In practice, the execution subject can determine the loss value between the initial face feature vector attribute value and the preset attribute value based on a preset loss function. For example, the preset loss function can be a cross-entropy loss function.

[0044] In practice, based on the preset loss function, the execution subject can generate a face feature vector gradient value by performing derivative processing on the initial face feature vector according to the following formula:

[0045]

[0046] Wherein, Δz represents the gradient value of the face feature vector. Z represents the initial face feature vector. y0 represents the attribute value of the initial face feature vector. y represents the preset attribute value. L(y0, y) represents the loss function. The loss function is derived with respect to the initial face feature vector.

[0047] Step 104, based on the gradient value of the face feature vector, the initial face feature vector is updated to generate an updated face feature vector.

[0048] In some embodiments, the above execution subject can update the initial face feature vector based on the gradient value of the face feature vector to generate an updated face feature vector.

[0049] In practice, based on the gradient value of the face feature vector, the execution subject can generate an updated face feature vector by the following steps:

[0050] First, the product of the preset face feature vector update coefficient and the gradient value of the face feature vector is determined as the vector gradient value.

[0051] Second, the difference between the initial face feature vector and the vector gradient value is determined as the updated face feature vector.

[0052] The updated face feature vector can be:

[0053]

[0054] Wherein, The updated face feature vector is represented by Z. The initial face feature vector is represented by Z. The face feature vector update coefficient is represented by λ. The gradient value of the face feature vector is represented by Δz. The vector gradient value is represented by λΔz.

[0055] Step 105, input the updated face feature vector into the pre-trained face editing model to obtain the target face image.

[0056] In some embodiments, the execution subject can input the updated face feature vector into the pre-trained face editing model to obtain the target face image. Wherein, the target face image is the final face image obtained by editing the attribute of the initial face image. For example, the age attribute of the initial face image is 25 years old, and the age attribute of the face image of 60 years old is expected to be obtained. Through face feature vector extraction and related gradient update processing on the initial face image, and inputting the updated face feature vector into the pre-trained face editing model, the final face image of 60 years old age attribute is the target image. The face editing model can be a GAN network (Generative Adversarial Networks, generative adversarial network).

[0057] The above various embodiments of the present disclosure have the following beneficial effects: through the face editing method based on back propagation of some embodiments of the present disclosure, modeling of complex attribute correlation is completed, and the definition of the edited face image is improved. Specifically, the reason why it is difficult to model complex attribute correlation is that the semantic direction used by the face editing method is at the attribute level, which is difficult to model complex attribute correlation, resulting in a low definition of the edited face image. Based on this, the face editing method based on back propagation of some embodiments of the present disclosure, first, obtains an initial face feature vector of a target face. Thus, the target face image information to be edited for different attributes of the face is obtained. Second, the initial face feature vector is input into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value. Thus, the preparation data for modeling complex attribute correlation is obtained, which provides data support for modeling complex attribute correlation. Then, the initial face feature vector attribute value and the preset attribute value are converted into a face feature vector gradient value. The face feature vector gradient value represents the semantic direction of attribute editing of the face feature vector. Then, based on the face feature vector gradient value, the initial face feature vector is updated by gradient to generate an updated face feature vector. Thus, the optimal semantic direction between the attribute level and the instance-specific direction is found. Finally, the updated face feature vector is input into a pre-trained face editing model to obtain a target face image. Thus, the modeling of complex attribute correlation is completed, and the definition of the edited face image is improved.

[0058] Further reference Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a face editing device based on back propagation, which device embodiments correspond to those method embodiments shown in Figure 1 , and the device can be applied in various electronic devices.

[0059] As Figure 2As shown, the face editing apparatus 200 based on back propagation of some embodiments includes an acquisition unit 201, a first input unit 202, a conversion unit 203, an update unit 204, and a second input unit 205. The acquisition unit 201 is configured to acquire an initial face feature vector of a target face. The first input unit 202 is configured to input the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value. The conversion unit 203 is configured to convert the initial face feature vector attribute value and a preset attribute value into a face feature vector gradient value, where the face feature vector gradient value represents a semantic direction of attribute editing on the face feature vector. The update unit 204 is configured to perform gradient update on the initial face feature vector based on the face feature vector gradient value to generate an updated face feature vector. The second input unit 205 is configured to input the updated face feature vector into a pre-trained face editing model to obtain a target face image.

[0060] It can be understood that the units described in the face editing apparatus 200 based on back propagation correspond to the respective steps in the method described above. Figure 1 The operations, features, and advantages described above for the method also apply to the apparatus 200 and the units included therein, and thus are not repeated here.

[0061] Reference is made below to Figure 3 FIG. 3 shows a structural schematic diagram of an electronic device (e.g., a server) 300 suitable for implementing some embodiments of the present disclosure. The electronic device in some embodiments of the present disclosure can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a vehicle terminal (e.g., a car navigation terminal), and the like, as well as a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of embodiments of the present disclosure.

[0062] As shown in FIG. 3, the electronic device 300 can include a processing apparatus (e.g., a central processor, a graphics processor, etc.) 301 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or loaded into a random access memory (RAM) 303 from a storage apparatus 308. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing apparatus 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0063] Generally, the following devices can be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 309. The communication devices 309 can allow the electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it is understood that all of the shown devices are not required to be implemented or present. More or fewer devices can alternatively be implemented or present. Figure 3 Each block shown in the flowcharts can represent a device or multiple devices as needed.

[0064] In particular, processes described above with reference to the flowcharts can be implemented as a computer software program according to some embodiments of the present disclosure. For example, some embodiments of the present disclosure include a computer program product including a computer program carried on a computer readable medium, the computer program containing program codes for executing the methods shown in the flowcharts. In some such embodiments, the computer program can be downloaded and installed from a network through the communication devices 309, or installed from the storage devices 308, or installed from the ROM 302. When the computer program is executed by the processing devices 301, the above-described functions defined in the methods of some embodiments of the present disclosure are performed.

[0065] Note that the computer readable medium in some embodiments of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can 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 present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by an instruction execution system, apparatus or device, or that can be used by or in connection with an instruction execution system, apparatus or device. In some embodiments of the present disclosure, the computer readable signal medium can include a computer readable program code propagated in or on a carrier medium, in which the computer readable program code is embodied. Such propagated computer readable program code can take many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination of the foregoing. The computer readable signal medium can 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 can be transmitted using any suitable medium, including but not limited to, wire, cable, wireless, RF, infrared or any suitable combination of the foregoing.

[0066] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP (Hyper Text Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.

[0067] The computer readable medium can be included in the electronic device; or can exist independently of the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: obtain an initial face feature vector of a target face; input the initial face feature vector into a pre-trained attribute fitting model to obtain an initial face feature vector attribute value; convert the initial face feature vector attribute value and a preset attribute value into a face feature vector gradient value, where the face feature vector gradient value represents a semantic direction of attribute editing on the face feature vector; perform gradient updating on the initial face feature vector based on the face feature vector gradient value to generate an updated face feature vector; and input the updated face feature vector into a pre-trained face editing model to obtain a target face image.

[0068] Computer program code for carrying out operations of some embodiments of the disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can 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 latter scenario, the remote computer can 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 can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0069] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in some cases, 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 flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0070] The units described in some embodiments of the present disclosure can be implemented in the form of software, or can be implemented in the form of hardware. The described units can also be arranged in a processor, for example, a processor can be described as including an acquisition unit, a first input unit, a conversion unit, an update unit, and a second input unit. Among them, the names of these units do not constitute a limitation on the units themselves in some cases, for example, the update unit can also be described as "a unit that generates an updated face feature vector based on the gradient value of the face feature vector and gradient updates the initial face feature vector to generate an updated face feature vector".

[0071] The functions described above in the present document can be performed at least in part by one or more hardware logic components. For example, non-limiting example types of hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), and so on.

[0072] Some embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements any of the above-mentioned face editing methods based on back propagation.

[0073] The above description is merely some preferred embodiments of the present disclosure and a description of the principles of the technology used. Those skilled in the art should understand that the scope of the application involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or equivalent features without departing from the above inventive concept. For example, the above features are replaced with each other to form a technical solution with similar functions to the technical features disclosed in the embodiments of the present disclosure (but not limited to).

Claims

1. A face editing method based on backpropagation, comprising: Obtain the initial facial feature vector of the target face; The initial facial feature vector is input into a pre-trained attribute fitting model to obtain the initial facial feature vector attribute values; The initial facial feature vector attribute values ​​and preset attribute values ​​are converted into facial feature vector gradient values, wherein the facial feature vector gradient values ​​represent the semantic direction of attribute editing of the facial feature vector; Based on the gradient value of the face feature vector, the initial face feature vector is updated to generate an updated face feature vector. The updated facial feature vector is input into a pre-trained face editing model to obtain the target face image; The attribute fitting model is trained through the following steps: Obtain the set of facial feature vectors; The set of facial feature vectors is input into the face editing model to obtain a set of facial images; The set of face images is input into a pre-trained attribute classifier to obtain a face image attribute dataset; Each face feature vector in the face feature vector set and the face image attribute data corresponding to the face feature vector in the face image attribute dataset are combined to form an initial attribute fitting model sample, thus obtaining an initial attribute fitting model sample set; Based on the initial attribute fitting model sample set, the initial attribute fitting model is trained to obtain an attribute fitting model, including: determining the network structure of the initial attribute fitting model and initializing the network parameters of the initial attribute fitting model; using the face feature vectors included in the initial attribute fitting model sample set as the input of the initial attribute fitting model, and using the face image attribute data corresponding to the face feature vectors included in the initial attribute fitting model sample set as the expected output of the initial attribute fitting model, and training the initial attribute fitting model using a deep learning method; and determining the trained initial attribute fitting model as the trained attribute fitting model.

2. The method according to claim 1, wherein converting the initial facial feature vector attribute values ​​and preset attribute values ​​into facial feature vector gradient values ​​comprises: Based on a preset loss function, the initial face feature vector is differentiated to generate the gradient value of the face feature vector.

3. The method according to claim 1, wherein, The step of updating the initial face feature vector based on the gradient value of the face feature vector to generate an updated face feature vector includes: The product of the preset face feature vector update coefficient and the face feature vector gradient value is determined as the vector gradient value; The difference between the initial face feature vector and the gradient value of the vector is used to update the face feature vector.

4. A face editing device based on backpropagation, comprising: The acquisition unit is configured to acquire the initial facial feature vector of the target face; The first input unit is configured to input the initial face feature vector into a pre-trained attribute fitting model to obtain the initial face feature vector attribute values. The conversion unit is configured to convert the initial facial feature vector attribute values ​​and preset attribute values ​​into facial feature vector gradient values, wherein the facial feature vector gradient values ​​represent the semantic direction of attribute editing of the facial feature vector; The update unit is configured to perform gradient update on the initial face feature vector based on the gradient value of the face feature vector to generate an updated face feature vector. The second input unit is configured to input the updated facial feature vector into a pre-trained face editing model to obtain the target face image; The attribute fitting model is trained through the following steps: Obtain the set of facial feature vectors; The set of facial feature vectors is input into the face editing model to obtain a set of facial images; The set of face images is input into a pre-trained attribute classifier to obtain a face image attribute dataset; Each face feature vector in the face feature vector set and the face image attribute data corresponding to the face feature vector in the face image attribute dataset are combined to form an initial attribute fitting model sample, thus obtaining an initial attribute fitting model sample set; Based on the initial attribute fitting model sample set, the initial attribute fitting model is trained to obtain an attribute fitting model, including: determining the network structure of the initial attribute fitting model and initializing the network parameters of the initial attribute fitting model; using the face feature vectors included in the initial attribute fitting model sample set as the input of the initial attribute fitting model, and using the face image attribute data corresponding to the face feature vectors included in the initial attribute fitting model sample set as the expected output of the initial attribute fitting model, and training the initial attribute fitting model using a deep learning method; and determining the trained initial attribute fitting model as the trained attribute fitting model.

5. The face editing device based on backpropagation according to claim 4, wherein, The conversion unit is further configured to: Based on a preset loss function, the initial face feature vector is differentiated to generate the gradient value of the face feature vector.

6. The face editing device based on backpropagation according to claim 4, wherein the updating unit is further configured to: The product of the preset face feature vector update coefficient and the face feature vector gradient value is determined as the vector gradient value; The difference between the initial face feature vector and the gradient value of the vector is used to update the face feature vector.

7. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-3.

8. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-3.

9. A computer program product comprising a computer program that, when executed by a processor, implements the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Face processing method and device for virtual character in game and readable storage medium

    CN111632374A

  • Face attribute editing method based on reinforcement learning

    CN112800893A