Face aging editing method and device based on generative adversarial network and medium

The face aging editing method through a generative adversarial network, combined with an image discriminator and an age classifier, solves the problem of difficulty in retaining individual features in face aging synthesis in the existing technology, and achieves high-quality, low-cost aging image generation.

CN118735768APending Publication Date: 2024-10-01NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084060.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing facial aging synthesis technology is difficult to generate realistic aging images while retaining individual characteristics, and methods based on physical models require a large number of training samples and high computing costs.

Method used

A face aging editing method based on a generative adversarial network is adopted. Through joint training of the generator and the discriminator, combined with the image discriminator, age classifier and identity recognition network, a conditional generative adversarial network is constructed to ensure that the generated face image is consistent with the target age. consistency and identity preservation.

Benefits of technology

It is possible to generate realistic face images of target age groups on the basis of retaining individual identity characteristics, ensuring image quality and detail fidelity, and reducing computational costs and sample requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735768A_ABST
    Figure CN118735768A_ABST
Patent Text Reader

Abstract

The invention provides a face aging editing method and device based on a generative adversarial network, and a medium. The method comprises the following steps: obtaining a to-be-edited face image and target age group information; the face image to be edited is preprocessed, and a preprocessed face image is obtained; inputting the preprocessed face image and the target age group information into a trained generator of a generative adversarial network to obtain a synthetic face with a style to which the target age group belongs; the generative adversarial network comprises a generator and a discriminator, the generator is used for generating a synthetic face with a style to which the target age group belongs, and the discriminator is used for judging whether the input picture is a real picture or a picture generated by the generator. The invention provides a model based on a generative adversarial network. The model can be used for performing face image synthesis of a target age group on a face while keeping character identity features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method, device and medium for editing face aging based on a generative adversarial network, and belongs to the technical field of computer vision. Background Art

[0002] Face aging synthesis technology has a wide range of applications in computer vision, such as helping to find lost children or predicting a person's future appearance. Traditional methods simulate the aging process by calculating the average face and its changes within an age group, but this method often loses individual features and produces unrealistic results. Although physics-based methods simulate changes in detail, they are limited by the large number of training samples required and high computational costs.

[0003] Prototype-based face aging synthesis methods are prone to losing individual information, resulting in distorted synthesis results. Although the physical model-based method takes into account that the shape and texture of real faces will change with age, it requires a large number of training samples and high computational costs. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a face aging editing method, device and medium based on a generative adversarial network, which can synthesize face images of a target age group while retaining the identity features of the person.

[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0006] In a first aspect, the present invention provides a face aging editing method based on a generative adversarial network, comprising the following steps:

[0007] Obtaining the face image to be edited and target age group information;

[0008] Preprocessing the face image to be edited to obtain a preprocessed face image;

[0009] Inputting the preprocessed face image and target age group information into a generator of a trained generative adversarial network to obtain a synthetic face with the style of the target age group;

[0010] The generative adversarial network includes a generator and a discriminator, wherein the generator is used to generate a synthetic face with a style belonging to a target age group, and the discriminator is used to determine whether an input image is a real image or an image generated by the generator.

[0011] Furthermore, the training method of the generative adversarial network includes:

[0012] Step 1: Obtain a face dataset; the face dataset includes multiple face images containing age information;

[0013] Step 2: Based on the face dataset, perform preliminary training of the generative adversarial network to obtain an adversarial network that has completed preliminary training.

[0014] Step 3: Extract the generator of the preliminarily trained adversarial network for further optimization;

[0015] Step 4: Perform final training on the generator based on the face images in the face image set and the generated images of the generator to obtain a trained generator of the generative adversarial network.

[0016] Further, step 1: obtaining a face dataset; the face dataset includes a plurality of face images containing age information, including:

[0017] Step 1.1: preprocessing the acquired face image, including face detection, face cropping and face alignment, and then performing data enhancement on the processed data to obtain a standard face image of a fixed size;

[0018] Step 1.2: Divide the face image set into multiple data groups corresponding to age groups according to age information; the number of the data groups is 5, each group corresponds to the age groups of 11-20 years old, 21-30 years old, 31-40 years old, 41-50 years old and over 50 years old.

[0019] Further, step 2: perform preliminary training of the generative adversarial network based on the face dataset to obtain a preliminarily trained adversarial network, including:

[0020] Step 2.1: Construct a preliminary generator loss function and a discriminator loss function;

[0021] Step 2.2: Based on the discriminator loss function, firstly, the generator is fixed unchanged, and the data group of the corresponding age group is retrieved according to the target age group information. The discriminator is trained based on the data group of the corresponding age group and the face image set to distinguish between real pictures and pictures generated by the generator to the greatest extent;

[0022] Step 2.3: Based on the preliminary generator loss function, the discriminator is fixed unchanged, and the generator is trained according to the data set of the corresponding age group and the face image set so that the discriminator cannot distinguish whether it is a real picture or a picture generated by the generator;

[0023] Step 2.4: Repeat steps 2.2-2.3 above until the discriminator cannot distinguish between real pictures and pictures generated by the generator or reaches a preset number of times, and obtain an adversarial network that has completed preliminary training.

[0024] Furthermore, the discriminator loss function and the preliminary generator loss function are:

[0025] L D = 1 2 E x∼ p x x D x C t -1 2 + 1 2 E y∼ p y y [(D G y C t 2 ] L G = 1 2 E y∼ p y y D G y C t -1 2

[0026] Among them, given a face image , Represents a real face within the target age group. Given a face and faces in the target age group The distribution of can be expressed as and ; Expresses expectation; L D is the discriminator loss function, L G is the initial generator loss function.

[0027] G(x| ) is the output of generator G with the target age group The synthetic face of the style, D(x| ) refers to the discriminator's decision of the target age group The probability that a given face image x of the style is real, D(G(y| )) refers to the discriminator determining that the generator generates a face with the target age group based on the real face data within the target age group. The probability that the style image is real, D (G (y) | ) refers to the discriminator determining that the real face image enters the generator G and generates a face image with the target age group The probability that the style image is real.

[0028] Further, step 4: finally training the generator according to the face images in the face image set and the generated images of the generator to obtain a trained generator of the generative adversarial network, including:

[0029] Step 4.1: Construct the final loss function of the generator; the final loss function of the generator G is formed by integrating the loss functions of the image discriminator, the age classifier and the identity recognition network;

[0030] Step 4.2: According to the final loss function of the generator G, the generator is trained to obtain a trained generator.

[0031] Furthermore, the final loss function LG2 of the generator G is:

[0032] LG2=λ D L D +λ G L G +λ I L identity +λ A L age

[0033] Among them, λ D , G , I and λ A are the discriminator weight coefficient, generator weight coefficient, identity consistency weight coefficient and age weight coefficient respectively; L D and L G The loss function for the discriminator D and the preliminary generator G is:

[0034] L D = 1 2 E x∼ p x x D x C t -1 2 + 1 2 E y∼ p y y [(D G y C t 2 ] L G = 1 2 E y∼ p y y D G y C t -1 2

[0035] L identity To calculate the perceptual loss:

[0036]

[0037] in, Corresponding to the features extracted from a specific feature layer in the pre-trained identity recognition network AlexNet, G(x| ) is the output of generator G with the target age group Synthesized face of the style.

[0038] L age For age loss:

[0039]

[0040] Here represents the softmax loss; through back-propagation, the age classification loss forces the parameters of the generator to change and generate faces in the correct age group.

[0041] Further, according to the final loss function of the generator G, the generator is trained to obtain a trained generator, including:

[0042] Inputting the face image in the face image set into the generator of the preliminarily trained adversarial network to obtain a generated image;

[0043] Inputting the face images in the face image set and the generated images of the image generator G into the trained age classifier and identity recognition network Alexnet (h) respectively, to obtain the output results of the trained age classifier and identity recognition network Alexnet;

[0044] According to the output results of the image discriminator D, the trained age classifier and the identity recognition network Alexnet, the specific function value of the final loss function of the generator G is calculated; by minimizing the loss function and back-propagating the error, the model parameters of the generator are updated to obtain a trained generator.

[0045] Furthermore, the age classifier is a softmax loss, and its training method is:

[0046] Based on the loss function of the age classifier, the face image set is input into the age classifier, and the image training is performed using the stochastic gradient descent method to obtain a trained age classifier.

[0047] Furthermore, the training method of the identity recognition network AlexNet is:

[0048] Based on the loss function of the identity recognition network, the face image set is input into the identity recognition network, and the image training is performed using the stochastic gradient descent method to obtain a trained identity recognition network.

[0049] In a second aspect, the present invention provides an age editing device based on a generative adversarial network, characterized in that it includes a processor and a storage medium;

[0050] The storage medium is used to store instructions;

[0051] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.

[0052] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] (1) The present invention ensures the consistency between the aged face image and the corresponding target age by setting a discriminator based on a conditional generative adversarial network.

[0055] (2) The age classifier module designed by the present invention can force the generated face image to be migrated to the target age domain.

[0056] (3) The present invention can ensure the quality and details of editing and the fidelity of the image while migrating the real face image to the target age domain.

[0057] (4) The success of generative adversarial networks in the field of image generation, especially conditional generative adversarial networks, provides new possibilities for the synthesis of aging face images. The identity-preserving conditional generative adversarial network proposed in this paper aims to solve the challenges of insufficient samples and maintaining individual identity information. Through end-to-end network training, face images that meet the target age and maintain identity features are generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is the overall architecture diagram of the network model of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0060] Embodiment 1:

[0061] This embodiment proposes a face aging editing method based on a generative adversarial network, and its overall framework is as follows: Figure 1 As shown, the following steps are included:

[0062] Step 1: If Figure 1 As shown, for the target age group Preprocessing is performed to divide the face images of different age groups into 5 groups, each group corresponding to the age groups of 11-20 years old, 21-30 years old, 31-40 years old, 41-50 years old and over 50 years old. Given a face image , set the label to indicate the age group to which they belong. Represents height, Represents width, and 5 represents 1-5, a total of 5 age groups.

[0063] Step 2: Given a face image Input generator G, output with target age group Synthesized face of the style .

[0064] Step 3: Assumptions Represents a real face within the target age group. Given a face and faces in the target age group The distribution of can be expressed as and For the designed generator, the target age Synthetic face The discriminator D should not classify it as a fake sample. For real faces, it belongs to real The probability should be high.

[0065] Step 4: According to step 3, the loss function of the discriminator D and the generator G can be calculated as follows:

[0066] L D = 1 2 E x∼ p x x D x C t -1 2 + 1 2 E y∼ p y y [(D G y C t 2 ] L G = 1 2 E y∼ p y y D G y C t -1 2

[0067] Among them, given a face image , Represents a real face within the target age group. Given a face and faces in the target age group The distribution of can be expressed as and ; express expectations;

[0068] G(x| ) is the output of generator G with the target age group The synthetic face of the style, D(x| ) refers to the discriminator's decision of the target age group The probability that a given face image x of the style is real, D(G(y| )) refers to the discriminator determining that the generator generates a face with the target age group based on the real face data within the target age group. The probability that the style image is real, D (G (y) | ) refers to the discriminator determining that the real face image enters the generator G and generates a face image with the target age group The probability that the style image is real.

[0069] Step 5: Given a face image and synthetic face images Enter the pre-trained AlexNet to calculate the perceptual loss , the calculation formula is as follows:

[0070]

[0071] Here Corresponding to the features extracted by a specific feature layer in the pre-trained AlexNet.

[0072] Step 6: Composite the image Enter the age classifier to calculate the age loss , the calculation formula is as follows:

[0073]

[0074] Here Represents the softmax loss. Through back propagation, the age classification loss forces the parameters of the generator to change and generate faces in the correct age group.

[0075] Specifically, the method of this embodiment includes the following contents:

[0076] Obtaining the face image to be edited and target age group information;

[0077] Preprocessing the face image to be edited to obtain a preprocessed face image; the specific method of preprocessing includes face detection, face cropping and face alignment, and then performing data enhancement on the processed data to obtain a standard face image of a fixed size;

[0078] Inputting the preprocessed face image and target age group information into a generator of a trained generative adversarial network to obtain a synthetic face with the style of the target age group;

[0079] The generative adversarial network includes a generator and a discriminator, wherein the generator is used to generate a synthetic face with a style belonging to a target age group, and the discriminator is used to determine whether an input image is a real image or an image generated by the generator.

[0080] After the generator network training is completed, the initial input is a human face image, called the initial image. After the initial image enters the generator network, feature extraction is performed to convert the initial image into an aging face image of the selected age group. The aging face image is the final output.

[0081] Specifically, the training method for generating an adversarial network provided in this embodiment includes:

[0082] Step 1: Obtain a face dataset; the face dataset includes multiple face images containing age information;

[0083] Step 1.1: preprocessing the acquired face image, including face detection, face cropping and face alignment, and then performing data enhancement on the processed data to obtain a standard face image of a fixed size;

[0084] Step 1.2: Divide the face image set into multiple data groups corresponding to age groups according to age information; the number of the data groups is 5, each group corresponds to the age groups of 11-20 years old, 21-30 years old, 31-40 years old, 41-50 years old and over 50 years old.

[0085] Step 2: Based on the face dataset, perform preliminary training of the generative adversarial network to obtain an adversarial network that has completed preliminary training.

[0086] Step 2.1: Construct a preliminary generator loss function and a discriminator loss function;

[0087] The discriminator loss function and the preliminary generator loss function are:

[0088] L D = 1 2 E x∼ p x x D x C t -1 2 + 1 2 E y∼ p y y [(D G y C t 2 ] L G = 1 2 E y∼ p y y D G y C t -1 2

[0089] Among them, given a face image , Represents a real face within the target age group. Given a face and faces in the target age group The distribution of can be expressed as and ; express expectations;

[0090] G(x| ) is the output of generator G with the target age group The synthetic face of the style, D(x| ) refers to the discriminator's decision of the target age group The probability that a given face image x of the style is real, D(G(y| )) refers to the discriminator determining that the generator generates a face with the target age group based on the real face data within the target age group. The probability that the style image is real, D (G (y) | ) refers to the discriminator determining that the real face image enters the generator G and generates a face image with the target age group The probability that the style image is real.

[0091] L D is the discriminator loss function, L G is the initial generator loss function.

[0092] Step 2.2: Based on the discriminator loss function, firstly, the generator is fixed unchanged, and the data group of the corresponding age group is retrieved according to the target age group information. The discriminator is trained based on the data group of the corresponding age group and the face image set to distinguish between real pictures and pictures generated by the generator to the greatest extent;

[0093] Step 2.3: Based on the preliminary generator loss function, the discriminator is fixed unchanged, and the generator is trained according to the data set of the corresponding age group and the face image set so that the discriminator cannot distinguish whether it is a real picture or a picture generated by the generator;

[0094] Step 2.4: Repeat steps 2.2-2.3 above until the discriminator cannot distinguish between real pictures and pictures generated by the generator or reaches a preset number of times, and obtain an adversarial network that has completed preliminary training.

[0095] Step 3: Extract the generator of the preliminarily trained adversarial network for further optimization;

[0096] Step 4: Perform final training on the generator based on the face images in the face image set and the generated images of the generator to obtain a trained generator of the generative adversarial network.

[0097] Step 4.1: Construct the final loss function of the generator; the final loss function of the generator G is formed by integrating the loss functions of the image discriminator, the age classifier and the identity recognition network;

[0098] The final loss function LG2 of the generator G is:

[0099] LG2=λD L D +λ G L G +λ I L identity +λ A L age

[0100] Among them, λ D , G , I and λ A are the discriminator weight coefficient, generator weight coefficient, identity consistency weight coefficient and age weight coefficient respectively; L D and L G The loss function for the discriminator D and the preliminary generator G is:

[0101] L D = 1 2 E x∼ p x x D x C t -1 2 + 1 2 E y∼ p y y [(D G y C t 2 ] L G = 1 2 E y∼ p y y D G y C t -1 2

[0102] L identity To calculate the perceptual loss:

[0103]

[0104] in, Corresponding to the features extracted by a specific feature layer in the pre-trained identity recognition network AlexNet. Each layer of the generator G transforms the input image x into a Images of the same style, Extract features of each layer of the generator.

[0105] L age For age loss:

[0106]

[0107] Here Represents the softmax loss. Through back propagation, the age classification loss forces the parameters of the generator to change and generate faces in the correct age group.

[0108] Step 4.2: According to the final loss function of the generator G, the generator is trained to obtain a trained generator.

[0109] Inputting the face image in the face image set into the generator of the preliminarily trained adversarial network to obtain a generated image;

[0110] Inputting the face images in the face image set and the generated images of the image generator G into the trained age classifier and identity recognition network Alexnet (h) respectively, to obtain the output results of the trained age classifier and identity recognition network Alexnet (h);

[0111] According to the output results of the image discriminator D, the trained age classifier and the identity recognition network Alexnet (h), the specific function value of the final loss function of the generator G is calculated; by minimizing the loss function and back-propagating the error, the model parameters of the generator are updated to obtain a trained generator.

[0112] Specifically, the age classifier is a softmax loss, and its training method is:

[0113] Based on the loss function of the age classifier, the face image set is input into the age classifier, and the image training is performed using the stochastic gradient descent method to obtain a trained age classifier.

[0114] Specifically, the training method of the identity recognition network AlexNet is:

[0115] Based on the loss function of the identity recognition network, the face image set is input into the identity recognition network, and the image training is performed using the stochastic gradient descent method to obtain a trained identity recognition network.

[0116] The overall structure of AlexNet consists of 5 convolutional layers (Convolution, ReLU, LRN, Pooling) + 3 fully connected layers, including:

[0117] 1. Input layer: image size 227*227*3.

[0118] 2. The first convolutional layer C1: uses 96 11*11 filters, stride 4, padding 0, and the convolutional layer is followed by ReLU, so the output size is (227-11) / 4+1=55, so each feature map is 55*55*96. The training parameters are (11*11*3*96)+96=34944. At the same time, it is processed by the LRN layer, and the size remains unchanged.

[0119] 3. Maximum pooling layer: filter is 3*3, stride is 2, padding is 0, output is 27*27*96, 96 feature maps

[0120] 4. The second convolutional layer C2: uses 256 5*5 filters, stride 1, padding 2, output is 27*27*256, 256 feature maps, training parameters (5*5*96*256)+256=614656.

[0121] 5..Maximum pooling layer: filter is 3*3, stride is 2, padding is 0, output is 13*13*256, 256 feature maps.

[0122] 6. The third convolutional layer C3+ReLU: uses 384 3*3 filters, stride is 1, padding is 1, the output is 13*13*384, 384 feature maps, and the training parameters are (3*3*256*384)+384=885120.

[0123] 7. The fourth convolutional layer C4+ReLU: uses 384 3*3 filters, stride 1, padding 1, output is 13*13*384, 384 feature maps, training parameters (3*3*384*384)+384=1327488.

[0124] 8. The fifth convolutional layer C5+ReLU: uses 256 3*3 filters, stride is 1, padding is 1, output is 13*13*256, 256 feature maps, training parameters (3*3*384*256)+256=884992.

[0125] 9. Maximum pooling layer: filter is 3*3, stride is 2, padding is 0, output is 6*6*256, 256 feature maps.

[0126] Corresponding to the features extracted from the specific feature layer in the pre-trained identity recognition network AlexNet, where the specific feature layer is the first 9 layers of the identity recognition network AlexNet.

[0127] Embodiment 2:

[0128] This embodiment provides an age editing device based on a generative adversarial network, characterized in that it includes a processor and a storage medium;

[0129] The storage medium is used to store instructions;

[0130] The processor is used to operate according to the instructions to execute the steps of the method according to the first embodiment.

[0131] Embodiment three:

[0132] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described in the first embodiment are implemented.

[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0134] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0137] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A face aging editing method based on generative adversarial network, characterized in that: The following steps are involved: Obtaining the face image to be edited and target age group information; Preprocessing the face image to be edited to obtain a preprocessed face image; Inputting the preprocessed face image and target age group information into a generator of a trained generative adversarial network to obtain a synthetic face with the style of the target age group; The generative adversarial network includes a generator and a discriminator, wherein the generator is used to generate a synthetic face with a style belonging to a target age group, and the discriminator is used to determine whether an input image is a real image or an image generated by the generator.

2. The face aging editing method based on generative adversarial network according to claim 1 is characterized in that: The training method of the generative adversarial network includes: Step 1: Obtain a face dataset; the face dataset includes multiple face images containing age information; Step 2: Perform preliminary training of the generative adversarial network based on the face dataset to obtain a preliminarily trained adversarial network; Step 3: Extract the generator of the adversarial network that has been preliminarily trained; Step 4: Perform final training on the generator based on the face images in the face image set and the generated images of the generator to obtain a trained generator of the generative adversarial network.

3. The face aging editing method based on generative adversarial network according to claim 2 is characterized in that: Step 1: Obtain a face dataset; the face dataset includes multiple face images containing age information, including: Step 1.1: preprocessing the acquired face image, including face detection, face cropping and face alignment, and then performing data enhancement on the preprocessed data to obtain a standard face image of a fixed size; Step 1.2: Divide the standard facial image into multiple data groups corresponding to age groups according to age information; the number of the data groups is 5, each group corresponds to the age groups of 11-20 years old, 21-30 years old, 31-40 years old, 41-50 years old and over 50 years old.

4. The face aging editing method based on generative adversarial network according to claim 2 is characterized in that: Step 2: Perform preliminary training of the generative adversarial network based on the face dataset to obtain a preliminarily trained adversarial network, including: Step 2.1: Construct a preliminary generator loss function and a discriminator loss function; Step 2.2: Based on the discriminator loss function, firstly, the generator is fixed unchanged, and the data group of the corresponding age group is retrieved according to the target age group information. The discriminator is trained based on the data group of the corresponding age group and the face image set to distinguish between real pictures and pictures generated by the generator to the greatest extent; Step 2.3: Based on the preliminary generator loss function, the discriminator is fixed unchanged, and the generator is trained according to the data set of the corresponding age group and the face image set so that the discriminator cannot distinguish whether it is a real picture or a picture generated by the generator; Step 2.4: Repeat steps 2.2-2.3 above until the preset number of times is reached to obtain a preliminarily trained adversarial network.

5. The face aging editing method based on generative adversarial network according to claim 4 is characterized in that: The discriminator loss function and the preliminary generator loss function are: , Among them, given a face image , Represents a real face within the target age group. Given a face and faces in the target age group The distribution of can be expressed as and ; Expresses expectation; L D is the discriminator loss function, L G is the preliminary generator loss function; G(x| ) is the output of generator G with the target age group The synthetic face of the style, D(x| ) refers to the discriminator's decision of the target age group The probability that a given face image x of the style is real, D(G(y| )) refers to the discriminator determining that the generator generates a face with the target age group based on the real face data within the target age group. The probability that the style image is real, D (G (y) | ) refers to the discriminator determining that the real face image enters the generator G and generates a face image with the target age group The probability that the style image is real.

6. The face aging editing method based on generative adversarial network according to claim 5 is characterized in that: Step 4: finally training the generator according to the face images in the face image set and the generated images of the generator to obtain a trained generator of the generative adversarial network, including: Step 4.1: Construct the final loss function of the generator; the final loss function of the generator G is formed by integrating the loss functions of the image discriminator, the age classifier and the identity recognition network; Step 4.2: Input the face images in the face image set and the generated images of the generator into the generator, and train the generator according to the final loss function of the generator G to obtain a trained generator.

7. The face aging editing method based on generative adversarial network according to claim 6 is characterized in that: The final loss function LG2 of the generator G is: LG2=λ D L D +λ G L G +λ I L identity +λ A L age Among them, λ D , G , I and λ A are the discriminator weight coefficient, generator weight coefficient, identity consistency weight coefficient and age weight coefficient respectively; L D and L G The loss function for the discriminator D and the preliminary generator G is: , L identity To calculate the perceptual loss: , in, Corresponding to the features extracted from a specific feature layer in the pre-trained identity recognition network AlexNet, G(x| ) is the output of generator G with the target age group Synthesized faces of the style; L age For age loss: , Here Represents softmax loss.

8. The face aging editing method based on generative adversarial network according to claim 1, characterized in that: Inputting the face images in the face image set and the generated images of the generator into the generator, training the generator according to the final loss function of the generator G, and obtaining a trained generator, including: Inputting the face image in the face image set into the generator of the preliminarily trained adversarial network to obtain a generated image; Inputting the face images in the face image set and the generated images of the image generator G into the age classifier and the identity recognition network Alexnet (h) respectively, to obtain the output results of the age classifier and the identity recognition network Alexnet; According to the output results of the image discriminator D, the trained age classifier and the identity recognition network Alexnet, the specific function value of the final loss function of the generator G is calculated; by minimizing the loss function and back-propagating the error, the model parameters of the generator are updated to obtain a trained generator.

9. An age editing device based on a generative adversarial network, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.