본문 바로가기

비지도학습/GAN

AdaIN,2017

Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization, Cornell University,2017

 

Abstract

The earlier paper(Gatys et al.) recently introduced a neural algorithm that renders a content image in the style of another image, achieving so-called style transfer. However, their framework requires a slow iterative optimization process, which limits its practical application. Fast approximations with feed-forward neural networks have been proposed to speed up neural style transfer. Unfortunately, the speed improvement comes at a cost: the network is usually tied to a fixed set of styles and cannot adapt to arbitrary new styles. In this paper, we present a simple yet effective approach that for the first time enables arbitrary style transfer in real-time. At the heart of our method is a novel adaptive instance normalization (AdaIN) layer that aligns the mean and variance of the content features with those of the style features. Our method achieves speed comparable to the fastest existing approach, without the restriction to a pre-defined set of styles. In addition, our approach allows flexible user controls such as content-style trade-off, style interpolation, color & spatial controls, all using a single feed-forward neural network.

이전 논문 (Gatys et al.)은 최근 콘텐츠 이미지를 다른 이미지의 스타일로 렌더링하여 이른바 스타일 전달을 달성하는 신경 알고리즘을 도입했습니다.

그러나 프레임 워크에는 느린 반복 최적화 프로세스가 필요하므로 실제 적용이 제한됩니다.

신경 스타일 전송 속도를 높이기 위해 피드 포워드 신경망을 사용한 빠른 근사치가 제안되었습니다.

안타깝게도 속도 향상에는 대가가 따릅니다.

네트워크는 일반적으로 고정 된 스타일 집합에 연결되어 있으며 임의의 새로운 스타일에 적응할 수 없습니다.

이 문서에서는 처음으로 임의의 스타일을 실시간으로 전송할 수있는 간단하면서도 효과적인 접근 방식을 제시합니다.

우리 방법의 중심에는 콘텐츠 특징의 평균과 분산을 스타일 특징의 평균과 분산을 정렬하는 새로운 적응 형 인스턴스 정규화 (AdaIN) 레이어가 있습니다. 우리의 방법은 미리 정의된 스타일 세트에 대한 제한없이 기존의 가장 빠른 접근 방식에 필적하는 속도를 달성합니다.

또한, 우리의 접근 방식은 단일 피드-포워드 신경망을 사용하는 콘텐츠 스타일 트레이드 오프, 스타일 보간, 색상 및 공간 제어와 같은 유연한 사용자 제어를 허용합니다.

Gatys et al. = "Image Style Transfer Using Convolutional Neural Networks"

 

1.Introduction

The seminal work of Gatys' paper showed that deep neural networks (DNNs) encode not only the content but also the style information of an image. Moreover, the image style and content are somewhat separable: it is possible to change the style of an image while preserving its content. The style transfer method of [16] is flexible enough to combine content and style of arbitrary images. However, it relies on an optimization process that is prohibitively slow.

Gatys의 논문의 중요한 작업은 심층 신경망 (DNN)이 콘텐츠뿐만 아니라 이미지의 스타일 정보도 인코딩한다는 것을 보여주었습니다.

또한 이미지 스타일과 콘텐츠는 다소 분리 가능합니다. 콘텐츠를 유지하면서 이미지의 스타일을 변경할 수 있습니다.

[16]의 스타일 전송 방법은 임의의 이미지의 내용과 스타일을 결합 할 수있을만큼 유연합니다.

그러나 엄청나게 느린 최적화 프로세스에 의존합니다.

 

Significant effort has been devoted to accelerating neural style transfer. [24, 51, 31] attempted to train feed-forward neural networks that perform stylization with a single forward pass. A major limitation of most feed-forward methods is that each network is restricted to a single style. There are some recent works addressing this problem, but they are either still limited to a finite set of styles [11, 32, 55, 5], or much slower than the single-style transfer methods [6].

신경 스타일 전달을 가속화하기 위해 많은 노력을 기울였습니다.

[24, 51, 31]은 단일 순방향 패스로 스타일 화를 수행하는 피드-포워드 신경망을 훈련 시키려고 시도했습니다.

대부분의 피드 포워드 방법의 주요 제한 사항은 각 네트워크가 단일 스타일로 제한된다는 것입니다.

이 문제를 다루는 최근의 몇 가지 작업이 있지만 여전히 유한한 스타일 세트 [11, 32, 55, 5]로 제한되거나 단일 스타일 전송 방법 [6]보다 훨씬 느립니다.

 

In this work, we present the first neural style transfer algorithm that resolves this fundamental flexibility-speed dilemma. Our approach can transfer arbitrary new styles in real-time, combining the flexibility of the optimizationbased framework [16] and the speed similar to the fastest feed-forward approaches [24, 52]. Our method is inspired by the instance normalization (IN) [52, 11] layer, which is surprisingly effective in feed-forward style transfer. To explain the success of instance normalization, we propose a new interpretation that instance normalization performs style normalization by normalizing feature statistics, which have been found to carry the style information of an image [16, 30, 33]. Motivated by our interpretation, we introduce a simple extension to IN, namely adaptive instance normalization (AdaIN). Given a content input and a style input, AdaIN simply adjusts the mean and variance of the content input to match those of the style input. Through experiments, we find AdaIN effectively combines the content of the former and the style latter by transferring feature statistics. A decoder network is then learned to generate the final stylized image by inverting the AdaIN output back to the image space. Our method is nearly three orders of magnitude faster than [16], without sacrificing the flexibility of transferring inputs to arbitrary new styles. Furthermore, our approach provides abundant user controls at runtime, without any modification to the training process.

이 작업에서 우리는 이러한 근본적인 유연성-속도 딜레마(flexibility-speed dilemma)를 해결하는 최초의 신경 스타일 전달 알고리즘을 제시합니다.

우리의 접근 방식은 최적화 기반 프레임워크의 유연성 [16]과 가장 빠른 피드 포워드 접근 방식 [24, 52]과 유사한 속도를 결합하여 임의의 새로운 스타일을 실시간으로 전송할 수 있습니다.

우리의 방법은 인스턴스 정규화 (IN) [52, 11] 레이어에서 영감을 얻었으며 피드 포워드 스타일 전송에 놀랍도록 효과적입니다.

인스턴스 정규화의 성공 여부를 설명하기 위해 인스턴스 정규화가 이미지의 스타일 정보를 전달하는 것으로 밝혀진 특성 통계를 정규화하여 스타일 정규화를 수행한다는 새로운 해석을 제안한다 [16, 30, 33].

해석에 동기를 부여하여 IN에 대한 간단한 확장, 즉 AdaIN (Adaptive instance normalization)을 소개합니다.

콘텐츠 입력과 스타일 입력이 주어지면 AdaIN은 단순히 스타일 입력과 일치하도록 콘텐츠 입력의 평균과 분산을 조정합니다.

실험을 통해 AdaIN은 feature 통계를 전송하여 전자와 스타일 후자의 내용을 효과적으로 결합합니다.

그런 다음, 디코더 네트워크는 AdaIN 출력을 다시 이미지 공간으로 반전하여 최종 양식화된 이미지를 생성하도록 학습됩니다.

우리의 방법은 입력을 임의의 새로운 스타일로 전송하는 유연성을 희생하지 않고 [16]보다 거의 3 배 더 빠릅니다.

또한 우리의 접근 방식은 교육 프로세스를 수정하지 않고도 런타임에 풍부한 사용자 컨트롤을 제공합니다.

 

2. Related Work

Style transfer.

The problem of style transfer has its origin from non-photo-realistic rendering [28], and is closely related to texture synthesis and transfer [13, 12, 14]. Some early approaches include histogram matching on linear filter responses [19] and non-parametric sampling [12, 15]. These methods typically rely on low-level statistics and often fail to capture semantic structures. Gatys et al. [16] for the first time demonstrated impressive style transfer results by matching feature statistics in convolutional layers of a DNN. Recently, several improvements to [16] have been proposed. Li and Wand [30] introduced a framework based on markov random field (MRF) in the deep feature space to enforce local patterns. Gatys et al. [17] proposed ways to control the color preservation, the spatial location, and the scale of style transfer. Ruder's paper (Ruder et al. [45]) improved the quality of video style transfer by imposing temporal constraints.

스타일 전송의 문제는 비사실적 렌더링 [28]에서 비롯되며 텍스처 합성 및 전송 [13, 12, 14]과 밀접한 관련이 있습니다.

일부 초기 접근법에는 선형 필터 응답(linear filter responses)에 대한 히스토그램 일치[19] 및 non-parameter 샘플링 [12, 15]이 포함됩니다.

이러한 방법은 일반적으로 저수준 통계(low-level statistics)에 의존하며 종종 의미 구조(semantic structure)를 캡처하지 못합니다.

Gatys et al. [16] 처음으로 DNN의 컨볼루션 레이어에서 feature 통계를 일치시켜 인상적인 스타일 전송 결과를 시연했습니다.

최근에 [16]에 대한 몇 가지 개선 사항이 제안되었습니다.

Li and Wand [30]는 로컬 패턴을 적용하기 위해 딥 피처 공간에서 MRF (markov random field) 기반 프레임 워크를 도입했습니다.

Gatys et al. [17] 색상 보존, 공간적 위치 및 스타일 전달의 규모를 제어하는 ​​방법을 제안했습니다.

Ruder의 논문 (Ruder et al. [45])은 시간적 제약을 부과하여 비디오 스타일 전송의 품질을 향상 시켰습니다.

 

The framework of Gatys et al. [16] is based on a slow optimization process that iteratively updates the image to minimize a content loss and a style loss computed by a loss network. It can take minutes to converge even with modern GPUs. On-device processing in mobile applications is therefore too slow to be practical. A common workaround is to replace the optimization process with a feed-forward neural network that is trained to minimize the same objective [24, 51, 31]. These feed-forward style transfer approaches are about three orders of magnitude faster than the optimization-based alternative, opening the door to realtime applications. Wang et al. [53] enhanced the granularity of feed-forward style transfer with a multi-resolution architecture. Ulyanov et al. [52] proposed ways to improve the quality and diversity of the generated samples. However, the above feed-forward methods are limited in the sense that each network is tied to a fixed style. To address this problem, Dumoulin et al. [11] introduced a single network that is able to encode 32 styles and their interpolations. Concurrent to our work, Li et al. [32] proposed a feed-forward architecture that can synthesize up to 300 textures and transfer 16 styles. Still, the two methods above cannot adapt to arbitrary styles that are not observed during training.

Image style transfer using convolutional neural networks.[16]의 프레임 워크는 콘텐츠 손실과 손실 네트워크에 의해 계산된 스타일 손실을 최소화하기 위해 이미지를 반복적으로 업데이트하는 느린 최적화 프로세스를 기반으로합니다.

최신 GPU를 사용하더라도 수렴하는 데 몇 분이 걸릴 수 있습니다.

따라서 모바일 애플리케이션의 온-디바이스 처리는 너무 느려 실용적이지 못합니다.

일반적인 해결 방법은 최적화 프로세스를 동일한 목표를 최소화하도록 학습된 피드 포워드 신경망으로 대체하는 것입니다 [24, 51, 31].

이러한 피드 포워드 스타일 전송 접근 방식은 최적화 기반 대안보다 약 3배 더 빠르며 실시간 애플리케이션의 문을 엽니다. [53]

다중 해상도 아키텍처를 사용하여 피드 포워드 스타일 전송의 세분성을 강화했습니다.

생성된 샘플의 품질과 다양성을 개선하기위한 제안 된 방법. 그러나 위의 피드 포워드 방법은 각 네트워크가 고정된 스타일에 묶여 있다는 점에서 제한.

이 문제를 해결하기 위해 A learned representation for artistic style[11]은 32개의 스타일과 그 보간을 인코딩 할 수있는 단일 네트워크를 도입했습니다.

우리의 작업과 동시에 Diversified texture synthesis with feed-forward networks.[32]는 최대 300 개의 텍스처를 합성하고 16 개의 스타일을 전송할 수있는 피드 포워드 아키텍처를 제안했습니다.

그러나 위의 두 가지 방법은 훈련 중에 관찰되지 않는 임의의 스타일에 적응할 수 없습니다.

 

Very recently, Chen and Schmidt [6] introduced a feedforward method that can transfer arbitrary styles thanks to a style swap layer. Given feature activations of the content and style images, the style swap layer replaces the content features with the closest-matching style features in a patchby-patch manner. Nevertheless, their style swap layer creates a new computational bottleneck: more than 95% of the computation is spent on the style swap for 512 × 512 input images. Our approach also permits arbitrary style transfer, while being 1-2 orders of magnitude faster than [6].

아주 최근에 [6]은 스타일 스왑 레이어(style swap layer) 덕분에 임의의 스타일을 전송할 수있는 피드 포워드 방법을 도입했습니다.

콘텐츠 및 스타일 이미지의 기능 활성화가 주어지면 스타일 스왑 레이어는 패치별 방식으로 콘텐츠 기능을 가장 근접한 스타일 기능으로 대체합니다.

그럼에도 불구하고 스타일 스왑 레이어는 새로운 계산 병목 현상을 발생시킵니다.

계산의 95 % 이상이 512 × 512 입력 이미지의 스타일 스왑에 사용됩니다.

우리의 접근 방식은 또한 임의의 스타일 전송을 허용하지만 [6]보다 1-2 배 더 빠릅니다.

 

Another central problem in style transfer is which style loss function to use. The original framework of Gatys et al. [16] matches styles by matching the second-order statistics between feature activations, captured by the Gram matrix. Other effective loss functions have been proposed, such as MRF loss [30], adversarial loss [31], histogram loss [54], CORAL loss [41], MMD loss [33], and distance between channel-wise mean and variance [33]. Note that all the above loss functions aim to match some feature statistics between the style image and the synthesized image.

스타일 전송의 또 다른 핵심 문제는 사용할 스타일 손실 함수입니다.

 Image style transfer using convolutional neural networks.[16]의 원래 프레임 워크는 Gram 행렬에 의해 캡처 된 기능 활성화 간의 2 차 통계를 일치시켜 스타일을 일치시킵니다.

MRF 손실(Combining markov random fields and convolutional neural networks for image synthesis) [30], 적대적 손실(. Precomputed real-time texture synthesis with markovian generative adversarial networks) [31], 히스토그램 손실(Stable and controllable neural texture synthesis and style transfer using histogram losses.) [54], CORAL 손실(Synthetic to real adaptation with deep generative correlation alignment networks.) [41], MMD 손실(Demystifying neural style transfer.)[33], 채널별 평균과 분산 사이의 거리와 같은 다른 효과적인 손실 함수가 제안되었습니다. 33].

위의 모든 손실 함수는 스타일 이미지와 합성 이미지 간의 일부 기능 통계를 일치시키는 것을 목표로 합니다.

 

Deep generative image modeling.

There are several alternative frameworks for image generation, including variational auto-encoders [27], auto-regressive models [40], and generative adversarial networks (GANs) [18]. Remarkably, GANs have achieved the most impressive visual quality. Various improvements to the GAN framework have been proposed, such as conditional generation [43, 23], multistage processing [9, 20], and better training objectives [46, 1]. GANs have also been applied to style transfer [31] and cross-domain image generation [50, 3, 23, 38, 37, 25].

변형 자동 인코더 [27], 자동 회귀 모델 [40], 생성 적대 네트워크 (GAN) [18] 등 이미지 생성을 위한 몇 가지 대체 프레임 워크가 있습니다.

놀랍게도 GAN은 가장 인상적인 시각적 품질을 달성했습니다.

조건부 생성(Unsupervised representation learning with deep convolutional generative adversarial networks.) [43, 23], 다단계 처리 [9, 20], 더 나은 훈련 목표 [46, 1]와 같은 GAN 프레임 워크에 대한 다양한 개선이 제안되었습니다.

GAN은 스타일 전송 [31] 및 교차 도메인 이미지 생성 [50, 3, 23, 38, 37, 25]에도 적용되었습니다.

 

3. Background

3.1. Batch Normalization

The seminal work of Ioffe and Szegedy [22] introduced a batch normalization (BN) layer that significantly ease the training of feed-forward networks by normalizing feature statistics. BN layers are originally designed to accelerate training of discriminative networks, but have also been found effective in generative image modeling [42]. Given an input batch x ∈ R N×C×H×W , BN normalizes the mean and standard deviation for each individual feature channel: (1) where γ, β ∈ R C are affine parameters learned from data; µ(x), σ(x) ∈ R C are the mean and standard deviation, computed across batch size and spatial dimensions independently for each feature channel:

Batch normalization: Accelerating deep network training by reducing internal covariate shift.[22]의 중요한 작업은 기능 통계를 정규화하여 피드 포워드 네트워크의 훈련을 상당히 쉽게하는 배치 정규화 (BN) 계층을 도입했습니다.

BN 레이어는 원래 판별 네트워크의 훈련을 가속화하도록 설계되었지만 생성 이미지 모델링에서도 효과적인 것으로 밝혀졌습니다 [42].

입력 배치 x ∈ R NxCxHxW가 주어지면 BN은 각 개별 특성 채널에 대한 평균 및 표준 편차를 정규화합니다.

여기서 γ, β ∈ R C는 데이터에서 학습 한 유사 매개 변수입니다. µ (x), σ (x) ∈ R C는 각 기능 채널에 대해 독립적으로 배치 크기 및 공간 차원에서 계산 된 평균 및 표준 편차입니다.

BN uses mini-batch statistics during training and replace them with popular statistics during inference, introducing discrepancy between training and inference. Batch renormalization [21] was recently proposed to address this issue by gradually using popular statistics during training. As another interesting application of BN, Li et al. [34] found that BN can alleviate domain shifts by recomputing popular statistics in the target domain. Recently, several alternative normalization schemes have been proposed to extend BN’s effectiveness to recurrent architectures [35, 2, 47, 8, 29, 44].

BN은 훈련 중에 미니 배치 통계를 사용하고 추론 중에 인기 통계로 대체하여 훈련과 추론 사이에 불일치를 유발합니다.

이 문제를 해결하기 위해 훈련 중에 인기 통계를 점진적으로 사용하여 배치 재정규화(Batch renormalization) [21]가 최근 제안되었습니다.

Revisiting batch normalization for practical domain adaptation[34]의 또 다른 흥미로운 응용 프로그램은 BN이 대상 도메인에서 인기있는 통계를 다시 계산하여 도메인 이동을 완화 할 수 있음을 발견했습니다.

최근에 BN의 효율성을 반복 아키텍처로 확장하기 위해 몇 가지 대체 정규화 방식이 제안되었습니다 [35, 2, 47, 8, 29, 44].

 

3.2. Instance Normalization

In the original feed-forward stylization method [51], the style transfer network contains a BN layer after each convolutional layer. Surprisingly, Ulyanov et al. [52] found that significant improvement could be achieved simply by replacing BN layers with IN layers:

원래의 피드포워드 스타일화 방법 [51]에서 스타일 전송 네트워크는 각 컨볼 루션 레이어 다음에 BN 레이어를 포함합니다.

놀랍게도 [52]는 BN 레이어를 IN 레이어로 대체하는 것만으로도 상당한 개선을 달성 할 수 있음을 발견했습니다.

Different from BN layers, here µ(x) and σ(x) are computed across spatial dimensions independently for each channel and each sample:

BN 레이어와 달리 여기서 µ (x) 및 σ (x)는 각 채널 및 각 샘플에 대해 독립적으로 공간 차원에서 계산됩니다.

Another difference is that IN layers are applied at test time unchanged, whereas BN layers usually replace minibatch statistics with population statistics.

또 다른 차이점은 IN 레이어는 테스트 시간에 변경되지 않고 적용되는 반면 BN 레이어는 일반적으로 미니 배치 통계를 모집단 통계로 대체한다는 것입니다.

 

3.3. Conditional Instance Normalization

Instead of learning a single set of affine parameters γ and β, Dumoulin et al. [11] proposed a conditional instance normalization (CIN) layer that learns a different set of parameters γ s and β s for each style s:

단일 세트의 아핀 매개 변수 γ 및 β를 학습하는 대신 A learned representation for artistic style. [11]은 각 스타일에 대해 서로 다른 매개 변수 집합 γs 및 βs를 학습하는 조건부 인스턴스 정규화 (CIN) 계층을 제안했습니다.

During training, a style image together with its index s are randomly chosen from a fixed set of styles s ∈ {1, 2, ..., S} (S = 32 in their experiments). The content image is then processed by a style transfer network in which the corresponding γ s and β s are used in the CIN layers. Surprisingly, the network can generate images in completely different styles by using the same convolutional parameters but different affine parameters in IN layers.

학습 중에 인덱스와 함께 스타일 이미지가 고정 된 스타일 세트 ∈ {1, 2, ..., S}에서 무작위로 선택됩니다 (실험에서 S = 32).

콘텐츠 이미지는 CIN 레이어에서 해당 γ 및 β가 사용되는 스타일 전송 네트워크에 의해 처리됩니다.

놀랍게도 네트워크는 동일한 컨볼루션 매개 변수를 사용하지만 IN 레이어에서 다른 아핀 매개 변수를 사용하여 완전히 다른 스타일의 이미지를 생성 할 수 있습니다.

 

Compared with a network without normalization layers, a network with CIN layers requires 2F S additional parameters, where F is the total number of feature maps in the network [11]. Since the number of additional parameters scales linearly with the number of styles, it is challenging to extend their method to model a large number of styles (e.g., tens of thousands). Also, their approach cannot adapt to arbitrary new styles without re-training the network.

정규화 계층이없는 네트워크와 비교하여 CIN 계층이있는 네트워크에는 2F S 추가 매개 변수가 필요합니다.

여기서 F는 네트워크의 전체 feature map의 개수입니다 [11].

추가 매개 변수의 수가 스타일 수에 따라 선형 적으로 확장되기 때문에 많은 수의 스타일 (예 : 수만)을 모델링하기 위해 방법을 확장하는 것이 어렵습니다. 또한 그들의 접근 방식은 네트워크를 재교육하지 않고는 임의의 새로운 스타일에 적응할 수 없습니다.

 

4. Interpreting Instance Normalization

Despite the great success of (conditional) instance normalization, the reason why they work particularly well for style transfer remains elusive. Ulyanov et al. [52] attribute the success of IN to its invariance to the contrast of the content image. However, IN takes place in the feature space, therefore it should have more profound impacts than a simple contrast normalization in the pixel space. Perhaps even more surprising is the fact that the affine parameters in IN can completely change the style of the output image.

(조건부) 인스턴스 정규화의 큰 성공에도 불구하고 스타일 전송에 특히 잘 작동하는 이유는 아직 파악하기 어렵습니다.

Ulyanov et al. IN의 성공은 콘텐츠 이미지의 콘트라스트에 대한 불변성 때문입니다.

그러나 IN은 기능 공간에서 발생하므로 픽셀 공간에서 단순한 대비 정규화보다 더 큰 영향을 미칩니다.

더 놀라운 것은 IN의 아핀 매개 변수가 출력 이미지의 스타일을 완전히 변경할 수 있다는 사실입니다.

 

It has been known that the convolutional feature statistics of a DNN can capture the style of an image [16, 30, 33]. While Gatys et al. [16] use the second-order statistics as their optimization objective, Li et al. [33] recently showed that matching many other statistics, including channel-wise mean and variance, are also effective for style transfer. Motivated by these observations, we argue that instance normalization performs a form of style normalization by normalizing feature statistics, namely the mean and variance. Although DNN serves as a image descriptor in [16, 33], we believe that the feature statistics of a generator network can also control the style of the generated image.

DNN의 convolutional feature 통계는 이미지의 스타일을 포착 할 수있는 것으로 알려져 있습니다 [16, 30, 33].

Gatys et al. [16] 2 차 통계를 최적화 목표로 사용, Li et al. [33] 최근에는 채널 별 평균 및 분산을 포함한 다른 많은 통계를 일치시키는 것이 스타일 전달에도 효과적이라는 것을 보여주었습니다.

이러한 관찰에 동기를 부여하여 인스턴스 정규화는 기능 통계, 즉 평균과 분산을 정규화하여 스타일 정규화의 한 형태를 수행한다고 주장합니다.

DNN은 [16, 33]에서 이미지 설명자 역할을 하지만 생성기 네트워크의 특성 통계가 생성 된 이미지의 스타일을 제어 할 수도 있다고 생각합니다.

 

We run the code of improved texture networks [52] to perform single-style transfer, with IN or BN layers. As expected, the model with IN converges faster than the BN model (Fig. 1 (a)). To test the explanation in [52], we then normalize all the training images to the same contrast by performing histogram equalization on the luminance channel. As shown in Fig. 1 (b), IN remains effective, suggesting the explanation in [52] to be incomplete. To verify our hypothesis, we normalize all the training images to the same style (different from the target style) using a pretrained style transfer network provided by [24]. According to Fig. 1 (c), the improvement brought by IN become much smaller when images are already style normalized. The remaining gap can explained by the fact that the style normalization with [24] is not perfect. Also, models with BN trained on style normalized images can converge as fast as models with IN trained on the original images. Our results indicate that IN does perform a kind of style normalization.

개선된 텍스처 네트워크 [52] 코드를 실행하여 IN 또는 BN 레이어를 사용하여 단일 스타일 전송을 수행합니다.

예상대로 IN이있는 모델은 BN 모델보다 빠르게 수렴됩니다 (그림 1 (a)).

[52]의 설명을 테스트하기 위해 휘도 채널에서 히스토그램 등화를 수행하여 모든 훈련 이미지를 동일한 대비로 정규화합니다.

그림 1 (b)에서 보듯이 IN은 여전히 ​​유효하며 [52]의 설명이 불완전함을 시사한다.

가설을 검증하기 위해 [24]에서 제공하는 사전 훈련 된 스타일 전달 네트워크를 사용하여 모든 훈련 이미지를 동일한 스타일 (대상 스타일과 다름)로 정규화합니다.

그림 1 (c)에 따르면 이미지가 이미 스타일 정규화되어있을 때 IN에 의한 개선이 훨씬 더 작아집니다.

나머지 차이는 [24]의 스타일 정규화가 완벽하지 않다는 사실로 설명 할 수 있습니다.

또한 스타일 정규화 된 이미지에 대해 훈련 된 BN이있는 모델은 원본 이미지에 대해 훈련 된 IN이있는 모델만큼 빠르게 수렴 할 수 있습니다.

우리의 결과는 IN이 일종의 스타일 정규화를 수행한다는 것을 나타냅니다.

 

Since BN normalizes the feature statistics of a batch of samples instead of a single sample, it can be intuitively understood as normalizing a batch of samples to be centered around a single style. Each single sample, however, may still have different styles. This is undesirable when we want to transfer all images to the same style, as is the case in the original feed-forward style transfer algorithm [51]. Although the convolutional layers might learn to compensate the intra-batch style difference, it poses additional challenges for training. On the other hand, IN can normalize the style of each individual sample to the target style. Training is facilitated because the rest of the network can focus on content manipulation while discarding the original style information. The reason behind the success of CIN also becomes clear: different affine parameters can normalize the feature statistics to different values, thereby normalizing the output image to different styles.

BN은 단일 샘플 대신 샘플 배치의 기능 통계를 정규화하므로 단일 스타일을 중심으로 샘플 배치를 정규화하는 것으로 직관적으로 이해할 수 있습니다.

그러나 각 샘플은 여전히 ​​다른 스타일을 가질 수 있습니다.

이것은 원래의 피드 포워드 스타일 전송 알고리즘 [51]의 경우처럼 모든 이미지를 동일한 스타일로 전송하려는 경우 바람직하지 않습니다.

컨볼루션 계층이 내부 배치 스타일 차이를 보상하는 방법을 배울 수 있지만 훈련에 추가적인 문제가 발생합니다.

반면 IN은 각 개별 샘플의 스타일을 대상 스타일로 정규화 할 수 있습니다.

나머지 네트워크는 원래 스타일 정보를 버리고 콘텐츠 조작에 집중할 수 있기 때문에 교육이 용이합니다.

CIN이 성공한 이유도 분명합니다.

서로 다른 아핀 매개 변수가 기능 통계를 서로 다른 값으로 정규화하여 출력 이미지를 서로 다른 스타일로 정규화 할 수 있습니다.

 

5. Adaptive Instance Normalization

If IN normalizes the input to a single style specified by the affine parameters, is it possible to adapt it to arbitrarily given styles by using adaptive affine transformations? Here, we propose a simple extension to IN, which we call adaptive instance normalization (AdaIN). AdaIN receives a content input x and a style input y, and simply aligns the channelwise mean and variance of x to match those of y. Unlike BN, IN or CIN, AdaIN has no learnable affine parameters. Instead, it adaptively computes the affine parameters from the style input:(8) in which we simply scale the normalized content input with σ(y), and shift it with µ(y). Similar to IN, these statistics are computed across spatial locations.

IN이 affine 매개 변수에 의해 지정된 단일 스타일로 입력을 정규화하는 경우, 적응적 아핀 변환을 사용하여 임의로 지정된 스타일에 적응시킬 수 있을까요?

여기서는 적응형 인스턴스 정규화 (AdaIN)라고하는 IN에 대한 간단한 확장을 제안합니다.

AdaIN은 콘텐츠 입력 x와 스타일 입력 y를 수신하고 x의 채널 별 평균과 분산을 y의 값과 일치하도록 정렬합니다.

BN, IN 또는 CIN과 달리 AdaIN에는 학습 가능한 아핀 매개 변수가 없습니다.

대신 스타일 입력에서 affine 매개 변수를 적응적으로 계산합니다.

(8)에서 우리는 σ (y)로 정규화 된 콘텐츠 입력을 간단히 스케일링하고 µ (y)로 이동합니다.

IN과 유사하게 이러한 통계는 여러 공간 위치에서 계산됩니다.

 

Intuitively, let us consider a feature channel that detects brushstrokes of a certain style. A style image with this kind of strokes will produce a high average activation for this feature. The output produced by AdaIN will have the same high average activation for this feature, while preserving the spatial structure of the content image. The brushstroke feature can be inverted to the image space with a feed-forward decoder, similar to [10]. The variance of this feature channel can encoder more subtle style information, which is also transferred to the AdaIN output and the final output image.

직관적으로 특정 스타일의 붓질을 감지하는 특징 채널을 고려해 보겠습니다.

이러한 종류의 획이있는 스타일 이미지는 이 기능에 대해 높은 평균 활성화를 생성합니다.

AdaIN이 생성 한 출력은 콘텐츠 이미지의 공간 구조를 유지하면서이 기능에 대해 동일한 높은 평균 활성화를 갖습니다.

브러시 스트로크 기능은 [10]과 유사하게 피드 포워드 디코더를 사용하여 이미지 공간으로 반전 될 수 있습니다.

이 기능 채널의 분산은 더 미묘한 스타일 정보를 인코딩 할 수 있으며, 이는 AdaIN 출력 및 최종 출력 이미지로도 전송됩니다.

 

In short, AdaIN performs style transfer in the feature space by transferring feature statistics, specifically the channel-wise mean and variance. Our AdaIN layer plays a similar role as the style swap layer proposed in [6]. While the style swap operation is very time-consuming and memory-consuming, our AdaIN layer is as simple as an IN layer, adding almost no computational cost.

간단히 말해 AdaIN은 feature 통계, 특히 채널별 평균 및 분산을 전송하여 feature space에서 스타일 전송을 수행합니다.

AdaIN 레이어는 [6]에서 제안한 스타일 스왑 레이어와 유사한 역할을합니다.

스타일 스왑 작업은 시간과 메모리를 많이 소모하지만, AdaIN 레이어는 IN 레이어만큼 간단하여 계산 비용이 거의 추가되지 않습니다.

 

6. Experimental Setup

Fig. 2 shows an overview of our style transfer network based on the proposed AdaIN layer. Code and pretrained models (in Torch 7 [7]) are available at: https: //github.com/xunhuang1995/AdaIN-style

그림 2는 제안 된 AdaIN 계층을 기반으로 한 스타일 전송 네트워크의 개요를 보여줍니다.

코드 및 사전 훈련 된 모델 (Torch 7 [7])은 https : //github.com/xunhuang1995/AdaIN-style에서 사용할 수 있습니다.

 

6.1. Architecture

Our style transfer network T takes a content image c and an arbitrary style image s as inputs, and synthesizes an output image that recombines the content of the former and the style latter. We adopt a simple encoder-decoder architecture, in which the encoder f is fixed to the first few layers (up to relu4 1) of a pre-trained VGG-19 [48]. After encoding the content and style images in feature space, we feed both feature maps to an AdaIN layer that aligns the mean and variance of the content feature maps to those of the style feature maps, producing the target feature maps t:

스타일 전송 네트워크 T는 콘텐츠 이미지 c와 임의의 스타일 이미지 s를 입력으로 취하고 전자와 스타일 후자의 콘텐츠를 재결합하는 출력 이미지를 합성합니다.

우리는 인코더 f가 사전 훈련된 VGG-19의 처음 몇 레이어 (최대 relu4 1)에 고정되는 간단한 인코더-디코더 아키텍처를 채택합니다 [48].

피처 공간에서 콘텐츠와 스타일 이미지를 인코딩 한 후 두 피처 맵을 AdaIN 레이어에 공급하여 콘텐츠 피처 맵의 평균과 분산을 스타일 피처 맵의 평균과 분산에 맞춰 대상 피처 맵 t를 생성합니다.

A randomly initialized decoder g is trained to map t back to the image space, generating the stylized image T(c, s):

무작위로 초기화 된 디코더 g는 t를 이미지 공간에 다시 매핑하도록 훈련되어 양식화 된 이미지 T (c, s)를 생성합니다.

The decoder mostly mirrors the encoder, with all pooling layers replaced by nearest up-sampling to reduce checkerboard effects. We use reflection padding in both f and g to avoid border artifacts. Another important architectural choice is whether the decoder should use instance, batch, or no normalization layers. As discussed in Sec. 4, IN normalizes each sample to a single style while BN normalizes a batch of samples to be centered around a single style. Both are undesirable when we want the decoder to generate images in vastly different styles. Thus, we do not use normalization layers in the decoder. In Sec. 7.1 we will show that IN/BN layers in the decoder indeed hurt performance.

디코더는 대부분 인코더를 미러링하며 모든 풀링 레이어는 바둑판 효과를 줄이기 위해 가장 가까운 업샘플링으로 대체됩니다.

테두리 아티팩트를 피하기 위해 f와 g 모두에 반사 패딩(reflection padding)을 사용합니다.

또 다른 중요한 아키텍처 선택은 디코더가 인스턴스, 배치 또는 정규화 레이어를 사용하지 않는지 여부입니다.

Sec. 4에서 말한대로 IN은 각 샘플을 단일 스타일로 정규화하는 반면, BN은 샘플 배치를 단일 스타일을 중심으로 정규화합니다.

디코더가 매우 다른 스타일의 이미지를 생성하도록하려면 둘 다 바람직하지 않습니다.

따라서 디코더에서 정규화 레이어를 사용하지 않습니다.

7.1섹션에서 우리는 디코더의 IN / BN 레이어가 실제로 성능을 저하시키는 것을 보여줄 것입니다.

 

6.2. Training

We train our network using MS-COCO [36] as content images and a dataset of paintings mostly collected from WikiArt [39] as style images, following the setting of [6]. Each dataset contains roughly 80, 000 training examples. We use the adam optimizer [26] and a batch size of 8 content-style image pairs. During training, we first resize the smallest dimension of both images to 512 while preserving the aspect ratio, then randomly crop regions of size 256 × 256. Since our network is fully convolutional, it can be applied to images of any size during testing. Similar to [51, 11, 52], we use the pre-trained VGG19 [48] to compute the loss function to train the decoder:

우리는 [6]의 설정에 따라 콘텐츠 이미지로 MS-COCO [36]를 사용하고 WikiArt [39]에서 주로 수집 한 그림 데이터 세트를 스타일 이미지로 사용하여 네트워크를 훈련시킵니다.

각 데이터 세트에는 대략 8만 개의 학습 예제가 포함되어 있습니다.

아담 옵티 마이저 [26]와 8 개의 콘텐츠 스타일 이미지 쌍의 배치 크기를 사용합니다.

훈련하는 동안 먼저 가로 세로 비율을 유지하면서 두 이미지의 가장 작은 크기를 512로 조정 한 다음 크기가 256 × 256 인 영역을 무작위로 자릅니다.

네트워크는 완전 컨볼 루션이므로 테스트 중에 모든 크기의 이미지에 적용 할 수 있습니다.

[51, 11, 52]와 유사하게 사전 훈련 된 VGG19 [48]을 사용하여 디코더를 훈련하기위한 손실 함수를 계산합니다.

(11) which is a weighted combination of the content loss Lc and the style loss Ls with the style loss weight λ. The content loss is the Euclidean distance between the target features and the features of the output image. We use the AdaIN output t as the content target, instead of the commonly used feature responses of the content image. We find this leads to slightly faster convergence and also aligns with our goal of inverting the AdaIN output t.

(11)은 콘텐츠 손실 Lc와 스타일 손실 Ls와 스타일 손실 가중치 λ의 가중치 조합입니다.

콘텐츠 손실은 대상 특징과 출력 이미지의 특징 사이의 유클리드 거리입니다.

콘텐츠 이미지의 일반적으로 사용되는 feature response 대신 AdaIN 출력 t를 콘텐츠 대상으로 사용합니다.

우리는 이것이 약간 더 빠른 수렴으로 이어지고 AdaIN 출력 t를 반전하려는 목표와도 일치함을 발견했습니다.

Since our AdaIN layer only transfers the mean and standard deviation of the style features, our style loss only matches these statistics. Although we find the commonly used Gram matrix loss can produce similar results, we match the IN statistics because it is conceptually cleaner. This style loss has also been explored by Li et al. [33].

AdaIN 레이어는 스타일 기능의 평균 및 표준 편차 만 전송하므로 스타일 손실은 이러한 통계와 만 일치합니다. 일반적으로 사용되는 그람 행렬 손실이 유사한 결과를 생성 할 수 있지만 개념적으로 더 명확하기 때문에 IN 통계와 일치합니다. 이 스타일 손실도 [33]에 의해 조사되었습니다.

(13) where each φi denotes a layer in VGG-19 used to compute the style loss. In our experiments we use relu1 1, relu2 1, relu3 1, relu4 1 layers with equal weights.

(13)식에서 각 φi는 스타일 손실을 계산하는 데 사용되는 VGG-19의 레이어를 나타냅니다.

실험에서 우리는 동일한 가중치를 가진 relu1 1, relu2 1, relu3 1, relu4 1 레이어를 사용합니다.

 

7. Results

7.1. Comparison with other methods

In this subsection, we compare our approach with three types of style transfer methods: 1) the flexible but slow optimization-based method [16], 2) the fast feed-forward method restricted to a single style [52], and 3) the flexible patch-based method of medium speed [6]. If not mentioned otherwise, the results of compared methods are obtained by running their code with the default configurations. 1 For [6], we use a pre-trained inverse network provided by the authors. All the test images are of size 512 × 512.

이 하위 섹션에서는 우리의 접근 방식을 세 가지 유형의 스타일 전송 방법과 비교합니다.

1) 유연하지만 느린 최적화 기반 방법 [16](Image style transfer using convolutional neural networks.),

2) 단일 스타일로 제한된 빠른 피드 포워드 방법 [52](Improved texture networks: Maximizing quality and diversity in feed-forward stylization and texture synthesis.),

3) 중간 속도의 유연한 패치 기반 방법 [6](Fast patch-based style transfer of arbitrary style.).

달리 언급되지 않은 경우 비교 방법의 결과는 기본 구성으로 코드를 실행하여 얻습니다.

[6]의 경우 저자가 제공한 사전학습된 역 네트워크(reverse network)를 사용합니다.

모든 테스트 이미지의 크기는 512 × 512입니다.

 

Qualitative Examples.

In Fig. 4 we show example style transfer results generated by compared methods. Note that all the test style images are never observed during the training of our model, while the results of [52] are obtained by fitting one network to each test style. Even so, the quality of our stylized images is quite competitive with [52] and [16] for many images (e.g., row 1, 2, 3). In some other cases (e.g., row 5) our method is slightly behind the quality of [52] and [16]. This is not unexpected, as we believe there is a three-way trade-off between speed, flexibility, and quality. Compared with [6], our method appears to transfer the style more faithfully for most compared images. The last example clearly illustrates a major limitation of [6], which attempts to match each content patch with the closest-matching style patch. However, if most content patches are matched to a few style patches that are not representative of the target style, the style transfer would fail. We thus argue that matching global feature statistics is a more general solution, although in some cases (e.g., row 3) the method of [6] can also produce appealing results.

그림 4에서는 비교 방법에 의해 생성 된 예제 스타일 전송 결과를 보여줍니다.

모델 학습 중에는 모든 테스트 스타일 이미지가 관찰되지 않는 반면 [52]의 결과는 각 테스트 스타일에 하나의 네트워크를 피팅하여 얻은 것입니다.

그럼에도 불구하고 양식화 된 이미지의 품질은 많은 이미지 (예 : 1, 2, 3 행)에서 [52] 및 [16]과 상당히 경쟁적입니다.

다른 경우 (예 : 5 행)에서는 방법이 [52] 및 [16]의 품질보다 약간 뒤처집니다.

속도, 유연성 및 품질간에 3 가지 절충안이 있다고 믿기 때문에 이것은 예상치 못한 일이 아닙니다.

[6]에 비해 우리의 방법은 비교되는 대부분의 이미지에서 스타일을보다 충실하게 전달하는 것으로 보입니다.

마지막 예제는 [6]의 주요 제한 사항을 명확하게 보여 주며, 각 콘텐츠 패치를 가장 근접한 스타일 패치와 일치 시키려고 시도합니다.

그러나 대부분의 콘텐츠 패치가 대상 스타일을 대표하지 않는 몇 가지 스타일 패치와 일치하는 경우 스타일 전송이 실패합니다.

따라서 일부 경우 (예 : 행 3)의 경우 [6]의 방법이 매력적인 결과를 생성 할 수도 있지만 전역 특성 통계를 일치시키는 것이보다 일반적인 솔루션이라고 주장합니다. 

 

Quantitative evaluations.

Does our algorithm trade off some quality for higher speed and flexibility, and if so by how much? To answer this question quantitatively, we compare our approach with the optimization-based method [16] and the fast single-style transfer method [52] in terms of the content and style loss. Because our method uses a style loss based on IN statistics, we also modify the loss function in [16] and [52] accordingly for a fair comparison (their results in Fig. 4 are still obtained with the default Gram matrix loss). The content loss shown here is the same as in [52, 16]. The numbers reported are averaged over 10 style images and 50 content images randomly chosen from the test set of the WikiArt dataset [39] and MS-COCO [36].

우리의 알고리즘은 더 빠른 속도와 유연성을 위해 어느 정도의 품질을 상쇄합니까? 그렇다면 얼마나됩니까?

이 질문에 정량적으로 답하기 위해 우리는 최적화 기반 방법 [16]과 빠른 단일 스타일 전송 방법 [52]과 내용 및 스타일 손실 측면에서 접근 방식을 비교합니다.

우리의 방법은 IN 통계를 기반으로 한 스타일 손실을 사용하기 때문에 공정한 비교를 위해 [16]과 [52]의 손실 함수도 수정합니다 (그림 4의 결과는 여전히 기본 그람 행렬 손실로 얻음).

여기에 표시된 내용 손실은 [52, 16]과 동일합니다.

보고된 숫자는 WikiArt 데이터 세트 [39] 및 MS-COCO [36]의 테스트 세트에서 무작위로 선택된 10 개의 스타일 이미지와 50 개의 콘텐츠 이미지에 대한 평균입니다.

As shown in Fig. 3, the average content and style loss of our synthesized images are slightly higher but comparable to the single-style transfer method of Ulyanov et al. [52]. In particular, both our method and [52] obtain a style loss similar to that of [16] between 50 and 100 iterations of optimiza tion. This demonstrates the strong generalization ability of our approach, considering that our network has never seen the test styles during training while each network of [52] is specifically trained on a test style. Also, note that our style loss is much smaller than that of the original content image.

그림 3에서 볼 수 있듯이 합성 된 이미지의 평균 콘텐츠 및 스타일 손실은 약간 높지만 Improved texture networks: Maximizing quality and diversity in feed-forward stylization and texture synthesis.[52] 등의 단일 스타일 전송 방법과 비슷합니다.

특히, 우리의 방법과 [52] 둘 다 최적화의 50-100 반복 사이에서 [16]과 유사한 스타일 손실을 얻습니다.

이것은 [52]의 각 네트워크가 테스트 스타일에 대해 특별히 훈련되는 동안 우리 네트워크가 훈련 중에 테스트 스타일을 본 적이 없다는 점을 고려할 때 접근 방식의 강력한 일반화 능력을 보여줍니다.

또한 스타일 손실은 원본 콘텐츠 이미지보다 훨씬 작습니다.

 

Speed analysis.

Most of our computation is spent on content encoding, style encoding, and decoding, each roughly taking one third of the time. In some application scenarios such as video processing, the style image needs to be encoded only once and AdaIN can use the stored style statistics to process all subsequent images. In some other cases (e.g., transferring the same content to different styles), the computation spent on content encoding can be shared.

대부분의 계산은 콘텐츠 인코딩, 스타일 인코딩 및 디코딩에 소비되며 각각의 시간은 대략 1/3입니다. 비디오 처리와 같은 일부 애플리케이션 시나리오에서 스타일 이미지는 한 번만 인코딩되어야하며 AdaIN은 저장된 스타일 통계를 사용하여 모든 후속 이미지를 처리 ​​할 수 ​​있습니다. 다른 경우 (예 : 동일한 콘텐츠를 다른 스타일로 전송)에서는 콘텐츠 인코딩에 소요되는 계산을 공유 할 수 있습니다.

In Tab. 1 we compare the speed of our method with previous ones [16, 52, 11, 6]. Excluding the time for style encoding, our algorithm runs at 56 and 15 FPS for 256 × 256 and 512 × 512 images respectively, making it possible to process arbitrary user-uploaded styles in real-time. Among algorithms applicable to arbitrary styles, our method is nearly 3 orders of magnitude faster than [16] and 1-2 orders of magnitude faster than [6]. The speed improvement over [6] is particularly significant for images of higher resolution, since the style swap layer in [6] does not scale well to high resolution style images. Moreover, our approach achieves comparable speed to feed-forward methods limited to a few styles [52, 11]. The slightly longer processing time of our method is mainly due to our larger VGG-based network, instead of methodological limitations. With a more efficient architecture, our speed can be further improved

표1에서 우리는 방법의 속도를 이전 방법과 비교합니다 [16, 52, 11, 6].

스타일 인코딩 시간을 제외하고 알고리즘은 각각 256 × 256 및 512 × 512 이미지에 대해 56 및 15 FPS로 실행되므로 사용자가 업로드 한 임의의 스타일을 실시간으로 처리 할 수 ​​있습니다.

임의의 스타일에 적용 할 수있는 알고리즘 중에서 우리의 방법은 [16]보다 약 3 배 빠르며 [6]보다 1-2 배 빠릅니다.

[6]의 스타일 스왑 레이어가 고해상도 스타일 이미지에 잘 맞지 않기 때문에 [6]보다 속도 향상은 고해상도 이미지에서 특히 중요합니다.

더욱이, 우리의 접근 방식은 몇 가지 스타일로 제한되는 피드 포워드 방법과 비슷한 속도를 달성합니다 [52, 11].

우리 방법의 처리 시간이 약간 더 긴 것은 주로 방법 론적 제한 대신 더 큰 VGG 기반 네트워크 때문입니다. 보다 효율적인 아키텍처를 통해 속도를 더욱 향상시킬 수 있습니다.

 

7.2. Additional experiments.

In this subsection, we conduct experiments to justify our important architectural choices. We denote our approach described in Sec. 6 as Enc-AdaIN-Dec. We experiment with a model named Enc-Concat-Dec that replaces AdaIN with concatenation, which is a natural baseline strategy to combine information from the content and style images. In addition, we run models with BN/IN layers in the decoder, denoted as Enc-AdaIN-BNDec and Enc-AdaIN-INDec respectively. Other training settings are kept the same.

이 하위 섹션에서는 중요한 아키텍처 선택을 정당화하기 위해 실험을 수행합니다.

우리는 Sec. 6, Enc-AdaIN-Dec. AdaIN을 연결로 대체하는 Enc-Concat-Dec이라는 모델로 실험합니다.

이는 콘텐츠와 스타일 이미지의 정보를 결합하는 자연스러운 기준 전략입니다.

또한 디코더에서 각각 Enc-AdaIN-BNDec 및 Enc-AdaIN-INDec으로 표시된 BN / IN 레이어가있는 모델을 실행합니다.

다른 훈련 설정은 동일하게 유지됩니다.

In Fig. 5 and 6, we show examples and training curves of the compared methods. In the image generated by the EncConcat-Dec baseline (Fig. 5 (d)), the object contours of the style image can be clearly observed, suggesting that the network fails to disentangle the style information from the content of the style image.

그림 5와 6에서는 비교 방법의 예제와 학습 곡선을 보여줍니다.

EncConcat-Dec 기준선 (그림 5 (d))에 의해 생성 된 이미지에서 스타일 이미지의 객체 윤곽이 명확하게 관찰 될 수 있으며,

이는 네트워크가 스타일 이미지의 내용에서 스타일 정보를 분리하지 못함을 시사합니다.

This is also consistent with Fig. 6, where Enc-Concat-Dec can reach low style loss but fail to decrease the content loss. Models with BN/IN layers also obtain qualitatively worse results and consistently higher losses. The results with IN layers are especially poor. This once again verifies our claim that IN layers tend to normalize the output to a single style and thus should be avoided when we want to generate images in different styles.

이것은 Enc-Concat-Dec이 낮은 스타일 손실에 도달 할 수 있지만 콘텐츠 손실을 줄이지 못하는 그림 6 과도 일치합니다.

BN / IN 레이어가있는 모델은 질적으로 더 나쁜 결과를 얻고 지속적으로 더 높은 손실을 얻습니다.

IN 레이어의 결과는 특히 좋지 않습니다.

이것은 IN 레이어가 출력을 단일 스타일로 정규화하는 경향이 있으므로 다른 스타일로 이미지를 생성하려는 경우 피해야한다는 우리의 주장을 다시 한 번 확인합니다.

 

7.3. Runtime controls

To further highlight the flexibility of our method, we show that our style transfer network allows users to control the degree of stylization, interpolate between different styles, transfer styles while preserving colors, and use different styles in different spatial regions. Note that all these controls are only applied at runtime using the same network, without any modification to the training procedure.

방법의 유연성을 더욱 강조하기 위해 스타일 전송 네트워크를 통해 사용자가 스타일 화 정도를 제어하고, 서로 다른 스타일간에 보간하고, 색상을 유지하면서 스타일을 전송하고, 서로 다른 공간 영역에서 서로 다른 스타일을 사용할 수 있음을 보여줍니다.

이러한 모든 컨트롤은 훈련 절차를 수정하지 않고 동일한 네트워크를 사용하는 런타임에만 적용됩니다.

 

Content-style trade-off.

The degree of style transfer can be controlled during training by adjusting the style weight λ in Eqa. 11. In addition, our method allows content-style trade-off at test time by interpolating between feature maps that are fed to the decoder. Note that this is equivalent to interpolating between the affine parameters of AdaIN.

스타일 전달 정도는 식 11에서 스타일 가중치 λ를 조정하여 훈련 중에 제어 할 수 있습니다.

또한, 우리의 방법은 디코더에 공급되는 feature map들 사이에서 이를 interpolate하여 테스트 시간에 컨텐츠 스타일의 절충을 허용합니다.

이것은 AdaIN의 아핀 매개 변수 사이를 보간하는 것과 같습니다.

T(c, s, α) = g((1 − α)f(c) + αAdaIN(f(c), f(s))) (14)

 

The network tries to faithfully reconstruct the content image when α = 0, and to synthesize the most stylized image when α = 1. As shown in Fig. 7, a smooth transition between content-similarity and style-similarity can be observed by changing α from 0 to 1.

네트워크는 α = 0 일 때 콘텐츠 이미지를 충실하게 재구성하고 α = 1 일 때 가장 스타일화 된 이미지를 합성하려고 시도합니다.

그림 7과 같이 α를  0에서 1까지 변경하여 콘텐츠 유사성과 스타일 유사성 간의 부드러운 전환을 관찰 할 수 있습니다.

 

 

Style interpolation.

To interpolate between a set of K style images s1, s2, ..., sK with corresponding weights w1, w2, ..., wK such that PK k=1 wk = 1, we similarly interpolate between feature maps (results shown in Fig. 8):

PK k = 1 wk = 1이되도록 해당 가중치 w1, w2, ..., wK를 사용하여 K 스타일 이미지 세트 s1, s2, ..., sK 사이를 보간하기 위해 유사하게 특성 맵간에 보간합니다 (결과는 그림 8) :

T(c, s1,2,...K, w1,2,...K) = g( X K k=1 wkAdaIN(f(c), f(sk))) (15)

 

Spatial and color control.

Gatys et al. [17] recently introduced user controls over color information and spatial locations of style transfer, which can be easily incorporated into our framework. To preserve the color of the content image, we first match the color distribution of the style image to that of the content image (similar to [17]), then perform a normal style transfer using the color-aligned style image as the style input. Examples results are shown in Fig. 9.

Controlling perceptual factors in neural style transfer[17]에서 최근에 우리의 프레임 워크에 쉽게 통합 될 수있는 스타일 전송의 색상 정보 및 공간 위치에 대한 사용자 컨트롤을 도입했습니다.

콘텐츠 이미지의 색상을 유지하기 위해 먼저 스타일 이미지의 색상 분포를 콘텐츠 이미지의 색상 분포와 일치시킨 다음 ([17]과 유사) 스타일 입력으로 색상 정렬 된 스타일 이미지를 사용하여 일반 스타일 전송을 수행합니다.

결과의 예는 그림 9에 나와 있습니다.

In Fig. 10 we demonstrate that our method can transfer different regions of the content image to different styles. This is achieved by performing AdaIN separately to different regions in the content feature maps using statistics from different style inputs, similar to [4, 17] but in a completely feed-forward manner. While our decoder is only trained on inputs with homogeneous styles, it generalizes naturally to inputs in which different regions have different styles.

그림 10에서 우리는 우리의 방법이 콘텐츠 이미지의 다른 영역을 다른 스타일로 전송할 수 있음을 보여줍니다.

이는 [4, 17]과 유사하지만 완전히 피드 포워드 방식으로 서로 다른 스타일 입력의 통계를 사용하여 콘텐츠 기능 맵의 서로 다른 지역에 대해 개별적으로 AdaIN을 수행함으로써 달성됩니다.

디코더는 동종 스타일의 입력에 대해서만 훈련되지만, 다른 영역에 다른 스타일이있는 입력으로 자연스럽게 일반화됩니다.

 

8. Discussion and Conclusion

In this paper, we present a simple adaptive instance normalization (AdaIN) layer that for the first time enables arbitrary style transfer in real-time. Beyond the fascinating applications, we believe this work also sheds light on our understanding of deep image representations in general.

이 논문에서는 처음으로 임의의 스타일을 실시간으로 전송할 수있는 간단한 적응 형 인스턴스 정규화 (AdaIN) 계층을 제시합니다.

매혹적인 응용 프로그램 외에도이 작업은 일반적으로 깊은 이미지 표현에 대한 우리의 이해를 밝혀 준다고 믿습니다.

 

It is interesting to consider the conceptual differences between our approach and previous neural style transfer methods based on feature statistics. Gatys et al. [16] employ an optimization process to manipulate pixel values to match feature statistics. The optimization process is replaced by feed-forward neural networks in [24, 51, 52]. Still, the net work is trained to modify pixel values to indirectly match feature statistics. We adopt a very different approach that directly aligns statistics in the feature space in one shot, then inverts the features back to the pixel space.

특성 통계를 기반으로 한 이전 신경 스타일 전송 방법과 우리의 접근 방식 간의 개념적 차이점을 고려하는 것은 흥미 롭습니다.

Gatys et al. [16] 특성 통계와 일치하도록 픽셀 값을 조작하기 위해 최적화 프로세스를 사용합니다.

최적화 프로세스는 [24, 51, 52]에서 피드 포워드 신경망으로 대체되었습니다.

그럼에도 불구하고 네트워크는 피처 통계와 간접적으로 일치하도록 픽셀 값을 수정하도록 훈련되었습니다.

우리는 한 번에 기능 공간의 통계를 직접 정렬한 다음 기능을 다시 픽셀 공간으로 반전시키는 매우 다른 접근 방식을 채택합니다.

 

Given the simplicity of our approach, we believe there is still substantial room for improvement. In future works we plan to explore more advanced network architectures such as the residual architecture [24] or an architecture with additional skip connections from the encoder [23]. We also plan to investigate more complicated training schemes like the incremental training [32]. Moreover, our AdaIN layer only aligns the most basic feature statistics (mean and variance). It is possible that replacing AdaIN with correlation alignment [49] or histogram matching [54] could further improve quality by transferring higher-order statistics. Another interesting direction is to apply AdaIN to texture synthesis.

접근 방식의 단순성을 고려할 때 여전히 개선의 여지가 상당하다고 생각합니다.

향후 작업에서는 잔여 아키텍처 [24] 또는 인코더에서 추가 스킵 연결이있는 아키텍처 [23]와 같은 고급 네트워크 아키텍처를 탐색 할 계획입니다.

또한 점진적 훈련 [32]과 같은보다 복잡한 훈련 계획을 조사 할 계획입니다.

또한 AdaIN 레이어는 가장 기본적인 기능 통계 (평균 및 분산) 만 정렬합니다.

AdaIN을 상관 정렬 [49] 또는 히스토그램 일치 [54]로 대체하면 고차 통계를 전송하여 품질을 더욱 향상시킬 수 있습니다.

또 다른 흥미로운 방향은 AdaIN을 텍스처 합성에 적용하는 것입니다.

<<References>>

[1] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. 2

[2] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 2

[3] K. Bousmalis, N. Silberman, D. Dohan, D. Erhan, and D. Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. arXiv preprint arXiv:1612.05424, 2016. 2

[4] A. J. Champandard. Semantic style transfer and turning two-bit doodles into fine artworks. arXiv preprint arXiv:1603.01768, 2016. 8 [5] D. Chen, L. Yuan, J. Liao, N. Yu, and G. Hua. Stylebank: An explicit representation for neural image style transfer. In CVPR, 2017. 1 [6] T. Q. Chen and M. Schmidt. Fast patch-based style transfer of arbitrary style. arXiv preprint arXiv:1612.04337, 2016. 1, 2, 4, 5, 6, 7 [7] R. Collobert, K. Kavukcuoglu, and C. Farabet. Torch7: A matlab-like environment for machine learning. In NIPS Workshop, 2011. 4 [8] T. Cooijmans, N. Ballas, C. Laurent, C¸ . Gulc¸ehre, and ¨ A. Courville. Recurrent batch normalization. In ICLR, 2017. 2

[9] E. L. Denton, S. Chintala, R. Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, 2015. 2

[10] A. Dosovitskiy and T. Brox. Inverting visual representations with convolutional networks. In CVPR, 2016. 4

[11] V. Dumoulin, J. Shlens, and M. Kudlur. A learned representation for artistic style. In ICLR, 2017. 1, 2, 3, 5, 6, 7

[12] A. A. Efros and W. T. Freeman. Image quilting for texture synthesis and transfer. In SIGGRAPH, 2001. 1

[13] A. A. Efros and T. K. Leung. Texture synthesis by nonparametric sampling. In ICCV, 1999. 1

[14] M. Elad and P. Milanfar. Style-transfer via texture-synthesis. arXiv preprint arXiv:1609.03057, 2016. 1

[15] O. Frigo, N. Sabater, J. Delon, and P. Hellier. Split and match: example-based adaptive patch sampling for unsupervised style transfer. In CVPR, 2016. 1

[16] L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer using convolutional neural networks. In CVPR, 2016. 1, 2, 3, 5, 6, 7, 8 [17] L. A. Gatys, A. S. Ecker, M. Bethge, A. Hertzmann, and E. Shechtman. Controlling perceptual factors in neural style transfer. In CVPR, 2017. 1, 7, 8

[18] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014. 2

[19] D. J. Heeger and J. R. Bergen. Pyramid-based texture analysis/synthesis. In SIGGRAPH, 1995. 1

[20] X. Huang, Y. Li, O. Poursaeed, J. Hopcroft, and S. Belongie. Stacked generative adversarial networks. In CVPR, 2017. 2

[21] S. Ioffe. Batch renormalization: Towards reducing minibatch dependence in batch-normalized models. arXiv preprint arXiv:1702.03275, 2017. 2

[22] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In JMLR, 2015. 2

[23] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017. 2, 8 [24] J. Johnson, A. Alahi, and L. Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In ECCV, 2016. 1, 2, 3, 8

[25] T. Kim, M. Cha, H. Kim, J. Lee, and J. Kim. Learning to discover cross-domain relations with generative adversarial networks. arXiv preprint arXiv:1703.05192, 2017. 2

[26] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 5

[27] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In ICLR, 2014. 2

[28] J. E. Kyprianidis, J. Collomosse, T. Wang, and T. Isenberg. State of the” art: A taxonomy of artistic stylization techniques for images and video. TVCG, 2013. 1

[29] C. Laurent, G. Pereyra, P. Brakel, Y. Zhang, and Y. Bengio. Batch normalized recurrent neural networks. In ICASSP, 2016. 2

[30] C. Li and M. Wand. Combining markov random fields and convolutional neural networks for image synthesis. In CVPR, 2016. 1, 2, 3

[31] C. Li and M. Wand. Precomputed real-time texture synthesis with markovian generative adversarial networks. In ECCV, 2016. 1, 2 [32] Y. Li, C. Fang, J. Yang, Z. Wang, X. Lu, and M.-H. Yang. Diversified texture synthesis with feed-forward networks. In CVPR, 2017. 1, 2, 8

[33] Y. Li, N. Wang, J. Liu, and X. Hou. Demystifying neural style transfer. arXiv preprint arXiv:1701.01036, 2017. 1, 2, 3, 5 [34] Y. Li, N. Wang, J. Shi, J. Liu, and X. Hou. Revisiting batch normalization for practical domain adaptation. arXiv preprint arXiv:1603.04779, 2016. 2 [35] Q. Liao, K. Kawaguchi, and T. Poggio. Streaming normalization: Towards simpler and more biologically-plausible normalizations for online and recurrent learning. arXiv preprint arXiv:1610.06160, 2016. 2

[36] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C. L. Zitnick. Microsoft coco: Com- ´ mon objects in context. In ECCV, 2014. 3, 5

[37] M.-Y. Liu, T. Breuel, and J. Kautz. Unsupervised image-to-image translation networks. arXiv preprint arXiv:1703.00848, 2017. 2

[38] M.-Y. Liu and O. Tuzel. Coupled generative adversarial networks. In NIPS, 2016. 2

[39] K. Nichol. Painter by numbers, wikiart. https://www. kaggle.com/c/painter-by-numbers, 2016. 5

[40] A. v. d. Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016. 2

[41] X. Peng and K. Saenko. Synthetic to real adaptation with deep generative correlation alignment networks. arXiv preprint arXiv:1701.05524, 2017. 2

[42] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. 2

[43] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In ICML, 2016. 2

[44] M. Ren, R. Liao, R. Urtasun, F. H. Sinz, and R. S. Zemel. Normalizing the normalizers: Comparing and extending network normalization schemes. In ICLR, 2017. 2

[45] M. Ruder, A. Dosovitskiy, and T. Brox. Artistic style transfer for videos. In GCPR, 2016. 1

[46] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In NIPS, 2016. 2

[47] T. Salimans and D. P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In NIPS, 2016. 2

[48] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. 4, 5

[49] B. Sun, J. Feng, and K. Saenko. Return of frustratingly easy domain adaptation. In AAAI, 2016. 8

[50] Y. Taigman, A. Polyak, and L. Wolf. Unsupervised crossdomain image generation. In ICLR, 2017. 2

[51] D. Ulyanov, V. Lebedev, A. Vedaldi, and V. Lempitsky. Texture networks: Feed-forward synthesis of textures and stylized images. In ICML, 2016. 1, 2, 4, 5, 8

[52] D. Ulyanov, A. Vedaldi, and V. Lempitsky. Improved texture networks: Maximizing quality and diversity in feed-forward stylization and texture synthesis. In CVPR, 2017. 1, 2, 3, 5, 6, 7, 8

[53] X. Wang, G. Oxholm, D. Zhang, and Y.-F. Wang. Multimodal transfer: A hierarchical deep convolutional neural network for fast artistic style transfer. arXiv preprint arXiv:1612.01895, 2016. 2

[54] P. Wilmot, E. Risser, and C. Barnes. Stable and controllable neural texture synthesis and style transfer using histogram losses. arXiv preprint arXiv:1701.08893, 2017. 2, 8

[55] H. Zhang and K. Dana. Multi-style generative network for real-time transfer. arXiv preprint arXiv:1703.06953, 2017.

'비지도학습 > GAN' 카테고리의 다른 글