zoukankan      html  css  js  c++  java
  • Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization

    Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization

    2019-10-10 10:50:19

     

    Paperhttp://openaccess.thecvf.com/content_ICCV_2017/papers/Huang_Arbitrary_Style_Transfer_ICCV_2017_paper.pdf 

    Officical Torch Codehttps://github.com/xunhuang1995/AdaIN-style 

    Unofficial PyTorch Codehttps://github.com/naoto0804/pytorch-AdaIN  

    Unofficial PyTorch Codehttps://github.com/irasin/Pytorch_Adain_from_scratch 

     

    1. Background and Motivation:

    本文提出一种快速的可以适应任何一种 style 的图像转换技术。首先先来回归一下常见的几种 Normalization 技术:

     

    1). Batch Normalization

    给定输入的一个 batch x,BN 对每一个特征通道进行归一化操作:

     

    其中,gamma 和 beta 是从数据中学习的仿射参数,mu 和 delta 是均值和方差,是分别沿着 batch size 和 spatial dimension 方向对每一个特征通道进行的操作:

     

    BN 在训练的时候利用 mini-batch 统计来学习,在 inference 的阶段就用流行的统计来替换他们,这样就导致了 training 和 inference 的不一致。后续也有很多对该问题的改进。

     

    2). Instance Normalization

    后来出现的 IN layers 可以显著的改善 style transfer 的性能,即:

     

    与 BN layer 不同的是,此处的均值和方差是分别对 channel 和 each sample 沿着空间维度计算得到的:

      

    另外的一个与 BN 的不同之处是:training 和 inference 是一致的。

    3). Conditional Instance Normalization: 

    该方法对每一种 style 都学习一种参数,即:

    惊奇的是,该方法可以产生完全不同 style 的图像,但是用的是同一组网络参数,仅仅是 IN layer 的 affine parameters 不同。

    2. Interpreting Instance Normalization

    3. Adaptive Instance Normalization: 

    既然 IN 可以根据 affine parameters 将输入归一化为 single style,那么,有没有可能,我们给定多种自适应的 affine transformations 来生成任意给定类型的图像呢?基于该动机,作者对 IN 的技术进行了拓展,提出了 Adaptive Instance Normalization (AdaIN)。AdaIN 接收一张 content input X 和 一张 style input Y,并且简单地对 X 进行 channel wise mean and variance 使其可以匹配 Y。与 BN, IN, CIN 不同,AdaIN 没有可学习的 affine parameters。其根据输入的 style image,自适应的生成 affine parameters:

    本文将 normalized content input 进行 scale 处理,然后用 mu(y) 进行 shift。这些统计都是沿着 spatial locations 进行的。

    4. Experimental Results

      

  • 相关阅读:
    Oracle SQL语句收集
    SqlParameter In 查询
    SQL 性能优化
    Entity Framework
    【XLL API 函数】 xlfSetName
    【XLL API 函数】xlfUnregister (Form 2)
    【XLL API 函数】xlfUnregister (Form 1)
    【Excel 4.0 函数】REGISTER 的两种形式以及VBA等效语句
    【Excel 4.0 函数】REGISTER
    【Bochs 官方手册翻译】 第一章 Bochs介绍
  • 原文地址:https://www.cnblogs.com/wangxiaocvpr/p/11645592.html
Copyright © 2011-2022 走看看