Impressed Structure In Deep Learning
Multi-task Learning
Domain adaptation
Transfer learning
GAN
AnoGAN, Anomaly GAN
Reinforcement learning
Capsule, Spiking NN
Black-box In Deep Learning
LIME, Local interpretable model-agnostic explanations
LRP, Layer-wise relevance propagation
Advantage of Statistics In Deep Learning
3. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
3
4. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
4
5. Impressed structure in Deep Learning
• Transfer learning family
5
Same Task on Source and
Target Domains
Same Source and Target
Marginal Distribution on X
Same Task on Source and
Target Domains
“Usual”
Learning Setting
Inductive Transfer
Learning
Transductive
Transfer Learning
Unsupervised
Transfer Learning
Multi-task Learning (Source known)
Self-taught Learning (Source unknown)
Domain adaptation Transfer Learning
YesYes
Yes No
No No
11. Impressed structure in Deep Learning
• Domain adoption (Different source, Same task)
- Train: Backward
11
class label 𝑦
domain label 𝑑
⋮
𝜕𝐿 𝑓
𝜕𝜃 𝑓
Loss 𝐿 𝑓=
𝜕𝐿 𝑦
𝜕𝜃 𝑓
− 𝜆
𝜕𝐿 𝑑
𝜕𝜃 𝑓
𝜕𝐿 𝑦
𝜕𝜃 𝑦
Loss 𝐿 𝑦
𝜕𝐿 𝑑
𝜕𝜃 𝑑
Loss 𝐿 𝑑
features𝑓
12. Impressed structure in Deep Learning
• Domain adoption (Different source, Same task)
- Backward / Backpropagation
• Adversarial
- Domain classifier 跟 label predictor feature extractor 互相對抗
- Domain classifier 會幫助 label predictor 預測效能
12
Goal 2: 各別任務 loss 越小越好Goal 1: 整體 loss 越小越好
!
!
min
𝜃 𝑦
𝜕𝐿 𝑦
𝜕𝜃 𝑦
& min
𝜃 𝑑
𝜕𝐿 𝑑
𝜕𝜃 𝑑
min
𝜃 𝑓,𝜃 𝑦,𝜃 𝑑
𝜕𝐿 𝑦
𝜕𝜃𝑓
− 𝜆
𝜕𝐿 𝑑
𝜕𝜃𝑓
13. Impressed structure in Deep Learning
• Transfer learning (Different source, Different task)
- 自己運算資源、訓練模型的資料不足
- 別人已經訓練好任務更大的模型
• 例如 Google 用 ImageNet 訓練好的模型
13
我只是想分類 Dog 和 Cat
14. Impressed structure in Deep Learning
• Transfer learning (Different source, Different task)
- 把別人的 model (Pre-trained Model) 最後一層拔掉,加入新的層,然後用新資料訓練新層的參數
14
15. Impressed structure in Deep Learning
• Transfer learning (Different source, Different task)
- 把別人的 model (Pre-trained Model) 最後一層拔掉,加入新的層,然後用新資料訓練新層的參數
15
16. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
16
17. Impressed structure in Deep Learning
• GAN, Generative Adversarial Network
- Loss 計算相似 Domain adoption
- 以 Image 為例
17
G𝒛𝑰 𝐑𝐞𝐚𝐥 𝑰’ 𝐑𝐞𝐚𝐥
G
生成器
𝒛 + 𝝈
D
分類器
𝑰 𝐅𝐚𝐜𝐤
𝑰 𝐑𝐞𝐚𝐥
Real probability
Encode - Decode
18. Impressed structure in Deep Learning
• GAN, Generative Adversarial Network
18
G
生成器
𝒛 + 𝝈
D
分類器
𝑰 𝐅𝐚𝐜𝐤
𝑰 𝐑𝐞𝐚𝐥
0.9
0.1
Real probability
0.9
0.9
Ideally In fact
0.7 0.9
19. Impressed structure in Deep Learning
• GAN, Generative Adversarial Network
- 評估生成器的能力
• 兩個(資料庫 vs 生成)分布是否相同
• Inception Score (IS)
• Fréchet Inception Distance (FID)
- 可以用 GAN 生成新資料嗎?
• Betwend Yes & No. 無法生成超過資料庫的特徵
• ex. 想生成頭朝左的黑馬
只有頭朝右的黑馬→ No
頭朝右的黑馬 & 頭朝左的斑馬→ Yes
19
20. Impressed structure in Deep Learning
• AnoGAN, Anomaly GAN
- 可在無異常樣本下訓練分類器區分異常、並偵測未知異常圖形
20
real
difference
generated Anomaly detection
異常
正常
正常時的樣貌
23. Impressed structure in Deep Learning
• AnoGAN, Anomaly GAN
- 用來判斷是否異常
1. 生成正常時該有的樣貌
2. 計算異常分數
23
Anomaly detection真實異常
正常時的樣貌
生成正常
difference
24. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
24
25. Impressed structure in Deep Learning
• Reinforcement learning
- 從現在的環境來決定行為,介於監督式和非監督式間
- 應用機器人行為:聊天、物流裝箱、競賽(ex. 打電動)
25
26. Impressed structure in Deep Learning
• Reinforcement learning
- Plays catch
26
• S, situation
• A, action
■ left, stay, right
• R, reward
■ 1: 接到, 0: 等待掉落, -1: 死掉
• Policy
■ Largest reward: 接到次數最多
http://edersantana.gith
ub.io/articles/keras_rl/
27. Impressed structure in Deep Learning
• Reinforcement learning
- Plays catch
27
End
𝑺 𝒕
left
stay
right
判定
𝑅𝑡
死掉
接到
等待掉落
Existed NN
𝑺𝒕+𝟏
𝐴 𝑡
28. Impressed structure in Deep Learning
• Reinforcement learning
- Plays catch
28
𝑺 𝒕
left
stay
right
判定
𝑅𝑡
死掉
接到
等待掉落
Existed NN
𝑺𝒕+𝟏
𝐴 𝑡
29. Impressed structure in Deep Learning
• Reinforcement learning
- Plays catch, RL part
29
𝑺 𝒕
left
stay
right
判定
𝑅𝑡
死掉
接到
等待掉落
Correct pair(s)
𝑺 𝟏, 𝑨 𝟏
′
, … , (𝑺 𝒕, 𝑨 𝒕
′
)
Modify weight
𝑨 𝒕
′
𝑺𝒕+𝟏
𝐴 𝑡
Existed NN
30. Impressed structure in Deep Learning
• Reinforcement learning
- Plays catch, RL part
30
Modify 𝐴 𝑡 to 𝐴 𝑡
′
31. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
31
32. Impressed structure in Deep Learning
• Capsule and Dynamic Routing
- Drawbacks of CNN
• Pooling weak
- Ambivalent the spatial relationships of the previous layer
32
15 9 4 2
11 5 8 6
8 7 3 17
2 3 7 3
15 8
8 17
10 5
5 8
Max pooling
Average pooling
Only keep partial feature
Max is define by input layer, not Bi-layer
旋轉縮放和平移不變性,適應程度較小,需要大量 augmentation 協助
Weight are equal
Who
33. Impressed structure in Deep Learning
• Capsule and Dynamic Routing
- 用向量代替元素輸出,可捕捉空間結構信息的膠囊概念
33
Tradition NN Capsule Net
Unit: List of objects
objects can be different attributes
Unit: One object
Ex. value, one-hot vector, pixel
34. Impressed structure in Deep Learning
• Capsule and Dynamic Routing
- 用 routing-by-agreement 取代 max-pooling
34
R
G
B
2
1
⋯ ⋯
Layer I Layer JLayer A Layer B Layer C Layer ZLayer Y
35. Impressed structure in Deep Learning
• Capsule and Dynamic Routing
- 用 routing-by-agreement 取代 max-pooling
36
R
G
B
2
1
幾乎傳一樣
所以不能迭代太多次
R
G
B
2
1
1st 迭代後
R
G
B
2
1
2nd 迭代後
R
G
B
2
1
nth 迭代後
𝑊𝑖𝑗, 𝐶𝑖𝑗
𝑊𝑖𝑗: 傳統 CNN 的權重,不變
𝐶𝑖𝑗: 𝑖 對 𝑗 的影響力,迭代改變
Layer I Layer J
1 = 𝑖=𝑅,𝐺,𝐵 𝐶𝑖1 ⋅ 𝑊𝑖1 ⋅ capsule 𝑖
𝑊𝑖𝑗, 𝐶𝑖𝑗𝑊𝑖𝑗, 𝐶𝑖𝑗 𝑊𝑖𝑗, 𝐶𝑖𝑗
更新 𝐶𝑖𝑗 ⇒ 𝐶 𝑅1 ↑, 𝐶G1 ↓, 𝐶 𝐵1 ↓,
𝐶 𝑅2 ↓, 𝐶G2 ↓, 𝐶 𝐵2 ↑
再更新 𝐶𝑖𝑗 ⇒ 𝐶 𝑅1 ↑, 𝐶G1 ↓, 𝐶 𝐵1 ↓,
𝐶 𝑅2 ↓, 𝐶G2 ↓, 𝐶 𝐵2 ↑
新的
初始均等
定義
36. Impressed structure in Deep Learning
• Capsule and Dynamic Routing
- 用 routing-by-agreement 取代 max-pooling
37
壓縮到 [0,1) 保留向量特徵
37. Impressed structure in Deep Learning
• Spiking NN
- 從其它神經元得到的訊號,該神經元反應強度隨著輸入訊號變化
- 直到強度超過閾值後
• 才傳遞訊號給下個神經元
• 該神經元重置反應強度
38
神經元的突觸樹、軸突和細胞體
38. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
39
39. Black-box in Deep Learning
40
Predict: wolf
True: wolf
Predict: husky
True: husky
Predict: wolf
True: wolf
Predict: wolf
True: wolf
Predict: husky
True: husky
Predict: wolf
True: husky
40. Black-box in Deep Learning
• LIME, Local interpretable model-agnostic explanations
- 透過擾動輸入樣本 (perturb the input)
- 來判斷哪些特徵對辨識結果有最大的影響
41
41. Black-box in Deep Learning
42
Predict: wolf
True: wolf
Predict: husky
True: husky
Predict: wolf
True: wolf
Predict: wolf
True: wolf
Predict: husky
True: husky
Predict: wolf
True: husky
42. Black-box in Deep Learning
• LRP, Layer-wise relevance propagation
- 將 loss 透過反向傳播 (backpropagation)
- 來判斷每個 pixel 和 unit 與辨識結果的關聯性
43
使用已訓練好的模型權重和預測誤差
不對模型做任何改變
𝑅𝑗 =
𝑘
𝑎 𝑘 𝑤𝑗𝑘
+
𝑗 𝑎 𝑘 𝑤𝑗𝑘
+ 𝑅 𝑘
43. Black-box in Deep Learning
• LRP, Layer-wise relevance propagation
- Demo website: http://heatmapping.org/mnist.html
44
已存在 model: Long ReLu
1 的判斷9 的判斷 7 的判斷
44. Black-box in Deep Learning
• LRP, Layer-wise relevance propagation
- Demo website: http://heatmapping.org/mnist.html
45
45. Black-box in Deep Learning
• Compare
• Ref: Explainable AI 是什麼?為什麼 AI 下判斷要可以解釋?
46
改 model unit 改 image pixel 透過 loss 反傳
任意 model X V V
特定 layer V X V
特定 class X Δ V
小區域敏感度 X V X
計算速度 Δ X V
Soft attention change LIME / IntGrad LRP / GradCAM
46. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
47
47. Advantage of Statistics in Deep Learning
• [2019/02] 深度學習的發展遇到了 3 個瓶頸!
- Alan Yuille 電腦視覺領域奠基者表示,深度學習正面臨三大瓶頸
• 三大瓶頸:需要大量標註數據、過度擬合基準數據、對圖像變化過度敏感
• 組合爆炸:真實世界的圖像,從組合學觀點來看太大量了
任何一個數據集,不管多大,都很難表達出現實的複雜程度
- Pedro Domingos 分析 1.6 萬篇論文後表示,深度學習的發展終點將近
• [2017/12] AI 熱潮,會不會只是一場泡沫?
- 就像 100 年前的電力、20 年前的網際網路一樣,AI 也會改變每一個產業。
48
48. Advantage of Statistics in Deep Learning
• CS vs. DS 處理問題方式
49
初階 Computer Science
1. 直接套模型
2. 參考別人調參數和改架構
3. 用更熱門的模型架構
4. 上社群、論壇求解
5. 沒轍了
初階 Data Science / Statistics
1. 分析資料型態
2. 選擇合適模型
3. 猜測可能的問題
4. 找工具 or 方法驗證猜想
5. 調整輸入資料 or 模型參數
6. 沒轍了 初階 CS 可能永久卡關
1. 數學不好
2. 不擅長資料視覺化
統計分析
初階 Statistics 較弱
• 參考 “從統計到資料科學”
49. Advantage of Statistics in Deep Learning
• CS vs. DS 處理問題方式:用套件找邊界 (pixel 值變化)
50
找肝臟區域 改善腫瘤預測區域
同一個套件為什麼效果差這麼多?
覺得這個套件很爛 腫瘤預測區域 改善預測區域
50. Advantage of Statistics in Deep Learning
• CS vs. DS 處理問題方式:
51
看了幾個例子後猜測
1. FNH 在 ART vs. PV 差異較 HCC & HEM 大
2. HEM 的質地比 HCC 的不均勻
肝癌 CT 影像
你會怎麼驗證猜測?
51. Advantage of Statistics in Deep Learning
• 我一開始做論文的處理問題方式:
52
我用折線圖,除了測站間值有高低其他都看不出來
老師:換 Box Plot 畫看看
哇!!真的有東西
為什麼同一個類型 box range 不一樣
我現在會用 group box plot 畫在一起
52. Outline
• Impressed Structure In Deep Learning
- Transfer learning
- GAN
- Reinforcement learning
- Capsule, Spiking NN
• Black-box
• Advantage of Statistics
53