ART + AI — Generating African Masks using (Tensorflow and TPUs)

However, the sample supports generation of 32px images (cifar dataset) and my main task was to extend the model to support large image sizes (64px, 128px), similar to work done with artDCGAN..This was achieved mainly by extending (adding layers to) the generator and discriminator within the DCGAN model..The trickiest part here was to ensure size consistency .i.e..ensure input/output from each layer or function matches the expected shape and size.Generative Adversarial Networks (GANs)GANs are a form of deep neural network that are particularly useful for density estimating..GANs are generative in that they learn a distribution (the training image dataset) and can generate “novel” samples that lie within this distribution..They are adversarial because they are structured as a game in which two neural networks (a generator G and a discriminator D) compete — G learns to generate fake images (by estimating the image data distribution) and the D learns to tell apart real from fake images (probability that the image comes from the distribution or from G).As the game progresses, the G learns to create “convincing” images which D cannot tell apart from real images..It is expected that G learns all of the salient “modes” within the data and covers all of them when generating new images..E.g..a GAN trained on the Cifar10 dataset should generate images from all 10 categories (cars, trucks, aeroplanes etc)..Advances in this area of research have focused on finding good criteria for both networks to evaluate themselves (loss functions), better architectures which address several known issues (e.g. one network overpowering the other, failing to learn all “modes” of the data distribution), generation of realistic/high resolution images etc.For this project, an unconditional DCGAN[1] or deep convolutional GAN architecture is used given its architectural choices that make it stable during training..Tensorflow provides example code on training a DCGAN (CIFAR, MNIST) with TPUs which was extended for this experiment.Data Preparation and TrainingFor this project, I used the African Masks dataset — a manually curated set of ~9300 images depicting African Masks (I am still curating this dataset but plan to release it soon).The goal of this dataset is to provide additional resources for exploring intersections between AI and Africa Art.One thing to note is that this dataset contains diverse “modes” of images (i.e. masks of many different, shapes, textures etc) as opposed to well defined datasets like CelebA which contain only faces with limited variations..It would be interesting to see how the GAN attempts to learn modes from this dataset and its interpretations of these modes.. More details

Leave a Reply