Deep Convolutional Generative Adversarial Networks (DCGANs)

Ever wondered if a super high resolution image can be created from a low resolution image? Or can a convolution neural network extract features from a large unlabeled dataset of images by performing arithmetic operations on images? however, A paper on a specialised Generative Adversarial Networks, known as Deep Convolutional Generative Adversarial Networks (DCGAN) provides a peek into converting this sci-fi imagination into reality. 

What are DCGANs ?

DCGANs are a class of GANs which utilise the architecture of Convolutional Neural Networks (CNNs) to classify images. While CNNs have found wide applications in supervised learning, their application in unsupervised learning has still been a frontier to explore.

With DCGANs and their architectural constraints, they can be effectively use for not just unsupervised learning and classification algorithms. but the feature extraction methodologies of generator and discriminator of these DCGANs can also be in use as representational images for classification labelled datasets. 

Architecture

so To ensure suitable and appropriate scaling and stability of models on varied datasets and training deeper generative models with higher resolution. The architectural guidelines are:

  • The first layer of DCGAN takes in a uniform distribution as noise (Z).
  • The output is also converted into a four dimensional tensor and fed into the convolutional stack.
  • Pooling layers replaced with fractional-strided convolutions in the generator and strided-convolutions in the discriminator.
  • thus, Fully connected hidden layers are not in use.
  • Using batchnorm in both, generator and discriminator.
  • LeakyReLU as activation function in all layers of Generator except for the output layer, in which tanh is in use.
  • In discriminator,  LeakyReLU is also in use as the activation function in all layers. With slope as 0.2
  • The last layer of discriminator is flattened.

Image source

Hyperparameter tuning

  • No image pre-processing undertaken.
  • Mini batch stochastic gradient descent used to train all images, with    mini-batch size of 128.
  • Weight initializer with Gaussian distribution. Standard deviation of 0.02.
  • Adam optimizer with learning rate of 0.0002.
  • Momentum term, 1 is set at 0.5

Discriminator features

While supervised CNNs have been well-known to learn features, feature extraction and learning by an unsupervised CNN was never successful. CNNs trained on large image sets, have been prove to learn image detectors. But by using guided back-propogation, even unsupervised CNNs are now learning hierarchy of discriminating features.

The Arithmetics of Generator

Empirical evidence suggests that the Generator learns specific features and that it follows vector arithmetic principles. Hence, upon averaging the Z vector and studying the results of three examples, the generator was observe to be following principles of linear arithmetic.

The image below depicts this vector arithmetic in operation. For each column, the respective Z vectors of all the samples are average. This mean of Z vector is then operate as per arithmetics. This gives vector Y as output. The sample at centre of the output is the output by Generator. 8 samples with noise of 0.25 are further add, to gauze the interpolation capabilities of the Generator. The noisy overlap in bottom two examples is the result of misalignment. 

Image Source

Inferences

The DCGAN shows to be learning the hierarchy of features on its own in a large image dataset. Aside from supervised CNN models, this shows that unsupervised GAN CNN models can also learn features from images, subsequently classifying the images based on these features. Hence, the stabilise DCGANs can be use to classify large, unlabelled image datasets into categories based on learned features.

Another important observation is that the Generator in DCGANs obey principles of vector arithmetic operations on its learned features.

Further research

The parameter to judge the accuracy of classification by an unsupervised learning CNN model is by feeding its results into a supervised model of the same image set. Though the unsupervised DCGAN model has shown impressive results, still a horizon of improvements are required in its accuracy vis-vis supervised learning models.

Written By: Sachin Shastri

Reviewed By: Vikas Bhardwaj

If you are Interested In Machine Learning You Can Check Machine Learning Internship Program
Also Check Other Technical And Non Technical Internship Programs

Leave a Comment

Your email address will not be published. Required fields are marked *