第14章コンピュータビジョン
14.12.1. Method14.12.1 手法
Fig. 14.12.2 illustrates the CNN-based style transfer method with a simplified example. First, we initialize the synthesized image, for example, into the content image. This synthesized image is the only variable that needs to be updated during the style transfer process, i.e., the model parameters to be updated during training. Then we choose a pretrained CNN to extract image features and freeze its model parameters during training. This deep CNN uses multiple layers to extract hierarchical features for images. We can choose the output of some of these layers as content features or style features. Take Fig. 14.12.2 as an example. The pretrained neural network here has 3 convolutional layers, where the second layer outputs the content features, and the first and third layers output the style features.
英語のヒント
図14.12.2は、CNNにもとづくスタイル変換の手法を、単純化した例で示している。まず、合成画像を、たとえばコンテンツ画像に初期化する。この合成画像は、スタイル変換の過程で更新する必要のある唯一の変数、つまり訓練のあいだに更新するモデルのパラメータである。次に、事前学習したCNNを選んで画像の特徴を抽出し、訓練のあいだはそのモデルのパラメータを凍結する。この深いCNNは、複数の層を使って画像の階層的な特徴を抽出する。これらの層のいくつかの出力を、コンテンツの特徴やスタイルの特徴として選べる。図14.12.2を例にとろう。ここでの事前学習したニューラルネットワークには3つの畳み込み層があり、2番目の層がコンテンツの特徴を出力し、1番目と3番目の層がスタイルの特徴を出力する。
Fig. 14.12.2図14.12.2
CNN-based style transfer process. Solid lines show the direction of forward propagation and dotted lines show backward propagation.
英語のヒント
CNNにもとづくスタイル変換の過程。実線は順伝播の向きを、点線は逆伝播を示す。
Next, we calculate the loss function of style transfer through forward propagation (direction of solid arrows), and update the model parameters (the synthesized image for output) through backpropagation (direction of dashed arrows). The loss function commonly used in style transfer consists of three parts: (i) content loss makes the synthesized image and the content image close in content features; (ii) style loss makes the synthesized image and style image close in style features; and (iii) total variation loss helps to reduce the noise in the synthesized image. Finally, when the model training is over, we output the model parameters of the style transfer to generate the final synthesized image.
英語のヒント
次に、順伝播(実線の矢印の向き)を通じてスタイル変換の損失関数を計算し、逆伝播(破線の矢印の向き)を通じてモデルのパラメータ(出力する合成画像)を更新する。スタイル変換でよく使われる損失関数は三つの部分からなる。(i)コンテンツ損失は、合成画像とコンテンツ画像をコンテンツの特徴の点で近づける。(ii)スタイル損失は、合成画像とスタイル画像をスタイルの特徴の点で近づける。(iii)全変動損失は、合成画像のノイズを減らすのに役立つ。最後に、モデルの訓練が終わったら、スタイル変換のモデルのパラメータを出力して、最終的な合成画像を生成する。
In the following, we will explain the technical details of style transfer via a concrete experiment.
英語のヒント
以下では、具体的な実験を通じて、スタイル変換の技術的な詳細を説明する。