Image Style Transfer Using
Convolutional Neural Networks (2016)
(a.k.a. Neural Style Transfer)
Oct, 2018
Sooyoung Moon
2
sabjil.jpg julgyu.jpg
Content Image Style Image
Example
3
julgyuesabjil.jpg
New Image
Example
4
Abstract
이전에는..
Rendering the semantic content of an image in different styles is a difficult image processing task.
여러 다른 style image에 content를 렌더링하는 것은 어려운 일이다. 우리는 어려운 일을
해냈다!!
Arguably, a major limiting factor for previous approaches has been the lack of image
representations that explicitly represent semantic information and, thus, allow to separate image
content from style.
이전에는 의미 있는 정보(contents)를 정확하게 표현하는 것이 부족했다. 고로,
스타일로부터 이미지 컨텐츠를 분리하게 가능하는 것에 한계가 있었다. 어떤 방법을 썼길래?
5
The algorithm allows us to produce new images of high perceptual quality that combine the
content of an arbitrary photograph with the appearance of numerous well-known artworks.
이 알고리즘은 잘 알려진 예술작품의 스타일과 임의의 사진의 컨텐츠를 조합하여 새로운
고퀄리티의 이미지를 만들어 낸다.
Our results provide new insights into the deep image representations learned by Convolutional
Neural Networks and demonstrate their potential for high level image synthesis and
manipulation.
우리의 결과물은 CNN에 의한 deep image representations에 대해 새로운 인싸이트를 제공
한다. 그리고 high level image synthesis & manipulation 에 대한 포텐셜을 증명한다.
Abstract
이제는..
6
Introduction
이전에는..
Texture transfering은 예전에도 여러 방법들이 있었다.
주로 texture transfer algorithm의 베이직은 non-parametric methods였고, 타겟 이미지의
structure을 보존하는 방법들이 달랐다.
예를 들면,
- Efros&Freeman: correspondence map [link]
- Image Analogies (2001, Hertzman et al) [link]
- Fast Texture Transfer (2001, Ashikhmin) [link]
- Directional Texture Transfer (2010, Lee et al.) [link]
7
Image Quilting for Texture Synthesis and Transfer (2001, Efros & Freeman) [link]
얼굴에 밥풀 붙이기 라던가..
아련 …
8
Image Quilting for Texture Synthesis and Transfer (2001, Efros & Freeman) [link]
얼굴에 밥풀 붙이기 라던가..
9
Image Analogies (2001, Hertzman et al) [link]
여기는 강물 재창조..
10
Fast Texture Transfer (2001, Ashikhmin) [link]
예쁜 꽃 사진에 필터 뿌리기..
급노화가 온 것 같은 것은 기분 탓이야....
11
Directional Texture Transfer (2010, Lee et al.) [link]
돈이 없어서 열어보지 못했음..
12
Directional Texture Transfer (2010, Lee et al.) [link]
돈이 없어서 열어보지 못했음..
난…ㄱ ㅏ끔…
눈물을 흘린 ㄷ ㅏ….
13
그래서 구글링..
자랑스러운 한국인…!
Directional Texture Transfer (2010, Lee et al.) [link]
14
Introduction
이전에는..
Texture transfering은 예전에도 여러 방법들이 있었다.
그러나 한계가 있었다: Texture transfer를 하기 위해 오로지 타겟 이미지의 Low-level feature들만
사용했다.
이상적으로 보면, Content image로부터 컨텐츠를 추출한 다음 Style image의 style에 렌더링하는
Texture transfer 절차가 좋아보인다.
15
Introduction
그러므로 이미지의 representations 찾는 것이 우선이 되어야한다. semantic image content의
variation이랑 그림에 나타낼 스타일에 대해서 각각 독립적으로 모델링하는 것이 이미지의
representation이라고 할 수 있다.
이러한 factorized representations는 이미 이전에 이루어진 적 있다. 다음과 같은 제한된
이미지에서 수행되었다. 다른 조명 아래의 얼굴들, 다른 폰트 스타일의 철자들, 손으로
쓰여진 숫자들, 번지수 등이 그 예시다.
16
Introduction
스타일로부터 컨텐츠 분리는 여전히 어려운 문제다. 하지만 Deep CNN의 발전은 강력한
컴퓨터 비전 시스템을 가능하게 해줬다. 더 구체적으로 말하자면, Natural images의 high-
level 의미 정보를 추출하는 것을 학습시킨 컴퓨터 비전 시스템이 가능해 졌다.
충분한 양의 레이블된 데이터로 학습시킨 CNN은 데이터셋들 전반적으로 일반화되어 있는
feature representations들에서 high-level 이미지 컨텐츠를 추출하는 것을 학습한다.
17
Introduction
이 논문에서는 deep CNN의로 학습된 generic feature representations가 natural images들의
컨텐츠와 스타일을 독립적으로 조작하고 독립적으로 수행하는 것에 사용되는지 보여준다.
모델이 딥하다보니 싱글 뉴럴넷에서 있었던 옵티마이제이션 문제를 줄일 수 있다. 새로운
이미지는 어떻게 만들어지냐 하면 샘플이미지의 feature representations와 어떠한 pre-
image를 매칭 시키면서 pre-image의 모습을 찾아나가는 방법이다.
실제로, 우리의 스타일 트랜스퍼 알고리즘은 ‘image representations’의 반대 방법을 쓰는
CNN이 베이스인 model을 쓴다.
18
Deep image representations
Pre-trained 19 layer VGG network 사용
출처: https://www.youtube.com/watch?v=fIW8fI2Xb_k
19
Deep image representations
출처: https://www.youtube.com/watch?v=fIW8fI2Xb_k
20
뒤로 갈수록 디테일 픽셀 정보가
로스된다.
서로 다른 레이어들간의
상관관계를 분석한다. conv1 /
conv1,conv2 / conv1, conv2, conv3
/ conv1,conv2,conv3,con4 /
conv1,conv2,conv3, conv4, conv5
e: 마침내 global arrangement 는
사라져도 주어진 이미지의
스타일이 잘 생성된다.
21
2.1 Style representation
22출처: https://www.youtube.com/watch?v=fIW8fI2Xb_k
23
Content representation
⃗" : generated image
⃗# : original image
$% : original image의 feature representation in layer &
'%
: generated image의 feature representation in layer &
위의 로스 함수를 통해 gradient descen를 통해 ⃗"가 ⃗#가 되게끔 한다.
24
Style representation
Layer 들 간의 상관관계를 분석하는 틀인 그램 매트릭스를 사용
출처: 보찬님의 슬라이드(CycleGAN) Gram Matrix 홍정모 교수님 유투브 바로가기 (클릭!)
25
Results
26
Results
27
Results
28
Trade-off between content and style matching
29
Effect of different layers of the Convolutional Neural Network
30
Initialisation of gradient descent
31
Photorealistic style transfer
32
Discussion
33
꽤 잘한 것 같지만 그래도 한계점이 있다.
Discussion
34
LIMITATION 1
Resolution of the synthesized images.
The speed of the synthesis procedure depends heavily on image resolution.
Discussion
35
LIMITATION 2
Noise.
While this is less of an is- sue in the artistic style transfer, the problem becomes more apparent
when both, content and style images, are photographs.
Discussion
36
LIMITATION 2Discussion
제가 직접 한번 테스트 해보겠읍니다..
삽질 할 준비가 되어있는 문수영씨 이미 삽질 중인 아저씨
37
LIMITATION 2Discussion
삽질 할 준비가 되어있는 문수영씨 이미 삽질 중인 아저씨
LIMITATION 1에서 언급했듯이 빠른 학습을 위해 디멘션은 128*128로 바꿨습니다...
38
LIMITATION 2Discussion
메마른 땅에 강물이 흐르게 되고 하늘에는 풀이 자라나니
39
LIMITATION 2Discussion
원래부터 화질이 안좋아서 노이즈가 생긴지 잘 모르겠습…
40
LIMITATION 2Discussion
오리지날 이미지랑 비교해보면 노이즈가 좀 생긴 것 같기도…
41
LIMITATION 2
However, the noise is very characteristic and appears to resemble the filters of units in the
network.
Discussion
42
LIMITATION 3
The separation of image content from style is not necessarily a well defined problem.
This is mostly because it is not clear what exactly defines the style of an image.
It might be the brush strokes in a painting, the colour map, certain dominant forms and shapes,
but also the composition of a scene and the choice of the subject of the image and probably it is
a mixture of all of them and many more.
Discussion
43
LIMITATION 3Discussion
예를 들면,
내가 눈썹 왁싱을 하고 싶어서
모나리자 스타일을 가져다가
쓰겠다고 해서 내 눈썹이 사라지는
것이 아니다..
내 정면의 모습이 마음에 안 들어서
측면을 기대하고 저런 남자 사진
스타일을 가져다 쓴다고 해서 내가
얼굴을 돌리고 찍은 사진이 합성되는
것이 아니다..
사기 사진 등장 ㅎ
44
LIMITATION 3
In our work we consider style transfer to be successful if the generated image ‘looks like’ the style
image but shows the objects and scenery of the content image.
현실과 타협할 시간…
Discussion
45
Nevertheless,
생물학적 시각 체계가 수행하는 일들 중 하나를 해낼 수 있도록 훈련된 Neural Network가
어느 정도는 style로부터 contents를 자동으로 분리할 수 있다는 것이 굉장히 fascinating하다.
Discussion
46
마무리
최적화된 ANN의 성능과 사람의 비전이 서로 상당히 닮았다는 점을 고려해보면
사람도 역시 contents 를 style로부터 추론해내는 능력이 있다고 생각할 수 있다. 그렇기
때문에 예술을 창조하고 즐길 수 있는 것이다. 즉, 우리의 시각 체계의 추론 능력에 대한
확실한 특성을 유추할 수 있다. 아름다운 마무리
Discussion

Neural-style-transfer

  • 1.
    Image Style TransferUsing Convolutional Neural Networks (2016) (a.k.a. Neural Style Transfer) Oct, 2018 Sooyoung Moon
  • 2.
  • 3.
  • 4.
    4 Abstract 이전에는.. Rendering the semanticcontent of an image in different styles is a difficult image processing task. 여러 다른 style image에 content를 렌더링하는 것은 어려운 일이다. 우리는 어려운 일을 해냈다!! Arguably, a major limiting factor for previous approaches has been the lack of image representations that explicitly represent semantic information and, thus, allow to separate image content from style. 이전에는 의미 있는 정보(contents)를 정확하게 표현하는 것이 부족했다. 고로, 스타일로부터 이미지 컨텐츠를 분리하게 가능하는 것에 한계가 있었다. 어떤 방법을 썼길래?
  • 5.
    5 The algorithm allowsus to produce new images of high perceptual quality that combine the content of an arbitrary photograph with the appearance of numerous well-known artworks. 이 알고리즘은 잘 알려진 예술작품의 스타일과 임의의 사진의 컨텐츠를 조합하여 새로운 고퀄리티의 이미지를 만들어 낸다. Our results provide new insights into the deep image representations learned by Convolutional Neural Networks and demonstrate their potential for high level image synthesis and manipulation. 우리의 결과물은 CNN에 의한 deep image representations에 대해 새로운 인싸이트를 제공 한다. 그리고 high level image synthesis & manipulation 에 대한 포텐셜을 증명한다. Abstract 이제는..
  • 6.
    6 Introduction 이전에는.. Texture transfering은 예전에도여러 방법들이 있었다. 주로 texture transfer algorithm의 베이직은 non-parametric methods였고, 타겟 이미지의 structure을 보존하는 방법들이 달랐다. 예를 들면, - Efros&Freeman: correspondence map [link] - Image Analogies (2001, Hertzman et al) [link] - Fast Texture Transfer (2001, Ashikhmin) [link] - Directional Texture Transfer (2010, Lee et al.) [link]
  • 7.
    7 Image Quilting forTexture Synthesis and Transfer (2001, Efros & Freeman) [link] 얼굴에 밥풀 붙이기 라던가.. 아련 …
  • 8.
    8 Image Quilting forTexture Synthesis and Transfer (2001, Efros & Freeman) [link] 얼굴에 밥풀 붙이기 라던가..
  • 9.
    9 Image Analogies (2001,Hertzman et al) [link] 여기는 강물 재창조..
  • 10.
    10 Fast Texture Transfer(2001, Ashikhmin) [link] 예쁜 꽃 사진에 필터 뿌리기.. 급노화가 온 것 같은 것은 기분 탓이야....
  • 11.
    11 Directional Texture Transfer(2010, Lee et al.) [link] 돈이 없어서 열어보지 못했음..
  • 12.
    12 Directional Texture Transfer(2010, Lee et al.) [link] 돈이 없어서 열어보지 못했음.. 난…ㄱ ㅏ끔… 눈물을 흘린 ㄷ ㅏ….
  • 13.
  • 14.
    14 Introduction 이전에는.. Texture transfering은 예전에도여러 방법들이 있었다. 그러나 한계가 있었다: Texture transfer를 하기 위해 오로지 타겟 이미지의 Low-level feature들만 사용했다. 이상적으로 보면, Content image로부터 컨텐츠를 추출한 다음 Style image의 style에 렌더링하는 Texture transfer 절차가 좋아보인다.
  • 15.
    15 Introduction 그러므로 이미지의 representations찾는 것이 우선이 되어야한다. semantic image content의 variation이랑 그림에 나타낼 스타일에 대해서 각각 독립적으로 모델링하는 것이 이미지의 representation이라고 할 수 있다. 이러한 factorized representations는 이미 이전에 이루어진 적 있다. 다음과 같은 제한된 이미지에서 수행되었다. 다른 조명 아래의 얼굴들, 다른 폰트 스타일의 철자들, 손으로 쓰여진 숫자들, 번지수 등이 그 예시다.
  • 16.
    16 Introduction 스타일로부터 컨텐츠 분리는여전히 어려운 문제다. 하지만 Deep CNN의 발전은 강력한 컴퓨터 비전 시스템을 가능하게 해줬다. 더 구체적으로 말하자면, Natural images의 high- level 의미 정보를 추출하는 것을 학습시킨 컴퓨터 비전 시스템이 가능해 졌다. 충분한 양의 레이블된 데이터로 학습시킨 CNN은 데이터셋들 전반적으로 일반화되어 있는 feature representations들에서 high-level 이미지 컨텐츠를 추출하는 것을 학습한다.
  • 17.
    17 Introduction 이 논문에서는 deepCNN의로 학습된 generic feature representations가 natural images들의 컨텐츠와 스타일을 독립적으로 조작하고 독립적으로 수행하는 것에 사용되는지 보여준다. 모델이 딥하다보니 싱글 뉴럴넷에서 있었던 옵티마이제이션 문제를 줄일 수 있다. 새로운 이미지는 어떻게 만들어지냐 하면 샘플이미지의 feature representations와 어떠한 pre- image를 매칭 시키면서 pre-image의 모습을 찾아나가는 방법이다. 실제로, 우리의 스타일 트랜스퍼 알고리즘은 ‘image representations’의 반대 방법을 쓰는 CNN이 베이스인 model을 쓴다.
  • 18.
    18 Deep image representations Pre-trained19 layer VGG network 사용 출처: https://www.youtube.com/watch?v=fIW8fI2Xb_k
  • 19.
    19 Deep image representations 출처:https://www.youtube.com/watch?v=fIW8fI2Xb_k
  • 20.
    20 뒤로 갈수록 디테일픽셀 정보가 로스된다. 서로 다른 레이어들간의 상관관계를 분석한다. conv1 / conv1,conv2 / conv1, conv2, conv3 / conv1,conv2,conv3,con4 / conv1,conv2,conv3, conv4, conv5 e: 마침내 global arrangement 는 사라져도 주어진 이미지의 스타일이 잘 생성된다.
  • 21.
  • 22.
  • 23.
    23 Content representation ⃗" :generated image ⃗# : original image $% : original image의 feature representation in layer & '% : generated image의 feature representation in layer & 위의 로스 함수를 통해 gradient descen를 통해 ⃗"가 ⃗#가 되게끔 한다.
  • 24.
    24 Style representation Layer 들간의 상관관계를 분석하는 틀인 그램 매트릭스를 사용 출처: 보찬님의 슬라이드(CycleGAN) Gram Matrix 홍정모 교수님 유투브 바로가기 (클릭!)
  • 25.
  • 26.
  • 27.
  • 28.
    28 Trade-off between contentand style matching
  • 29.
    29 Effect of differentlayers of the Convolutional Neural Network
  • 30.
  • 31.
  • 32.
  • 33.
    33 꽤 잘한 것같지만 그래도 한계점이 있다. Discussion
  • 34.
    34 LIMITATION 1 Resolution ofthe synthesized images. The speed of the synthesis procedure depends heavily on image resolution. Discussion
  • 35.
    35 LIMITATION 2 Noise. While thisis less of an is- sue in the artistic style transfer, the problem becomes more apparent when both, content and style images, are photographs. Discussion
  • 36.
    36 LIMITATION 2Discussion 제가 직접한번 테스트 해보겠읍니다.. 삽질 할 준비가 되어있는 문수영씨 이미 삽질 중인 아저씨
  • 37.
    37 LIMITATION 2Discussion 삽질 할준비가 되어있는 문수영씨 이미 삽질 중인 아저씨 LIMITATION 1에서 언급했듯이 빠른 학습을 위해 디멘션은 128*128로 바꿨습니다...
  • 38.
    38 LIMITATION 2Discussion 메마른 땅에강물이 흐르게 되고 하늘에는 풀이 자라나니
  • 39.
    39 LIMITATION 2Discussion 원래부터 화질이안좋아서 노이즈가 생긴지 잘 모르겠습…
  • 40.
    40 LIMITATION 2Discussion 오리지날 이미지랑비교해보면 노이즈가 좀 생긴 것 같기도…
  • 41.
    41 LIMITATION 2 However, thenoise is very characteristic and appears to resemble the filters of units in the network. Discussion
  • 42.
    42 LIMITATION 3 The separationof image content from style is not necessarily a well defined problem. This is mostly because it is not clear what exactly defines the style of an image. It might be the brush strokes in a painting, the colour map, certain dominant forms and shapes, but also the composition of a scene and the choice of the subject of the image and probably it is a mixture of all of them and many more. Discussion
  • 43.
    43 LIMITATION 3Discussion 예를 들면, 내가눈썹 왁싱을 하고 싶어서 모나리자 스타일을 가져다가 쓰겠다고 해서 내 눈썹이 사라지는 것이 아니다.. 내 정면의 모습이 마음에 안 들어서 측면을 기대하고 저런 남자 사진 스타일을 가져다 쓴다고 해서 내가 얼굴을 돌리고 찍은 사진이 합성되는 것이 아니다.. 사기 사진 등장 ㅎ
  • 44.
    44 LIMITATION 3 In ourwork we consider style transfer to be successful if the generated image ‘looks like’ the style image but shows the objects and scenery of the content image. 현실과 타협할 시간… Discussion
  • 45.
    45 Nevertheless, 생물학적 시각 체계가수행하는 일들 중 하나를 해낼 수 있도록 훈련된 Neural Network가 어느 정도는 style로부터 contents를 자동으로 분리할 수 있다는 것이 굉장히 fascinating하다. Discussion
  • 46.
    46 마무리 최적화된 ANN의 성능과사람의 비전이 서로 상당히 닮았다는 점을 고려해보면 사람도 역시 contents 를 style로부터 추론해내는 능력이 있다고 생각할 수 있다. 그렇기 때문에 예술을 창조하고 즐길 수 있는 것이다. 즉, 우리의 시각 체계의 추론 능력에 대한 확실한 특성을 유추할 수 있다. 아름다운 마무리 Discussion