Face skin color unification method and system based on generative adversarial network
By using a U-Net-like structure of generative adversarial networks and a multi-scale discriminant network, the problem of inconsistent skin color in portrait images is solved, achieving skin color uniformity and detail preservation, and improving the realism and consistency of generated images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FACEUNITY TECH CO LTD
- Filing Date
- 2026-03-02
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies struggle to achieve consistent and natural skin tone in portrait image processing, especially in handling differences in facial skin tone across different devices and scenarios, resulting in issues such as color cast, unevenness, texture distortion, and insufficient robustness.
A generative adversarial network-based approach is adopted to construct a U-Net-like generative network and combine it with a multi-scale discriminative network. Through spatial adaptive normalization layers and multi-scale adversarial loss training, skin color uniformity is achieved, and the consistency of facial details and structure is maintained.
It achieves consistency and naturalness in facial skin tone, reduces texture blur and artifacts, improves the realism and consistency of the generated results, and reduces batch consistency fluctuations caused by manual parameter tuning.
Smart Images

Figure CN122156032A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a face skin color unification method and a face skin color unification system based on generative adversarial networks. Background Technology
[0002] In the production and delivery of portrait images, the skin tone of the same face often varies significantly under different devices and in different scenarios due to factors such as the color temperature of the shooting light source, environmental reflection, exposure strategies, and post-processing. This manifests as color cast, uneven skin tone in certain areas, abrupt transitions between light and dark areas, and skin tone shifts in highlight / shadow areas. These skin tone differences reduce the consistency and usability of portrait photos in e-commerce, ID photos, film and television footage, advertising materials, and virtual avatar generation. Furthermore, they can easily lead to inconsistent styles and increased rework costs during batch processing.
[0003] Current methods for unifying skin tone typically rely on manual retouching or color correction and mapping based on traditional image processing techniques. Manual methods are highly dependent on operator experience, parameter adjustments are difficult to standardize, and batch consistency and processing efficiency are limited. Traditional color transfer, histogram matching, white balance correction, and rule-based skin tone region adjustment methods often struggle to simultaneously achieve overall color consistency and natural transitions in local skin tones under complex lighting and occlusion conditions. This can easily introduce problems such as skin tone boundary breaks, loss of texture detail, or consequently altered background colors. Furthermore, these methods require repeated parameter adjustments under different shooting conditions, resulting in insufficient robustness.
[0004] In recent years, deep learning-based portrait enhancement and style transfer methods have improved automation capabilities to some extent, but they still face two shortcomings in skin color unification tasks: on the one hand, the generated results are prone to artifacts, texture distortion, or weakening of identity features, resulting in unnatural skin texture and facial details; on the other hand, when the constraints of different scale structures and local regions are insufficient, the generation model has difficulty in stably handling the coordinated changes of high-frequency facial details and large-scale illumination color shift, resulting in inadequate skin color adjustment in local areas or overall tone shift. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method and system for unifying skin tone in facial images based on generative adversarial networks (GANs). By constructing an efficient generative network and a multi-scale discriminant network, it can achieve skin tone unification processing of input facial images and ensure consistency in detail and realism of the generated results. The generative network adopts a U-Net-like structure, fusing multi-level feature information to accurately preserve facial details and structure, and effectively adjust skin tone, avoiding texture blurring or distortion during generation. Furthermore, the introduction of a spatial adaptive normalization layer enables the model to adaptively adjust skin tone for different facial regions, thereby ensuring the uniformity and naturalness of the generated images. The multi-scale discriminant network effectively improves the realism and consistency of the generated images by judging features at different scales. Overall, the method improves skin tone consistency in facial images while preserving sufficient facial features and details, making the generated results visually more realistic.
[0006] To achieve the above objectives, this invention provides a method for unifying facial skin color based on generative adversarial networks, comprising: Obtain a training sample set, which includes an input face image and a target skin tone uniform image corresponding to the input face image; A generative adversarial network is constructed, comprising a generative network and a multi-scale discriminant network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. The upsampling module is used to fuse the low-level feature information output by the downsampling module. A spatial adaptive normalization layer is set in the generative network. The spatial adaptive normalization layer is used to adjust the size of the input feature map, and the spatial feature parameters λ and β are learned by two independent convolutional layers respectively, so as to perform inverse normalization processing on the normalized feature map based on λ and β. The input face image is input into the generation network to obtain a generated image. The input face image and the generated image are then stitched together to obtain a first stitched image. The input face image is then stitched together with the target skin color uniform image to obtain a second stitched image. The first stitched image and the second stitched image are then input into the multi-scale discriminant network for adversarial discrimination. The multi-scale discriminant network includes another scale input obtained by downsampling the first stitched image and the second stitched image respectively, and spectral normalization constraints are applied to the multi-scale discriminant network. The generative network is trained based on adversarial loss, perceptual loss, and L1 loss, and the multi-scale discriminative network is trained based on multi-scale adversarial loss to obtain a skin color uniformity model. Obtain the face image to be processed, input the face image to be processed into the generative network of the skin color unification model, and output the skin color unification result image.
[0007] In the above technical solution, preferably, the input of the generating network is an RGB image of a preset size, the downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers, the feature processing module includes three residual blocks with a stride of 1, the upsampling module includes three consecutive deconvolutional upsampling layers, and the output end is sequentially set with a 7×7 convolutional layer and a tanh activation function to output a skin tone uniform result image.
[0008] In the above technical solution, preferably, the target skin color uniform image is a real labeled image corresponding to the input face image. The real labeled image is used as the real sample input of the multi-scale discriminant network and is used to calculate the adversarial loss, perceptual loss and L1 loss of the generator network.
[0009] In the above technical solution, preferably, the perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, and the training loss of the generator network is a weighted sum of the adversarial loss, the perceptual loss and the L1 loss, wherein the L1 loss is the pixel difference between the generated image and the target skin color uniform image.
[0010] In the above technical solution, preferably, the multi-scale discriminant network includes a first scale input and a second scale input, wherein the first scale input is the input of the first stitched image and the second stitched image at their original resolutions, and the second scale input is another scale input obtained by downsampling the first scale input. The output of the multi-scale discriminant network includes feature maps of five different scales; the multi-scale adversarial loss is the weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, and the weights of the first-scale discriminant loss and the second-scale discriminant loss are 1.0 and 0.8, respectively.
[0011] This invention also proposes a face skin color unification system based on generative adversarial networks (GANs), used to implement the face skin color unification method based on GANs disclosed in any of the above technical solutions, including: The face image acquisition module is used to acquire the input face image and the target skin color uniform image in the training sample set, as well as to acquire the face image to be processed; A generative model building module is used to construct a generative adversarial network (GAN). The GAN includes a generative network and a multi-scale discriminant network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. The upsampling module is used to fuse the low-level feature information output by the downsampling module. A spatial adaptive normalization layer is set in the generative network. The spatial adaptive normalization layer is used to adjust the size of the input feature map and learns spatial feature parameters λ and β through two independent convolutional layers, respectively, so as to perform inverse normalization processing on the normalized feature map based on λ and β. The multi-scale discriminant network is used to perform adversarial discrimination on the first stitched image and the second stitched image respectively. The multi-scale discriminant network includes a second scale input obtained by downsampling the first scale input respectively, and spectral normalization constraints are applied to the multi-scale discriminant network. The skin color model training module is used to input the input face image into the generator network to obtain the generated image, construct the first stitched image and the second stitched image, and train the generator network based on adversarial loss, perceptual loss and L1 loss, and train the multi-scale discriminant network based on multi-scale adversarial loss to obtain a skin color uniformity model. The model inference output module is used to input the face image to be processed into the generative network of the skin color unification model and output the skin color unification result image.
[0012] In the above technical solution, preferably, the input of the generating network is an RGB image of a preset size; the downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers; the feature processing module includes three residual blocks with a stride of 1; the upsampling module includes three consecutive deconvolutional upsampling layers, and the output end is sequentially set with a 7×7 convolutional layer and a tanh activation function to output a skin tone uniform result image.
[0013] In the above technical solution, preferably, the model training component is used to use the target skin color uniform image as the real labeled image, the real labeled image is used as the real sample input of the multi-scale discriminative network, and is used to calculate the adversarial loss, perceptual loss and L1 loss of the generator network.
[0014] In the above technical solution, preferably, the perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, and the training loss of the generator network is a weighted sum of the adversarial loss, the perceptual loss, and the L1 loss, wherein the L1 loss is the pixel difference between the generated image and the target skin color uniform image.
[0015] In the above technical solution, preferably, the multi-scale discriminant network includes a first-scale input and a second-scale input. The first-scale input is the input of the first stitched image and the second stitched image at their original resolutions, and the second-scale input is another-scale input obtained by downsampling the first-scale input. The multi-scale adversarial loss is the weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, and the weights of the first-scale discriminant loss and the second-scale discriminant loss are 1.0 and 0.8, respectively.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) By constructing a generative adversarial network consisting of a generative network and a multi-scale discriminant network, and using the input face image and the target skin color uniform image to form a pairwise supervision, the end-to-end automatic generation of skin color uniformity is realized, reducing the batch consistency fluctuation caused by manual parameter tuning.
[0017] (2) By adopting a U-Net-like network architecture in the generative network and fusing the downsampled low-level feature information in the upsampling stage, and introducing residual blocks in the feature processing stage, skin color adjustment and facial structure details are kept in sync, reducing texture loss and weakening of identity features.
[0018] (3) By setting a spatial adaptive normalization layer in the generative network, spatial feature parameters λ and β are learned based on the input feature map and the normalized features are modulated by inverse normalization, thus realizing adaptive skin color correction for different facial regions and reducing local skin color unevenness and abrupt transition.
[0019] (4) By splicing the input face image with the generated image and the real labeled image respectively and inputting them into the multi-scale discriminant network for adversarial discrimination, while applying spectral normalization constraints to the discriminant network, and combining adversarial loss, VGG perceptual loss and L1 loss for joint training, the realism of the generated result and the consistency of the target skin color are optimized in a coordinated manner, reducing artifacts and color bias. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a face skin color unification method based on generative adversarial networks disclosed in an embodiment of the present invention. Figure 2 This is a schematic diagram of the framework of a generative adversarial network disclosed in one embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] The present invention will now be described in further detail with reference to the accompanying drawings: like Figure 1 and Figure 2 As shown, a face skin color unification method based on generative adversarial networks provided by the present invention includes: Obtain a training sample set, which includes the input face image and the target skin color uniform image corresponding to the input face image, so that the training process has pairwise supervision constraints.
[0023] A generative adversarial network (GAN) is constructed, which includes a generative network and a multi-scale discriminant network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. Feature extraction and restoration are performed according to the logic of downsampling module-feature processing module-upsampling module. The upsampling module is used to fuse the low-level feature information output by the downsampling module, so that the facial structure and detailed texture are preserved during the skin color adjustment process.
[0024] A spatial adaptive normalization layer is set in the generative network to adjust the size of the input feature map. The spatial feature parameters λ and β are learned by two independent convolutional layers respectively, so as to perform inverse normalization on the normalized feature map based on λ and β. This modulates the generated features in the spatial position dimension, thereby achieving the synergy between skin color correction and local texture preservation.
[0025] During the training phase, the input face image is fed into the generator network to obtain the generated image. The input face image and the generated image are then concatenated to obtain the first concatenated image. The input face image is then concatenated with the target skin color uniform image to obtain the second concatenated image. The first and second concatenated images are then fed into a multi-scale discriminant network for adversarial discrimination. The multi-scale discriminant network includes another scale input obtained by downsampling the first and second concatenated images respectively. Spectral normalization constraints are applied to the multi-scale discriminant network to suppress scale drift of the discriminant network parameters and stabilize adversarial training.
[0026] The generative network is trained using adversarial loss, perceptual loss, and L1 loss, and the multi-scale discriminative network is trained using multi-scale adversarial loss to obtain a skin color unification model.
[0027] During the inference phase, the face image to be processed is acquired, input into the generative network of the skin color unification model, and the skin color unification result image is output.
[0028] In this implementation, by using a unified technical approach of pairwise supervision, multi-scale adversarial constraints, and spatial adaptive normalization modulation, the consistency of facial structure and texture is maintained while outputting a uniform skin tone result, thereby reducing color cast and detail distortion.
[0029] In the above embodiment, preferably, the input of the generating network is an RGB image of a preset size, the downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers, the feature processing module includes three residual blocks with a stride of 1, the upsampling module includes three consecutive deconvolutional upsampling layers, and the output end is sequentially set with a 7×7 convolutional layer and a tanh activation function to output a skin tone uniform result image.
[0030] Specifically, the first layer of the downsampling module is a standard convolution of size 7×7, followed by three consecutive downsampling layers. The residual module consists of three residual blocks with a stride of 1. The upsampling layer consists of three consecutive deconvolutions. Finally, there is a 7×7 convolution and a tanh activation function. The output layer is used to restore the image to 512×512.
[0031] In this implementation, spatial consistency of skin color uniformity is improved and artifacts and texture breaks are reduced in the upsampling stage by using 7×7 convolution initial extraction, multi-level downsampling / upsampling, and residual block stabilization feature processing.
[0032] In the above implementation, preferably, the target skin color uniform image is a real labeled image corresponding to the input face image. The real labeled image is used as the real sample input of the multi-scale discriminant network to participate in adversarial discrimination. At the same time, the real labeled image serves as a supervision target to calculate the adversarial loss, perceptual loss and L1 loss during the training process of the generator network, so that the generated image forms a consistency constraint with the real label in addition to the adversarial constraint.
[0033] In this implementation, the consistency between skin color uniformity results and target distribution is enhanced by the dual role of real labeled images in the discriminator's real sample input and the generator's loss supervision target, thereby reducing color shift and style instability.
[0034] In the above implementation, preferably, the perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, used to constrain the semantic and texture consistency of the generated image in the feature space; the L1 loss uses the pixel difference between the generated image and the target skin color uniform image as a constraint term, used to constrain the pixel-wise deviation of color and brightness; the training loss of the generation network is a weighted sum of the adversarial loss, perceptual loss and L1 loss, so that the generation process simultaneously satisfies the adversarial realism constraint and the pairwise supervision constraint.
[0035] In this implementation, by combining the objectives of adversarial constraints, perceptual constraints, and pixel constraints, the overall consistency of skin color uniformity and local texture fidelity are balanced, thereby reducing oversmoothing and local artifacts.
[0036] In the above embodiments, preferably, the multi-scale discriminant network includes a first scale input and a second scale input. The first scale input is the input of the first stitched image and the second stitched image at their original resolutions, respectively. The second scale input is another scale input obtained by downsampling the first scale input. The output of the multi-scale discriminant network includes feature maps at five different scales to constrain the generation and real pairs at different scales. The multi-scale adversarial loss is a weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, with weights of 1.0 and 0.8 respectively, used to establish a stable balance between the original resolution discriminant constraint and the downsampling scale discriminant constraint.
[0037] Specifically, the multi-scale discriminant network takes the generator output image or the result of splicing the ground truth labeled image with the generator input image as input (input dimension is 6×512×512), and obtains another multi-scale input (dimension is 6×256×256) through direct downsampling operation.
[0038] The total loss of a multi-scale discriminant network can be expressed as a weighted sum of the losses of the decision makers at each scale: ; in , This represents the corresponding loss weight during training. Set to 1.0. Set it to 0.8. , These represent the resulting image of a unified facial skin tone after passing through the generator network, and the target image of the unified facial skin tone, respectively. and Then they respectively represent , The output after passing through the decision network.
[0039] Perceptual loss aims to ensure that the synthesized image (fake) output by the generator maintains semantic consistency with the target image (real). Secondly, to preserve high-frequency details in the generated image, an additional feature loss, L1 regularization loss, is added. Therefore, the overall loss function of the generator can be expressed as a weighted combination of the above losses: ; in , This represents the corresponding loss weight during training. Set to 1.0. Set it to 0.8.
[0040] In this implementation, the ability to comprehensively distinguish between global skin color consistency and local detail realism is improved by using discriminative constraints of dual-scale input and multi-scale output, and the training process is stabilized by weight allocation.
[0041] This invention also proposes a face skin color unification system based on generative adversarial networks (GANs), used to implement the face skin color unification method based on GANs disclosed in any of the above embodiments, including: The face image acquisition module is used to acquire the input face image and the target skin color uniform image in the training sample set, as well as to acquire the face image to be processed; The generative model building module is used to construct a generative adversarial network (GAN). The GAN includes a generative network and a multi-scale discriminative network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. The upsampling module is used to fuse the low-level feature information output by the downsampling module. A spatial adaptive normalization layer is set in the generative network. The spatial adaptive normalization layer is used to adjust the size of the input feature map and learns spatial feature parameters λ and β through two independent convolutional layers to perform inverse normalization processing on the normalized feature map based on λ and β. A multi-scale discriminant network is used to perform adversarial discrimination on the first stitched image and the second stitched image respectively. The multi-scale discriminant network includes a second-scale input obtained by downsampling the first-scale input respectively, and spectral normalization constraints are applied to the multi-scale discriminant network. The skin color model training module is used to input the input face image into the generator network to obtain the generated image, construct the first stitched image and the second stitched image, and train the generator network based on adversarial loss, perceptual loss and L1 loss, and train the multi-scale discriminant network based on multi-scale adversarial loss to obtain the skin color uniformity model. The model inference output module is used to input the face image to be processed into the generative network of the skin color unification model and output the skin color unification result image.
[0042] In this implementation, the system solidifies the data flow of data acquisition, model building, adversarial training, and inference output in a modular manner, which improves the consistency of batch processing and the maintainability of engineering deployment.
[0043] In the above embodiment, preferably, the input of the generating network is an RGB image of a preset size; the downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers; the feature processing module includes three residual blocks with a stride of 1; the upsampling module includes three consecutive deconvolutional upsampling layers, and the output end is sequentially set with a 7×7 convolutional layer and a tanh activation function to output a skin tone uniform result image.
[0044] In this implementation, by solidifying the structural parameters, the output style and quality of the same system are more stable across different batches of data, reducing the performance fluctuations caused by differences in network structure.
[0045] In the above implementation, preferably, the model training component is used to use the target skin color uniform image as the real labeled image, the real labeled image is used as the real sample input of the multi-scale discriminant network, and is used to calculate the adversarial loss, perceptual loss and L1 loss of the generator network, so that the training process forms supervision constraints at both the discriminant end and the generator end.
[0046] In this implementation, dual-channel supervision (discrimination input and loss calculation) of real labeled images improves the model's convergence stability and target skin color consistency.
[0047] In the above implementation, preferably, the perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, and the training loss of the generator network is a weighted sum of the adversarial loss, the perceptual loss and the L1 loss, wherein the L1 loss is the pixel difference between the generated image and the target skin color uniform image, which is used to constrain pixel-level color deviation.
[0048] In this implementation, by combining perceptual constraints and pixel constraints in parallel, the natural look of the skin tone uniformity result is improved and the loss of detail is reduced.
[0049] In the above embodiments, preferably, the multi-scale discriminant network includes a first-scale input and a second-scale input. The first-scale input is the input of the first stitched image and the second stitched image at their original resolutions, respectively. The second-scale input is another-scale input obtained by downsampling the first-scale input. The multi-scale adversarial loss is the weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, and the weights of the first-scale discriminant loss and the second-scale discriminant loss are 1.0 and 0.8, respectively. The loss is called by the skin color model training module during the training phase to update the parameters of the multi-scale discriminant network.
[0050] In this implementation, the two-scale loss weight constraint balances the original resolution detail discrimination and the downsampled scale structure discrimination, thereby reducing artifacts and color drift caused by adversarial training instability.
[0051] The facial skin color unification system based on generative adversarial networks disclosed in the above embodiments has the same functions as the steps of the facial skin color unification method based on generative adversarial networks disclosed in the above embodiments. In the implementation process, the above embodiments are referred to for operation, and will not be repeated here.
[0052] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for unifying facial skin color based on generative adversarial networks, characterized in that, include: Obtain a training sample set, which includes an input face image and a target skin tone uniform image corresponding to the input face image; A generative adversarial network is constructed, comprising a generative network and a multi-scale discriminant network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. The upsampling module is used to fuse the low-level feature information output by the downsampling module. A spatial adaptive normalization layer is set in the generative network. The spatial adaptive normalization layer is used to adjust the size of the input feature map, and the spatial feature parameters λ and β are learned by two independent convolutional layers respectively, so as to perform inverse normalization processing on the normalized feature map based on λ and β. The input face image is input into the generation network to obtain a generated image. The input face image and the generated image are then stitched together to obtain a first stitched image. The input face image is then stitched together with the target skin color uniform image to obtain a second stitched image. The first stitched image and the second stitched image are then input into the multi-scale discriminant network for adversarial discrimination. The multi-scale discriminant network includes another scale input obtained by downsampling the first stitched image and the second stitched image respectively, and spectral normalization constraints are applied to the multi-scale discriminant network. The generative network is trained based on adversarial loss, perceptual loss, and L1 loss, and the multi-scale discriminative network is trained based on multi-scale adversarial loss to obtain a skin color uniformity model. Obtain the face image to be processed, input the face image to be processed into the generative network of the skin color unification model, and output the skin color unification result image.
2. The face skin color unification method based on generative adversarial networks according to claim 1, characterized in that, The input to the generating network is an RGB image of a preset size. The downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers. The feature processing module includes three residual blocks with a stride of 1. The upsampling module includes three consecutive deconvolutional upsampling layers. The output is set with a 7×7 convolutional layer and a tanh activation function in sequence to output a skin tone uniform result image.
3. The face skin color unification method based on generative adversarial networks according to claim 1, characterized in that, The target skin color uniform image is a real labeled image corresponding to the input face image. The real labeled image is used as the real sample input of the multi-scale discriminant network and is used to calculate the adversarial loss, perceptual loss and L1 loss of the generator network.
4. The method for unifying facial skin color based on generative adversarial networks according to claim 1, characterized in that, The perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, and the training loss of the generative network is a weighted sum of the adversarial loss, the perceptual loss, and the L1 loss, wherein the L1 loss is the pixel difference between the generated image and the target skin color uniform image.
5. The method for unifying facial skin color based on generative adversarial networks according to claim 1, characterized in that, The multi-scale discriminant network includes a first-scale input and a second-scale input. The first-scale input is the input of the first stitched image and the second stitched image at their original resolutions, respectively. The second-scale input is another-scale input obtained by downsampling the first-scale input. The output of the multi-scale discriminant network includes feature maps of five different scales; the multi-scale adversarial loss is the weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, and the weights of the first-scale discriminant loss and the second-scale discriminant loss are 1.0 and 0.8, respectively.
6. A facial skin color unification system based on generative adversarial networks, characterized in that, A method for unifying facial skin color based on generative adversarial networks as described in any one of claims 1 to 5 includes: The face image acquisition module is used to acquire the input face image and the target skin color uniform image in the training sample set, as well as to acquire the face image to be processed; A generative model building module is used to construct a generative adversarial network (GAN). The GAN includes a generative network and a multi-scale discriminant network. The generative network adopts a U-Net-like network architecture and includes a downsampling module, a feature processing module composed of residual blocks, and an upsampling module connected in sequence. The upsampling module is used to fuse the low-level feature information output by the downsampling module. A spatial adaptive normalization layer is set in the generative network. The spatial adaptive normalization layer is used to adjust the size of the input feature map and learns spatial feature parameters λ and β through two independent convolutional layers, respectively, so as to perform inverse normalization processing on the normalized feature map based on λ and β. The multi-scale discriminant network is used to perform adversarial discrimination on the first stitched image and the second stitched image respectively. The multi-scale discriminant network includes a second scale input obtained by downsampling the first scale input respectively, and spectral normalization constraints are applied to the multi-scale discriminant network. The skin color model training module is used to input the input face image into the generator network to obtain the generated image, construct the first stitched image and the second stitched image, and train the generator network based on adversarial loss, perceptual loss and L1 loss, and train the multi-scale discriminant network based on multi-scale adversarial loss to obtain a skin color uniformity model. The model inference output module is used to input the face image to be processed into the generative network of the skin color unification model and output the skin color unification result image.
7. The face skin color unification system based on generative adversarial networks according to claim 6, characterized in that, The input to the generating network is an RGB image of a preset size; the downsampling module includes a 7×7 convolutional layer and three consecutive downsampling layers; the feature processing module includes three residual blocks with a stride of 1; the upsampling module includes three consecutive deconvolutional upsampling layers, and the output is sequentially set with a 7×7 convolutional layer and a tanh activation function to output a skin tone uniform result image.
8. The face skin color unification system based on generative adversarial networks according to claim 6, characterized in that, The model training component is used to take the target skin color uniform image as the real labeled image, which is used as the real sample input of the multi-scale discriminative network and is used to calculate the adversarial loss, perceptual loss and L1 loss of the generative network.
9. The facial skin color unification system based on generative adversarial networks according to claim 6, characterized in that, The perceptual loss is a perceptual loss based on the intermediate layer features of the VGG network, and the training loss of the generator network is a weighted sum of the adversarial loss, the perceptual loss, and the L1 loss, wherein the L1 loss is the pixel difference between the generated image and the target image with uniform skin color.
10. The face skin color unification system based on generative adversarial networks according to claim 6, characterized in that, The multi-scale discriminant network includes a first-scale input and a second-scale input. The first-scale input is the input of the first stitched image and the second stitched image at their original resolutions. The second-scale input is another-scale input obtained by downsampling the first-scale input. The multi-scale adversarial loss is the weighted sum of the first-scale discriminant loss and the second-scale discriminant loss, and the weights of the first-scale discriminant loss and the second-scale discriminant loss are 1.0 and 0.8, respectively.