Overview of Style Transfer (Deep Harmonization)

What is Style Transfer in Neural Networks?
Architecture & Algorithm
Gatys et al

Pooling Process

Losses in Style Transfer:
  • Content Loss
    Let us select a hidden layer (L) in vgg-19 to calculate the content loss. Let p: original image and x: generated image. Let Pl and Fl denote feature representations of the respective images corresponding to layer L. Then the content loss will be defined as:
  • Style Loss
    For this, we first have to calculate Gram Matrix. Calculation of correlation between different filters/ channels involves the dot product between the vectorized feature maps i and j at layer l. The matrix thus obtained is called Gram Matrix (G). Style loss is the square of difference between the Gram Matrix of the style image with the Gram Matrix of generated Image.
  • Total Loss
    is defined by the below formula (with α and β are hyperparameters that are set as per requirement).
    The generated image X, in theory, is such that the content loss and style loss is least. That means X matches both the content of P and style of A at the same time. Doing this will generate the desired output.
Note:
Code & Output
entire code, data files and outputs
__CA__’s Github Repo