第7章畳み込みニューラルネットワーク
7.1.4. Channels7.1.4 チャネル
Returning to our Waldo detector, let’s see what this looks like. The convolutional layer picks windows of a given size and weighs intensities according to the filter , as demonstrated in Fig. 7.1.2. We might aim to learn a model so that wherever the “waldoness” is highest, we should find a peak in the hidden layer representations.
英語のヒント
ウォーリー検出器に戻って、これがどう見えるかを見てみよう。図7.1.2に示すように、畳み込み層は与えられた大きさの窓を選び、フィルタに従って明るさに重みを付ける。「ウォーリーらしさ」が最も高いところならどこでも、隠れ層の表現に山が見つかるようなモデルを学習することをめざすかもしれない。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 7.1.2図7.1.2
Detect Waldo (image courtesy of William Murphy (Infomatique)).
英語のヒント
ウォーリーを検出する(画像提供:William Murphy (Infomatique))。
There is just one problem with this approach. So far, we blissfully ignored that images consist of three channels: red, green, and blue. In sum, images are not two-dimensional objects but rather third-order tensors, characterized by a height, width, and channel, e.g., with shape pixels. While the first two of these axes concern spatial relationships, the third can be regarded as assigning a multidimensional representation to each pixel location. We thus index as . The convolutional filter has to adapt accordingly. Instead of , we now have .
英語のヒント
この手法にはただ一つ問題がある。ここまでは、画像が赤、緑、青の三つのチャネルからなることを、のんきに無視してきた。まとめると、画像は2次元の対象ではなく、むしろ高さ、幅、チャネルで特徴づけられる3階のテンソルであり、たとえば形状は画素である。これらの軸のうち最初の二つは空間的な関係にかかわるが、三つ目は各画素の位置に多次元の表現を割り当てるものとみなせる。そこで、をと添え字付けする。畳み込みフィルタもそれに応じて適応しなければならない。の代わりに、今度はとなる。
Moreover, just as our input consists of a third-order tensor, it turns out to be a good idea to similarly formulate our hidden representations as third-order tensors . In other words, rather than just having a single hidden representation corresponding to each spatial location, we want an entire vector of hidden representations corresponding to each spatial location. We could think of the hidden representations as comprising a number of two-dimensional grids stacked on top of each other. As in the inputs, these are sometimes called channels. They are also sometimes called feature maps, as each provides a spatialized set of learned features for the subsequent layer. Intuitively, you might imagine that at lower layers that are closer to inputs, some channels could become specialized to recognize edges while others could recognize textures.
英語のヒント
さらに、入力が3階のテンソルからなるのとちょうど同じように、隠れ表現も同様に3階のテンソルとして定式化するのがよい考えであることがわかる。言い換えれば、各空間位置に対応する隠れ表現を一つだけもつのではなく、各空間位置に対応する隠れ表現のベクトル全体がほしい。隠れ表現は、何枚もの2次元の格子を積み重ねたものからなると考えられる。入力と同じく、これらはチャネルと呼ばれることもある。また、それぞれが次の層のために学習された特徴量を空間的に並べた組を与えるので、特徴マップと呼ばれることもある。直観的には、入力に近い下のほうの層では、あるチャネルは縁を認識するのに特化し、ほかのチャネルは質感を認識できるようになる、と想像できるかもしれない。
To support multiple channels in both inputs () and hidden representations (), we can add a fourth coordinate to : . Putting everything together we have:
英語のヒント
入力()と隠れ表現()の両方で複数のチャネルに対応するため、に4番目の座標を加えてとできる。すべてをまとめると、次が得られる。
(7.1.7)
where indexes the output channels in the hidden representations . The subsequent convolutional layer will go on to take a third-order tensor, , as input. We take (7.1.7), because of its generality, as the definition of a convolutional layer for multiple channels, where is a kernel or filter of the layer.
英語のヒント
ここでは、隠れ表現の出力チャネルの添え字である。次の畳み込み層は、続いて3階のテンソルを入力として受け取る。その一般性から、式(7.1.7)を複数のチャネルのための畳み込み層の定義とする。ここでは、層のカーネルまたはフィルタである。
There are still many operations that we need to address. For instance, we need to figure out how to combine all the hidden representations to a single output, e.g., whether there is a Waldo anywhere in the image. We also need to decide how to compute things efficiently, how to combine multiple layers, appropriate activation functions, and how to make reasonable design choices to yield networks that are effective in practice. We turn to these issues in the remainder of the chapter.
英語のヒント
まだ扱う必要のある演算がたくさんある。たとえば、すべての隠れ表現を一つの出力、たとえば画像のどこかにウォーリーがいるかどうか、にまとめる方法を考え出す必要がある。また、計算を効率よく行う方法、複数の層を組み合わせる方法、適切な活性化関数、そして実際に効果的なネットワークを生み出すための筋の通った設計の選び方を決める必要もある。この章の残りでは、これらの問題に取り組む。