In neural style transfer, we have a content image and a style image, and we combine these two images in such a way that the combined image preserves the content of the content image while maintaining the style of the style image.
An example style image and content image are as follows:
In the preceding picture, we want to retain the content in the picture on right (the content image), but overlay it with the color and texture in the picture on the left (the style image).
The process of performing neural style transfer is as follows. We try to modify the original image in a way that the loss value is split into content loss and style loss. Content loss refers to how different the generated image is from the content image. Style loss refers to how correlated the style image is to the generated image.
While we mentioned that the loss is calculated based on the difference in images, in practice, we modify it slightly by ensuring that the loss is calculated...