Why is FID so popular for evaluating GANs and other generative models?

The FID seems to be the most popular evaluation metric for GANs and other generative models. Why is it so popular? It seems to have some obvious issues, such as the assumption of Gaussian distributions, the lack of ability to detect memorization of training data, and so on. Some other issues are also discussed here: https://en.wikipedia.org/wiki/Fr%C3%A9chet_inception_distance Thanks!
Category: Data Science

Strategy for achieving a “hybrid” GAN

I have worked with a few GAN-like algorithms, but always with similar inputs and outputs. Being only a novice in deep learning, I often work by adapting an already existing Notebook, but today I have a more complex problem and I cannot find a similar example. For my algorithm I need to predict a curve, which is a list of floats (e.g. dimension 20x1), from two types of input data; a 2D image (e.g. a 16x16 normalized float array) and …
Category: Data Science

Can I use a GAN to increase my Dataset used for Image detection?

I am currently working on a machine learning project where I use the YOLO Algorithm to detect an object inside of a picture or video. The problem I face is that the specific image set (side-scan sonar) that I am working with is mostly classified, thus there is not a wide range of images available to the public to be used for training. Would I be able to implement a GAN to produce a larger data-set of side-scan sonar imagines …
Category: Data Science

Constrain GAN so the subject is always the same

I want to build a face GAN, but I want to be able to control the 'camera angle' of the generated image, and I also want the subject (the generated face) to be the same every time. If the above is possible, then it seems like it could generate the variety of angles necessary for something like photogrammetry. Is this possible? How would I implement the constraints?
Topic: gan
Category: Data Science

Error: An operation has `None` for gradient with categorical_crossentropy

I am trying to train my discriminator network using Keras with the TensorFlow backend. The network is meant to classify the input into one of the 9 output labels. I am passing a 2D input (height, width, no channels) and a one-hot vector for the output. I was able to train the network independently using fit(). However, now that I have switched to train_on_batch, it is giving me the error mentioned. This is my discriminator code: def build_discriminator(time_steps, feature_size, input_spectrogram=None): …
Category: Data Science

Question About Discriminator of CycleGan

The Discriminator of CycleGan outputs not just a single value to say that the image is real or fake.... But It outputs a grid of numbers (like 8X8 or 7x7), where each number says whether one patch of the input image is fake or real. So, my question is that, why do we do this.. What benefits does it gives us, and what was the problem in the approach where we only outputted a single value?
Category: Data Science

WGAN-GP: how to understand whether my networks are working as they are supposed to?

I am training a WGAN-GP. Is there any way to verify whether my networks are working as they are supposed to during training? I have no feeling about the outputs of my networks. I do not want to wait until the end of the training and then find out that there is something wrong. (I am using W Loss and MSE loss when training the generator. In a paper, I read authors saying that there is more information in the …
Category: Data Science

In which way GAN generator transforms the data(for transforming a noise to the data)?

I have the problem: I understood how GAN works in general, but I need information how it work detailed. The part I don't understand is how the random noise at input is transformed to data on the output(the math side of that process). If anybody knows answer for the question please say it or at least say in which side I need google the question.
Category: Data Science

Predicting a signal based on other signals

I want to predict a signal based on other related signals, how would I go about doing this? My current approach is to do some feature extraction (in the time and frequency domain) on both the ground truth signal and on the input signals. I use the features that I calculated on my input signals to predict the ground truth signal with basic regression models such as RandomForestRegressor or GradientBoostingRegressor models. I've used a rolling window approach with varying step/window …
Category: Data Science

Is it right to argue that a testing dataset is not needed when evaluating the performance of a GAN?

For my degree final project I have been working on a GAN to solve a certain image enhancement task. The problem I’m currently working on has an extremely limited number of datasets due to the physical constraints of taking such pictures, and for this reason I used a paired dataset for training and an unpaired dataset to see if the images generated from the unpaired dataset have the same distribution of the ground truth in the paired one, which turned …
Category: Data Science

How do GANs learn category distributions

I'm currently getting more into the topic of GANs and Generating Models. I've understood how the Generator and Discriminator work together in optimization to generate synthetic samples. Now I'm wondering how the model learns to reflect the occurance frequencies of the true entries in case of categorical data. As an example, lets say we have two columns of entries (1,A), (1, A), (2, A), (2, B) The model, when trained would not only try to output real combinations, so e.g. …
Category: Data Science

Generator losses in WGAN and potential convergence failure

I have been training a WGAN for a while now, with my generator training once in every five epochs. I have tried several model architectures(no of filters) and also tried varying the relationship with each other. No matter what happens, my output is essentially noise. On further reading, it seems to be a classic case of convergence failure. Over time, my generator loss gets more and more negative while my discriminator loss remains around -0.4 My guess is that since …
Category: Data Science

CycleGAN: Both losses from discriminator and generator drop fast, after 100 epochs outputs blurred original image

I'm trying to train a 3D Cycle-GAN on medical image synthesis, more specifically CT to MR. Currently I'm using a 3-Layer Discriminator and a 6 layer UNetGenerator borrowed from the official CycleGAN codes. Same lambda A, B of 10 and .5 of identity. The discriminator loss drops to around 0 in the first few epochs, and the total loss for generator drops to around 1 as well. The generator continues to ouput blurred original input image. During my debugging I …
Category: Data Science

How to collect all variables as a list in tensorflow grouped as a function

I am trying to reproduce the cGAN network architecture introduced on the recent paper deep video portrait(2018, Standford) I have defined Generator as T(x) following the notation of the paper. And T(x) refer the above listed operation blocks, such as conv_down(), conv_upsample(), biLinearDown() and finalTanH(). I had notated their scope with 'with tf.variable_scope()' syntax. While I am comprising a loss and optimizer, found that I need to collect those Generator related variables all together since we are going to train …
Category: Data Science

proper solution to synthesize nailart on hand picture

I'm trying to synthesize nailart on hand picture. Next 3 steps are what I'm trying to do. take hand pictures select options like color, cubic .. etc synthesize And the way I thought to solve this is get nail contour by trained UNET model with datasets (hand pics, hand pics with nail area painted) make synthetic nailarts image by trained pix-to-pix model with datasets( nailart pics, semantic images including nailarts' options) synthesize nailart image on hand picture I'm wondering whether …
Category: Data Science

Super Resolution GAN with different input image size

Good morning, I am trying to train a Super Resolution GAN. Following some materials on the web I managed to train a first SRGAN model. To do that I took some high resolution image (128x128 pixels) and I downscale them to 32x32 to train the model. Once I finished the training of the model, I tested it using some new images that I didn't use for the training. Everything works fine if I used a 32x32 image, while the model …
Topic: gan
Category: Data Science

CycleGAN on keras provides an error

from __future__ import print_function, division import scipy, os import scipy.misc from keras.datasets import mnist from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import BatchNormalization, Activation, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.activations import relu from keras.layers.convolutional import UpSampling2D, Conv2D, Conv2DTranspose from keras.models import Sequential, Model from keras.optimizers import Adam import datetime import matplotlib.pyplot as plt import sys import numpy as np import os import keras import shutil, os, random from keras.models import load_model …
Category: Data Science

Keras Backpropagation when Later Layers are Frozen

I am working on a project with facial image translation and GANs and still have some conceptual misunderstandings. In my definition of my model, I extract a deep embedding of my generated image and the input image using a state of the art CNN which I mark as untrainable, calculate the distance between these embeddings and use this distance itself as a loss in my model definition. If the model from which the embeddings come from is untrainable, will the …
Category: Data Science

WGAN-GP slow critic training time

I am implementing WGAN-GP using Tensorflow 2.0, but each training iteration of the critic is very slow (about 4 secs on my CPU, and somehow 9 secs on Colab GPU). Is WGAN-GP usually this slow or there is a flaw in my code? Here's my code for training the critic: def train_critic(self, X_real, batch_size, gp_loss_factor, optimizer): y_real = np.ones((batch_size, 1)) # Get batch of generated images noise = np.random.normal(0, 1, (batch_size, self.z_dim)) X_fake = self.gen.predict(noise) y_fake = -np.ones((batch_size, 1)) X …
Category: Data Science

GAN optimizer settings in Keras

I am working on a Generative Adversarial Network, implementing in Keras. I have my generator model, G, and discriminator D, both are being created by two functions, and then the GAN model is created using these two models, like this light sample of the code: gopt=Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=1e-08) dopt=Adam(lr=0.00005, beta_1=0.9, beta_2=0.999, epsilon=1e-08) opt_gan = Adam(lr=0.00006, beta_1=0.9, beta_2=0.999, epsilon=1e-08) G= gmodel(......) G.compile(loss=...., optimizer=gopt) D=dmodel(..) D.trainable = False GAN=ganmodel(generator_model=G,discriminator_model=D,...) GAN_model.compile(loss=["mae", "binary_crossentropy"], loss_weights=[0.5, 0.5], optimizer=opt_gan) D.trainable = True D.compile(loss='binary_crossentropy', optimizer=dopt) now my …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.