Top Banner
Chapter 4. Deep Learning tomoaki_teshima ココココココココココココココココ 6 ココ 4 コ §1.1. … §2.1.
39

Cvim saisentan-6-4-tomoaki

Aug 19, 2014

Download

Engineering

tomoaki0705

関東CV勉強会第23回の発表資料
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cvim saisentan-6-4-tomoaki

Chapter 4. Deep Learning

tomoaki_teshimaコンピュタービジョン最先端ガイド 6 巻第 4 章

§1.1. … §2.1.

Page 2: Cvim saisentan-6-4-tomoaki

全体の流れ

•Deep Learning の紹介• ILSVRC の衝撃• その後の快進撃

•Deep Learning で達成したが、Neural Network ではできなかったこと• NN 冬の時代

•Neural Network(NN) の紹介• 基本的な仕組み• 学習方法

Page 3: Cvim saisentan-6-4-tomoaki

Super Vision (Deep Learning) の逆襲

ImageNet Large Scale Visual Recognition Competition 2012 (ILSVRC2012)http://image-net.org/challenges/LSVRC/2012/results.html

Supe

rVision

Supe

rVision ISI ISI ISI ISI

OXFORD_V

GG

XRCE/INRIA

OXFORD_V

GG0

0.050.1

0.150.2

0.250.3

Classification Error (5 guesses)

Supe

rVision

Supe

rVision

OXFORD_V

GG

OXFORD_V

GG

OXFORD_V

GG

OXFORD_V

GG ISI ISI0

0.10.20.30.40.50.6

Localization Error (5 guesses)

Page 4: Cvim saisentan-6-4-tomoaki

Deep Learning の Debut深イイ学習= deep learning の話http://togetter.com/li/387872

Page 5: Cvim saisentan-6-4-tomoaki

いきなり ILSVRC で Debut した訳ではない

Why does deep learning require the construction of generative data models?http://www.quora.com/Why-does-deep-learning-require-the-construction-of-generative-data-models2010 年 5 月“2009 年半ばぐらいから delicious のエントリーに Deep Learning の名前を良く見るので気になっていた.”http://d.hatena.ne.jp/repose/20110112/12948373322011 年 1 月 12 日

1940 1980 1990 2010

Deep learning逆伝播法NN 冬の時代

Neocognitron(1982)CNN(1989) DBN(2006)

Page 6: Cvim saisentan-6-4-tomoaki

Deep Learning の何がすごいのか?

画像

特徴量

認識結果分類結果

画像

認識結果分類結果

特徴量抽出

マッチング

Deep Learning

Page 7: Cvim saisentan-6-4-tomoaki

特徴量職人の朝は早い

決定木職人の朝は早い。 (@sla)https://twitter.com/sla/status/166079710764335105ヒューリスティック職人の朝は早い。 (@tomerun)https://twitter.com/tomerun/status/192659930208141312アノテーション職人の朝は早い (@shuyo)中谷秀洋 Active Learning 入門http://www.slideshare.net/shuyo/introduction-to-active-learning-25787487

Page 8: Cvim saisentan-6-4-tomoaki

@ambee_whisper, Twitter / ambee_whisper: @shock_pan_man ...https://twitter.com/ambee_whisper/status/256039859528019968

Page 9: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep Learning

得居誠也 (@ beam2d), Deep Learning 技術の今http://www.slideshare.net/beam2d/deep-learning20140130

2013 年 3 月2013 年 4 月2013 年 8 月2013 年 10 月2013 年 12 月2014 年 1 月2014 年 4 月

:Google が DNN research を買収 (G.Hinton ら ):Baidu が Institute of Deep Learning を 設立:Yahoo が IQ Engines を 買収:Yahoo が LookFlow を 買収:Facebook が AI Lab を 設立 (Y.LeCun):Google が Deep Mind を 買収:Google Street View が CAPTCHA を 解読

Page 10: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningDNN Research

http://media.utoronto.ca/media-releases/u-of-t-neural-networks-start-up-acquired-by-google/March 12, 2013

Page 11: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningInstitute of Deep Learning

http://www.techinasia.com/baidu-opens-research-lab-california-deep-learning/ April 15, 2013

Page 12: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningYahoo IQ Engine

http://techcrunch.com/2013/08/23/yahoo-acquires-image-recognition-startup-iq-engines/August 23, 2013

Page 13: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningYahoo LookFlow

http://techcrunch.com/2013/10/23/yahoo-acquires-startup-lookflow-to-work-on-flickr-and-deep-learning/Oct 23, 2013

Page 14: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningFacebook AI Lab

https://www.facebook.com/yann.lecun/posts/10151728212367143December 10, 2013

Page 15: Cvim saisentan-6-4-tomoaki

まだまだ熱い Deep LearningGoogle DeepMind

http://techcrunch.com/2014/01/26/google-deepmind/January 26, 2014

Page 17: Cvim saisentan-6-4-tomoaki

Deep LearningTUEEEEEEEEE

Page 18: Cvim saisentan-6-4-tomoaki

全体の流れ

•Deep Learning の紹介• ILSVRC の衝撃• その後の快進撃

•Deep Learning で達成したが、Neural Network ではできなかったこと• NN 冬の時代

•Neural Network(NN) の紹介• 基本的な仕組み• 学習方法

Page 19: Cvim saisentan-6-4-tomoaki

NN 冬の時代

In 2000, it was even pointed out by the organizers of the Neural Information Processing System (NIPS) conference that the term “neural networks” in the submission title was negatively correlated with acceptance.In contrast, positive correlations were made with support vector machines (SVMs), Bayesian networks, and variational methods.

[11] Best Practices for Convolutional Neural Networks Applied to Visual Document Analysishttp://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.10.5032

Page 20: Cvim saisentan-6-4-tomoaki

冬の時代の理由

•3層より深い NN では汎化能力が上がらない

•学習の指針が謎

•計算量が多すぎる

Page 21: Cvim saisentan-6-4-tomoaki

訓練誤差

訓練誤差

訓練データ

正解データ

NN

訓練データ

出力

NN

Page 22: Cvim saisentan-6-4-tomoaki

汎化誤差 ( 汎化能力 )

訓練データ

正解データ

NN

未知のデータ

出力

NN

期待される結果

汎化誤差

汎化誤差が大きい←→過学習

Page 23: Cvim saisentan-6-4-tomoaki

全体の流れ

•Deep Learning の紹介• ILSVRC の衝撃• その後の快進撃

•Deep Learning で達成したが、Neural Network ではできなかったこと• NN 冬の時代

•Neural Network(NN) の紹介• 基本的な仕組み• 学習方法

Page 24: Cvim saisentan-6-4-tomoaki

NN ってなんだろう?A feedforward neural network is an artificial neural network where connections between the units do not form a directed cycle. This is different from recurrent neural networks.

The feedforward neural network was the first and simplest type of artificial neural network devised. In this network, the information moves in only one direction, forward, from the input nodes, through the hidden nodes (if any) and to the output nodes. There are no cycles or loops in the network.

http://en.wikipedia.org/wiki/Feedforward_neural_network

Page 25: Cvim saisentan-6-4-tomoaki

NN の基礎

入力から直接出力を求めるのではなく、中間層を入れる!

入力層

中間層

出力層

画像や音声など

出力。クラス分類の場合には、どのクラスに属するか。

Page 26: Cvim saisentan-6-4-tomoaki

重み係数とバイアス

ノードは値を持つ

重みとノードの値を掛け合わせる

パスは重みを持つ

バイアス項を足し合わせる

活性化関数を通す

Page 27: Cvim saisentan-6-4-tomoaki

活性化関数

Page 28: Cvim saisentan-6-4-tomoaki

順伝播•画像や音声を入力すれば対応する出力が決定する

•適切なパラメータ (w,b)を設定することで、様々な問題を表現できる

•どうやってパラメータを学習するのか?

Page 29: Cvim saisentan-6-4-tomoaki

どうやって学習すんの?

→Backpropagation  誤差逆伝播法× ごさぎゃくでんぱんほう

○ ごさぎゃくでんぱほう

適当な重みとバイアスを設定する

教師データと出力の誤差を計算する

訓練データから出力を計算する

誤差を最小化するように重みとバイアスを更新する

Page 30: Cvim saisentan-6-4-tomoaki

誤差逆伝播法

誤差に寄与する重みを小さくする正答に寄与する重みを大きくする

d( 正解 )

p( 計算結果 )

1 0

0.24 0.76

𝜕𝐶𝜕𝑤𝑖𝑗

= (𝑝𝑖−𝑑𝑖 )h 𝑗

増やすのか減らすのか

どのぐらい変化させるのか

(9)

Page 31: Cvim saisentan-6-4-tomoaki

出力層以外の重み係数の伝播法

この矢印は• 正答に寄与する

の?• 誤差に寄与する

の?

d

p

1 0

0.24 0.76

𝛿𝑖= 𝑓 ′ (𝑥 𝑖 )∑𝑙𝛿𝑙𝑤𝑙𝑖

シグモイド関数の微分

上の層からのフィードバック

(13)

Page 32: Cvim saisentan-6-4-tomoaki

中間層の係数の更新

𝜕𝐶𝜕𝑤𝑖𝑗

=𝛿𝑖h 𝑗

𝛿13 𝛿23

d

p

1 0

0.24 0.76(14)

𝜕𝐶𝜕𝑤𝑖𝑗

= 𝑓 ′ (𝑥 𝑖 )∑𝑙𝛿𝑙𝑤𝑙𝑖h 𝑗

上の層からのフィードバックの和をもとに係数の増減を決定する

Page 33: Cvim saisentan-6-4-tomoaki

ミニバッチで繰り返す

入力データ (1)

教師データ (1)

更新

入力データ (2)

教師データ (2)

更新

Page 34: Cvim saisentan-6-4-tomoaki

// backward pass, update weightsfor( i = l_count-1; i > 0; i-- ){ int n1 = layer_sizes->data.i[i-1], n2 = layer_sizes->data.i[i]; cvInitMatHeader( &_df, 1, n2, CV_64F, df[i] ); cvMul( grad1, &_df, grad1 ); cvInitMatHeader( &_w, n1+1, n2, CV_64F, weights[i] ); cvInitMatHeader( &_dw, n1+1, n2, CV_64F, dw->data.db + (weights[i] - weights[0]) ); cvInitMatHeader( x1, n1+1, 1, CV_64F, x[i-1] ); x[i-1][n1] = 1.; cvGEMM( x1, grad1, params.bp_dw_scale, &_dw, params.bp_moment_scale, &_dw ); cvAdd( &_w, &_dw, &_w ); if( i > 1 ) { grad2->cols = n1; _w.rows = n1; cvGEMM( grad1, &_w, 1, 0, 0, grad2, CV_GEMM_B_T ); } CV_SWAP( grad1, grad2, temp );}

OpenCV2.4.8opencv\sources\modules\ml\src\ann_mlp.cpp

calc_activ_func_deriv( x2, &_df, _w.data.db + _w.rows*_w.cols );cvInitMatHeader( grad1, 1, ovcount, CV_64F, buf_ptr );

微分を計算

(15)式の α(15)式の ε

Page 35: Cvim saisentan-6-4-tomoaki

多層 Neural Network•誤差が分散する

•入力層まで伝播しない

•過学習に陥る

Page 36: Cvim saisentan-6-4-tomoaki

まとめ

•NN( の多くは ) は入力層、出力層、隠れ層の3層からなり、それぞれの層をつなぐ経路の重みで出力が決定する

•重みの学習には、 Back Propagation(誤差逆伝播法)を使い、繰り返し係数を更新する

•中間層が3層以上になると、学習がうまくいかないことが多い

Page 37: Cvim saisentan-6-4-tomoaki

今日は Deep Learning の勉強会です!

•層が浅い

•層を深くすると•過学習がおきる•誤差の伝播が分散してしまう

•層が深い

•Dropout•層の結合を疎にする•オートエンコーダを用いる

Neural Network Deep learning, CNN

Page 38: Cvim saisentan-6-4-tomoaki

深イイ学習の解説にご期待ください!

http://togetter.com/li/387872https://twitter.com/dandelion1124/status/255700185089470464

Page 39: Cvim saisentan-6-4-tomoaki

参考文献ImageNet Large Scale Visual Recognition Competition 2012 (ILSVRC2012) http://www.image-net.org/challenges/LSVRC/2012/results.html

深イイ学習= deep learning の話

http://togetter.com/li/387872

Why does deep learning require the construction of generative data models? – Quora http://www.quora.com/Why-does-deep-learning-require-the-construction-of-generative-data-models

deep learning わからん & An Analysis of Single-Layer Networks in Unsupervised Feature Learning (NIPS2010) 読んだメモ - 糞ネット弁慶

http://d.hatena.ne.jp/repose/20110112/1294837332

@sla, Twitter / sla: 決定木職人の朝は早い。「まず適度に育ったやつ探すんだ」職人の ... https://twitter.com/sla/status/166079710764335105

@tomerun, Twitter / tomerun: ヒューリスティック職人の朝は早い。日が昇る頃にはエディタを起 ... https://twitter.com/tomerun/status/192659930208141312

中谷秀洋 , Active Learning 入門

http://www.slideshare.net/shuyo/introduction-to-active-learning-25787487

@ambee_whisper, Twitter / ambee_whisper: @shock_pan_man ... https://twitter.com/ambee_whisper/status/256039859528019968

得居誠也 (@ beam2d), Deep Learning 技術の今

http://www.slideshare.net/beam2d/deep-learning20140130

U of T neural networks start-up acquired by Google | University of Toronto Media Room http://media.utoronto.ca/media-releases/u-of-t-neural-networks-start-up-acquired-by-google /

Steven Millward , Baidu Opens Lab in Silicon Valley Devoted to Research into ‘Deep Learning‘ http://www.techinasia.com/baidu-opens-research-lab-california-deep-learning /

Chris Velazco, Yahoo Acquires Image-Recognition Startup IQ Engines To Improve Flickr Photo Organization & Search | TechCrunch http://techcrunch.com/2013/08/23/yahoo-acquires-image-recognition-startup-iq-engines /Yahoo Acquires Startup LookFlow To Work On Flickr And `Deep Learning’ | TechCrunch http://techcrunch.com/2013/10/23/yahoo-acquires-startup-lookflow-to-work-on-flickr-and-deep-learning/

Yann LeCun - Big news today! Facebook has created a new research...https://www.facebook.com/yann.lecun/posts/10151728212367143

Catherine Shu, Google Acquires Artificial Intelligence Startup DeepMind For More Than $500M | TechCrunch http://techcrunch.com/2014/01/26/google-deepmind /

Frederic Lardinois, Google Maps の Street View の画像認識アルゴリズムが CAPTCHA のほとんどを解読 ? TechCrunchhttp://jp.techcrunch.com/2014/04/17/20140416googles-new-street-view-image-recognition-algorithm-can-beat-most-captchas/

Best Practices for Convolutional Neural Networks Applied to Visual Document Analysis http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.10.5032