Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
PPT - Deep and Confident Prediction For Time Series at Uber
1. Deep and Confident Prediction
for Time Series at Uber
Zhu et al. in <arxiv>
발표자 : 윤지상
Graduate School of Information. Yonsei Univ.
Machine Learning & Computational Finance Lab.
4. 1. Introduction
BNN에서의 uncertainty 계량을 효율적인 방법
으로 수행했고 real application에 적용한 연구
Bayesian Neural Network(BNN) model of time series prediction
and quantify the prediction uncertainty?
10. 1. Introduction
Prediction Uncertainty can be decomposed to 3 types:
1. Model Uncertainty : 모델 파라미터의 학습이 부족한 정도를 나타내며 많은 데이
터로 fitting 시킬수록 줄어드는 uncertainty
2. Inherent Noise : data generation 과정에서 나오는 실제 분포와 다른 정도를 나타
내며 줄이기 어려운 uncertainty
3. Model misspecification : test sample이 train set과 얼마나 다른 population에서
sampling 됐는 지의 정도를 나타내며 anomaly detection 등에서 사용 가능
Prediction Uncertainty?
11. 1. Introduction
Prediction Uncertainty can be decomposed to 3 types:
1. Model Uncertainty : 모델 파라미터의 학습이 부족한 정도를 나타내며 많은 데이
터로 fitting 시킬수록 줄어드는 uncertainty
2. Inherent Noise : data generation 과정에서 나오는 실제 분포와 다른 정도를 나타
내며 줄이기 어려운 uncertainty
3. Model misspecification : test sample이 train set과 얼마나 다른 population에서
sampling 됐는 지의 정도를 나타내며 anomaly detection 등에서 사용 가능
Prediction Uncertainty?
14. 2. Overview
→ Prediction distribution을 알아야한다.
모델의 목표 : 학습한 모델이 새로운 데이터에 대해
prediction할 때 그 신뢰구간은 어떻게 되는가?
15. 2. Overview
𝑊 = 𝑚𝑜𝑑𝑒𝑙 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠
𝑋, 𝑌 = 𝐷 = 𝑥1, 𝑦1 , … , 𝑥𝑛, 𝑦𝑛
𝑥∗
, 𝑦∗
= 𝑛𝑒𝑤 𝑑𝑎𝑡𝑎
→ Prediction distribution을 알아야한다.
모델의 목표 : 학습한 모델이 새로운 데이터에 대해
prediction할 때 그 신뢰구간은 어떻게 되는가?
16. 2. Overview
MLE (𝑃 𝐷 𝑊 최대화), MAP (𝑃 𝑊 𝐷 최대화) 의 모델 파라미터 𝑊 Point
Estimation이 아닌 𝑃 𝑊 𝐷 분포 자체를 추정하는 Posterior Estimation
𝑊 = 𝑚𝑜𝑑𝑒𝑙 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠
𝑋, 𝑌 = 𝐷 = 𝑥1, 𝑦1 , … , 𝑥𝑛, 𝑦𝑛
𝑥∗
, 𝑦∗
= 𝑛𝑒𝑤 𝑑𝑎𝑡𝑎
→ Prediction distribution을 알아야한다.
모델의 목표 : 학습한 모델이 새로운 데이터에 대해
prediction할 때 그 신뢰구간은 어떻게 되는가?
posterior
17. 2. Overview
단, 𝑊의 high dimension 성질 때문에 적분이 불가능하고 posterior를 직접 구하기 어
렵기 때문에 MC dropout 샘플링으로 𝑝(𝑊|𝑋. 𝑌)와 적분 계산을 한번에 하게 된다.
→ Prediction distribution을 알아야한다.
모델의 목표 : 학습한 모델이 새로운 데이터에 대해
prediction할 때 그 신뢰구간은 어떻게 되는가?
posterior
MC dropout : dropout을 train phase 와 inference
phase에 모두 적용
19. 2. Overview
We want to know 𝐕𝐚𝐫(𝒚∗|𝒙∗)
By Law of total Variance,
Var 𝑓𝑊 𝑥∗ : 𝑥∗가 주어질 때 parameter 𝑊를 통해 나오는 예측 값의 uncertainty
𝜎2 ∶ new data의 𝑥∗에 대한 target 값이 𝑦∗로 정해질 uncertainty → data generation에서
나오는 uncertainty → inherent noise
20. 2. Overview
𝑥가 주어질 때 𝑊로 𝑦 를 예측 못할 uncertainty + (𝑥, 𝑦)와 (𝑥∗
, 𝑦∗
)가 다른 분포에서 sampling
됐을 uncertainty
Var 𝑓𝑊
𝑥∗
= model uncertainty + model misspecification
We want to know 𝐕𝐚𝐫(𝒚∗|𝒙∗)
By Law of total Variance,
Var 𝑓𝑊 𝑥∗ : 𝑥∗가 주어질 때 parameter 𝑊를 통해 나오는 예측 값의 uncertainty
𝜎2 ∶ new data의 𝑥∗에 대한 target 값이 𝑦∗로 정해질 uncertainty → data generation에서
나오는 uncertainty → inherent noise
21. 2. Overview
We want to know 𝐕𝐚𝐫(𝒚∗|𝒙∗)
By Law of total Variance,
𝐕𝐚𝐫(𝒚∗
|𝒙∗
)
= Model uncertainty + Model misspecification + Inherent noise
= test data에 대한 prediction uncertainty 측정
22. 2. Overview
This study contributes:
1. Setting provides a generic and scalable uncertainty estimation
implementation for deep prediction models.
2. Quantifies the prediction uncertainty from three sources:
(i) model uncertainty, (ii) inherent noise, and (iii) model misspecification.
The third uncertainty has been previously overlooked, and we propose a
potential solution with an encoder-decoder.
3. Motivates a real-world anomaly detection use-case at Uber that uses
Bayesian Neural Networks with uncertainty estimation to improve
performance at scale.
25. 3. Quantify Uncertainty
Model Misspecification
Model misspecification : test sample이 train set과 얼마나 다른 population에서
sampling 됐는 지의 uncertainty
1. Encoder-Decoder pre-training으로 train set
distribution을 Encoder 마지막 cell state에
embedding
2. Encoder 마지막 cell state에 새로 추가하는
Prediction Net을 이용해 prediction
→ test data inference 시 학습된 train set
representation embedding으로 test data와 train
set의 차이를 표현할 수 있게 되어 uncertainty를
표현할 수 있게 된다.
Model Uncertainty + Model Misspecification
26. 3. Quantify Uncertainty
모든 𝑊 layer에 MC dropout을 적용하고 inference를 B번 했을 때,
Model Uncertainty
Model Uncertainty + Model Misspecification
MC dropout : dropout을 inference time에도 적용
Model
Uncertainty
Model Uncertainty : 모델 파라미터의 학습이 부족한 정도
27. 3. Quantify Uncertainty
Inherent Noise
where, 𝑊 are fitted weight parameters on train data
Inherent Noise : data generation 과정에서 나오는 실제 분포와 다른 정도
Inherent
Noise
32. 5. Experiments
Settings
Uber daily trips settings :
• City : Atlanta, Boston, Chicago, Los Angeles, New York City, San Francisco, Toronto,
and Washington D.C
• Period : Train 3yrs / Validation 4 months / Test 8 months
• Network :
Encoder-Decoder = 2-layer LSTM cells with 128 and 32 hidden states
Prediction Net = 3 FC layers with 128, 64, 16 hidden units and tanh activation
• Time step : data of 28 days as input and predict upcoming day
Raw data are log-transformed and first day is subtracted from all values of other days
34. 5. Experiments
Results
PredNet :
Model Unceratinty
Enc+Pred :
Model Uncertainty + Model
Misspecification
Enc+pred+Noise :
Model Uncertainty + Model
Misspecification + Inherent Noise
40. APPENDIX
4.2. Application to Anomaly Detection at Uber
There are two main challenges we need to address in this application:
Scalability: In order to provide real-time anomaly detection at the current scale, each
predictive interval must be calculated within a few milliseconds during
inference stage. Performance: With highly imbalanced data, we aim to reduce the false
positive rate as much as possible to avoid unnecessary on-call duties, while making
sure the false negative rate is properly controlled so that real outages will be captured.
By adding MC dropout layers in the neural network, the estimated predictive intervals
achieved 100% recall rate and a 80.95% precision rate.