AdaIN的全名是Adaptive Instance Normalization,源自风格迁移的论文Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization
假设原图和风格图经过VGG进行特征提取后得到shape分别为CxHxW和CxH‘xW’的特征图c和s,AdaIN的计算如下:
A d a I N ( c , s ) = σ ( s ) ( c − μ ( c ) σ ( c ) ) + μ ( s ) AdaIN(c,s)=\sigma(s)\left(\frac{c-\mu(c)}{\sigma(c)}\right)+\mu(s) AdaIN(c,s)=σ(s)(σ(c)c−μ(c))+μ(s)
其中, μ ( ) \mu() μ()和 σ ( ) \sigma() σ()都是channel-wise的,也就是对特征图每个通道求均值和标准差,从而shape=CxHxW的特征图会得到shape=Cx1x1的均值和标准差。