機械学習 中級編 と Azure
- Cloud による最適なコンピューティング環境 -
畠山 大有 | Daiyu Hatakeyama | @dahatake
Architect && Software Engineer && Applied Data Scientist (目指している)
Microsoft Japan
AI への過度の期待と失望
研究 と ビジネスを関連付けられる人材の不足
Deep Learning の Project は、現状 非常に高コスト
Data Science and ML platforms
Collaboration Acceleration
Automation
1,000を超えるモデルの展開と管理のため
の
自動化されたワークフロー
GPT3に代表される、複数AIモデルの融合と
トランスファーラーニング
NLP、リコメンデーション、Many-Models
の様な
構成可能で再現可能なレシピ
ML の実践に貢献する複数ロールのための
ツールとプロセス
複数のステークホルダーによる倫理的使用
を保証する堅牢な責任あるAIアプローチ
エンタープライズグレードのデータとモデ
ルの
ガバナンス/セキュリティ
モデルの運用化を加速するMLOpsの台頭
強化学習、AN、合成データなどの高度な
技術
複数クラウド での トレーニングと推論
- 最新のアナリティクス・機械
学習ツールの外部評価 -
2018年 - 2020年の大幅なアップデートによ
り、2020年最新の調査で「Market
Leader」の評価を頂きました
Cognitive Services Knowledge mining Machine Learning
Azure
Machine Learning
Develop Your Own Model
20
https://docs.microsoft.com/ja-jp/azure/architecture/data-guide/technology-choices/data-science-and-machine-learning
https://medium.com/microsoftazure/9-advanced-tips-for-production-machine-learning-6bbdebf49a6f
Use Pre-trained Model
80
Azure
Cognitive Services
数年前だと…
コンサル費用数千万 + 数か月
誰でも数分でできる
襟あり
RALPH LAUREN
Cognitive Services
Custom Vision
Notebooks Automated ML UX Designer
Reproducibility Automation Deployment Re-training
CPU, GPU, FPGAs IoT Edge
モデルの構築・展開を、個人から企業レベルでも
この車の妥当な価格は?
Mileage
Condition
Car brand
Year of make
Regulations
…
Parameter 1
Parameter 2
Parameter 3
Parameter 4
…
Gradient Boosted
Nearest Neighbors
SVM
Bayesian Regression
LGBM
…
Mileage Gradient Boosted Criterion
Loss
Min Samples Split
Min Samples Leaf
Others Model
Which algorithm? Which parameters?
Which features?
Car brand
Year of make
試行錯誤
Criterion
Loss
Min Samples Split
Min Samples Leaf
Others
N Neighbors
Weights
Metric
P
Others
Which algorithm? Which parameters?
Which features?
Mileage
Condition
Car brand
Year of make
Regulations
…
Gradient Boosted
Nearest Neighbors
SVM
Bayesian Regression
LGBM
…
Nearest Neighbors
Model
繰り返し
Gradient Boosted
Mileage
Car brand
Year of make
Car brand
Year of make
Condition
Mileage
Condition
Car brand
Year of make
Regulations
…
Gradient Boosted
Nearest Neighbors
SVM
Bayesian Regression
LGBM
…
Gradient Boosted
SVM
Bayesian Regression
LGBM
Nearest Neighbors
Which algorithm? Which parameters?
Which features?
繰り返し
Regulations
Condition
Mileage
Car brand
Year of make
データセット
目標設定
学習の一貫性
出力
入力
アンサンブル学習
仮想マシンの自動起動・オートスケール
学習過程の可視化・モデルの説明性 (解釈性)
ベストなモデルの選択
Optimized model
分類・回帰・時系列予測
ONNX サポート
User inputs
Feature
engineering
Algorithm
selection
Hyperparameter
tuning
Model Leaderboard
Dataset
Configuration
& Constraints
76% 34% 82%
41%
88%
72%
81% 54% 73%
88% 90% 91%
95% 68%
56%
89% 89% 79%
Rank Model Score
1 95%
2 76%
3 53%
…
Data
Clearing
Model Explanation
GPU GPU
Job
Management
Container
Packaging
VM Auto scale
Ensemble Learning
“HyperDrive”
Logging for
Visualize
User inputs
Feature
engineering
Algorithm
selection
Hyperparameter
tuning
Model Leaderboard
Dataset
Configuration
& Constraints
76% 34% 82%
41%
88%
72%
81% 54% 73%
88% 90% 91%
95% 68%
56%
89% 89% 79%
Rank Model Score
1 95%
2 76%
3 53%
…
Data
Clearing
Model Explanation
GPU GPU
Job
Management
Container
Packaging
VM Auto scale
Ensemble Learning
“HyperDrive”
Logging for
Visualize
User inputs
Feature
engineering
Algorithm
selection
Hyperparameter
tuning
Model Leaderboard
Dataset
Configuration
& Constraints
76% 34% 82%
41%
88%
72%
81% 54% 73%
88% 90% 91%
95% 68%
56%
89% 89% 79%
Rank Model Score
1 95%
2 76%
3 53%
…
Data
Clearing
Model Explanation
GPU GPU
Job
Management
Container
Packaging
VM Auto scale
Ensemble Learning
“HyperDrive”
Logging for
Visualize
Data
Preprocessing
Feature
Selection
Algorithm
Selection
Hyperparameter
Tuning
Model
Recommendation
Interpretability
& Explaining
データの
クリーニン
グ
Feature の選択 ジョブの並列
実行と合わせ
て
設定範囲の中で、
何を選択して
何を選択肢から
除外するか
精度と
実行速度も
加味
そのモデルに影
響のあった
Feature は
どれだったのか?
Deep Learning
Deep learning
Auto-settings
休日検知
気象など Open Dataset の利用
複数の models
新しい learners
Time series forecasting
目的変数
Target
• 目的変数 Target
• 説明変数の中に、妥当性のある時間のデータ
Day Store Sales Week_of_year
9/3/2018 A 2000 36
9/3/2018 B 600 36
9/4/2018 A 2300 36
9/4/2018 B 550 36
説明変数
Feature
頻度の一貫性
• 値の取りうる範囲が広い
• 例: Learning rate: 0.1 もしくは 0.01 もしくは 0.001 もしくは …
• 複数の値の組み合わせ
• 最適な構成を探し出すのは困難
• 一つの学習ジョブの実行時間は長い
• 時間とリソースの制限
Explorer
分散環境で並列実行することで高速化を実現
Bias
人 作られる
• 例: StreetBump smartphone app
• スマートフォンの GPS “Data” を使って、
道路の異常個所を収集
• 年収の低い方は? http://www.streetbump.org/
信頼性
安全で信頼できる
透明性
理解できる
包括性
あらゆる人の力とな
り、人々を結びつけ
る
プライバシー
と
セキュリティ
安全に管理され
プライバシーを
最大限尊重する
公平性
全ての人を
公平に扱う
THE GOLDEN RULE
Microsoft の AI のための倫理的原則
説明責任
システムとしての
説明責任を
果たす
信頼性
安全で信頼できる
透明性
理解できる
包括性
あらゆる人の力とな
り、人々を結びつけ
る
プライバシー
と
セキュリティ
安全に管理され
プライバシーを
最大限尊重する
公平性
全ての人を
公平に扱う
THE GOLDEN RULE
Microsoft の AI のための倫理的原則
説明責任
システムとしての
説明責任を
果たす
Joy Buolamwini, MIT Dr. Timnit Gebru, Google
Woman
Dark Skin
Woman
Light Skin
Man
Dark Skin
Man
Light Skin
2018 MS
Face API
Error Rate
20.8% 1.7% 6.0% 0.0%
2019 MS
Face API
Error Rate
1.5% 0.3% 0.3% 0.0%
Woman
Dark Skin
Woman
Light Skin
Man
Dark Skin
Man
Light Skin
1.52% .34% .33% 0%
304,000 68,000 66,000 0
公平なのか?
NYC の著名なデパートには
毎年 2,000万人もの人が来店する
50%ずつの性別と肌の色と仮説す
る
小売業向けの性別 Classifier
誤差率が小さくとも、相対的な違いに注目
https://youtu.be/fMym_BKWQzk
https://www.microsoft.com/ja-jp/AI/our-approach-to-ai/
The Future Computed:AI とその社会における役割
-ブラッド スミス
Brad Smith,
President of Microsoft
• Learn more about our approach at https://www.microsoft.com/AI/our-approach-to-ai
• Download The Future Computed at aka.ms/Futurecomputed
• Check the Responsible AI section at aischool.microsoft.com
• Get started with homomorphic encryption at ailab.microsoft.com
• Get started with InterpretML at github.com/Microsoft/interpret
モデルの精度とモデルの解釈性はトレードオフになりがち
Black Box
モデル
• なぜその予測値になっ
た?
• モデルの改善方法
は?
• モデル構造が複雑
• 理解するのが非常に困難
要因探索、与信管理など説明責任が伴うビジネスでは
ブラックボックスなモデルは使えない...
実データは複雑
十分に表現力がある(≒複雑な)モデルを使わ
ないと「高い精度」を得られない
複雑なモデルは人間には理解できない
• 局所的な説明
1. モデルの入力データに対する予測値を基に、どの特徴量が予測に効いて
いるか
(どの変数が重要か)を推定する
2. 予測の根拠となった学習に最も寄与する訓練データを提示する
• 大域的な説明
1. 「到底理解できない」モデルを説明可能性に優れるモデルで近似して、
近似モデルの説明を「到底理解できない」モデルの説明とみなす
2. 局所的な説明をデータセット全体について得て、各特徴量の予測への影
響を示す分布を得て説明とみなす
解釈可能な
モデル
Black Box
解釈フレーム
ワーク
Data
解釈可能な
モデル
Black Box
解釈フレーム
ワーク
• 従来の統計的手法
• 線形回帰
• 決定木
• LIME
• SHAP
• Permutation Feature Importance
• Microsoft Interpret ML
• Azure ML Interpretability SDK
• Power BI – Key Influencers
アプローチ方法
https://arxiv.org/pdf/1910.10045.pdf
カテゴリー アプローチ方法 Microsoft 提案方法
解釈可能な
モデル
• 従来の統計解析手法
• 線形回帰
• 決定木
• 一般線形化モデル
• Power BI – Key Influencers
• Azure ML service – Visual Interface
• (Azure ML Studio)
• Python, R で実装
• その他 Microsoft InterpretML
汎用的な
解釈フレーム
ワーク
• Permutation Feature
Importance
• Partial Dependency Plot
• LIME
• SHAP
• Azure ML Studio – PFIモジュール
• Azure ML Interpretability SDK
• Python, R で実装
データ探
索
変数の重要度
各予測値に対する説明 サマ
リー
要因探索、与信管理などの業務で
はブラックボックスなモデルは使
えない...
https://docs.microsoft.com/en-
US/azure/machine-learning/service/machine-
learning-interpretability-explainability
Model interpretability with
Azure Machine Learning service
github.com/Microsoft/interpret
精度が高く、説明力のある
Explainable Boosting Machine
• fairlearn - 公平性のアセスメントと、調整(緩和)のための Open Source Tool
• 不公平性のアセスメント、監視、調整(緩和) と 可視化
https://github.com/fairlearn/fairlearn
Microsoft Responsible AI
Resource Center
https://aka.ms/RAIresources
Azure Machine Learning
https://azure.microsoft.com/en-us/services/machine-
learning/
https://docs.microsoft.com/en-us/azure/machine-
learning/concept-responsible-ml
Responsible Innovation Toolkit
https://docs.microsoft.com/azure/architecture/guide/respo
nsible-innovation
Responsible ML resources
FairLearn
https://github.com/fairlearn
https://aka.ms//FairLearnWhitepaper
https://docs.microsoft.com/azure/machine-
learning/concept-fairness-ml
InterpretML
https://github.com/interpretml
https://aka.ms//InterpretMLWhitepaper
https://docs.microsoft.com/azure/machine-
learning/how-to-machine-learning-interpretability
AI x メガネ
目が悪い人
x
メガネ
目が見えない人
x
AI メガネ
1284年
Good
会員数 4,150 名
全国 6 都市で
36 回イベント開催
福岡
大阪
広島
名古屋
東京
札幌
オンライン・オフライン含めた
機械学習教育講座の全国での推進
機械学習 SI エコシステム
日本最大の AI コミュニティ
https://dllab.connpass.com/
• AI や 機械学習の最新の
トレーニング
• 概要・基礎・チュートリアル
• 自分に適した、トレーニングコースの作成
• AI Business School
• Conversational AI
• AI Services
• Machine Learning
• Autonomous System
• Responsible AI
aischool.microsoft.com
Step-by-Step Learning Achievements スムーズな学習環境
 無料
 日本語対応
 ブラウザーのみ。ハンズオ
ン環境も含めて
 ダウンロード可能なサンプ
ルコード
 Product/Service, 技術レベル,
job role, などに応じたガイダ
ンス
 Videos, チュートリアル, ハン
ズオン
 スキルアップを促す
 ユーザー プロファイ
ル毎に
カスタマイズ
www.microsoft.com/learn
Open Source Repo Link
Azure ML Notebook Examples
Azure Machine Learning 公式サンプル
コード
https://aka.ms/ml-notebooks
BERT Large 自然言語モデル BERT のサンプルコード http://aka.ms/azure-bert
Microsoft Recommenders レコメンデーション サンプルコード http://aka.ms/recommenders
LightGBM LightGBM トップページ https://aka.ms/lightgbm
Natural Language Recipies 自然言語 サンプルコード https://aka.ms/nlp-recipes
ONNX ONNX トップページ https://aka.ms/onnx
ONNX RT ONNX Runtimeトップページ https://aka.ms/onnx-rt
Kubeflow & MLOps
Kubeflow + Azure ML + DevOps サンプル
コード
https://aka.ms/kubeflow-and-mlops
Azure Open Datasets Azure Open Datasets Webページ https://aka.ms/azure-open-datasets
Azure ML Free Trial Azure フリートライアル https://aka.ms/amlfree
Azure ML Docs Azure Machine Learning ドキュメント https://aka.ms/azureml-ja-docs
Invent with purpose.

東北大学AIE - 機械学習中級編とAzure紹介