Generative Convolution Layer for Image Generation

This paper introduces a novel convolution method, called generative convolution (GConv), which is simple yet effective for improving the generative adversarial network (GAN) performance. Unlike the standard convolution, GConv first selects useful kernels compatible with the given latent vector, and then linearly combines the selected kernels to make latent-specific kernels. Using the latent-specific kernels, the proposed method produces the latent-specific features which encourage the generator to produce high-quality images. This approach is simple but surprisingly effective. First, the GAN performance is significantly improved with a little additional hardware cost. Second, GConv can be employed to the existing state-of-the-art generators without modifying the network architecture. To reveal the superiority of GConv, this paper provides extensive experiments using various standard datasets including CIFAR-10, CIFAR-100, LSUN-Church, CelebA, and tiny-ImageNet. Quantitative evaluations prove that GConv significantly boosts the performances of the unconditional and conditional GANs in terms of Inception score (IS) and Frechet inception distance (FID). For example, the proposed method improves both FID and IS scores on the tiny-ImageNet dataset from 35.13 to 29.76 and 20.23 to 22.64, respectively.


Introduction
Generative adversarial network (GAN) [8], which allows to synthesize data distribution from a given prior distribution, has achieved great success for various applications such as text-to-image translation [27,13], image-to-image translation [15,4,46], and image inpainting [42,29,32]. In the original setting, GAN consists of two different networks called generator and discriminator: the generator is trained to construct the real data distribution to fool the discriminator, whereas the discriminator aims to classify real samples from synthetic ones which are generated by the generator [38]. Since the generator and discriminator are trained to minimize opposing goals, i.e. min-max game between them, training GAN stably is more difficult compared to supervised learning-based convolutional neural network (CNN) [45]. Therefore, a recent line of study focuses on moderating the unstable training problem. Several works [43,16,44,2] presented novel generator and discriminator architectures. These methods generate high fidelity images that easily fool humans, but they cannot fully overcome the unstable training issue of GAN [26].
The sharp gradient space of the discriminator is the most popular reason for the unstable GAN training [38]. To mitigate this issue, some papers [23,9,18,45] proposed regularization or normalization techniques that prevent the discriminator from making sharp gradients during the training procedure. As a regularization strategy, conventional methods [9,37,35,18,28] usually add regularization terms into the objective functions of adversarial learning. For instance, the gradient penalty-based regularization methods [9,37,35], which compute the gradient norm as the penalty term, have been widely used for regularization techniques. On the * Corresponding author spark.cbnuh@gmail.com (S. Park); ygshin@hnu.kr (Y. Shin) ORCID(s): other hand, normalization-based methods [23,1,20] also have been widely studied. Spectral normalization (SN) [23] is the most popular one that imposes the Lipschitz constraint on the discriminator around one by dividing weight matrices with the largest singular value. Since these regularization and normalization techniques successfully make the training procedure stably, most recent studies use these techniques in their applications.
On the other hand, some researchers explored architectural modules to enhance the GAN performance. Miyato et al. [24] proposed a conditional projection module that employs the conditional information by projecting the conditional vector to the feature vectors. This approach significantly improves the quality of the class-conditional image generation. Zhang et al. [43] introduced a selfattention unit which guides the generator and discriminator where to attend. The self-attention unit can improve the GAN performance, but it requires high computational costs to produce the self-attention map due to the matrix multiplication operation. Yeo et al. [40] introduced a simple yet effective technique, called a cascading rejection module, which produces dynamic features in an iterative manner at the last layer of the discriminator. Recently, Park et al. [25] proposed a novel residual block, called a generative residual block (GRB), which contains an additional side-residual path. By emphasizing the essential feature and suppressing the unnecessary one in the side-residual path, the GRB effectively decodes the latent feature and produces a highquality image.
However, there have been only a few attempts to redesign the standard convolution (Conv) to be effective for GAN training. Sagong et al. [30] proposed a novel conditional convolution (cConv) which incorporates the conditional information into the convolution operation. This approach effectively boosts the conditional GAN (cGAN) performance, Figure 1: The illustration of the major problem of the generator. The target image data is composed of two different modals, i.e. cat and dog images.
but it has a limitation: cConv only can be used for cGAN scheme since it is designed for replacing the conditional batch normalization. Recently, Park et al. [26] proposed perturbed convolution (PConv) that not only improves the GAN performance but also prevents the discriminator from falling into the overfitting problem. However, since PConv is developed for the discriminator, it is hard to apply to the generator.
Indeed, most state-of-the-art GAN studies [23,24,2,43] construct their generator architectures by stacking multiple residual blocks [10,11] composed of Conv, batch normalization (BN) [14], and activation function. More specifically, these methods usually employed the latent vector such as the Gaussian random noise vector as the input of their generators. Thus, to produce different images according to the input latent vector, the generator should learn dynamic features that consider the input latent vector. However, since Conv uses the shared convolution kernel without considering the input latent vector, it is difficult to learn the dynamic features. We agree that even though Conv has this problem, it has shown fine performance in the GAN study. However, we believe that there would exist a novel convolution technique that is more suitable for the generator.
To prove our hypothesis, in this paper, we present a novel convolution method, called generative convolution (GConv), which effectively improves the GAN performance by learning the dynamic features considering the input latent vector, i.e. latent-specific features. Different from Conv, GConv contains a simple kernel converting module that produces kernels representing the latent-specific features. More specifically, the kernel converting module first chooses useful kernels which are compatible with the input latent vector, and then linearly combines the selected kernels to produce latent-specific kernels. This approach is simple but surprisingly effective. First, with slight additional hardware costs, the GAN and cGAN performances are significantly improved. Second, since GConv has the same external structure with Conv, it can be easily implemented to the existing generators without altering the network architecture. To prove the superiority of GConv, we provide extensive experiments using various datasets such as CIFAR-10 [19], CIFAR-100 [19], LSUN-Church (LC) [41], CelebA (CA) [21], tiny-ImageNet (TIN) [7,39], and CelebA-GQ [21,16]. Quantitative evaluations show that GConv significantly boosts the GAN and cGAN performances in terms of Inception score (IS) and Frechet inception distance (FID).
Key contributions of our paper are summarized as follows: First, we propose a novel convolution operation, i.e. GConv, which is a direct replacement of the standard convolution. Second, extensive experiments on various datasets reveal that GAN and cGAN trained with GConv outperform those trained with Conv in terms of FID and IS. For instance, the proposed method improves FID and IS scores on the TIN dataset from 35.13 to 29.76 and 20.23 to 22.64, respectively.

Preliminaries
This section briefly introduces GAN and points out the limitations of existing methods. In general, the adversarial learning between the discriminator D and the generator G is formulated as where and are the objective functions for the and , respectively. In addition, x means a sample from the real data ( ) and z indicates a latent vector sampled from latent distribution ( ) such as Gaussian normal distribution. In this setting, is guaranteed to generate ( ) if D is always optimal. However, due to various issues such as gradient vanishing or explosion problems, this objective function is often fail to train both networks stably. To alleviate this problem, various studies have reformulated Eqs. 1 and 2. Mao et al. [22] proposed a least square errorbased objective function (LSGAN), whereas Arjovsky et al. [1] employed Wasserstein distance between real and generated samples to build the objective function (WGAN). The current widely-used practice is training the GAN with the hinge adversarial loss [40,24,23,2,26,29,32,3]. The hinge adversarial loss is formulated as To further improve the GAN performance as well as training stability, many studies have explored novel network architectures or normalization techniques. However, these methods still have a common issue with the generator. In detail, the generator is trained to synthesize the target data distribution, i.e.
( ). Thus, if ( ) is a single-modal distribution, the generator makes samples easily following ( ). However, if ( ) consists of multiple modals, the generator is difficult to successfully generate all modals in ( ). A major reason causing this problem is that the generator employs the shared convolution kernels without considering the input latent vector, i.e. .
For ease of understanding, we prepare an example [25]. Let us consider where ( ) is a distribution that is composed of two classes of images, i.e. dog and cat images, as shown in Fig. 1. In our example, we assume that the left and right sides of the latent space are mapped to the dog and cat images, respectively. To produce the visually plausible images, the generator should learn features specialized for each class. However, since the generator used the shared convolutional kernels, it is difficult to produce dynamic features specialized for each class. That means it is needed to learn features that consider for generating the diverse images well. To alleviate this problem, this paper proposes a novel convolution technique which is effective to GAN.

Generative Convolution (GConv)
This paper presents a novel convolution operation, i.e. GConv, which produces latent-specific features. In GConv, there is a simple kernel converting module that modulates convolution kernels for learning the latent-specific features. = ℎ × × in which ℎ , and indicate the kernel height, width, and input feature dimension, respectively, and n means the number of kernels. In the kernel converting module, the network first selects kernels by multiplying the scaling value which is computed as follows: where ∈ ℝ 1× is the input latent vector with dimension and ∈ ℝ 1× is a mean vector obtained by applying channel-wise global average pooling in the input tensor.
∈ ℝ ( + )× is a weight matrix trained for inferring the scaling parameters S = { 1 , ..., } ∈ ℝ 1× . In addition, and ⊙ indicate a sigmoid function and concatenation operation, respectively. Using Eq. 5, each GConv individually computes the scaling parameters in the range zero to one. By multiplying to each kernel , the generator pays less attention to the useless kernels needed for producing images. In other words, by using S, the generator could build a set of selected kernelsK ∈ ℝ × that considers the latent vector. After buildingK, the latent-specific kernelsK ∈ ℝ × can be produced by linearly-combining theK, which is defined aŝ where W L ∈ ℝ × is the weight matrix trained for producinĝ K. It is worth noting that all operations in Eqs. 5 and 6 are simple linear algebraic computations; the proposed method requires a small number of additional computational costs, i.e. W s and W L . Using the latent-specific kernels, the output features of GConv is naturally computed as follows: where X ∈ ℝ ×ℎ× × and Y ∈ ℝ ×ℎ× × are input and output features, and b, h, and w indicate the sizes of batch, height, and width, respectively. Here, Eq. 7 can be reformulated by replacing thê term as follows: where Diag(⋅) is a function creating a diagonal matrix from the given vector. It is worth noting that the second term in Eq. 8, i.e. X * KDiag(S)W L , can be easily represented with the neural network operation. More specifically, the Diag(S) multiplication acts the same role with element-wise multiplication, whereas the W L multiplication is equivalent to 1 × 1 convolution operation. Based on these observations, we draw a block diagram of GConv as depicted in Fig.3. This block diagram has the mathematically same meaning with Eq. 8. Therefore, it is easy to implement GConv by using deep-learning libraries such as Tensorflow or Pytorch.
To clarify the effectiveness of the proposed method, we trained a GAN with a simple network architecture consisting of multiple fully-connected layers. In our experiments, eight two-dimensional (2D) Gaussian mixture models (GMMs) are used as the real data distribution. For a fair comparison, in the generator, we only replaced the standard fullyconnected layers with the GConv. Fig. 4 illustrates the experimental results. The generator with standard fully-connected layers suffers from the mode collapse problem, whereas the generator with the GConv generates all the GMMs successfully. These results demonstrate that the proposed method is effective to train GAN. More extensive experiments will be presented in Sec. 4.2.
Indeed, one may anticipate that GConv is similar to the conventional channel-attention (CA) methods [36,34], which emphasizing the selected channels of the input feature. However, there is a major difference between the proposed method and conventional ones: the proposed method is an alternative operation of convolution, but the CA technique is a post-processing algorithm used after conducting the convolution operation. More specifically, existing CA methods are usually located after performing the convolution operation to enhance the specific channels of output feature. In contrast, the proposed method directly selects and combines kernels in the convolution layer. That means it is able to use the existing CA method after performing GConv. The detailed explanations will be described in the section 4.2.

Implementation Details
To prove the superiority of GConv, we conducted extensive experiments utilizing the various datasets which are widely used for evaluating the GAN performance: CIFAR-10 [19], CIFAR-100 [19], LC [41], CA [21], TIN [7,39], and CelebA-HQ [21,16]. The resolutions of the CIFAR-10 and CIFAR-100 datasets are 32 × 32, whereas the images of LC, CA, and TIN datasets are resized to 128 × 128 pixels. Also, the CelebA-HQ dataset is used for training the networks that produce the 256 × 256 images. To train GAN, we used the hinge-version loss in Eqs. 3 and 4 as the objective function. Since all parameters in the discriminator and generator including GConv can be differentiated, we employed the Adam optimizer [17] and set the user parameters of Adam optimizer, i.e. 1 and 2 , to 0 and 0.9, respectively. For training the CIFAR-10, CIFAR-100, and CelebA-HQ datasets, we set the learning rate as 0.0002, and the discriminator was updated 5 times using different minibatches when the generator is updated once. In contrast, for training the LC, CA, and TIN, we employed a twotime scale update rule (TTUR) [12] that the learning rates of the generator and discriminator are set to 0.0001 and 0.0004, respectively. Note that the TTUR technique updates the discriminator a single time when the generator is updated once. For all datasets, we decreased the learning rate linearly in the last 50,000 iterations. For the CIFAR-10 and CIFAR-100 datasets, we set a batch size of the discriminator as 64 and trained the generator for 50k iterations. In our experiments, following the previous papers [24,23,25], the generator was trained with a batch size twice as large as when training the discriminator. That means the generator and discriminator were trained with 128 and 64 batch size, respectively. For the LC, CA, and TIN datasets, both batch sizes of the discriminator and the generator are set to 32. The network is trained to 300k iterations on LC and CA datasets and 1M iterations on TIN dataset. For the CelebA-HQ dataset, the network is trained to 100k iterations, while setting the batch sizes of the generator and discriminator to 32 and 16, respectively.
To quantify the importance of GConv, we employed a strong baseline in [23] following the state-of-the-art studies [24,2,43,25]. More specifically, we employed the generator and discriminator architectures constructing with multiple residual blocks (RBs) as our baseline models; we just replaced Conv in the generator with GConv and did not alter the architecture of the discriminator. Note that we used   Fig. 5. For training the CIFAR-10 and CIFAR-100 datasets the spectral normalization (SN) [23] is only used for the discriminator, whereas the SN is applied to both generator and discriminator for training LC, CA, and TIN datasets [43]. In the discriminator, the feature maps are down-sampled by utilizing the average-pooling after the second convolution. In the generator, the up-sampling (a nearest-neighbor interpolation) operation is located before the first convolution. A detailed descriptions of the network architectures for the generator and discriminator are described in Tables 1 and 2. To train the network in the conditional GAN (cGAN) framework, following the most representative cGAN scheme, we replaced the BigBN in the generator with the conditional BigBN [2] and added the conditional projection layer in the discriminator [24]. More specifically, in the RB of the generator, we concatenated z with the one-hot vector which represents the input class, and used the concatenated vector to conditional BigBN and GConv. Note that other network architectures were the same as the models used for experiments of unconditional GAN.

Evaluation Metric
In the field of GAN, FID [12] and IS [31] are most widely used assessments that evaluate how well the generator produces image. More specifically, FID is defined as follows: where { , } and { , } are the mean and covariance of the samples with distributions of real and generated images, respectively. Lower FID scores mean better quality of the generated images. To measure the performance using FID, in this paper, we generated 50,000 images for each dataset.
On the other hand, IS is expressed as where l is the label predicted by the Inception model [33] trained for classifying ImageNet dataset [7] having a thousand classes, and ( | ) and ( ) represent the conditional class distributions and marginal class distributions, respectively. That means it measures how the generator produces diverse images with high-quality. However, IS has an one major drawback: IS is no meaning when evaluating the performance in a single class dataset such as CA, since it measures the score using the KL-divergence between ( | ) and ( ). Therefore, in this paper, we did not use IS for evaluating the GAN performance for CA and LSUN datasets.

Experimental Results
Before proving the superiority of GConv on various datasets, we first conducted extensive ablation studies on CIFAR-10 and CIFAR-100 datasets. In our experiments, the network was trained three times from scratch to prove that the performance improvement was not due to the lucky weight initialization. First, we compared the GAN performances between Conv and GConv. As described in Table 3, the proposed method exhibits better performance than Conv in terms of FID and IS. It is worth noting that the proposed method shows superior performance to Conv in the cGAN as well as GAN. That means the GConv could be used for both studies for improving the performance. In addition, the proposed method consistently outperforms its counterpart, in both CIFAR-10 and CIFAR-100 datasets. These observations indicate that the latent-specific features produced in GConv effectively support the generator to produce highquality images. Indeed, owing to W s and W L in Eqs. 5 and 6, GConv needs a slightly more network parameters than Conv. For instance, when training the CIFAR-10 and CIFAR-100 datasets, the generator with Conv uses about 3.54M convolution weights, whereas that with GConv utilizes about 4.37M convolution weights. Thus, one may anticipate that the performance improvement is caused due to the increased number of network parameters. To mitigate this issue, we conducted ablation studies that match the computational costs of Conv with that of GConv. More specifically, we increased the number of output channels in Conv to match the number for convolution weights with GConv. In this paper, we referred the Conv with increased output channels as Conv*. As described in Table 3, Conv* shows performance either slightly improved or failed to improve even increasing the number of network parameters. In particular, on the CIFAR-10 dataset, Conv* trained with the cGAN framework shows a poor FID score compared with Conv. In addition, GConv still shows better performance than Conv*. These results reveal that even if the number of network parameters is increased, it is difficult to further improve the performance using Conv. In contrast, GConv significantly boosts the GAN performance successfully in both GAN and cGAN. Based on these observations, we concluded that GConv has a fine trade-off between improved performance and increased computational costs, which makes GConv to be fine for practical use.
On the other hand, one may have a query that the difference between GConv and conventional CA modules. As mentioned in Section 3.1, the major difference between the two methods is their locations in the network: GConv is a replacement of Conv, whereas the CA module is the post-processing method used after performing convolution operation. In other words, the existing CA techniques can be used after GConv. To clarify this claim, we conducted ablation studies that attach the CA module after Conv and GConv. In our experiments, we used the CA technique introduced in [36], which is the most popular one among the CA techniques. In this paper, we denoted Conv and GConv with CA module as Conv † and GConv † , respectively. The illustrations about Conv † and GConv † are depicted in Fig. 6. As described in Table 3 Conv † shows better performance than Conv, which means the exiting CA module is effective to improve the GAN performance. It is worth noting that GConv † also shows better performance than GConv. In addition, GConv † exhibits superior performance to Conv † in both GAN and cGAN schemes. These results contain two important meanings. First, GConv can be generally used as the replacement of Conv since it is compatible with the existing techniques designed for Conv. Second, GConv and the CA module act different roles in the networks; they can be used together for improving the GAN performance. Based on these observations, we concluded that it does not need to compare the effectiveness between GConv and the CA module. Therefore, in the remainder of this paper, we only compared the performance of GConv with that of Conv.
Furthermore, to show the generalization ability of GConv, we conducted other ablation studies in which the networks are trained with different experimental settings. First, we trained the networks using various adversarial objective functions: the objective function based on the cross-entropy (CE) theorem (Eqs. 1 and 2) and the objective function proposed in the least square GAN (LSGAN) paper [22]. As shown in Table 4, the proposed method outperforms Conv even trained with various objective functions. That means GConv can be generally applied to train the GAN regardless of the objective function. In addition, to check the compatibility of GConv with various activation functions, we changed the activation function in the RBs of the generator. In our experiments, we employed the exponential linear unit (ELU) [5] and gated linear unit (GLU) [6] as the activation function. As summarized in table 5, the proposed method exhibits superior performance to Conv in the various activation functions. Based on these results, we expected that the GConv can be generally used for the GAN-based image generation techniques having various experimental settings.
In order to validate the ability of GConv when synthesizing images in challenging datasets, we trained the GAN using the LC, CA, and TIN datasets. Specifically, the LC and CA datasets are trained by following the experimental settings for GAN, whereas the TIN dataset is trained by following that for the cGAN. In Tables 3,5, and 4, we already proved that the performance improvement is not due to the lucky weight initialization. Thus, we trained the network a single time from scratch. Instead, to clearly show the superiority of GConv, we drew a graph representing the FID and IS scores over training iterations, as shown in Fig. 7. The FID and IS scores of Conv are converged earlier than those of GConv; the proposed method shows better performance than Conv. We summarized the final FID and IS scores of GConv and those of Conv in Table. 6. The scores in the bracket indicate the minimum FID and the maximum IS scores during the training procedure. As described in Table 6, even when comparing the minimum FID score, GConv exhibits better performance than Conv. In particular, the proposed method significantly improves the GAN performance on the challenging dataset, i.e. tiny-ImageNet. That means GConv is effective to produce images in various datasets. Fig. 8 shows the samples of the generated images. As shown in Fig. 8, the proposed method effectively leads the generators to produce high-quality images. Moreover, to show the effectiveness of GConv for generating high-resolution images, we conducted additional experiments using the CelebA-HQ dataset [21,16]. In this paper, we trained the networks to produce 256 × 256 images. The experimental results are presented in Table 7 and Fig. 9. It is worth noting that the GConv shows much lower FID scores compared with Conv, and it produces the convincing images. Based on these results, we expected that the proposed method can utilized to produce high-resolution images. Indeed, this study does not intend to produce the design of an optimal generator and discriminator architectures for GConv. There might be another network architecture that improves the GAN performance and produces more high-quality images. Instead, this paper focuses on verifying whether it is possible to achieve the better GAN performance by simply replacing Conv with GConv.

Conclusion and Future Works
This paper has proposed a novel convolution technique for the generator, called GConv, which significantly improves the GAN performance. By simply replacing Conv with GConv, the generator is able to synthesize the visually plausible image, which results in the performance improvement of GAN. The main advantage of GConv is that it can be integrated into any generator architectures seamlessly with marginal overheads, while considerably improving the performance. In addition, this paper deeply investigated the effectiveness of GConv in various aspects by conducting  many-sided ablation studies. Thus, we expect that the proposed can be applied to various GAN-based image synthesizing techniques. However, this paper aims at introducing a novel convolution method specialized to the GAN. We agree that the GConv might work well for the GAN-based image generation technique, but might cause some issues in other networks used for different applications. Although this paper only covers the effectiveness of GConv in the field of GAN-based image generation technique, we have shown that the proposed method could improve the GAN performance significantly with various aspects. As our future work, we plan to further investigate a novel convolution method that could cover various applications.

Declaration of Competing Interest
The authors declare no conflict of interest.