fast-neural-style icon indicating copy to clipboard operation
fast-neural-style copied to clipboard

Avoid checkerboard pattern

Open sheerun opened this issue 9 years ago • 6 comments

Hey,

Your algorithm has been mentioned in recent article about checkerboard artifacts. It says you could avoid them by "switching deconvolutional layers for resize-convolution layers". Not sure what it means, but I thought I could mention it..

sheerun avatar Oct 18 '16 08:10 sheerun

The link to article: http://distill.pub/2016/deconv-checkerboard/

sheerun avatar Oct 18 '16 08:10 sheerun

I find in https://github.com/jcjohnson/fast-neural-style/blob/master/fast_neural_style/models.lua#L96, it has already support nearest neighbor upsampling to fix this problem.

xlvector avatar Oct 30 '16 05:10 xlvector

Nice find @xlvector . I am now training with

-arch c9s1-16,d32,d64,R64,R64,R64,R64,R64,U2,U2,c9s1-3

and it looks good so far.

htoyryla avatar Oct 30 '16 06:10 htoyryla

@htoyryla U2 is just a nearest-neighbor upsampling; you may get better results if you stick a stride-1 convolution between the two upsampling layers:

-arch c9s1-16,d32,d64,R64,R64,R64,R64,R64,U2,c3s1-32,U2,c9s1-3

jcjohnson avatar Oct 30 '16 16:10 jcjohnson

Thanks for the tip! Even if I didn't have any problems with it. BTW in the udnie test today I used this architecture.

htoyryla avatar Oct 30 '16 16:10 htoyryla

What about vertical lines?

image

fehmi avatar Aug 04 '20 20:08 fehmi