1
$\begingroup$

I'm reading about conditional GAN (cGAN) architecture, what I know is that the generator creates images combining both noise vector and conditional variable, the noise vector brings in random elements like colors or shapes while conditional variable is used for maintaining the same object.

As for the discriminator, the input is an image that is either fake (generated by the generator) or real (from the dataset) combines with the conditional variable. What I don't understand is that why do we also include the conditional variable in the discriminator, I get that the generator needs them for guidance, but why does the discriminator, which is just classifying fake or real, require this additional information?

$\endgroup$

1 Answer 1

2
$\begingroup$

Because otherwise there is no conditioning... consider the case where you condition the generator but not the discriminator: given an image and a label, the generator proposes an image, which will be passed to the discriminator... however, it has no idea what that image should represent, so at most it can at most guess if it comes from the joint distribution or not (aka dataset, as a naive GAN)

So, by giving the information also to the discriminator (take the digit MNIST case), the discriminator learns how a specific digit looks like, forcing the generator to generate realistic images of that specific label

$\endgroup$
5
  • $\begingroup$ Why does the discriminator need to know what do the images represent ? I still don't understand, I think giving the label to the discriminator is meaningless since the generator already produces images that correlated with the label $\endgroup$
    – abcd
    Nov 13, 2023 at 13:29
  • $\begingroup$ @abcd no, the generator is no forced at all to understand your label as conditioning if not forced by the discriminator, it can just ignore such information and fall back to the normal GAN, try and you'll see $\endgroup$
    – Alberto
    Nov 14, 2023 at 10:18
  • $\begingroup$ Are you saying that the generator will produce something different from the conditional label I provide? I read from the tutorials that they combine the one-hot encoding vector of the label with the noise vector, then the generator will always output the image correlated with the label $\endgroup$
    – abcd
    Nov 15, 2023 at 20:21
  • $\begingroup$ @abcd given you also give the concatenated vector to the discriminator, if you don't condition your discriminator, the generator will be free to ignore the label given as input $\endgroup$
    – Alberto
    Nov 16, 2023 at 21:34
  • $\begingroup$ Thanks for your help $\endgroup$
    – abcd
    Nov 20, 2023 at 10:15

You must log in to answer this question.