Difference between DCGAN and cyclicGAN


Introduction:

In recent times, lots of research have been going on, and many new techniques have been introduced in the Deep Learning domain. Especially, the development has been made in the computer vision area such as Deepface and 3D model generation using 2d images and many more.

There is also a subdomain of vision area which can generate unseen images by training a Generative adversarial network(GAN). There are multiple ways to generate images depending on applications. But, there are two models which can be used mostly.
  1. DCGAN (Deep convolution GAN)
  2. cyclicGAN

Explanation:

One can check the following criteria to distinguish between these two models.

Architecture:

DCGAN has basic GAN architecture which contains a generator and discriminator. The input of the generator is a random numbers array from any distribution (normal/uniform).

Figure 1: DCGAN functional diagram

CyclicGAN has a complex architecture that contains two generators and discriminators. One GAN architecture (Generator + discriminator) is used to convert style A to B and the second architecture helps to convert style B to A. The inputs for both generators are generated images from each other. 

Figure 2: Cyclic GAN functional diagram only for an image cycle

The difference in loss functions:

In the usage of loss functions, The adversarial loss function is required in both DCGAN and CyclicGAN models to train GAN models to generate realistic images. The cyclic consistency loss function is used in only CyclicGAN that can help to transfer the style from Image A to B and vice versa.

Adversarial loss:

In Every GAN model, Adversarial loss is a must. Adversarial loss tries to match the distribution of generated images to dataset distribution.
Where D tries to maximize the correctness with the help of logD(x) and G tries to minimize the fake prediction with the help of log(1 -D(G(z))).

So, Adversarial loss is used in both networks. As DCGAN has only one discriminator model. The loss function applies to the output of that discriminator. Where cyclicGAN has two discriminator models. So, We have two loss functions with different discriminator functions(D) in that case.

Cyclic consistency loss:

Cyclic consistency loss is basically used to push both mapping models MAB and  MBA to be consistent with each other. It helps to prevent mapping by contradicting each other

Forward cyclic consistency (for image A):
Cyclic consistency loss function:

The difference in discriminator architectures:

The DCGAN model uses a simple classification CNN model that has the last layer as flatten neuron. So, It requires fixed-sized images. CyclicGAN uses PatchGANs which helps to classify 70x70 sized overlapped patch from the images whether it is real or fake. It has a small number of parameters than the full image discriminator that is used in the DCGAN. Also, the model accepts arbitrary images in a fully convolutional fashion. 

Conclusion:

From the above observations, DCGAN is used only to generate realistic images as per the input data. Where CyclicGAN is used to transfer image style A to B and vice versa. The architecture differs in both GAN models where DCGAN contains only one GAN and CyclicGAN contains two GAN models in a cyclic fashion. Two losses have been explained to understand of usage of adversarial loss and specifically cyclic consistency loss. Usage of PatchGAN is briefly explained for classifying overlapping patches as real or fake.

Comments

Popular posts from this blog

CyclicGAN