├── README.md └── gan-model-on-anime-image-dataset-tensorflow.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # GAN-model-using-TensorFlow 2 | In this repo, I will use GAN(Generative Adversarial Network) on Anime_image dataset. 3 | GAN is short form of Generative Adversarial Network and a deep learning architecture. GAN consists of 2 parts, Discriminator and Generator. 4 | The Generator tries to creat fake images and fool the Discriminator, and Discriminator tries to distinguish the images and label them as fake(0) or real(1). 5 | 6 | This zero-sum game continuees until the Generator can no longer creat images which fools the Discriminator and the Discriminator cannot be fooled. 7 | 8 | There are different types of GAN Models but we are using DCGAN which is the short form of Deep Convolutional GAN. 9 | 10 | 11 | 12 | **What is Discriminator ?** 13 | 14 | The Discriminator is a Neural Network model which tries to distinguish the real images from fake images(generated by Generator) and label them as fake(0) or real(1). 15 | 16 | Notes : 17 | 18 | 1.The image size is (64,64), so the input_shape of first conv2d layer should be (64,64,3). 19 | 20 | 2.The output of Discriminator is either a 0(fake) or 1(real). 21 | 22 | 3.Using "same" as padding ensures us that the output dimension is not going to change. 23 | 24 | 4.In the Discriminator function, all activations should be "LeakyReLU", exept the last layer which should be "sigmoid" 25 | 26 | 5.The last layer is using "sigmoid" as activation function to create a binary output, which real images are labeled as 1 and the fake ones are labeled as 0. 27 | 28 | 6.The Discriminator downsamples the input shape. 29 | 30 | 31 | **What is Generator ?** 32 | 33 | The Generator tries to creat fake images and fool the Discriminator, and Discriminator tries to distinguish the images and label them as fake(0) or real(1). 34 | 35 | Notes : 36 | 37 | 1.The latent space is an arbitrarily defined vector space of Gaussian-distributed values and here I consider 100 as latent_dim. 38 | 39 | 2.Also units in Dense layer can be (4,4,256) (so it has 4096 nodes)---> 256 versions of 4*4 images. 40 | 41 | 3.Using "same" as padding ensures us that the output dimension is not going to change. 42 | 43 | 4.The output shape will be (None, 64, 64, 3) just like the input image(real image) of Discriminator. 44 | 45 | 5.In Generator, we can use Upsampling or Conv2DTranspose layer to upsample the input. 46 | 47 | **This dataset has 63,632 "high-quality" anime faces.** 48 | The source of the dataset is from kaggle : https://www.kaggle.com/datasets/splcher/animefacedataset 49 | --------------------------------------------------------------------------------