{'fraction_non_alphanumeric': 0.03263804330562761, 'fraction_numerical': 0.009370533114511092, 'mean_word_length': 4.6716709202822395, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Flexible Portrait Image Editing with Fine-Grained Control

We develop a new method for portrait image editing, which supports fine-grained editing of geometries, colors, lights and shadows using a single neural network model. We adopt a novel asymmetric conditional GAN architecture: the generators take the transformed conditional inputs, such as edge maps, color palette, sliders and masks, that can be directly edited by the user; the discriminators take the conditional inputs in the way that can guide controllable image generation more effectively. Taking color editing as an example, we feed color palettes (which can be edited easily) into the generator, and color maps (which contain positional information of colors) into the discriminator. We also design a region-weighted discriminator so that higher weights are assigned to more important regions, like eyes and skin. Using a color palette, the user can directly specify the desired colors of hair, skin, eyes, lip and background. Color sliders allow the user to blend colors in an intuitive manner. The user can also edit lights and shadows by modifying the corresponding masks. We demonstrate the effectiveness of our method by evaluating it on the CelebAMask-HQ dataset with a wide range of tasks, including geometry/color/shadow/light editing, hand-drawn sketch to image translation, and color transfer. We also present ablation studies to justify our design.


I. INTRODUCTION
In the digital age, portrait and self-portrait photographs are extremely popular and have spread to every corner of the world. Although these images are casual in nature, many users would like to retouch them before sharing online. The general purpose photo editing tools, such as Adobe Photoshop, provide professional retouching results, however they target only highly skilled users.
In research community, the methods for portrait editing can be roughly grouped into two categories: transfer-based approaches [7,10,24,34] and user-guided approaches [48,53]. The transfer-based methods allow the user to transfer colors, lights and shadows from a user-specified reference image to target images. Although these methods can generate visually appealing results, they do not support fine-grained control, since the transfer process is often designed in a fully automated manner. Moreover, it may also be challenging to find suitable reference images to achieve the desired transfer effect.
The user-guided approaches allow the user to control the retouching results by using color strokes [30], color and texture patches [47,48,53], tags [17] or even texts [2]. The color strokes or patches based methods require moderate user interaction, such as sketching strokes or copying patches to the region of interest. Those methods are intuitive and easy to use, and ideal for the scenarios in which the user only retouches a few images. However, applying them to a large amount of photos is tedious and time consuming. Besides, very sparse user inputs sometimes confuse the neural network that may produce unpredictable colorization results [52]. The tag/text based methods support batch processing naturally, but their way of control is not intuitive and they cannot support fine tuning.
In this paper, we propose an effective framework that adopts conditional GAN [15,22] for fine-grained geometry, color, light and shadow editing (see Fig. 1). Given the training images, We first extract features (e.g., edge maps, color, etc.) as conditional information for controllable image generation. For better visualization to the end users, the features correspond to different editing operations are separated and saved in the form of images. Then we feed the concatenated conditional information into the generator and discriminator of our models, and train the generator to reconstruct the original images. Different from the previous conditional GAN based approaches where the generators and discriminators are usually fed with the same conditional information, we convert generator inputs to the form that are noise robust and easy for hand editing, and convert discriminator inputs to the form that can guide controllable image generation more efficiently. After training, the model can take unseen conditional inputs for image synthesis or editing. Moreover, it is flexible to extend our framework for more editing operations by concatenating additional conditional information with those discussed in this paper.
Our main contributions can be summarized as follows: • We design an all-in-one model for portrait geometry, color, light and shadow editing without compromising performance, which generates photo realistic images and reduces the complexity of deployment and maintenance. • We demonstrate novel and convenient ways for fine-grained portrait image editing, including color editing using palette and slider, and light/shadow editing using masks. These methods are easy to use for both professional and non-professional users. *   Our method supports fine-grained editing of geometries, colors, lights and shadows using a single neural network model. It allows the user to edit colors via a color palette and/or slider, geometries via edge maps, and lights and shadows via masks. It can also generate images from hand-drawn sketches. The percentages in (d) indicate the yellow ratio in the first row of palette, which controls hair color.
• We propose an asymmetric conditional GAN architecture to improve the performance of fine-grained color editing using palette, and enhance the robustness of geometry editing guided by edge maps. • We design a region-weighted discriminator that enables explicitly assigning higher weight to the more important regions of the generated images, like eyes and face, when computing loss. • Our palette and slider based color editing enables batch image processing, which is not supported in the previous finegrained editing methods.
II. RELATED WORK Conditional GAN. Unconditional GANs, proposed by Goodfellow et al. [11], take only a random noise vector as input, thereby is unable to support user control. In contrast, conditional GANs [22] train on a labeled data set and allow the user to specify the label to control each generated instance. Conditional GANs demonstrate promising performance on various image synthesis tasks [12,15,27,32], where a widely used form for image editing is image-to-image translation [26]. However, the existing variants of conditional GANs usually feed the same label/conditional information into generator and discriminator, which is sub-optimal since these two components are designed for different purpose. Therefore, our proposed asymmetric conditional GAN feeds different conditional information into generator and discriminator to better fit the application needs. Portrait Image Editing. Portrait image editing has attracted considerable interest due to its wide application, which consists of a long list of tasks, including geometry editing [46], colorization [53], relighting and shadow manipulation [44,54,55], stylization [21,51], pose and expression control [40] and so on. Recently, there are also a few attempts to enable the control of multiple attributes using a single model. For example, MichiGAN [39] is designed for disentangled hair manipulation of structure, shape and so on. However, each attribute in MichiGAN requires a separate condition module, which makes it inflexible to extend. In this work, we conduct extensive experiments to show that our model can be extended for a wide range of tasks by simply concatenating more conditional information to the inputs. Colorization and Color Editing. The existing image colorization and color editing methods can be categorized into two groups, user-guided approach and transfer-based approach. The user guided approaches usually control the results using sparse user inputs, like strokes [20,30], points/patches [53], and so on. These methods often do not support batch editing. The transfer-based approach allows automatic color transfer from the reference images [1,13,29], but do not allow fine-grained control. Similar to our approach, the transfer-based image recoloring method proposed by Chang et al. [4] also takes palette as input. However, they do not incorporate spatial information into the algorithm, so their method is inflexible for fine-grained editing. Light and Shadow Editing. There is also a long line of research on portrait image relighting or light/shadow editing. Most of the recent approaches [14,23,38,54] use target light for control. For example, Nestmeyer et al. [23] use physics-based relight, but find noise increases when there is little light. Shu et al. [35] also propose method to transfer light from reference image, however, they notice the method fails when adding/removing no-diffuse effects. We adopt the mask-based method, which is more controllable during fine-grained light and shadow editing.

A. Overview
We first extract portrait edge maps, colors, and light/shadow masks from the training images. Then the conditional GAN is trained to reconstruct the original images with the extracted constraint features as input. After training, we can modify the

Notation
Description noisy edge map G the generator I G the input of G P F the output of G m(P F ) applying the skin and eye masks to P F D L the multi-scale discriminator for local facial components model inputs to achieve fine-grained portrait image editing. To ease reading, we list the main notations in Table I. B. Model Inputs 1) Edge Maps: Edge maps, which provide salient structural information for images, are often used to control the geometry of the generated images. The DexiNed model [28] shows encouraging edge detection performance on outdoor images. To adapt DexiNed for portrait images, we annotate 27 portrait images manually and then combine them with the Barcelona Images for Perceptual Edge Detection (BIPED) dataset [28] that contains 250 hand-annotated outdoor images for model training. Given an input image, the trained model outputs a probability matrix of the same dimension as the input, where each value in the matrix represents the likelihood of the corresponding pixel to be part of an edge. Since the generated edge maps are noisy, we apply the following steps to further reduce noise: 1) apply the Gaussian filter to the input edge map and then set the pixels below a pre-defined threshold β to 0 (β = 0.35 in our implementation); 2) move a 5 × 5 sliding window through the edge map with stride size 1, and filter out the bottom 20% values in each window; 3) apply the Gaussian filter in step 1) to generate the final edge map. Comparing with the classic edge detection algorithms [3,49,51], we observe the portrait-tailored DexiNed model produces visually clean results that facilitate editing.
2) Color Palette: Fine-grained color editing is often a tedious work and usually requires expertise. To help get rid of the tedious work, we design our framework to support automated color editing without compromise of fine grained control. Our framework achieves this objective with the help of color palettes.
We use the CelebAMask-HQ dataset [19] for model training, which contains high-resolution portrait images and manually annotated facial segmentation masks. If there is any additional portrait images from the other sources, the pretrained face parsing model released by Lee et al. [19] can also be used for annotation. Then we compute the average RGB pixel value of each facial component as the corresponding color map. An example is shown in Fig.2(b). However, editing image with color map still requires users to decide the boundary of each facial component. To further simply the color editing work, we take colors of the 5 most important components from the color map, namely average colors of hair, face, eye, lip and background, to create a color palette for each image. An example is shown in Fig.2(c). Order of these components in the color palettes are fixed, if any component is not found we use black as the default color. It is possible to add more facial components for finer grained color control. However, exposing non-professional users to too many choices may increase the editing complexity, so we let the model to help decide colors of the other components based on the context.

3) Light and Shadow Masks:
We apply a simple yet effective light extraction algorithm [33] to extract facial light from the input images, and facial shadow extraction can be achieved by applying the same algorithm on the inverted image. Then the extracted light and shadow are binarized with the threshold 0.15 after being normalized to the range of [0, 1]. Finally, the binary images are processed using a 2D median filter with window size 7 × 7 to generate the light and shadow masks. Fig. 3 shows an example of light and shadow mask extraction.

C. Edge Map Noising Methods
We apply three noising methods, namely random removal, random shift and random lines, to the edge maps to improve model robustness. This allows even beginners to edit extracted edge maps and obtain high quality results. We use N = {n RR (·), n RS (·), n RL (·), n N (·)} to denote the set of noising functions, where n RR (·), n RS (·), n RL (·) denotes random remove, random shift and random line, respectively. And n N (·) denotes not to apply any of the noising functions, i.e., simply returning the original input. Given an edge map I E , we apply a random noising function n(·) uniformly selected from N to generate the noisy edge map n(I E ), then n(I E ) is used as part of the inputs during model training. During test, we do not apply any noising function to I E , that is, we directly feed I E into the model for inference.
Random removal. We remove a randomly selected region from the input in this noising method, which is similar to the masks used in [50], except that we apply it to the edge maps instead of the original images. Let h and w be the height and width of the input image. We select a random rectangle R of height h and width w from the edge map to remove, where h ∈ (0, α × h) and w ∈ (0, α × w) are randomly selected from the intervals, and 0 < α < 1 is a hyper-parameter determines the max dimensions of R. We set α = 0.33 in our implementation. See Fig. 4(b) for an example of random removal. This noising method improves the robustness of the model so that it can deal with missing lines in edge maps.
Random shift. We first select a random rectangle R of height h and width w from the edge map following the same steps in random removal, and then shift the lines in R by a random displacement. Fig. 4(c) shows an output generated by this noising method, where the lines on face are shifted towards the right hand side. The introduced noises during training helps model to learn to generate more coherent images when the edge map contains inaccurate lines drawn by user.
Random lines. Adding random lines to edge map can be achieved via similar operations as random shift. Assume R is the random rectangle selected from the original edge map, and R is the target area that lines in R will be copied to, where R is of the same dimension as R. In random shift, the lines in R are overwritten by white color, which looks like being shifted from R to R . However, the random lines function, Fig. 4  looks adding extra lines to the edge map. This function is designed to improve model's robustness to extra noisy lines caused by edge map extraction or hand editing.

D. Asymmetric Conditional GAN
We build our model upon pix2pixHD [42], a conditional GAN based model designed for high-resolution photorealistic image-to-image translation. In the previous conditional GAN based models, both the generators and the discriminators take the same conditional information as input during model training. To facilitate fine-grained control, we propose a novel asymmetric conditional GAN, where the generator and the discriminators take relevant but different conditional information as input. This feature distinguishes our method and the other conditional GAN based image synthesis methods [6,8,42]. We show the network architecture in Fig. 5.
1) Generator: The original pix2pixHD model generator, composed of a global generator network and an additional local enhancer network, is able to produce images of resolution 2048 × 1024 or even higher. It is observed that even without the local enhancer network the quality of generated images of resolution 1024 × 512 or lower are still promising, so we only keep the global generator network in our implementation to reduce computation resource usage. To generate higher resolution images, one could add the local enhancer network back.
The generator G consists of three main components, a convolutional front-end, 9 residual blocks, and a transposed convolutional back-end. We concatenate noisy edges n(I E ), color palette I CP , light mask I L , shadow mask I S as conditional information to generate the output image. The concatenated input is passed through the three generator components sequentially, where they are down-sampled in the convolutional front-end and up-sampled in the transposed convolutional back-end. Finally, the generator yields a fake image P F = G(I G ).
2) Discriminators: We design multiple discriminators to provide feedback to the generator G based on more explicit conditions. In the existing conditional GAN models [6,8,42], the generators and the discriminators are fed with the same conditional input. However, such design either constrains the convenience of the control of the generators, or hinders the discriminators from providing better feedback for the generator outputs. Thus, we propose an asymmetric conditional GAN, that allows generators and discriminators to use conditional information in different forms, which are more relevant to their objective.
Different from the original multi-scale discriminators used Wang et al. [42], we also propose a region-weighted discriminator, which consists of two multi-scale discriminators, namely D G for the global appearance and D L for local facial components. As shown in Fig. 5, the architectures of these two multi-scale discriminators are similar, but they take different inputs and their parameters are not shared. Compared with hair and background, humans are usually more sensitive to the quality of generated faces and eyes, so it is intuitive to give their corresponding regions higher weights when computing loss. Therefore, we use semantic segmentation model to extract face and eye masks from the real portrait images P R , and apply masks to P to get m(P ), where P denotes P R or P F , and m(P ) denotes the concatenation of face and eye regions extracted from P .
We We can observe the difference between the generator and discriminator inputs. For geometry control, n(I E ) is used in the generator inputs to simulate the noisy edges, while I E is used in the discriminators' inputs, which allows the discriminators to find the possible regions caused by noises easily and thus provide better instructions to the generator on how to handle the noises. Similarly, for color control we use I CP in the generator inputs and I C in the discriminators' inputs. I CP is easier for users to edit, and I C is easier for discriminators to learn since it also contains positional information of the color pixels. Each multi-scale discriminator is also composed of two different discriminator networks. Both of the two discriminator networks take the same input to predict a fake/real label. Then the losses are computed based on their predictions. In multiscale discriminator D G , the first discriminator network passes inputs through several convolutional layers to compute the loss L O−G . The second discriminator down-samples the inputs with an average pool layer first, and then processes the down-sampled inputs with a similar network as the first one to compute the loss L DS−G . The final loss for D G is computed with Note that the parameters of the two networks are not shared. Loss L M D−L is computed in a similar way for D L .
3) Loss Functions: As described above, we use G to generate the fake portrait image P F = G(I G ). The other conditional information can be concatenated with P R or P F to get the inputs for the two discriminators, I D−G for D G and I D−L for D L . In order to differentiate the inputs when the different images P = P R and P = P F are used, we add additional subscripts R and In addition to L GAN , we also compute the perceptual loss [16] and the feature matching loss [42] to further improve the quality of the generated images. These two loss functions have proven effective in many image synthesis tasks [9,25,50]. To leverage the knowledge learned by the pretrained models, we feed real images P R and and fake images P F into the pretrained VGGNet [36] to compute the perceptual loss where Φ i (·) is the feature map at the i-th VGGNet layer, Φ i,j (·) is the j-th element in the feature map, and λ i is the weight for the i-th layer. We compute the feature matching loss in a similar way, except that we compute the distance between the feature maps extracted from D G where Φ n,j (·) is the feature map extracted from the i-th layer of the n-th discriminator of D G , since D G contains two discriminator networks. λ i is the weight of the i-th layer. So in addition to Eq. 1, we also adjust G parameters with

IV. EXPERIMENTS
In this section, we first describe the implementation details of our model. Then, we present the experimental results of various fine-grained editing operations supported by our model. Finally, we perform ablation studies to quantitatively verify the effectiveness of the proposed model.

Original
Original edges Edited edges Generated images

A. Implementation Details
Dataset. We use the CelebAMask-HQ dataset [19] in our experiments, which contains 30,000 high-resolution portrait images. Each image has a manually-annotated segmentation mask of facial attributes in 19 pre-defined classes. We rescale the images to 512 × 512, and use 29,490 randomly selected images for model training, and the remaining 510 images for testing.
Model training. We use the Adam optimizer [18] to train our models for 60 epochs with batch size 64. We set a constant learning rate 0.0002 for the first 30 epochs, and then linearly decrease it to zero for the next 30 epochs. We use VGG19 [36] when computing the perceptual loss.
B. Fine-Grained Editing 1) Geometry: Our proposed framework allows users to perform the common fine-grained portrait image editing operations using a single trained model, which supports geometry, color, light, and shadow editing. It is also flexible to extend the model to support more editing operations, e.g., freckle editing. In the experiments below, we modify the inputs in {I E , I CP , I L , I S } to demonstrate how they control the synthesised images. Edge maps. The edge maps extracted from the original portrait images provide the most important structural information for image reconstruction, so it is more convenient to directly modify the extracted edge maps for minor geometry editing. As the examples shown in Fig. 6, we modify I E and keep the other constraint inputs I CP , I L , I S unchanged to demonstrate many interesting applications, including add or remove accessories like eyeglasses and jewelry, hair style design, adjust facial components, and so on. With the help of our model, the users can conveniently generate photo-realistic images with just a few stroke editing steps, while these editing operations may be very complex and time consuming with the traditional photo editing software. Hand-drawn sketches. Although our framework is not designed to handle hand-drawn sketches on purpose, we find it can generate compelling results for hand-drawn sketch to image translation. In Fig. 7, we compare our results with Scribbler [30], DeepFaceEditing [5] and DeepPlasticSurgery [50]. In addition, we also test on an example drawn by ourselves. We use the model trained without light and shadow masks in this experiment for fair comparison with the baseline methods. As we can see Scribbler [30] DeepFaceEditing [5] DeepPlasticSurgery [50] Sketches Baseline Ours More Colors (Ours) Fig. 7. Though our method is not designed for sketches-to-image translation, it can generate visually pleasing images from hand-drawn sketches of various styles.
from Fig. 7, the style of these sketches are very different from the edge maps used to train the model, so we apply additional edge processing steps: 1) apply the steps described in §III-B1 to extract edges from the Scribbler [30] sketches, and keep the other sketches unchanged; 2) concatenate the edges and random color palettes as inputs to generate the intermediate images; 3) extract edges ( §III-B1) from the intermediate images, and repeat step 2 to generate the final results. Scribbler [30] is also designed for fine-grained colorization, but compared with their results the color of our method is more photo-realistic. Besides, compared with DeepFaceEditing [5], our results preserves more identity information about the sketches. Original 0% 25% 50% 75% 100% Fig. 9. Color editing using sliders. The user blends two colors, brown and blonde by controlling the mixing ratio. See the first row in the color palettes.

2) Colors:
In this section, we evaluate the proposed framework for fine-grained color editing. As the examples presented in Fig. 8, users only need to edit the color palettes I CP shown in the right bottom corner of the images to control the color of each facial components. Compared with the recent work [1,5], our approach does not require any reference image, and gives users more freedom to specify any preferred color to edit the target facial components only, while keeping color of the other facial components unchanged. Compared with the other fine-grained color editing approaches [30,48,53], which usually require user to specify color points or strokes on the target components, our approach is more convenient for batch editing. In the experiments, we only demonstrated editing the color of hair, skin, eyes, lips and background, but it is convenient to extend the model to support more facial components.
Our model has been proven to support color editing using the combination of colors, although it is trained with a single color for each facial component. In Fig. 9, we show how to perform hair color editing using a slider to control the combination of two colors. As we adjust the ratio of the two colors by move the slider from right to left, the hair color in generated image also changes gradually. While most of the facial components are not very sensitive to the left/right position of the two colors 25% 50% 75% 100% when using slider, like the hair color editing examples shown in Fig. 9, so the horizontal sliders can be used to change their color. However, we find color of eyes changes in a different way.
As the examples shown in the first row of Fig. 10, color of the left eye changes first when we adjust the slider horizontally from left to right. It is possibly because the eyes occupy two separate segments in the images, while the other facial components, such as hair and face skin, only occupy one single segment. Therefore, we can use a vertical slider for more natural control of the eye colors as shown in the second row of Fig. 10.
Besides, we also test the color combination methods. As presented in Fig. 11, we compare slider and vertical stripe pattern for hair color control. When we adjust the ratio of the two colors to 1 : 1, the generated hair colors are very close. Moreover, the results do not demonstrate obvious pattern correlated with the combination method. For example, we do not observe stripe in the generated image when using vertical stripe pattern. Compared with the vertical stripe pattern method, slider is more intuitive and convenient to use for end users.
In Fig. 12, we demonstrate that our model can also be trained for color transfer. In stead of computing the average color as described in §III-B2, we use color palette to represent the color distributions of each facial component from the reference images. More specifically, we sort the color pixels extracted from each facial component, and uniformly sample colors to create the new color palette, where each 1-pixel-width column represent one sampled color. Then we use the new color palette as conditional information for color transfer after model training. As demonstrated in Fig. 12, our method ensures color transfer from the same facial component of the reference image (i.e., prevents transfer from background to hair, skin, etc.), while most of the previous transfer based methods do not have such explicit restriction and hence are less controllable.
3) Lights & Shadows: Our model can also be used for fine-grained light and shadow editing through the modification of the binary light and shadow masks. As the examples show in Fig. 13, it is convenient to add or remove shadow/light to the desired area with simple mask modification operations. Our model is feed forward, so it can be easily implemented for interactive editing. In Fig. 14, we also compare the images generated using our model and a few existing portrait relighting methods.  Our method automatically generates shadow and light masks (second-to-last column), which are binary images, and feed them into our neural network model. We observe that our method can yield visually pleasing results comparable to the previous methods, while providing users with a direct way to edit light and shadow. In our implementation, we apply a simple method to extract light and shadow masks from the user-specified light image (second column in Fig. 14) and the original portrait images, and then generate the final masks through the AND/OR Boolean operations. Note that it is also possible to build 3D face models [41,45] from which high-quality light and shadow masks can be generated. We leave it as a future work. 4) Portrait Artworks: Though the main objective of our method is for portrait photo editing, we observe that our method can also be applied to various types of portrait artworks. As illustrated in Fig. 15, our model can improve photo-realism of oil paintings, pencil sketches, sculptures and black-and-white photos. We generate the results in two simple steps: 1) extracting edge maps, colors and shadow/light masks from the original image ( §III-B); and 2) editing colors via a palette.

Original
Target Hou et al. [14] Zhou et al. [55] Sun et al. [37] Sengupta et al. [31] Masks Ours C. Ablation Study 1) Asymmetric Conditional GAN: Fine-grained color control. We first conduct experiments to quantitatively analyze the performance of the proposed asymmetric conditional GAN for fine-grained color control. We denote by AC-GAN our model trained with the asymmetric conditional GAN, which takes color palette I CP as the generator input, and average color map I C as the discriminators input. Denote by C-GAN our model trained with the original conditional GAN, which takes I CP as both generator and discriminator inputs.
The test split is used for evaluation to compare the images generated by AC-GAN and C-GAN. Instead of the original color palettes, we use the color palette of a randomly selected image P rand as I CP to control image colors. Besides, we also use the manually annotated segmentation masks to generate color palette O CP for each synthesised image, following the steps described in §III-B2. For each facial component, we compute the Euclidean distance between their corresponding average colors in I CP and O CP . Besides, we also compare color distribution between the corresponding facial components in each synthesised image and P rand . Similar to Afifi et al. [1], we adopt the average of KL divergence to measure the difference between RGB color histograms in our experiments.
From the average color distances shown in Table II, we can see that colors of the images generated by AC-GAN are closer than those of C-GAN to the desired ones on the color palette for most of the facial components. Especially for lip, hair and eyes, users are usually more interested in editing their color. The face colors generated by C-GAN is slightly closer to the input for color control, which is probably because of the higher color variance of faces, so the value for face may be less representative. Since KL divergence treat distant and neighbouring columns in the RGB color histograms indifferently, which does not directly measure the color distance, so we use it as a reference to compare color distributions. The results in Table II show that the color distributions generated by AC-GAN are closer to that of the real images for 3 out of the 5 components. Robustness to noisy edge maps. The asymmetric conditional GAN is also possibly useful to improve the model robustness to noisy edge maps. To verify this, we apply the proposed edge map noising methods n(·) to the edge maps in the training split, the use the asymmetric and original conditional GAN to train the model. Similar to the experiments above, the models are denoted with AC-GAN and C-GAN, respective. AC-GAN takes n(I E ) as generator input and I E as discriminators input, while C-GAN takes n(I E ) as both generator and discriminators input. In addition, we also compare with the model trained with the original edge maps I E only, i.e., without applying the proposed edge map noising methods, which is denoted with O-Edge.
For the test split, we apply the different noising methods n(·) to the edge maps first, and then feed the same set of noisy edge maps into the models during inference. The average of the Structural Similarity Index (SSIM) [43] between the original image and the synthesised images are computed to compare their robustness to the noises.
As shown in Table III, AC-GAN consistently outperforms O-Edge and C-GAN in all evaluation scenarios, which effectively helps improve model robustness to the common edge map noises introduced by hand editing and edge map extraction models, including random remove, random shift and random lines. This again demonstrates the effectiveness of our proposed method in various editing tasks .   TABLE III  IMPACT OF THE NOISY EDGE MAPS ON THE MODEL TRAINED WITH THE CONDITIONAL GAN AND THE PROPOSED ASYMMETRIC CONDITIONAL GAN.  WE USE SSIM TO MEASURE THE SIMILARITY BETWEEN REAL AND FAKE IMAGES 2) Region-Weighted Discriminators: We also compare the quality of the generated images with and without the regionweighted discriminator D introduced in §III-D2. We use MD to denote the model trained with the original multi-scale discriminator (D G only), and use RW-MD to denote the proposed model that use region-weighted multi-scale discriminators (D G and D L ). Same as above, the training set is used to train MD and RW-MD, and the test set is used for evaluation.
The results are shown in Figure 16. Since the face and eye masks are used to give these regions higher weight when training RW-MD, we use the face parsing model trained by [19] to annotate the fake images by identifying the corresponding segments and classifying their labels, which are then compared with the manual annotations. The average of semantic segmentation F1 is used to quantify the reconstruction quality. From the results we can see, the average F1 scores of RW-MD are higher than MD for both face and eyes, where the improvements of eyes are more obvious.

V. DISCUSSIONS & FUTURE WORK
We presented a new method for portrait image editing. Using a single neural network model, our method allows the user to edit colors, lights, shadows as well as geometries in an easy and intuitive manner. Our method can also generate visually pleasing images from hand-drawn sketches. While we have demonstrated high quality editing results, our approach is still subject to a few limitations that can be addressed in follow-up work. First, we observe our neural network model often removes small facial features, such as freckles in the results (Fig 17(a)), since our edge map extraction method usually ignores them. One possible solution is to provide an additional mask and annotate training data to model those small features. Second, our model focuses on foreground objects, thereby has difficulty in colorizing background patterns (Fig 17(b),(c)). This is because of the large variety in background patterns, which are more difficult for the model to learn. Inspired by Yang et al. [50], one can add foreground masks so that the model generates portraits only, while keeping the original background unchanged. Third, our model cannot generate jewelry and headgear that are not available in the training data. For example, the jewelry in Fig 17(d) is missing in the generated image. This problem can be solved by providing more relevant training data. Fourth, with the help of color palette, our method enables fine-grained color editing in batches. However, when applying our model to videos, we observe that the generated results often have flickering artifacts due to lack of consideration of temporal coherence. It is interesting to extend our method for fine-grained video color editing with video generation models.
Though we focus on portrait image editing in the paper, we believe the proposed asymmetric conditional GAN (AC-GAN) is a general framework that can be applied to other controllable generation tasks. For example, AC-GAN can deal with the situations when the controlling signal is over simplified or abstracted for model to learn (e.g., auto-encoder encoded representation of edges), or when there is too few training data. We will explore along this direction in the near future.