Correction by Projection: Denoising Images with Generative Adversarial Networks

03/12/2018 ∙ by Subarna Tripathi, et al. ∙ 0

Generative adversarial networks (GANs) transform low-dimensional latent vectors into visually plausible images. If the real dataset contains only clean images, then ostensibly, the manifold learned by the GAN should contain only clean images. In this paper, we propose to denoise corrupted images by finding the nearest point on the GAN manifold, recovering latent vectors by minimizing distances in image space. We first demonstrate that given a corrupted version of an image that truly lies on the GAN manifold, we can approximately recover the latent vector and denoise the image, obtaining significantly higher quality, comparing with BM3D. Next, we demonstrate that latent vectors recovered from noisy images exhibit a consistent bias. By subtracting this bias before projecting back to image space, we improve denoising results even further. Finally, even for unseen images, our method performs better at denoising better than BM3D. Notably, the basic version of our method (without bias correction) requires no prior knowledge on the noise variance. To achieve the highest possible denoising quality, the best performing signal processing based methods, such as BM3D, require an estimate of the blur kernel.



There are no comments yet.


page 1

page 2

page 3

page 4

page 6

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Generative adversarial networks (GANs) [1, 2]

exploit the discriminative power of deep neural networks for the task of generative modeling. A GAN consists of two models: a

generator and a discriminator. The generator maps samples from a low-dimensional latent space onto the space of images. The discriminator tries to distinguish between images produced by the generator and real images. To coerce the generator to produce images that match the distribution of real images, we optimize it to fool the discriminator. It has been shown that various GAN minimax objectives are equivalent to minimizing corresponding divergences between the real and generated data.

Figure 1: Images with Gaussian noise (left), denoised images with BM3D (second), denoised images with proposed method(third), and the ground truth images (right)

Over the last several years, many researchers have successfully applied variants of GANs [3]

to tasks including synthesizing 2D images, face processing, image completion, image editing, 3D objects generation and reconstruction, fashion image generation, image and video super-resolutions, video generation, image-to-image translation, text-to-image generation, audio and text synthesis.

While generating images can be useful, we often want to infer latent representations given images. As an example, the latent code recovery methods is also used for generating fashion images that have horizontal symmetry  [4]. It is known that vectors that are close in latent space, generate visually similar images. Algebraic operations in latent vector space often lead to meaningful corresponding operations in image space.

However, the original GAN formulation gives no out-of-the-box method to reverse the mapping, projecting images back into latent space. How best to perform the reverse mapping (from image space to latent space) remains an open research problem. Authors in [5] suggests an extension to GAN in which a third model explicitly learns the reverse mapping. [6] suggest that inverting the generator is difficult, noting that, in principle, a single image may map to multiple latent vectors . They propose a gradient-based approach to recover latent vectors and evaluate the process on the reconstruction error in image space.

Recently, [7] proposes to recover latent vectors using a gradient-based method using “stochastic clipping”, and achieve successful recovery

of time given a certain residual threshold. The idea of “stochastic clipping” is based on the notion that the latent vectors have close to zero probability of landing on the boundary values.

In this paper, we show that latent code recovery can be used to denoise and deblur images, building on the method of  [7]. First, we show that for corrupted versions of images that are actually generated by our trained GAN, we can significantly denoise them, achieving higher quality as measured by PSNR, compared to BM3D [8], one of the best signal processing-based denoising methods. Next, we demonstrate that deblurring can be treated as an attribute in latent space, given the noise variance. Arithmetic on deblurring latent vector space denoises and deblurs the images even further. Finally, we show that even for unseen images, our method appears to denoise better than BM3D (Fig 1). To our knowledge, this is the first empirical demonstration that recovery of latent vectors in DCGAN can be used for image denoising and deblurring. After adding even significant amounts of Gaussian noise to images, we denoise the images with higher fidelity comparing with state-of-the-art denoising method.

2 Related Work

Image denoising is an actively researched inverse problem in low-level vision for last couple of decades. It has rich literature in traditional signal processing based methods. See [9] for a detailed survey. BM3D [8] is one of the best methods on image denoising in that domain. Recently, many researchers have proposed discriminative learning based methods for image denoising. Typically, these methods learn the image prior models and corresponding denoising function using CNNs. See  [10, 11, 12] for overviews on these methods.

In this paper, we focus on the use of GANs for denoising and deblurring. Specifically, we project noisy images onto the range of the GAN by attempting to recover the latent vector which corresponds to the closest point on the GAN manifold. Several papers attempt gradient-based methods for inverting deep neural networks. Authors in [13]

invert discriminative CNNs for the purpose of interpreting hidden representations. To invert generative models,

[6] and [14] both optimize over latent vectors to minimize distance in image space, but neither reported that the inference procedure could faithfully recover ground truth latent vectors or that the inferred vectors (across multiple runs) tended to be proximal in latent space. In a different approach,  [5], and [15], learn separate neural network encoders for performing the reverse mapping. The latent code recovery methods [7, 16] is also used for generating fashion images that have horizontal symmetry  [4]. Authors in  [7] also note that the reverse projection can be used to remove Gaussian noise. However, they do not investigate any potential for latent vector arithmetic for deblurring. Authors in [17] allow the model to change the input vector that leads to better images according to the discriminator.

3 Method

Recovery from an image generated by the generator, and from a real image are different. Former one can be considered as an inverse operation of an existing forward operation. However, attempting to recover the latent vector from a real image is more like a projection of it onto the manifold learned by the generator.

Our approach of recovering the latent vectors is based on [7]. In order to recover the latent vector of a generated image, we produce an image for a latent vector . We then initialize a new, random vector of the same shape as . This new vector maps to a corresponding image . In order to reverse engineer the input , we successively update the components of in order to push the representation closer to the original image . In our experiments we minimize the norm, yielding the following optimization problem:

We optimize over by gradient descent, performing the update until some convergence criteria is met. Only solving for this optimization problem refers to as no clipping.

All latent vectors are sampled uniformly from the hyper-cube. To enforce this constraint, we apply the modified optimization

For projected gradient, we replace components that are too large with the maximum allowed value and components that are too small with the minimum allowed value. The authors in [7]

introduce a heuristic technique called

stochastic clipping. When using stochastic clipping, instead of setting components to or , we reassign the clipped components uniformly at random in the allowed range.

Figure 2: Example recovered images from CelebA dataset (no added noise) with stochastic gradient [7].
Figure 3: Example recovered images from LFW dataset (no added noise) with stochastic gradient [7].

For the recovery of a real image the forward mapping does not necessarily exist. We perform the following optimization in this case.

with stochastic clipping, where denotes real images. We refer this latent vectors recovery methods as LVR. The generator in our experiments is trained with CelebA dataset [18]. Example real images from CelebA dataset and their recovery using the LVR are shown in Fig 2. Additionally, some images from LFW [19] (the generator never saw these images) and their recovery are shown in Fig 3.

Authors in  [7] note that the reverse projection can be used to remove Gaussian noise. In order to explore the denoising potential within this framework, we corrupt the real images with varying levels of Gaussian noise variance, and apply LVR for , where denotes real images and denotes Gaussian noise variance. The above denoising methods do not require the noise variance a priori unlike traditional denoising methods, and still produce better denoising results.

In case of high noise variance, the recovered images using LVR methods appear to be blurred. In order to explore the deblurring potential, we apply LVR on generated images with different noise variances represented by () and recover the corresponding latent vectors for those noise levels. Here, indexes over to and indexes over to . is the difference between average over sample and the average of their corresponding recovered for noise level . We observe that, adding to recovered latent vectors from other generated images with noise variance sharpens the recovered images. Interestingly, this happens while denoising real images. Empirically, there seems to exist vectors in latent space that can add sharpness in image space. If we denote the sharpness attribute in latent vector space as for noise variance , interestingly, we find the quality of is higher than for recovered latent vectors with LVR.

4 Experimental Results

We now summarize our experimental findings. All experiments are conducted with DCGANs as described by [2]

and re-implemented in Tensorflow by

[20]. We made necessary changes on top of [20]. We train the generator using the CelebA [18] dataset.

Figure 4: Image De-noising Results with LVR methods [7]. Top row: input noisy images to the algorithm; Reference generated images. Bottom row: Recovered images by LVR with no clipping; projected gradient and stochastic gradient methods.
PSNR of reconstructed images with [7]
No clipping Projected Gradient Stochastic Clipping
Table 1: Reconstructed image quality evaluation for No clipping, projected gradient and stochastic gradient strategies as described in [7].

We first perform the experiments for denoising of generated images after adding Gaussian noise with variance of pixels units by applying different strategies as described in [7]. Stochastic clipping method outperforms projected gradient which performs better than no clipping strategy. Stochastic clipping method obtains more than dB higher PSNR than the without clipping strategy. Figure 4 shows the corresponding visual results.

We notice that the denoised images are significantly smoother than the images with which the generator was trained on. In order to improve the denoising results further, we explore the latent space for additional sharpness. We compare the latent space sharpness attribute-based method as LVR-SA, and always use the baseline of latent vector recovery with stochastic clipping.

As described in section 3, we first generate a set of images, , corrupt them with Gaussian noise with different variance. For each noise variance, we recover the latent vectors using stochastic clipping strategy. We then take the difference between average latent vectors that generated the image and the average latent vectors that were recovered. This difference serves as sharpness attribute. First, we add this sharpness attribute to the recovered vectors for those images. We observe that after adding the sharpness attribute, the PSNR increases upto dB. Next, we apply the same sharpness attribute while recovering a different set of real images, . Interestingly, the same sharpness attribute helps increase the PSNR by more than dB. Table 2 summarizes the above results, where the first row corresponds to the former case and the second row corresponds to the later scenario respectively. Figure 5 shows the corresponding visualizations. For each column, the top images are the original images. We add Gaussian noise to those images and recover them in the middle row with stochastic clipping. Third row denotes the recovered images after adding the sharpness attribute . The generator is trained only on celebA [18]. In the left column, the images are sampled from CelebA dataset and in the right, the images are sampled from LFW [19] dataset.

Figure 5: Sharpness attribute heuristics for images from from celebA dataset (left) and LFW dataset (right). The sharpness attribute is added to the two scenarios.
Effect of Sharpness attribute
same image sets
different image sets
Table 2: Adding sharpness attribute to the recovered vectors increases enhances the image quality.
(in pixels) BM3D LVR LVR-SA
Table 3: Reconstructed image quality evaluation by PSNR for different noise variance. For best BM3D reconstruction, corresponding noise variance is given. Unlike LVR, Denoising by BM3D and the proposed LVR-SA require noise variance.

Finally we compare the denoising results utilizing the above sharpness attribute method with stochastic clipping LVR and BM3D. Table 3 shows the results for different noise variances. The RGB images use -bit representation. The pixels can take values in the range of both inclusive for R,G, and B space. We experiment with high noise variance values. For low noise variance, the recovered images with different methods yield similar quality image deniosing. Latent vector recovery (LVR) with stochastic clipping yields better denoising results. This LVR method does not require the noise variance as a prior knowledge. Moreover, adding the sharpness latent vector (LVR-SA) improves the image quality on top of LVR. BM3D and LVR-SA both require a-priori knowledge of the noise variance. Figure 6 demonstrates the corresponding visual results. Denoising with the proposed method recovers clearly better quality images than BM3D.

Figure 6: Image denoising Results. Top row: original images from celebA dataset, input images to the algorithm with added Gaussian noise ( noise variance in pixels) on input images. Bottom row: denoised images with BM3D, denoised images with proposed method.

5 Conclusions

We show that latent vector recovery from GAN, in practice, can be used for image denoising. The denoised image quality is superior to methods such as BM3D. Additionally, we show that sharpness can be treated as an attribute in latent vector space. Adding this sharpness attribute leads to even higher quality image denoising than simple latent vector recovery based methods.