ニューラルネットワークの歴史と手法3

2.6K Views

June 01, 22

スライド概要

大学院で使っているニューラルネットワークの資料です.深層ニューラルネットワークを取り扱っています.

この資料はあまり掘り下げていません.最新の知見に追いついて行けていないので内容に古い部分があるかもしれません.

profile-image

コンピュータを使って色々計算しています.個人的な技術に関するメモと講義資料が置いてあります.気が向いた時に資料を修正しています. 公立小松大学臨床工学科准教授 https://researchmap.jp/read0128699

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

ニューラルネットワークの 歴史と⼿法3 深層ニューラルネットワーク 公⽴⼩松⼤学 藤⽥ ⼀寿 Ver.20240715 深層ニューラルネットワークは⽇進⽉歩です. ⽇々新たな知⾒が出てきます.これを含めたネットの資 料を鵜呑みにしないようにしましょう. 必ず元論⽂をチェックしましょう!!

2.

ニューラルネットワークの深層化と⾃由 なアーキテクチャの創造

3.

多層パーセプトロンの限界 • 深くしても性能は上がらなかった. • SVMが登場し,多層パーセプトロンを使う必要がなくなった. • その結果,ニューラルネットワーク研究は下⽕になっていく. • 下⽕にはなったが,地道な研究はなされていた.

4.

深層ニューラルネットワーク の登場

5.

深層ニューラルネットワークとは • 2層よりの深いニューラルネットワークを深層ニューラルネットワー クという(Bishop and Bishop, 2023). • ニューラルネットワークが深いとはニューラルネットワークを構成する層 が多いことを⾔う. • 深いニューラルネットワークに焦点を当てた機械学習の分野を深層学 習という (Bishop and Bishop, 2023). 出⼒ ⼊⼒ 深層ニューラルネットワーク

6.
[beta]
softmax1

Conv
5x5+1(S)

Conv
1x1+1(S)

Conv
1x1+1(S)

MaxPool
3x3+1(S)

Plain Networks. We first evaluate 18-layer and 34-layer
plain nets. The 34-layer plain net is in Fig. 3 (middle). The
18-layer plain net is of a similar form. See Table 1 for detailed architectures.
The results in Table 2 show that the deeper 34-layer plain
net has higher validation error than the shallower 18-layer
plain net. To reveal the reasons, in Fig. 4 (left) we compare their training/validation errors during the training procedure. We have observed the degradation problem - the

softmax2

SoftmaxActivation

FC

AveragePool
7x7+1(V)

DepthConcat

Conv
3x3+1(S)

Conv
1x1+1(S)

We evaluate our method on the ImageNet 2012 classification dataset [36] that consists of 1000 classes. The models
are trained on the 1.28 million training images, and evaluated on the 50k validation images. We also obtain a final
result on the 100k test images, reported by the test server.
We evaluate both top-1 and top-5 error rates.
Conv
1x1+1(S)

4

Conv
1x1+1(S)

4.1. ImageNet Classification

Gaussian connections
Full connection
Subsampling
Full connection

for ImageNet. Left: the
s) as a reference. Midyers (3.6 billion FLOPs).
meter layers (3.6 billion
mensions. Table 1 shows

Conv
5x5+1(S)

DepthConcat

Conv
3x3+1(S)

4. Experiments

Conv
1x1+1(S)

fc 1000

FC

SoftmaxActivation

avg pool

Conv
1x1+1(S)

3x3 conv, 512

AveragePool
5x5+3(V)

3x3 conv, 512

Conv
1x1+1(S)

3x3 conv, 512

MaxPool
3x3+1(S)

MaxPool
3x3+1(S)

Conv
5x5+1(S)
FC

Conv
1x1+1(S)

Conv
1x1+1(S)

MaxPool
3x3+2(S)

DepthConcat

Conv
3x3+1(S)

3x3 conv, 512

Conv
1x1+1(S)

3x3 conv, 512

MaxPool
3x3+1(S)

3x3 conv, 256

Conv
5x5+1(S)

3x3 conv, 512, /2

Conv
1x1+1(S)

DepthConcat

Conv
3x3+1(S)

Conv
1x1+1(S)

Conv
1x1+1(S)

3x3 conv, 256

C5: layer F6: layer
120
84

3x3 conv, 256

FC
SoftmaxActivation

3x3 conv, 256

Conv
1x1+1(S)

3x3 conv, 256

Conv
5x5+1(S)

MaxPool
3x3+1(S)

softmax0

Conv
3x3+1(S)

Conv
1x1+1(S)

DepthConcat

Conv
1x1+1(S)

3x3 conv, 256

Conv
1x1+1(S)

3x3 conv, 256

AveragePool
5x5+3(V)

3x3 conv, 256

Conv
1x1+1(S)

3x3 conv, 256

MaxPool
3x3+1(S)

3x3 conv, 256

Conv
5x5+1(S)

3x3 conv, 256

Conv
1x1+1(S)

FC

Conv
3x3+1(S)

DepthConcat

Conv
1x1+1(S)

3x3 conv, 128

Conv
1x1+1(S)

3x3 conv, 256, /2

MaxPool
3x3+1(S)

3x3 conv, 128

Conv
5x5+1(S)

3x3 conv, 128

Conv
1x1+1(S)

DepthConcat

Conv
3x3+1(S)

MaxPool
3x3+2(S)

Conv
1x1+1(S)

3x3 conv, 128

Convolutions

Conv
1x1+1(S)

Conv
1x1+1(S)

3x3 conv, 128

S2: f. maps
6@14x14

Conv
1x1+1(S)

MaxPool
3x3+1(S)

3x3 conv, 128

Subsampling

Conv
1x1+1(S)

Conv
5x5+1(S)

Our implementation for ImageNet follows the practice
in [21, 41]. The image is resized with its shorter side randomly sampled in [256, 480] for scale augmentation [41].
A 224⇥224 crop is randomly sampled from an image or its
horizontal flip, with the per-pixel mean subtracted [21]. The
standard color augmentation in [21] is used. We adopt batch
normalization (BN) [16] right after each convolution and
before activation, following [16]. We initialize the weights
as in [13] and train all plain/residual nets from scratch. We
use SGD with a mini-batch size of 256. The learning rate
starts from 0.1 and is divided by 10 when the error plateaus,
and the models are trained for up to 60 ⇥ 104 iterations. We
use a weight decay of 0.0001 and a momentum of 0.9. We
do not use dropout [14], following the practice in [16].
In testing, for comparison studies we adopt the standard
10-crop testing [21]. For best results, we adopt the fullyconvolutional form as in [41, 13], and average the scores
at multiple scales (images are resized such that the shorter
side is in {224, 256, 384, 480, 640}).

Convolutions

Conv
1x1+1(S)

Conv
1x1+1(S)

3x3 conv, 128

3.4. Implementation

C1: feature maps
6@28x28

Conv
1x1+1(S)

Conv
3x3+1(S)

DepthConcat

Conv
1x1+1(S)

3x3 conv, 64

INPUT
32x32

Conv
1x1+1(S)

Conv
1x1+1(S)

3x3 conv, 128, /2

Conv
1x1+1(S)
DepthConcat

3x3 conv, 64

MaxPool
3x3+1(S)

3x3 conv, 64

Conv
5x5+1(S)

3x3 conv, 64
Conv
1x1+1(S)

3x3 conv, 64

Conv
3x3+1(S)

pool, /2

Conv
1x1+1(S)

MaxPool
3x3+2(S)

LocalRespNorm

Conv
3x3+1(S)

Conv
1x1+1(V)

3x3 conv, 64

Conv
1x1+1(S)

MaxPool
3x3+2(S)

neurons in a kernel map). The second convolutional layer takes as input the (response-normalized
and pooled) output of the first convolutional layer and filters it with 256 kernels of size 5 ⇥ 5 ⇥ 48.
The third, fourth, and fifth convolutional layers are connected to one another without any intervening
pooling or normalization layers. The third convolutional layer has 384 kernels of size 3 ⇥ 3 ⇥
256 connected to the (normalized, pooled) outputs of the second convolutional layer. The fourth
convolutional layer has 384 kernels of size 3 ⇥ 3 ⇥ 192 , and the fifth convolutional layer has 256
kernels of size 3 ⇥ 3 ⇥ 192. The fully-connected layers have 4096 neurons each.
7x7 conv, 64, /2

Residual Network. Based on the above plain network, we
insert shortcut connections (Fig. 3, right) which turn the
network into its counterpart residual version. The identity
shortcuts (Eqn.(1)) can be directly used when the input and
output are of the same dimensions (solid line shortcuts in
Fig. 3). When the dimensions increase (dotted line shortcuts
in Fig. 3), we consider two options: (A) The shortcut still
performs identity mapping, with extra zero entries padded
for increasing dimensions. This option introduces no extra
parameter; (B) The projection shortcut in Eqn.(2) is used to
match dimensions (done by 1⇥1 convolutions). For both
options, when the shortcuts go across feature maps of two
sizes, they are performed with a stride of 2.

Figure 2: An illustration of the architecture of our CNN, explicitly showing the delineation of responsibilities

between the two GPUs. One GPU runs the layer-parts at the top of the figure while the other runs the layer-parts
at the bottom. The GPUs communicate only at certain layers. The network’s input is 150,528-dimensional, and
the number of neurons in the network’s remaining layers is given by 253,440–186,624–64,896–64,896–43,264–
4096–4096–1000.
LocalRespNorm

image

Conv
7x7+2(S)

input

Figure 3: GoogLeNet network with all the bells and whistles

7

34-layer residual

深層ニューラルネットワークの例
2層パーセプトロン

C3: f. maps 16@10x10
S4: f. maps 16@5x5
OUTPUT
10

LeNet-5 (1998)

AlexNet (2012)

GoogleNet (2014)
ResNet34 (2015)

152層で画像認識コンテストで優勝

7.

深層ニューラルネットワークの衝撃 • 2012年数々のコンペティションで圧倒的な成績で優勝 • Imagenet Large Scale Visual Recognition Challenge 2012でConvolution networkが優勝 • IJCNN 2011 Traffic Sign Recognition優勝 • ICPR2012 Contest on “Mitosis Detection in Breast Cancer Histological Images”優勝 • ISBI 2012 challenge on segmentation of neural structures優勝 • など

8.

⼈間を超えた画像識別能⼒ Classification Results (CLS) 画像識別⼤会で優勝した⼿法のスコア 深層ニューラルネットワーク 0.3 Classification Error 0.25 0.28 深層ニューラルネットワークの登場で⼈⼯知能の画像 識別能⼒が⼤きく向上した. 0.26 0.2 AlexNet 0.15 GoogLeNet 0.16 ResNet 0.12 0.1 16.7% ↓ 23.3% ↓ 0.051 0.07 0.05 0 2010 2011 2012 2013 2014 Karpathy 0.036 0.03 0.023 2015 2016 2017 (http://image-net.org/challenges/talks_2017/ILSVRC2017_overview.pdf) http://karpathy.github.io/2014/09/02/what-i-learned-from-competing-against-a-convnet-on-imagenet/

9.

深層ニューラルネットワークで出来ること • 画像識別 • 国際的な画像識別⼤会で他の⼿法を圧倒 • ⼈間よりも⾼性能 • 画像⽣成 • イラストや絵画を⾃動⽣成(Stable diffusion, Dall-E, Midjourney) • 画像から⽂章の作成 • 画像の領域分割 • 画像から駐⾞場所を検出 • ロボット制御 • ゲームAI • 囲碁AI AlphaGoが柯潔⽒に勝利 • 翻訳 • DeepL,Google翻訳,ChatGPT,Claudeなど • 対話,⽂章⽣成 • ChatGPT,Claudeなど (Jin et al. 2017)

10.

畳み込みニューラルネットワ ーク

11.

深層ニューラルネットワークはうまく動くのか • 多層パーセプトロンで説明したとおり,層の数を増やしたからと⾔っ て性能が上がるわけではない. • しかし,なぜ深層ニューラルネットワークの性能が上がったのか. • ⼀つの理由は,ニューラルネットワークに画像の特徴を捉える構造を取り ⼊れたからである. • この構造を持つ深層ニューラルネットワークが畳み込みニューラルネット ワークである. もちろん,深層ニューラルネットワークは畳み込みニューラルネットワークだけ ではない.畳み込みという構造的なバイアスを持たなくても深層ニューラルネッ トワークの性能を⾼める⽅法はある.

12.

画像の特徴 • ⽂字Aの特徴はなにか? • Aは尖り,T字,斜め線などでできている. • これらがAの特徴と⾔える. • 逆に,⽂字画像に上記の特徴があれば,⽂字画像はAであるといえる のではないか. これらの特徴を持つ ならAがだろう. 推論 分解 ⽂字A ⽂字Aを構成する特徴

13.

畳み込みニューラルネットワークの構造 プーリング層 ⼊⼒ 畳み込み層 プーリング層 畳み込み層 全結合層 下層で捉えた特徴を使って, 画像を識別する.通常,画像 識別では多層パーセプトロン が使われる. 特徴を捉える. ズレを吸収する. 畳み込み層で画像の局所 特徴を捉える.Aという ⽂字画像なら,上の尖り ,中央のT字,中央の横 線,下部の斜め線が特徴 になるだろう. Aが横や縦にずれてもAで ある.しかし,画像がずれ ると,特徴の場所もずれて しまい別の画像として識別 されるかもしれない.プー リング層でズレを吸収する ことで,ズレに対応する. 捉えた特徴の更に特徴を捉 える.そうすると,下層で 捉えた特徴の組み合わせを 捉えることになる.

14.

畳み込み層による画像の特徴の抽出 数値化 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 画像 0 0 0 0 1 0 1 0 1 特徴 数値化 フィルタ 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0

15.

畳み込み層による画像の特徴の抽出 抜き出す 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 画像の⼀部 * 0 0 0 0 1 0 1 0 1 = 0×0 + 0×0 + 0×0 + 0×0 + 0×1 + 0×0 + 0×1 + 0×0 + 0×1=0 フィルタ 画像 抜き出した画像とフィルタの各要素をかけて⾜す(フ ロベニウス内積: Frobenius inner product). その結果を特徴マップに⼊れる. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 特徴マップ 0 0 0 0 0 0 0

16.

畳み込み層による画像の特徴の抽出 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 画像 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 * 0 0 0 0 1 0 1 0 1 = 0×0 + 0×0 + 0×0 + 0×0 + 0×1 + 0×0 + 0×1 + 0×0 + 1×1=1 * 0 0 0 0 1 0 1 0 1 = 0×0 + 0×0 + 0×0 + 0×0 + 0×1 + 1×0 + 0×1 + 1×0 + 0×1=0 * 0 0 0 0 1 0 1 0 1 = 0×0 + 0×0 + 0×0 + 0×0 + 1×1 + 0×0 + 1×1 + 0×0 + 1×1=3 画像の⼀部 フィルタ フィルタ適⽤する場所をずらし先と同じ計算を⾏ っていく.この計算を畳み込みという. 特徴マップはフィルタが表す画像の特徴を,画像 がどれほど含んでいるかを表す. 左の特徴マップを⾒ると,Aのとんがりの部分の 値が最も⾼い事がわかる. 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 特徴マップ 0 0 1 1 1 0 1

17.

特徴マップの⽐較 フィルタ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 画像 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 1 1 0 2 1 2 1 0 0 1 1 1 0 1 0 0 0 1 1 2 2 0 1 2 2 4 2 1 2 2 2 2 2 1 0 1 2 1 1 2 1 0 1 2 2 3 2 2 0 0 0 1 2 3 2 2 0 0 0 0 0 1 2 0 0 0 0 1 2 3 0 0 2 3 2 2 0 1 3 1 1 1 1 0 1 0 1 2 1 1 0 1 2 1 1 2 1 1 0 0 1 2 2 1 0 特徴マップ 特徴マップの値が⼤きい場所は,フィルタが表す画像特徴がある場所のと⼀致する. 0 0 0 0 0 1 2

18.

畳み込み層の役割 • 畳み込み層は画像の局所特徴を捉える.

19.

Maxプーリング 抜き出す 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 2 最⼤値を取る 2 2 0 1 特徴マップに⼊れる 1 1 1 1 0 2 1 0 1 2 2 2 3 2 0 2 1 1 1 2 2 2 特徴マップ 特徴マップ 特徴マップをあるサイズで切り取り,その中で最⼤の値を抽出し,その値を新たな特徴マップ に⼊れる.

20.

プーリング 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 特徴マップ 0 0 1 1 1 0 1 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 特徴マップ 場所をずらし最⼤値を⾏っていく.この計算をプーリング, 特に最⼤値を取るのでMaxプーリングという.

21.

プーリングにより作成した特徴マップの⽐較 0 0 0 0 1 0 1 0 1 フィルタ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 畳み込み 画像 プーリング 0 0 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 0 0 1 1 1 0 1 0 0 0 1 1 2 2 0 1 2 2 4 2 1 2 2 4 4 4 2 2 2 2 2 1 0 2 2 4 4 4 1 2 1 1 2 1 0 2 3 3 3 2 0 0 1 0 1 0 0 1 0 1 2 2 3 2 2 0 2 3 3 3 3 0 0 1 2 3 2 2 2 3 3 3 3 0 0 0 0 0 1 2 0 0 0 0 1 2 3 0 0 2 3 2 2 0 1 3 1 1 1 1 0 1 0 1 2 1 1 0 1 2 1 1 2 1 1 0 0 1 2 2 1 0 3 3 3 3 3 3 3 3 3 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 プーリングにより,どのあたりに特徴があるかが分かる. 0 0 0 0 0 1 2

22.

プーリングの役割 • 畳み込みで,任意の特徴がある場所が分かる. • プーリングにより作成した特徴マップは,畳み込みで作成した特徴マ ップに⽐べ最⼤値を取る場所が広く,特徴がある場所が特定できない のではないか? 画像 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 フィルタ 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 プーリング 畳み込み 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 0 0 1 1 1 0 1 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 畳み込みによりとんがりがある場所がピンポイントに求まる. しかし,プーリングによりとんがりがある場所がぼやけているのではないか?

23.

プーリングの役割 画像 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 フィルタ 0 0 0 0 1 0 1 0 1 プーリング 畳み込み 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 2 1 2 1 0 1 2 2 2 0 0 3 2 0 2 1 0 0 0 1 2 2 2 0 0 1 1 0 2 1 2 1 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 横にずれた画像 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 1 画像が横にずれると畳み込みによる特徴マップの最⼤値の場所も横にずれる. しかし,プーリングで作成した特徴マップの最⼤値の場所は2つ同じままである.

24.

プーリングの役割 • プーリングは画像の位置ズレを吸収してくれる. • これは,畳み込みニューラルネットワークによる識別の位置普遍性を 実現している⼀つの要因かもしれない.

25.

全結合層 特徴マップ 画像 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 2 2 2 2 2 3 2 2 2 2 3 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 4 4 4 2 2 4 4 4 2 3 3 3 2 2 3 3 3 3 2 3 3 3 3 分類結果が出⼒ 3 3 3 3 3 3 3 3 3 2 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 全結合層は単なる多層パーセプトロンだと 思えば良い. 全結合層には特徴マップが⼊⼒される. 全結合層は特徴マップとラベルの関係を学 習する. つまり,全結合層は特徴マップをクラス分 けする識別問題を解いている. 特徴マップを⼊⼒ 全結合層

26.

畳み込みニューラルネットワークの学習 • 予め画像の特徴が分かり,効果的なフィルタ(基底関数)を⽤意でき ればよいがそうではない. • 深層ニューラルネットワークでは,画像の特徴を捉えるフィルタを学 習により獲得する.

27.

Visualizing Understanding Convolutional Networks Visualizing and and Understanding Convolutional Networks Visualizing and Understanding Convolutional Networks 畳み込みニューラルネットワーク 出⼒ ⼊⼒ Figure 3. Architecture our 8 layer convnet model. Aby 224 by 224 crop an image 3 color planes) isaspresented Figure Figure 3. Architecture of our 8oflayer model. A 224 by 224 crop ofcrop an image (with 3(with color(with is presented 3. Architecture ourof8convnet layer convnet model. A 224 224 of an of image 3planes) color planes) is presented as as the input. This iswith convolved with 96 1st (red), layer (red), each of7using size 7 aby 7, using of 2 in y. both the input. This is This convolved 96with di↵erent 1stdi↵erent layer each size of 7 by 7, stride 2ainstride both x both and the input. is convolved 96 di↵erent 1stfilters layer filtersfilters (red),of each size by 7, using a of stride of 2 in x andxy.and y. The resulting feature maps are then: (i) passed through a rectified function (not (ii) pooled within The resulting feature maps are then: passed through a rectified linear function (not shown), (ii) shown), pooled (max within The resulting feature maps are (i) then: (i) passed through a rectified linearlinear function (not shown), (ii) pooled (max(max within 3x3 regions, using stride 2) and (iii) contrast normalized across feature maps to give 96 di↵erent 55 by 55 element feature 3x3 regions, using stride 2) and (iii) contrast normalized across feature maps to give 96 di↵erent 55 by 55 element feature 3x3 regions, using stride 2) and (iii) contrast normalized across feature maps to give 96 di↵erent 55 by 55 element feature maps. Similar operations are in layers The last are twofully layers are fully connected, taking features maps. maps. Similar operations are repeated in repeated layers The2,3,4,5. last two layers taking features from Similar operations are repeated in 2,3,4,5. layers 2,3,4,5. The last two layers areconnected, fully connected, taking features from from theconvolutional top convolutional layer as input in vector · 6 ·=256 = 9216 dimensions). Theisfinal layer is a C-way softmax the topthe convolutional layer aslayer input vector form (6form · 6 ·form =· 256 9216 dimensions). The final a C-way softmax top as in input in vector (6256 · 6(6 9216 dimensions). Thelayer final layer is a C-way softmax Cnumber being the number of classes. Allfeature filters and maps square in shape. function, C function, being of classes. All filters mapsfeature are square inare shape. function, C the being the number of classes. All and filters and feature maps are square in shape. Layer 1 Layer 1 Layer 1 Layer 2 Layer 2 Layer 2 Layer 3 Layer 3 Layer 3 Layer 4 Layer 4 Layer 4 Layer 5 Layer 5 Layer 5 (Zeiler and Fergus 2013) Figure 4.ofEvolution of achosen randomly chosen subset of model features through training. layer’s features are displayed Figure Figure 4. Evolution a randomly subset of model features through training. Each layer’s features are displayed 4. Evolution of a randomly chosen subset of model features through training. Each Each layer’s features are displayed in block. a di↵erent block. block, we show achosen randomly chosen subset of epochs features at epochs [1,2,5,10,20,30,40,64]. in a di↵erent Within eachWithin block, we show randomly subset of features at [1,2,5,10,20,30,40,64]. in a di↵erent block. Within each each block, weashow a randomly chosen subset of features at epochs [1,2,5,10,20,30,40,64]. The visualization shows the strongest activation (across all training examples) for a given projected The visualization shows the strongest activation (across all training examples) for a given map,feature projected down to The visualization shows the strongest activation (across all training examples) for afeature given feature map, map, projected downdown to to pixel space deconvnet Color contrast is artificially and theand figure isfigure bestfigure viewed in electronic pixel space using ourapproach. deconvnet approach. contrast isenhanced artificially enhanced and the is viewed best viewed in electronic pixelusing spaceour using our deconvnet approach. ColorColor contrast is artificially enhanced the is best in electronic form. form.form. ⼊⼒に近い層では画像を形作る線分の特徴が抽出され,上位層に⾏くに 従い下位層で抽出された情報を組み合わせた抽象的な情報になっていく.

28.

畳み込みニューラルネットワーク Convolutional Deep Belief Networks for Scalable Unsupervised Le Table 2. Test error for MNIST data Labeled training samples 1,000 2,000 CDBN 2.62±0.12% 2.13±0.10% 1 3.21% 2.53% Ranzato et al. (2007) Hinton and (2006) Convolutional Deep Belief Networks for Salakhutdinov Scalable Unsupervised Learning of Hierarchical Weston et al. (2008) 2.73% Table 2. Test error for MNIST dataset Labeled training samples 1,000 2,000 3,000 5,000 CDBN 2.62±0.12% 2.13±0.10% 1.91±0.09% 1.59±0.11% 3.21% 2.53% 1.52% Ranzato et al. (2007) Hinton and Salakhutdinov (2006) Convolutional Deep Belief Networks for Scalable Unsupervised Learning of Hierarchical Representations Weston et al. (2008) 2.73% 1.83% - 出⼒ ⼊⼒ are not conditionally independent of one another given the layers above and below. In contrast, our treatment using undirected edges enables combining bottom-up and top-down information more efficiently, as shown in Section 4.5. faces le Unsupervised Learning of Hierarchical Representations ven ment -up own s to ers; the ayer ght- In our approach, probabilistic max-pooling helps to address scalability by shrinking the higher layers; weight-sharing (convolutions) further speeds up the algorithm. For example, inference in a three-layer network (with 200x200 input images) using weightsharing but without max-pooling was about 10 times slower. Without weight-sharing, it was more than 100 times slower. In work that was contemporary to and done independently of ours, Desjardins and Bengio (2008) also applied convolutional weight-sharing to RBMs and experimented on small image patches. Our work, however, develops more sophisticated elements such as probabilistic max-pooling to make the algorithm more scalable. Figure 2. The first layer bases (top) and the second layer bases (bottom) learned from natural images. Each second layer basis (filter) was visualized as a weighted linear combination of the first layer bases. (Lee etthe al.third 2009) Figure 3. Columns 1-4: the second layer bases (top) and layer b categories. Column 5: the second layer bases (top) and the third layer bas object categories (faces, cars, airplanes, motorbikes). ⼊⼒に近い層では画像を形作る線分の特徴が抽出され,上位層に⾏くに 従い下位層で抽出された情報を組み合わせた抽象的な情報になっていく. 4. Experimental results 4.1. Learning hierarchical representations from natural images We first tested our model’s ability to learn hierarchical representations of natural images. Specifically, we unlabeled data do not share the same class labels, or the same generative distribution, as the labeled data. This framework, where generic unlabeled data improve performance on a supervised learning task, isFigure known 3. Columns 1-4: the second layer bases (top) and the third layer bases (bottom) learned f as self-taught learning. In their experiments, they used categories. Column 5: the second layer bases (top) and the third layer bases (bottom) learned from sparse coding to train a single-layer representation, and then used the learned representation to construct object categories (faces, cars, airplanes, motorbikes). features for supervised learning tasks. We used a similar procedure to evaluate our two-layer 注:画像はconvolutional deep belief networkのもの

29.

データ多様体 • ⾼次元データは,⼀般的に低次元の構造,すなわち低次元なデータ多様体を形成している. • 例えば,図に⽰した5という数字の画像では,数字は同じだが,向き,⽔平位置,垂直位置が異なる だけである. • つまり,図の場合,データは3⾃由度しかなく,データは⾼次元空間に埋め込まれた3次元多様体にあ るといえる. • この様に,データ多様体は通常データ空間に⽐べ遥かに低次元だから,データ多様体に適合した基底 関数を使えばより低次元多様体上で分類できる. • ニューラルネットワークはデータ多様体に適応した基底関数のセットを学習する. • さらに,ニューラルネットワークはデータ多様体の次元の中で,出⼒に必要な次元も学習する. • これらの機能のお陰で,ニューラルネットワークは画像のような⾼次元データの分類タスクで⾼い性 能を⽰すことができる.

30.

階層表現 • 深層ニューラルネットワークでは初期の層でエッジなどの低レベルの特徴を検知す る. • 後続の層でタスクに必要な低レベルな特徴を組み合わせた⾼レベルな特徴を作る. • これは,⼈の顔のようなより⾼レベルなオブジェクトは⽬などのより低レベルなオ ブジェクトで構成され,更に⽬などはエッジなどのより低レベルな要素を持つとい う,構成的帰納バイアス(compositional inductive bias)と⾒なすことができる. • 特徴や要素の組み合わせの可能性の数は深さが増すに連れ指数関数的に増加する. • ニューラルネットワークは,このような階層的表現を通し出⼒と⼊⼒空間を関連付 ける.

31.

分散表現 • ニューラルネットワークの隠れ層の各ニューロンは各階層のレベルに応じた特徴を表すと 考えられる. • ニューロンの活性が⾼ければ,それに対応する特徴が⼊⼒に含まれることを意味する. • 例えば,顔分類をするニューラルネットワークならば,ある層でメガネをかけているかど うかやヒゲを⽣やしているかどうかを捉えるニューロンがあるかもしれない.さらに,上 位層では,それらの特徴を組み合わせた特徴を捉えるニューロンもあるかもしれない. • 顔の特徴を捉えるニューロンはそれぞれ独⽴に存在し(活性は独⽴ではないだろう),そ れぞれに対応した特徴が⼊⼒にある場合,それぞれのニューロンの活性が⾼くなる. • つまり,それぞれの層で顔の特徴がネットワーク上で分散して表現されている. 活性が⾼くなる ヒゲ メガネ ユニット ユニット 活性が⾼くなる ヒゲ メガネ ユニット ユニット

32.

表現学習 • 畳み込みニューラルネットワークの最終層は全結合層となっている. • これは分類を⾏う多層パーセプトロン(MLP)である. • MLPは,その直前の層で抽出された⼊⼒の特徴を⽤い分類を⾏う. • つまり,畳み込みニューラルネットワークは,MLPがタスクを容易に ⾏えるようにするための⼊⼒と特徴の変換を学習により獲得する. • これを表現学習と呼ぶ.

33.

転移学習 • あるタスクで獲得した内部表現は,他の関連したタスクにも役⽴つことがある. • ⼀般的な⾃然画像の分類タスクのために訓練されたニューラルネットワークの内部表現(それが捉えられる 特徴)は,他の画像分類にも使えるだろう. • なぜならば,画像にはタスクによらない共通した特徴が存在することが予想されるため(特に低レベルの特 徴においては). • 内部表現を⽤いて,他の画像分類タスクを解くためにはどうすればよいか? • 最終の分類層(場合によっては上位の特徴抽出層を含む)を他の画像分類タスク向けに再訓練すれば良い. • これを転移学習という. • 病変の画像分類をそれのみで構成される⼩さなデータセットを⽤いニューラルネットワークを訓練しても精 度が出ないかもしれない. • ⼀⽅,事前に⼀般的な⾃然画像で訓練(事前訓練,pre-treining)し病変の画像分類のために再訓練(finetuning)をすれば,精度が向上するかもしれない. tree cat cancer normal ... dog ⾃然画像で訓練したニューラルネットワーク 病変の分類のために,事前訓練をしたネットワークを 分類層(⻘)のみ再学習する.

34.

脳の視覚処理

35.

⼈間の視覚処理 第⼀次視覚野:V1 ITの構造 (Tanaka, 2003) (Kandel) 下側頭葉:IT (inferior temporal cortex) Figure 25-12 Possible functions mediated by the two pathways connecting visual processing centers in the cerebral cortex. The icons represent salient physiological properties of cells in these areas. On the top is the pathway extending to the posterior parietal cortex, which is thought to be particularly involved in processing motion, depth, and spatial information. On the bottom is the pathway to the inferior temporal cortex, which is more concerned with form and color. Feeding into those two cortical pathways are the P and M 腹側経路 pathways from the retina. (MT = middle temporal; LGN = lateral geniculate nucleus.) (Adapted from Van Essen and Gallant 1994.) V1の構造 (Carlson) V2 V4 網膜 V1 IT LGN 組み合わ 組み合わ センサ 基本画像 features—movement, depth, form, and color. To ⾓度 express the specific combination of properties in the visual field at any given moment, せ せ independent groups of cells with different functions must temporarily be brought into association. As a result, there must be a mechanism Instead, as we have seen in this chapter, visual images typically are built up from the inputs of parallel pathways that process different by which the brain momentarily associates the information being processed independently by different cell populations in different cortical regions. This mechanism, as yet unspecified, is called the binding mechanism.

36.

単純型細胞と複雑型細胞 複雑型細胞 単純型細胞 CNNのプーリングに対応 メキシカンハット型フィルタ ON中⼼OFF周辺型受容野 (Kandel) CNNのフィルタに対応 ガボールフィルタ メキシカンハット型受容野を持つ細胞を束ねることで,線分をとらえる. 第1次視覚野の受容野はガボールフィルタに似ている. 深層ニューラルネットワークにおいても,下層でガボールフィルタに 似たフィルタが形成されることが確認されている. (Kandel) 線分に対し横断的に応答 する.

37.

Neocognitron(Biolcybern1980) • HubelとWieselの視覚の研究がベースとなる • 単純型細胞に対応したS-cellsで構成されるUs層と複雑型細胞 に対応したC-cellsで構成されるUc層がある. • Us層は畳み込み層,Uc層はプーリング層に対応する. 198 S-layer f I "/i" j S-plane P "-- ~ ~ S-column ^ Us2 ネオコグニトロンの仕組 ki=I み(Fukushima, 1980) UsI Ucl Fig. 4. Relation between S-planes and S-columnswithin an S-layer ネオコグニトロンの構造 only one candidate appears in an S-plane, the (福島, case 2017) なぜNeocognitronと⾔うのか? Cognitronのニューバージョンだから.

38.

下側頭葉での情報表現 (Inferior temporal cortex: IT) • ITでは視覚情報が単純な図形で表現される. • 脳でも上位の層では抽象化が起こる. cells, which represent different features contained in the object image, is necessary. This image reduction method has limitations. The initial sur vey of effective stimuli cannot cover the entire variety of objects existing in the world, so we may miss some very effective features. In addition, the tested methods of reducing the complexity of effective object images are limited by the available time of continuous recording from a single cell and also by the imagination of the experimenter. Because of these limitations, the objectivity of this method for determining optimal features has sometimes been questioned. However, alternative methods also have limitations. For example, some studies have used 細胞ごとに異なる図形特徴に反応する of complex shapes, sufficiently complex for the activation of most TE cells. Faces and Other Extensively Learned Objects Although the critical features for the activation of TE cells are only moderately complex in general, there are cells that respond to faces and critically require nearly all the essential features of the face. Such cells were originally found deep in the superior temporal sulcus (Bruce et al., 1981; Perrett et al., 1982), but they have also been found in TE (Baylis et al., 1987). Thus, there is more convergence of information to single cells for Downloaded from https://academic.oup.com/cercor/article-abstract/13/1/90/354662 by guest on (⽥中,認識と⾏動の科学) (Tanaka, 2003) Figure 1. Examples of reductive determination of optimal features for 12 TE cells. The images to the left of the arrows represent the original images of the most effective object stimulus and those to the right of the arrows, the critical features determined by the reduction. カラム構造をしている. (Tanaka, 2003)

39.

残差接続

40.

多層ニューラルネットワークの学習の困難 • 深層ニューラル ネットワークの表現⼒は,主に多層処理に由来してい る. • ネットワーク内の多層化が汎化パフォーマンスが⼤幅に向上させるこ とが観察される. • しかし,多層のニューラルネットワークの学習は困難である. • この困難の 1 つの説明は,shattered gradient (Balduzzi et al.,2017) である.

41.

Shattered gradient • ニューラルネットワークの表現⼒は深さに対して指数関数的に増加す る. • ReLU 活性化関数を使⽤すると,ネットワークが表現できる線形領域 の数が指数関数的に増加する. 多層化すると,⼊⼒に対し出⼒が線形である線形領域が細か くなり,複雑な関数を作り出すことができる.つまりReLU を使うと,線形関数の組み合わせで複雑な関数を作るという ことである. • ただし,この結果,誤差関数の勾配の不連続性が増⼤する. • 線形領域をまたぐとき勾配は不連続になるだろう.

42.

Shattered gradient • 図は⼀つの⼊⼒と⼀つの出⼒についてネットワークの導関数をプロット したものである. • 微積分の連鎖則から,これらの導関数は誤差関数表⾯の勾配を決定する. gradient gradient gradient • 図から,深いネットワークの場合,ネットワークの初期層の重みパラ メータの極めて⼩さな変化が,勾配に⼤きな変化を引き起こす可能性が あることが分かる. input input 2層ニューラルネットワーク 25層ニューラルネットワーク (a) (b) input 残差接続を伴う51層ニューラルネットワーク (c)

43.

Shattered gradient • 反復勾配ベースの最適化アルゴリズムは,勾配がパラメーター空間全 体で滑らかに変化することを前提としているため,この「shattered gradient」効果により,⾮常に深いネットワークではトレーニングが 無効になる可能性がある.

44.

残差接続 • ⾮常に深いネットワークの訓練に⼤いに役に⽴つニューラルネ ット ワークのアーキテクチャに対する重要な変更は,残差接続である (He et al., 2015a) . • これは,スキップ層接続の特定の形式である. x F1 + z1 F2 + z2 F3 + y

45.

残差接続 • ニューラルネットワークは次に⽰す⼀連の 3 つ層で構成されるとする. • 𝐳! = 𝐅! 𝐱 • 𝐳" = 𝐅" 𝐳! x F1 + z1 F2 + z2 F3 + • 𝐲 = 𝐅# 𝐳" • ここで,関数𝐅$ (⋅) は,単に線形変換とそれに続くReLU 活性化関数から構成される場合もあれば,複 数の線形,活性化関数,および正規化層を含むより複雑な場合もあるだろう. • 残差接続は,各関数への⼊⼒を出⼒に追加して返すだけで構成される. • 𝐳! = 𝐅! 𝐱 + 𝐱 • 𝐳" = 𝐅" 𝐳! + 𝐳! • 𝐲 = 𝐅# 𝐳" + 𝐳" • 𝐳! = 𝐅! 𝐱 + 𝐱など,関数と残差接続の各組み合わせは残差ブロックと呼ばれる. • ResNetとしても知られる残差ネットワークは,このようなブロックを順番に重ねた複数の層で構成 される. y

46.

残差接続 • 「残差」という⽤語は,各ブロックで関数が恒等マップ(identity map, 𝑓 𝑥 = 𝑥) と⽬的の出⼒の間の残差を学習するという事実を指す. • これは残差変換を並べ替えることで確認できる. • 𝐅! 𝐳!"# = 𝐳! − 𝐳!"# • 図のように,残差接続を伴うネットワークの勾配は,⼊⼒に対し過敏ではない. • また,右図のように,残留接続は誤差関数曲⾯をより滑らかにする効果がある. 誤差関数局⾯ gradient gradient gradient 導関数 input input input 2層ニューラルネット (a) ワーク 25層ニューラルネ (b) ットワーク 残差接続を伴う51層ニュ (c) ーラルネットワーク (a) 残差接続無し (b) 残差接続有り

47.

敵対的攻撃

48.

Fast Gradient Sign Method • ⼊⼒画像のピクセル値の変化に関する勾配を使⽤して,畳み込みネットワークに対 する敵対的攻撃を作成することができる (Szegedy et al., 2013). • これらの攻撃には,⼈間には知覚できないレベルで画像に⾮常に⼩さな変更を加え ることが含まれており,これにより画像がニューラル ネットワークによって誤分 類される. • 敵対的な画像を作成する簡単なアプローチの1つは,Fast Gradient Sign Method (FGSM)と呼ばれます (Goodfellow,Shlens, and Szegedy, 2014). • これには,画像𝐱内の各ピクセル値をピクセル値についての誤差関数𝐸(𝐱, 𝑡)の勾配 によって決定される符号を使⽤して固定量𝜖だけ変更することを含む. • これにより,次のように定義される変更されたイメージが得られる. • 𝐱 $ = 𝐱 + 𝜖 sign ∇𝐱 𝐸 𝐱, 𝑡 • ここで,𝑡は𝐱の真のラベルであり,誤差𝐸 𝐱, 𝑡 は,たとえば𝐱の負の対数尤度にで ある.

49.

Fast Gradient Sign Method • 必要な勾配は,バックプロパゲーションを使⽤して効率的に計算でき る. • FGSMでは,画像を誤差が⼤きくなるように (学習済みのネットワーク パラメーターを固定したまま) する. • 画像の各ピクセル値を間違えやすくなる⽅向(この⽅向は勾配から求めた 符号)に微⼩に変化させる. • 変更する量を⼩さく保つことで,画像の変化が⼈間の⽬には検出され ないようにすることができる. panda 57.7% gibbon 99.3%

50.

誤認識問題 • この問題は,⾼い能⼒を持つモデルが特定の画像に正確に適応し,⼊⼒の⼩さな変 化によって予測クラス確率に⼤きな変化を与えるオーバーフィッティングから発⽣ しているように⾒えるかもしれない. • しかし,特定のトレーニング済みネットワークに対して偽の出⼒を与えるように調 整された画像は,他のネットワークに供給されたときに同様に偽の出⼒を与える可 能性があることが判明している(Goodfellow, Shlens, and Szegedy, 2014). • さらに,柔軟性がはるかに低い線形モデルでも同様の敵対的な結果が得られる. • 図のように, 通常の,改ざんされていない画像であっても,誤った予測を⾏うよ うな物理的な物体を作成することも可能である. • これらの結果の意味を理解し,潜在的な落とし⽳を軽減することは.依然として未 解決の研究課題である. これらの画像は畳み込みニューラルネ ットワークにより45mph速度制限の標 識として堅牢に識別される.

51.

モデル平均

52.

アンサンブル • 同じ問題を解決するために複数の異なるモデルをトレーニングした場 合,単⼀の最適なモデルを選択しようとする代わりに,個々のモデル によって⾏われた予測を平均することで汎化能⼒を改善できることが よくある. • このようなモデルの組み合わせは,アンサンブルと呼ばれることもあ る. • 確率的な出⼒を⽣成するモデルの場合、予測分布は各モデルからの予 測の平均となる. & ' • 𝑝 𝐲 𝐱 = ∑'()& 𝑝( 𝐲 𝐱 • ここで,𝑝( 𝐲 𝐱 はモデル𝑙の出⼒,𝐿はモデルの総数である.

53.

ブートストラップデータセット • もちろん実際には,データセットは 1 つだけなので,アンサンブル内の異なるモデ ル間に変動を導⼊する必要がある. • 1 つのアプローチは,ブートストラップデータセットを使⽤することである. • ブートストラップデータセットでは,次のように複数のデータ セットを作成する. • 元のデータセットが𝑁個のデータ点𝐗 = 𝐱! , … , 𝐱 " で構成されているとする. • 𝐗からランダムに𝑁点を抽出し,新たなデータセット𝐗 # を作成する. • このプロセスを𝐿回繰り返すと,元のデータセット𝐗からのサンプリングによって取得され たサイズ𝑁の𝐿データセットを⽣成できる. • それぞれのデータセットは重複するデータ点もあるが,そうでないデータ点もあり,多様性 を持っている. • その後,各データセットをモデルの訓練に使⽤し,得られたそれぞれのモデルの予 測を平均する. • この⼿順は,ブートストラップ集約またはバギングとして知られている. (Breiman、1996).

54.

異なったアーキテクチャを持つモデルのアンサンブル • アンサンブルを形成するための別のアプローチは,元のデータセットを使⽤して,異なるアーキテクチャを 持つ複数の異なるモデルを訓練することである. • ⼊⼒ベクトル𝐱と単⼀の出⼒変数𝒚を使⽤した回帰問題を考え,アンサンブル予測の利点を分析してみる. • 訓練されたモデルのセット𝑦! 𝐱 , … , 𝑦" 𝐱 があると仮定する. • そして次の式で与えられるアンサンブル予測を形成する. ! • 𝑦#$" 𝐱 = " ∑" %&! 𝑦% 𝐱 • 予測しようとしている真の関数がℎ(𝐱)で与えられる場合,各モデルの出⼒は真の値と誤差を加算したものと して書くことができる. • 𝑦% 𝐱 = ℎ 𝐱 + 𝜖% 𝐱 • 平均⼆乗和誤差は次の形式になる. • 𝐸𝐱 𝑦% 𝐱 − ℎ 𝐱 ( = 𝐸𝐱 𝜖% 𝐱 ( • ここで𝐸𝐱 ⋅ は,⼊⼒ベクトル𝐱の分布に関する頻度主義的な期待値を表す. • したがって,個別に動作するモデルによって⽣じる平均誤差は次のようになる. ( • 𝐸)* = 1/𝑀 ∑" %&! 𝐸𝐱 𝜖% 𝐱

55.

異なったアーキテクチャを持つモデルのアンサンブル • アンサンブルからの予想誤差は次の式で与えられる. • 𝐸&'( = 𝐸𝐱 # ( ∑ 𝑦 𝐱 ( )*# ) −ℎ 𝐱 + = 𝐸𝐱 # ( ∑ 𝜖 𝐱 ( )*# ) + • 誤差の平均がゼロで相関関係がないと仮定すると, • 𝐸𝐱 𝜖) 𝐱 =0 • 𝐸𝐱 𝜖) 𝐱 𝜖! 𝐱 " = 0, 𝑚 = 1 • そして,我々は次の式を得る. • 𝐸&'( = # 𝐸 ( ,- 𝐸#$" = 𝐸𝐱 1 2 𝜖% 𝐱 𝑀 ( %&! " ". 1 1 1 = 2 𝐸𝐱 𝜖% 𝐱 ( + 2 𝐸𝐱 𝜖% 𝐱 𝜖, 𝐱 𝑀 𝑀 𝑀 %&! %,,,%-, = 1 𝐸 𝑀 )* • これは,𝑀個のモデルのバージョンを平均するだけでモデルの平均誤差を𝑀分の1に削減 できることを⽰唆する.残念ながら,これは個々のモデルによる誤差に相関がないとい う重要な前提に依存している.実際には,通常,誤差は⼤いに相関しており,全体的な 誤差の減少は⼀般にはるかに⼩さくなる.ただし,アンサンブルの予想誤差は構成モデ ルの予想誤差を超えないため,𝐸&'( ≤ 𝐸,- となることがわかる.

56.

ブースティング • 複数の「基本」分類器を組み合わせて,どの基本分類器よりもパフォーマンスが⼤ 幅に優れたアンサンブルを作る,ブースティング (Freund and Schapire, 1996) と いう多少異なるアプローチがある. • 基本分類器のパフォーマンスがランダムよりわずかに優れているだけであっても, ブースティングにより良好な結果が得られる. • ブースティングと,先に説明したバギングなどのアンサンブル⼿法の主な違いはつ ぎのとおりである. • 各基本分類器が順番にトレーニングされる. • 前に訓練した分類器の性能に依存して重み付けられたデータ点で構成されるデータセット を使⽤して訓練される. • 特に,基本分類器の1つによって誤って分類された点は,次の分類器をトレーニン グするために使⽤されるときに,より⼤きな重みが与えられる. • すべての分類器のトレーニングが完了すると,それらの予測は加重多数決スキーム を通じて結合される.

57.

Dropout

58.

Dropout • 任意の確率でユニットの出⼒を0(ユニットを無効化する)にすること をDropboutという. • 通常,学習時に⽤いられる.テストデータに使うと性能は落ちるだろう. • 過学習を抑えるために⽤いられる. • 過学習とは,訓練データを過剰に学習してしまい訓練データの識別は正確 に⾏えるが,テストデータに対する識別能⼒が低くなる現象のこと.

59.

Dropout • ドロップアウトとして知られる⾮常に効果的な形式の正則化 (Srivastava et al., 2014) がある. • これは,複数のモデルを個別にトレーニングすることなく指数関数的に多くのモデルに対して近似モ デルの平均化を実⾏する暗黙的な⽅法とみなすことができる. • 適⽤範囲が広く,計算コストも安価である. • ドロップアウトは単純で,訓練中に接続を含むノードをネットワークからランダムに削除する(出⼒ をゼロにする) ことである. • データ点がネットワークに提⽰されるたびに,どのノードを省略するかが新たにランダムに選択され る. 出⼒ 0 0.4 0 出⼒ 1 0.4 0.2 0.8 0.8 Dropout (Srivastava et al., 2014) Dropoutにより点線の 出⼒は0となった.

60.

Dropout • 訓練中に各データ点がネットワークに提⽰されると,その都度ランダムにニューロンが無効化され, その枝刈りされたネットワークに順⽅向および逆⽅向の伝播ステップが適⽤される. • そして,誤差関数勾配が作成され,たとえば確率的勾配法を⽤いて重みを更新する. • データポイントがミニバッチにグループ化されている場合,重みの更新を適⽤する前に,各ミニバッ チ内のデータポイントの勾配が平均化される. • 隠れ層のユニットが𝑀個あるネットワークの場合,2% の刈り込みネットワークが存在するため,訓 練中にこれらのネットワークのごく⼀部のみが考慮される. ユニットがM個あり,それぞれのユニットが有効か無効かの2状態 あると考えると,すべての有効,無効のパターンは2!⼦になる. • これは,アンサンブル内の各ネットワークが個別に訓練される従来のアンサンブル⼿法とは異なる. • もう 1 つの違いは,ドロップアウトを使⽤して暗黙的にトレーニングされている指数関数的に多く あるネットワークはそれぞれ独⽴しておらず,パラメーター値を互いに共有している. • パラメータの更新には⾮常に多くのノイズが伴うため,ドロップアウトを⽤いると訓練に時間がか かる可能性がある. • また,誤差関数は本質的にノイズが多いため,訓練中に減少する誤差関数を観察するだけでは,最適 化アルゴリズムが正しく機能しているかどうか確認するのが困難である.

61.

モンテカルロドロップアウト • 訓練が完了したあとも,Dropoutを原理的にアンサンブルルールを適⽤す ることで予測を⾏うことができる. • この場合,次の式となる. • 𝑝 𝐲 ∣ 𝐱 = ∑𝐑 𝑝 𝐑 𝑝 𝐲 𝑥, 𝐑 • ここで,合計は指数関数的に⼤きなマスク空間(ユニットの有効無効の状 態)にわたるもので, 𝑝 𝐲 𝑥, 𝐑 はマスク𝐑を使⽤したネットワークから の予測分布である. • この合計の計算は難しいため,少数のマスクをサンプリングすることで近 似する.実際には,良好な結果を得るには10枚または20枚のマスクで⼗分 である. • この⼿順はモンテカルロドロップアウトとして知られている.

62.

簡単なアプローチ • さらに簡単なアプローチは,ノードをマスクアウトせずに訓練済みの ネットワークを使⽤して予測を⾏う. • そして,各ノードへの予想される⼊⼒がテスト中と訓練中のものとほ ぼ同じになるようにネットワークの重みを再スケールする. • 訓練中に⼀部のノードが⽋落する可能性があるため,出⼒が減るだろう. その分スケールして調整する. • したがって,訓練中にノードが確率𝜌で存在する場合,テスト中にネッ トワークを使⽤して予測を⾏う前に,そのノードからの出⼒重みに𝜌 をかける.

63.

Dropoutの解釈 • ベイズ主義の観点からは,ドロップアウトの別の動機が考えられる. • 完全なベイズ的な取り扱いでは,各ネットワークを事後確率で重み付 けし,考えられるすべての21 ネットワークモデルを平均することに よって予測を⾏う. 𝑝 𝐲 𝐱, 𝐷 = '𝑝 𝐲 𝐱, 𝜃 𝑝 𝜃 𝐷 𝑑𝜃 各ネットワ ークの予測 事後分布 • この計算は,事後確率を評価する訓練時と,加重予測を計算するテス ト時の両⽅で,⾮常に⾼価なものとなる. • ドロップアウトは各可能なモデルに等しい重みを与えることで,この 𝑝 𝐲 ∣ 𝐱 = 1 𝑝 𝐲 𝐱, 𝜃𝐑 𝑝 𝜃𝐑 モデル平均を近似する. 5𝐑 𝑝 𝜃𝐑 はすべて同じ確率

64.

ドロップアウトの直感的機能 • ドロップアウトのさらなる直観的な背景には,過学習の軽減という役 割がある. • 標準的なネットワークでは,個々のデータ点のノイズに合わせてパラ メータが調整され,隠れ層のノードが過剰に特化してしまうことがあ る. • 各ノードは他のノードの出⼒に基づいて誤差を最⼩限に抑えるように 重みを調整するため,新しいデータには汎化できないようなノードの 共適応につながる. • ドロップアウトでは,各ノードは他の特定のノードに頼ることができ ず,代わりに幅広いコンテキストで有益な貢献をしなければならない ため,共適応と特化が軽減される.

65.

まとめ

66.

なぜ今更ニューラルネットワーク • 現在のディープラーニングの原型である福島やLeCunのモデルは1980年代にはす でに発表されていた.なぜ2010年前後から急にディープラーニングが発展・普及 したのか? • データの充実 • インターネット,ビッグデータ • コンピュータの⾼速化 • 膨⼤なデータを巨⼤なニューラルネットワークで学習するために必要な計算が実⽤的な時 間でできるようになった(GPGPUの発展により). • 簡単に使える • 開発環境が充実し開発が⽤意になった. • ⼿法の改善 • 他の⼿法の⼿詰まり感

67.

深層ニューラルネットワークの何が良い • ⾼性能 • データの特徴を解析しなくて良い? • 畳み込みニューラルネットワークではコンピュータが勝⼿に画像の特徴を抽出 すると⾔われている. • とはいえ,そうはうまく⾏かない. • 導⼊が簡単 • 有名なモデルは開発環境に元々⼊っている. • 開発環境に⼊っていないものもオープンソースで公開されていることが多い. • 中⾝が分からなくても,専⾨家でなくても使える. • 学習済みモデルが公開されており,すぐに⾼性能なモデルを使うことができる.

68.

深層ニューラルネットワークは使えるのか • 使うためには • プログラミング⾔語であるPythonが使える. • 多少のニューラルネットワーク⽤語を知っている. • 技術内容の雰囲気を掴んでいる. • ゲーム⽤GPUを搭載したPCを持っている. • つまり,やる気さえあれば誰でも使える. • 浅い理解をするためには • 線形代数,微分積分,確率,統計が必要. • いずれも⾼校レベルの数学を理解していれば何とかなる(と思う).

69.

深層ニューラルネットワークの注意 • これなら間違いないという技術は無いと思おう • まだ発展途上の技術である.. • 今⽇習ったことが明⽇古いということがあるかもしれない. • 深層ニューラルネットワークに詳しくあろうとするためには⽇々勉強が必 要である. • つぎのものがあれば誰にでもチャンスは有る. • やる気,思いつき,スピード,暇,インターネット,ゲーミングPC

70.

深層ニューラルネットワークの技術的問題 • 軽量,⾼速,⾼性能なディープラーニングの技術の要望 • IoT機器,エッジで処理したい. • ラベル付きデータが不⾜した場合の対応 • 動物はデータが少なくても学習できる? • モデルが⼤きすぎて問題が起きた時に原因を特定しにくい. • GoogleのAIは⼈をゴリラと何故間違えたのか? • ⼊⼒を少し変えるだけで,別物と識別される. panda 57.7% gibbon 99.3% • 転移学習 • ある問題を解決する機械を他の問題に転⽤できるか? • 抽象的な命令を理解できるか? もうできそう.

71.

脳と深層ニューラルネットワークは違う • 深層ニューラルネットワークのニューロンは動的な応答をしない. • そんなに脳は深いのか? • ⼀つの判断に500msかかるとする (遅めに設定) .1スパイクを送るため に必要な時間が10msだとすると判断に使えるネットワークの層の上限は 50ということになる. • 脳はReLUを使っているのか? • Sigmoid関数の⽅が神経細胞の性質と合っているのでは. • 脳はバックプロパゲーションを使っているのか? • 脳の学習はHebbian learningが基本ではないのか.