real-time image style transfercs229.stanford.edu/proj2017/final-posters/5140602.pdf · image style...

1
Real-Time Image Style Transfer Zhaoyou Wang, [email protected] Zhaoheng Guo, [email protected] Motivation Image style transfer is a long-standing problem that seeks to transfer the style of a reference style image onto another input picture. Our project has implemented two recent proposed image style transfer algorithms based on convolutional neural networks. Model Neural algorithm: 1. Content Loss 2. Style Loss 3. Joint Loss Function 4. Output: Realtime style transfer : Train an Image Transform Network Input Image Image Transform Network Content Image Style Image Joint Loss Two epochs over the 80k Microsoft COCO dataset with batch size 4 (resize to 256x256). We use a pre-trained VGG16 network for the loss calculation and an image transformation network with 3 convolution layers, 5 residual layers and 3 deconvolution layers. Style Baseline Real-time Results Training Details References 1. L. A. Gatys, A. S. Ecker and M. Bethge. A neural algorithm of artistic style. arXiv preprint arXiv:1508.06576, 2015. 2. J. Johnson, A. Alahi and L. Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pages 694–711. Springer, 2016. 3.D. Ulyanov, A. Vedaldi and V. Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016. L l c (y c ,y )= 1 2 ij (F l ij (y c ) - F l ij (y )) 2 Neural algorithm results with different style weights. Comparison of two methods: E l (y,y s )= 1 4 N 2 l M 2 l ij (G l ij (y ) G l ij (y s )) 2 L s (y,y s )= l w l E l G l ij = k F l ik F l jk ˆ y = arg min y L J (y c ,y s ,y ) L J L J (y c ,y s ,y )= αL c (y c ,y )+ β L s (y s ,y ) W * = arg min W L J (y c ,y s ,f W (y c )) Future Plans 1. Add photorealistic loss and semantic segmentation to reduce local distortion in original neural algorithm 2. Implement realtime algorithm for photo style transfer 3. Train a style extraction network to realize arbitrary image style transfer Discussion Important details for final results: 1. Input images need preprocessing (subtract mean value and normalize) to make loss network work properly. 2. Projecting the values of generated images to range [0, 255] to get rid of some noisy artifacts. 3. During the training process, allowing the image transformation network to work in range [0, 255] generates much better results than than [0, 1]. Sophia Lu, [email protected]

Upload: others

Post on 08-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Real-Time Image Style Transfercs229.stanford.edu/proj2017/final-posters/5140602.pdf · Image style transfer is a long-standing problem that seeks to transfer the style of a reference

Real-TimeImageStyleTransferZhaoyouWang,[email protected],[email protected]

MotivationMotivationImage style transfer is a long-standing problem that seeks to transfer the style of a reference style image onto another input picture. Our project has implemented two recent proposed image style transfer algorithms based on convolutional neural networks.

ModelNeuralalgorithm:1. ContentLoss

2.StyleLoss

3.JointLossFunction

4.Output:

Realtimestyletransfer:TrainanImageTransformNetwork

InputImage ImageTransformNetwork

ContentImage

StyleImage

JointLoss

Two epochs over the 80k Microsoft COCO dataset with batch size 4 (resize to 256x256). We use a pre-trained VGG16 network for the loss calculation and an image transformation network with 3 convolution layers, 5 residual layers and 3 deconvolution layers.

Style

Baseline

Real-time

Results

TrainingDetails

References1. L. A. Gatys, A. S. Ecker and M. Bethge.

A neural algorithm of artistic style. arXiv preprint arXiv:1508.06576, 2015.

2. J. Johnson, A. Alahi and L. Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European Conference on Computer Vision, pages 694–711. Springer, 2016.

3. D. Ulyanov, A. Vedaldi and V. Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.

Llc(yc, y) =

1

2

ij

(F lij(yc) � F l

ij(y))2

Neuralalgorithmresultswithdifferentstyleweights.

Comparisonoftwomethods:

El(y, ys) =1

4N2l M

2l

!

ij

(Glij(y)−Gl

ij(ys))2

Ls(y, ys) =!

l

wlEl

Glij =

k

F likF l

jk

y = arg miny

LJ(yc, ys, y)

LJ

LJ(yc, ys, y) = �Lc(yc, y) + �Ls(ys, y)

W � = arg minW

LJ(yc, ys, fW (yc))

FuturePlans1. Addphotorealisticlossandsemantic

segmentationtoreducelocaldistortioninoriginalneuralalgorithm

2. Implementrealtimealgorithmforphotostyletransfer

3. Trainastyleextractionnetworktorealizearbitraryimagestyletransfer

DiscussionImportantdetailsforfinalresults:1. Inputimagesneedpreprocessing

(subtractmeanvalueandnormalize)tomakelossnetworkworkproperly.

2. Projectingthevaluesofgeneratedimagestorange[0,255]togetridofsomenoisyartifacts.

3. Duringthetrainingprocess,allowingtheimagetransformationnetworktoworkinrange[0,255]generatesmuchbetterresultsthanthan[0,1].

SophiaLu,[email protected]