My neural network takes an image as an input and outputs another image. It's the generator of a cycleGAN.
I would like to add (to the discriminator loss
, the cycle consistency loss
and the identity loss
) a colour consistency loss
i.e. i want the output image to globally have the same colours than the input image.
Why? My problem is that the network "tints" my images too much in my opinion (a standard example is the following: my dataset has women that wear pink clothes more than men do and when i transform men into women, the GAN also transforms the clothes, and sort of adds a pink tint to the whole image). I know that adding this loss will encourage the network to "not change anything" though as any change would be a change in colours. Unless my loss looks at the averages of red, blue and green instead of looking at them pixel by pixel, which is what I'd like to go for.
Not the main question but any thoughts on that are appreciated: any idea about how to implement it in Pytorch, or if it's already been implemented? Searches for colour consistency on GANs just give me GANs that take black and white photos and add colour to them.