/Neural-Style-Transfer---Tensorflow

This project is the implementation of the neutral style transfer technique using the algorithm proposed in the paper "A Neural Algorithm of Artistic Style".

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Neural-Style-Transfer---Tensorflow

Introduction

This is the process which utilises deep learning to compose one image in the style of another image. The paper titled "A Neural Algorithm of Artistic Style" by Gatys et al. [1] gave the inspiration to build this project.

"Neural style transfer is an optimization technique used to take two images—a content image and a style reference image (such as an artwork by a famous painter)—and blend them together so the output image looks like the content image, but “painted” in the style of the style reference image.

This is implemented by optimizing the output image to match the content statistics of the content image and the style statistics of the style reference image. These statistics are extracted from the images using a convolutional network." [2]

image

Example

Screenshot 2023-05-18 at 10 08 13 AM Content Image A followed by respective style images on left corner of images B, C and D

Input

Style Image

image

Content Image

image

Output

image

Note:-

1) Gram-Matrix

  • Is a measure of correlation between two filters
  • If suppose a filter to detect black and brown stripes and one to detect eyes are present then it might imply the presence of a tiger

2) Loss Function

Content Loss

image

Style Loss

image

Total Loss

image

Content Image

References