はじめに
Deep Learning Specialization の Course 3, Week 2 (C3W2) の内容です。
(C3W2L01) Carry Out Error Analysis
内容
-
Error analysis
- Get $\sim$ 100 mislabeled dev set examples
- Count up how many are dogs (cat classifier の話をしているので,犬の写真を選ぶと error になる)
- 間違って犬の画像を「猫」と判断したケースが 5/100 であれば,犬に関する改善をしても大きな性能向上にならない。もし 50/100 なら,大きく改善する可能性がある
-
Evaluate multiple ideas in parallel
- Ideas for cat detection
- Fix pictures of dogs being recognized as cats
- Fix great cats (lions, panthers, etc.) being misrecognized
- Improve performance in blurry image
- ...
- 画像を見ながら原因をチェックし,大きいところに focus する
- Ideas for cat detection
Image | Dogs | Great cat | Blurry | ... | Comments |
---|---|---|---|---|---|
1 | x | ||||
2 | x | ||||
3 | x | x | |||
... | |||||
% of total | 8% | 48% | 61% | ... |
(C3W2L02) Cleaning up Incorrectly labeled data
内容
- Training set のラベルが間違っている場合
- DL algorithm are quite robust to random errors in the training set
- systematic error は影響あり (例えば,白い犬はすべて「猫」とラベル付けされている場合など)
- Dev/Test set の場合は,error analysis をする。影響が大きければ修正する。
Image | Dogs | Great cat | Blurry | ... | Incorrectly labeled | Comments |
---|---|---|---|---|---|---|
1 | x | |||||
2 | x | x | ||||
3 | x | x | ||||
... | ||||||
% of total | 8% | 48% | 61% | ... | 5% |
- Correcting incorrect dev/test set example
- Apply same process to your dev and test set to make sure they continue to come from the same distribution (dev set と test set は同じ分布)
- Consider examining examples your algorithm got right as well as ones it got wrong (アルゴリズムが判断を間違えたデータだけでなく,正しく判断したデータもチェックしてみる)
- Train and dev/test data may now come from slightly different distribution (Train data と dev/test data の分布は少し異なる可能性もある)
(C3W2L03) Build First System Quickly, Then Iterate
内容
- Set up dev/test set and metrics
- Build initial system quickly
- Use Bias/Variance analysis & error analysis to prioritize next step
- たいてい難しく考えすぎて,最初から複雑なシステムを作りがち
コメント
- 5 分 30 秒以降,真っ黒
(C3W2L04) Training and testing on different distribution
内容
- Mobile App の画像を分類するアルゴリズムを開発したい
- でも,集めたデータは web page からの画像 (高画素) が 200k,mobile app のデータが 10k。このとき,train / dev / test data をどうするか?
- Option 1 ; 両方足して 210k のデータにしてシャッフルして,
- trainin set ; 205k
- dev set ; 2.5k
- test set ; 2.5k
- 利点 ; 分布が同じ
- 欠点 ; dev/test set は,ほとんど web page のデータであり,mobile app のデータはあまり含まれていない
- Option 2
- train set ; web page 200k + mobile app 5k
- dev set ; mobile app 2.5k
- test set ; mobile app 2.5k
- 利点 ; dev/test set の分布が,アルゴリズムの狙い (mobile app の画像分類) と同じ
- 欠点 ; train set の分布が違う
- Option 1 より Option 2 のほうが良い
(C3W2L05) Bias and Variance with mismatched data distribution
内容
-
例えば Training error ; 1%,Dev error ; 10% のとき,
- Training error と Dev error が same distribution ; variance の問題
- distribution が違う場合 ; variance の問題ではないかもしれない
-
Training-dev set ; Same distribution as training set, but not used for training
-
Training error ; 1%, Training-dev error ; 9%, Dev error ; 10% の場合,variance の問題
-
Training error ; 1%, Training-dev error ; 1.5%, Dev errro ; 10% の場合,data-mismatch の問題
一般論として
- Human level と Training set error のギャップ;avoidable bias
- Training set error と Training-dev set error のギャップ;variance の問題
- Training-dev set error と Dev error のギャップ;data-mismatch の問題
- Dev error と Test error のギャップ;degree of overfitting to dev set
(C3W2L06) Addressing data mismatch
内容
- Carry out manual error analysis to try to understand difference between training and dev/test sets
- Make training data more similar; or collect more data similar to dev/test sets
- データを増やすために,artificial data synthesis を検討するのもよい
- 例えば 10000h のスピーチデータと 1h のノイズで,データを合成する
- 1h のノイズに overfit する危険性も考慮すること
(C3W2L07) Transfer Learning
内容
- 例えば猫の画像認識で訓練した neural network を radiography diagnosis (X 線画像診断) に応用する
- 最終層で $w^{[L]}$ と $b^{[L]}$ をランダムに初期化して,ここだけ学習する。他の層のパラメタは固定
- neural network の最後に新しい layer を追加して訓練することもある
- 転移しようとしているデータが少ないときに用いられる (少ないデータで学習 → 多いデータに転移,は意味がない)
まとめ
- When transfer learning makes sense (Transfer from A to B)
- Task A and B have the same input $x$
- You have a lot more data for Task A than Task B
- Low level features from A could be helpful for learning B
(C3W2L08) Multi-task Learning
内容
- 例えば自動運転のアプリケーションで,画像に歩行者,車,標識,信号などがあるかを見分けるなど,複数の要素を同時に学習する
- softmax と違って,複数のラベルを持つことができる
- 不明のラベルがあってもよい
- When multi-task learning make sense,
- Training on a set of tasks that could benefit from having shared lower-level features.
- Usually : Amount of data you have for each task is quite similar.
- Can train a big enough neural network to do well on all the tasks.
- マルチタスク学習よりも,転移学習のほうがよく使われる (たくさんのデータで学習した neural network を,少ないデータに転移 transfer する)
- コンピュータビジョンの物体認識では,マルチタスク学習が使われている
(C3W2L09) What is end-to-end deep learning?
内容
- speech recognition の例
- 従来方式 ; audio (x) → features → Phonemes → words → transcript (y)
- end-to-end ; audio (x) → transcript (y)
- データが 3000h であれば,従来方式でうまくいく。10000h ~ 100000h くらいあれば end-to-end ができる
- Face recognition
- 「画像の中から顔を認識する」 → 「顔を identify する」のように 2 段階に分ける (従来方式) のほうがうまくいく
- Machine translation (機械翻訳)
- end-to-end (English → French) がうまくいく
- たくさんの (English, French) のデータがあるから
(C3W2L10) Whether to use end-to-end learning
内容
- Pros and Cons of end-to-end deep learning
- Pros
- Let the data speech (人の先入観が入らない)
- Less hand-desgining of components needed
- Cons
- May needed large amount of data
- Excludes potentially useful hand-designed components
- Applying end-to-end deep learning
- Key question : Do you have sufficient data to learn a function of complexity needed to map $x$ to $y$ ?