SlideShare a Scribd company logo
1 of 31
Download to read offline
RNNによる多変量時系列データ分析の解釈性
2020/08/29
1
⼀般的な「解釈性」の⼿法
Post-analyzing
学習済みのブラックボックスなモデルの出⼒が⼊⼒の変化に対してどのように変
化するか
Ancola, et al. ICLR'18 に詳しい
Perturbation-based (マスクなど)
計算量がデータの次元に対して⼤きくなるのが難点
解釈性も安定して良いとは⾔えない
Gradient-based
Gradient*Input, LRP, Saliency mapなど
「RNNではDeepLIFTを使うべきでない」
Attention
モデル⾃体に組み込む。解釈⾃体を学習。
2
多変量時系列データ分析モデルに対する解釈性
LIME, SHAPなど有名どころの⼿法は使いにくい︖
今回紹介:
RNNの解釈性向上⼿法
Attention系: IMV-RNN (Guo, et al. ICML'19)
Saliency系: Input-Cell Attention (Ismail, et al. NeurIPS'19)
※ attentionを使うが解釈性を⾒るのはsaliencyを通す
3
Exploring Interpretable LSTM Neural Networks over Multi-Variable Data
Tian Guo, Tao Lin, Nino Antolov-Fantulin
(ETH Zurich, EPFL)
多変量データにおいて、変数毎に隠れ状態を計算し、それをsoft attentionで混合
させることで予測を出すモデルを提案
変数毎のattentionと時間⽅向のattentionを同時に学習する⽅法
精度を向上させながら解釈もできる
4
問題設定
Given : N-1-次元の外⽣変数と1次元のターゲット変数の組の系列
Goal : 時刻 のターゲット変数 を予測
更に副産物として変数/時刻に対する重要度
I ∈ R , I =≥0
N
n=1
∑
N
n 1
T ∈n
R , T =≥0
T
k=1
∑
T
k
n
1,  n = 1, ⋯ , N
を得たい。
X =T (x , ⋯ , x ),  x =1 T t [x , ⋯ , x , y ] ∈t
1
t
N−1
t RN
T + 1 =y^T+1 F(X )T
5
変数ごとのLSTM
各時刻の状態を⾏列で保持 ( :⼊⼒の変数の数)
=h
~
t [h , ⋯ , h ], h ∈t
1
t
N
t
n
Rd
状態更新は、テンソル との積を⽤いて計算
N
Wj
6
⼆種類のゲートの計算
後者の⽅がずっとパラメータ数が⼩さくなる(通常のLSTMに対して 倍)1/N
7
Mixture Attention
時間⽅向にアテンションをとったのち、変数に対するアテンションをとる
は正規分布とし、平均/分散をNN で計算p(y ∣z =T+1 T+1 n, h ⊕T
n
g )n
ϕ (h ⊕n T
n
g )n
8
Attentionと解釈性
attentionの値⾃体から重要度を解釈するのは難しい
なので重要度ベクトルを別の形で計算する
9
EMによってモデルのパラメータ と重要度ベクトル を推定する
特に、 の上界となる次の式を最⼩化する
( は訓練データのindexを表す)
最初の⼆項は通常最⼩化するもの。第三項は重要度に関する正則化とみなせる。
Θ I ∈ RN
− log Π p(y ∣X ; Θ)m T+1,m T,m
m
10
訓練アルゴリズム
以下を繰り返す。
を固定し、バッチデータに対して の事後分布を計算:
を勾配法で更新
重要度 を計算:
Θ zT+1,m
Θ
I
11
時刻の重要度 については、EMしても良いが階層的になってしまうので
attentionの値を⽤いて
で決めてしまう。
{T ∈n
R }T
12
⽐較⼿法1︓RETAIN (Choi, et al. NIPS'16)
REverse Time AttentIoN
患者の診断・治療経過のデータから今後の経過を予測
attention部をRNNにすることで解釈可能にする
13
⽐較⼿法2︓RETAIN (Choi, et al. NIPS'16)
※ RNNを逆順に⽤いる。IMV-RNNと⽐較する系列予測タスクには合わない気が︖
14
⽐較⼿法2︓Dual-stage Attention-based RNN (Qin, et al. IJCAI'17)
系列予測に使える
(time window Tで切ってはいるが、新しい時刻の⼊⼒に対してd_tを全て計算し直さね
ばならない…︖)
15
実験
データセット
PM2.5
外⽣変数︓気温、気圧、⾵向き、露点など
ターゲット︓PM2.5の量
PLANT
外⽣変数︓気温や雲の範囲など9次元
ターゲット︓太陽光発電量
SML
外⽣変数︓16次元
ターゲット︓室内の気温
16
実験
ベースライン
統計的⼿法︓STRX, ARIMAX
機械学習⼿法︓Random Forests, eXtreme Gradient Boosting, Elastic-Net
RNN⼿法︓RETAIN, DUAL
17
結果
18
解釈性
だいたいドメイン知識と適合するらしい
19
さらに各変数の中でいつ頃の値が重要かがわかる(左がfull, 右がtensor)
20
Input-Cell Attention Reduces Vanishing Saliency of Recurrent Neural
Networks
Aya Abdelsalam Ismail, Mohamed Gunady, Luiz Pessoa, Hector Corrada Bravo, Soheil
Feizi
(Univ. of Maryland)
単にLSTMを使うと勾配消失によってSaliencyが消えてしまう
⼊⼒を時刻に対する重み付き和で取り直すことで有効なSaliencyを得られる
LSTMの内部はいじらない
21
RNNにおける解釈性⼿法
多くの解釈性⼿法は画像・⾔語のタスクに注⽬。 時系列データでの研究は少ない
例︓fMRI (脳の活動を信号化)
「どの部位の変化が重要か」が知りたい
⾔語モデルでは「どの単語(=時刻)」が重要かしか考えない
22
問題設定
Input :
Output :
outputの各成分 に対する各⼊⼒の「寄与度」 を計算
する
Saliency map (cf. Simonyan, et al. '14)
他の勾配ベースの⼿法も考えられるが簡単のため今回はsaliencyを⽤いる
X = (x , ⋯ , x ), x ∈1 T t RN
S(X) = [S (X), ⋯ , S (X)]1 C
Sc R =c
[R ] ∈t,n
c
RT×N
23
提案⼿法︓Input-Cell Attention
24
提案⼿法︓Input-Cell Attention
LSTMへの⼊⼒ を重み付き和 に置き換える︓
A =t softmax(W tanh(W X ) ∈2 1 t
T
Rr×t
M =t A X ∈t t Rr×N
は「いくつの時刻に注意するか」
新しい⼊⼒ のサイズが⼤きいので⾏ベクトルの平均をとって 次元に落としてもよ
い
xt Mt
r
Mt N
25
実験︓⼈⼯データ
⻑さ100、各点は標準正規分布、⼆値分類、「重要な」点は1を⾜す/引く
Saliency の評価
正解の重要度マップに対するEuclid距離
Weighted Jaccard similarity : J(∣X∣, R(X)) = max(∣x ∣,R(x ))∑i=1
n
i i
min(∣x ∣,R(x ))∑i=1
n
i i
26
実験結果
27
実験︓sequential MNIST
縦軸を時刻とみなして数字を判別
通常のLSTMでも⼗分⾼い精度がだせるが、saliencyは正しく出ない。
28
実験︓fMRI
fMRIデータから、何をしているかを識別するタスク(⼆値分類)
Thomas, et al.'18 でLRPを⽤いた活性部位の同定
↑では⼀部分の活性しか⾒られなかったが、活性部位の変化が⾒えるように
On-task data / On-task Off-task data
後者は被験者が休んでいる間のデータも込み
先の図がOn-task dataでの結果
29
On-task Off-taskでの実験結果
右図の横軸は「真に重要な特徴量の割合」 (LSTMは重要でないものに注⽬してる) 30
今年出てるやつ(全く読めてない)
Interpretable Sequence Classification Via Prototype Trajectory (NeurIPS'20投稿?)
Counterfactual Explanations for Machine Learning on Multivariate Time Series Data
RNNではない。
Attention Mechanism for Multivariate Time Series Recurrent Model Interpretability
Applied to the Ironmaking Industry
31

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Multivariate Time series analysis via interpretable RNNs