CNN vs DCGAN

DCGANs stand for Deep Convolutional Generative Adversarial Networks. It is quite the contrary to a Convolutional Neural Network (CNN). It works in an opposite direction compared to a CNN. What CNN does is that it transforms an image to class labels, that is a list of probabilities, whereas DCGAN generates an image from random parameters.

CNNs and DCGANs

 

Some of you might wonder what are convolutions. Convolutions are the operations or the modifications we perform on an image. We perform modifications on the image kernel by multiplying it with the matrix of the operation we want to perform. For detailed information on image kernel and convolutions please visit here.

Moving on, what CNN does is it applies a lot of filters to extract various features from a single image. CNN applies multi-layered filters to a single image to extract features moving deeper into the layers.

CNN1

Now the typical working on CNNs is that it starts from a single RGB image on the right, multiple filtering layers are applied to produce smaller and large number of images.

cnn

Flow of CNNs

 

Image generation flow of DCGANs

DCGANs

Flow of DCGANs

 

Now, the filters that we previously mentioned are convolutional in CNNs and transposed-convolutional in DCGANs, both of them work in the opposite direction.

padding_strides

Illustration of their working

Convolution: (Bottom Up) 3×3 blue pixels contribute to generating a single green pixel. Each of 3×3 blue pixels multiplied by the corresponding filter value, and the results from different blue pixels summed up to be a single green pixel.

Transposed-Convolutions: (Top Down) A single green pixel contributes to generating 3×3 blue pixels. Each green pixel is multiplied by each 3×3 filter values and the results from different green pixels are summed up to be a single blue pixel.

 

It is suggested that the input parameters could use a semantic structure as in the following example-

inputpara

Interpretation of Input Parameters

 

Training Strategies:

CNN: Classifying authentic and fake images. Here, authentic images are provided as training data to the model.

DCGAN: It is trained to generate images classified as authentic by the CNN. It works by trying to fool the CNN, DCGAN learns to generate images similar to the training data.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s