Why use a random image as f_content for style transfer instead of just output of conv layer?

In lesson 8 or first lesson of part 2 course, Jeremy uses a random image and compared it to the VGG 5th block’s conv layer output of an actual bird image and uses optimizer to recreate that random image like the bird output from that conv layer and uses that as a f_content for style tranfer. What I don’t understand it why bother recreating a random image like the conv layer output, why not use directly the conv layer output as f_content?

The random image is also used for the style transfer. The content and style loss are added together, and then SGD is used to convert that random image into the final generated image.

At first Jeremy shows how to just use the random image with the content loss (but not the style loss), which is interesting but not very useful on its own. He also shows how to use just the random image with the style loss (but not the content loss). And then finally he puts these two things together to get the full style transfer.

So when doing the style transfer the total loss (content + style) measures how “far away” the random image is from the final image that we want to see, and SGD turns the random image into that final image.

1 Like

thank you… it makes sense now :slight_smile: