Neural Style Transfer
What is Neural Style Transfer?
content image와 style image를 input으로 하여 특별한 style을 가진 content image를 만드는 task다.
What are deep ConvNets learning?
layer의 unit 하나를 골라 그 unit의 activation을 최대화하는 image 9장을 골랐을 때, layer가 깊어질수록 high-level feature을 보여주었다.
Cost Function
Neural style transfer cost function은 generated image와 content, genearted image와 style 사이의 cost function을 이용해서 정의한다.
\( J(G) = \alpha J_{content} (C, G) + \beta J_{style} (S, G) \)
랜덤 하게 G 값을 선택한 후, gradient descent를 이용하여 \( J(G) \)를 줄이도록 만들면 된다
Content Cost Function
pre-trained convNet (VGG network 같은)을 가져와서 layer l의 activation을 generated image와 content image에 대해 각각 가져온다.
그런 다음 두 activation 값의 norm으로 content cost를 구한다.
(image에 따른 activation 값을 vector representation이라고 생각하는 가정이 깔려있는 것 같다.)
transfer learning이 효과가 있는 것이 발견되면서 너무 많은 것들을 알아야 하는 것 같다...
Style Cost Function
Style을 channel에 따른 activation들의 correlation이라고 정의하자.
\( a^{[l]}_{i, j, k} = activation at (i, j, k) \)라고 했을 때, style matrix G는 \( G^{[l]}_{kk'} = \sum_{i = 1}^{n^{[l]}_H} \sum_{j = 1}^{n^{[l]}_W} a^{[l]}_{ijk} a^{[l]}_{ijk'} \)로 정의할 수 있다.
Generated image와 style image에 대해 style matrix를 구하고 style cost function을 다음과 같이 정의한다.
$$ J^{[l]}_{style} (S, G) = \frac{1}{ ( 2 n^{[l]}_H n^{[l]}_W n^{[l]}_C )^2 } \sum_k \sum_{k'} ( G^{[l](S)}_{kk'} - G^{[l](G)}_{kk'} ) $$
1D and 3D Generalization
1D든 3D는 convolution 잘하면 된다.
'Google Machine Learning Bootcamp 2022 > Convolutional Neural Networks' 카테고리의 다른 글
4. Special Applications: Face recognition & Neural Style Transfer #1 (0) | 2022.08.02 |
---|---|
3. Object Detection (0) | 2022.08.02 |
2. Deep Convolutional Models: Case Studies #2 (0) | 2022.08.01 |
2. Deep Convolutional Models: Case Studies #1 (0) | 2022.08.01 |
1. Foundations of Convolutional Neural Networks (0) | 2022.07.28 |
댓글