chainer-fast-neuralstyle icon indicating copy to clipboard operation
chainer-fast-neuralstyle copied to clipboard

Any plans to update with Instance normalization?

Open igorbarinov opened this issue 9 years ago • 11 comments

Hi, do you have any plans to update your solution with Instance normalization as described here "Instance Normalization: The Missing Ingredient for Fast Stylization" https://arxiv.org/abs/1607.08022

igorbarinov avatar Jul 28 '16 16:07 igorbarinov

@igorbarinov what's the difference between instance nomalization and batchnorm with batchsize = 1 ?

austingg avatar Jul 29 '16 02:07 austingg

@igorbarinov got it. instance normalization only normalized in spatial not cross feature map and batch

austingg avatar Jul 30 '16 09:07 austingg

@austingg Have you tried it? I think it does the same thing with batch normalization when you set batchsize = 1

bucktoothsir avatar Jul 30 '16 18:07 bucktoothsir

@bucktoothsir I haven't tried. but batchsize = 1 still normalize cross the feature maps. instance normalization only do normalization within the feature map plane. As @yusuketomoto say, batchsize >=2 have some problem, i do all my experiments with batchsize = 1

austingg avatar Jul 30 '16 20:07 austingg

@bucktoothsir sorry . After i checked the paper, i found batchsize = 1 is instance normalization.

austingg avatar Jul 31 '16 09:07 austingg

Are you sure ? According to the paper that would mean that using batchsize=1 yields better results than batchsize >= 2

ttoinou avatar Aug 01 '16 19:08 ttoinou

@ttoinou batch normalization is across instances, however, when batch size = 1, there is only one instance. You can also implement multi batch training with normaliztion within instance.

austingg avatar Aug 02 '16 01:08 austingg

From the paper we can see the effect is greatly improved. Anybody have the implement in python, I can test it.

logic1988 avatar Aug 02 '16 03:08 logic1988

@logic1988 : Yes they updated their project yesterday with instance normalization with torch ! https://github.com/DmitryUlyanov/texture_nets @austingg : Great so there's still some hope to get the training faster by fixing the batchsize issue (I guess that loading images, resizing them and giving them to the GPU would be faster in batch, no ? there would be less CPU <-> GPU communication)

ttoinou avatar Aug 02 '16 07:08 ttoinou

There are a great Torch Implementation released by jcjohnson a few days ago. https://github.com/jcjohnson/fast-neural-style

In addition to the original method, the new method inspired by the the paper [Instance Normalization: The Missing Ingredient for Fast Stylization] has been implemented.

The latter seems to have a better result and faster speed than the former.

It said that:

These models use the same architecture as those used in our paper, except with half the number of filters per layer and with instance normalization instead of batch normalization. Using narrower layers makes the models smaller and faster without sacrificing model quality.

How to modify the corresponding code in this project? @yusuketomoto

logic1988 avatar Oct 08 '16 12:10 logic1988

On the same system, is the Torch implementation or this implementation faster? better? Anyone have comparisons?

artnose avatar Oct 12 '16 19:10 artnose