4
$\begingroup$

There are lots of examples of classifier using deep learning techniques with CIFAR-10 datasets. The way it works is that, train thousands of images of cat, dog, plane etc and then classify an image as dog, plane or cat. But I want to do the reverse thing. I want to train dog, cat, planes and it should output images. Here is my idea

  1. Group similar/clear images of cat as value 1, a less similar/blur images as 1.1 and so on. Similarly, group similar images of dog as value 2 and less similar images as 2.1 and so on ... Do the same for all types of images.

Generated dataset should look like this

input    output
 1      pixels(24*24) of a cat images(clear)
 1      pixels(24*24) of a cat images(clear)
 .
 .
 1.1      pixels(24*24) of another cat images(blur) 
 1.1      pixels(24*24) of another cat images(blur) 
  .
  .
  and so on
  1. Now train values of input and label of images as output. Input will be just 1 dimensional, may be I will think of some other data. Output layer will have 24*24 i.e 576 units or neurons.
  2. At the end of training, I want something like this, if I give a input for example 1.15 it should output a new image since we trained with values 1.1 and 1.2 but we didn't train with 1.11 or 1.115.

Please give me some idea how can I do this? Any link to example or papers would be nice.

$\endgroup$
  • 1
    $\begingroup$ Your plan is likely to output a single (averaged) cat-like image that becomes more blurry as you increase the input value. I.e. in your example the input 1.15 would not produce a "random" novel image, but some interpolation between the mean cat blur in the 1.1 images and the mean cat blur in the 1.2 images. Is that the intent? If you prefer to see something more creative, then yes there are many papers on generative networks. You could look into Variational Autoencoders and Generative Adversarial Networks as a start. $\endgroup$ – Neil Slater Jul 19 '17 at 12:03
  • $\begingroup$ Could you refer to some papers/examples related to Generative Adversarial Networks or Variational Autoencoders for start which is easy to start with? $\endgroup$ – asdfkjasdfjk Jul 19 '17 at 12:09
  • $\begingroup$ VAEs are easiest to understand and work with. Try this blog kvfrans.com/variational-autoencoders-explained as an intro, it links example code. Other than that, do a web search for either term (or short form VAE, GAN), you will get 100s of hits, and most of them will be useful $\endgroup$ – Neil Slater Jul 19 '17 at 12:30
4
$\begingroup$

DCGAN(Deep convolutioanl GAN) or WGAN can be used to generate images by training them on already existing images. GAN are very tricky to train. DCGAN and WGAN are the techniques that make it somewhat easier.

A GAN consists of a Generator and a Discriminator. Generator's job is to generate images and Discriminator's job is to predict whether the image generated by the generator is fake or real. If the generator succeeds in fooling the discriminator, we can say that generator has succeeded.

I have generated MNIST images using DCGAN, you can easily port the code to generate dogs and cats images.

| improve this answer | |
$\endgroup$
  • $\begingroup$ As far as naming is concerned, DCGAN is just a particular kind of GAN that uses deep convolutional layers. $\endgroup$ – E_net4 is not a porcupine Jul 24 '17 at 8:34
1
$\begingroup$

Generative Adversarial Networks (GANs) can generate novel, related images to a given training set. A general introduction (with code) can be found here and here.

| improve this answer | |
$\endgroup$
  • $\begingroup$ The answer is a bit short, and doesn't address the plan in the OP's main text. I suggest add a critique of OP's original plan (you can take content from my comment on the question if you want, I don't mind - I commented because I did not have enough to go on to make a full answer). Also worth expanding the description of GAN - just grab a couple general sentences about them (e.g. that they are composed of two networks, generator/discriminator, that they are tricky to train etc). $\endgroup$ – Neil Slater Jul 19 '17 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.