2. eAIプロセスパターンチームで整理したパターンの⼀覧
2
番号 パターン名
01 a04 Separation of Concerns and Modularization of ML Components
02 g02a Federated Learning
03 g02b Secure Aggregation
04 g10 Deployable Canary Model
05 g15b Microservice Architecture
06 g16 Data Lake
07 g17 Kappa Architecture
08 g18 Lambda Architecture
09 s02f Discard PoC code
10 s02h Parameter-Server Abstraction
11 s03a Isolate Data Workload and Training Workload to Different Machines
12 s03b ML Versioning
13 s05 Encapsulate ML models within rule-base safeguards
14 s10a Distinguish Business Logic from ML Models
15 s10b ML Gateway Routing Architecture
4. アーキテクチャ・デザインパターンの全体像
4
Separation of Concerns and
Modularization of ML Components
Federated Learning
Secure
Aggregation
Deployable
Canary
Model
Microservice Architecture
Data Lake
Kappa Architecture
Discard PoC code
Parameter-Server
AbstractionIsolate Data Workload and Training
Workload to Different Machines
ML Versioning Encapsulate ML models
within rule-base
safeguards
Distinguish Business
Logic from ML Models
ML Gateway Routing
Architecture
ビジネスロジックとの分離関係 Web・マイクロサービス関係
分散・エッジ関係
Lambda Architecture
保守性関係
ビッグデータ・ストリーム基盤関係
説明性・安全性関係
5. s10a: Distinguish Business Logic from ML Models
n ビジネスロジック⽤のコンポーネントと機械学習⽤のコンポーネントを分離
5 Haruki Yokoyama, Machine Learning System Architectural Pattern for Improving Operational Stability. ICSA Companion 2019: 267-274
6. g15b: Microservice Architecture
n 複雑なアプリケーション間でのやり取りを無くして、標準的なインターフェースで通信を⾏う
6
DANIEL SMITH, Exploring Development Patterns in Data Science. https://www.theorylane.com/2017/10/20/some-development-patterns-in-data-science/
Azure Machine Learning とは. https://docs.microsoft.com/ja-jp/azure/machine-learning/overview-what-is-azure-ml
10. s03a: Isolate Data Workload and Training Workload
to Different Machines
n 異なるワークロードを異なるマシンに物理的に分離し柔軟性とスケーラビリティを実現
Ø ストレージからデータを読み取り凝縮するデータワークロード
Ø 迅速かつ効率的に訓練する訓練ワークロード
n ワークロードの内容や規模、ネットワーク使⽤量に合わせ圧縮、スケジューリング、データ/計算機配置・構成最適化
10 Kim M. Hazelwood, et al. : Applied Machine Learning at Facebook: A Datacenter Infrastructure Perspective. HPCA 2018: 620-629
12. G02a: Federated Learning
① 共有モデル(訓練済みモデル)をローカルデバイスに配置
② ローカルデバイスで収集された利⽤データを元に共有モデルを再訓練
③ 各ローカルデバイスから提供された共有モデルからの差分を⽤いて、共有モデルを改良
12
①
①
②
②
③再訓練に⽤いる
利⽤データ
13. 実現例
n Android端末上のGboard (Googleキーボード)
① 各端末に共有モデルを配置
② 利⽤者の変換データを⽤いて再訓練
③ モデルの差分を抽出
④ 各端末からの差分を収集
⑤ 共有モデルへ反映するものを抽出
⑥ 共有モデルの更新
13
https://webbigdata.jp/ai/post-1915
①②
③
④
⑤
⑥
14. S02f: Discard PoC code
① PoCのために作成したコードは破棄し、PoCで得た知⾒に基づき保守性の⾼い
コードを再構築する
② ⼀般的に、PoCのために作成したコードでは、試⾏錯誤を効率的に実施するた
めの保守性を犠牲にしたコードや、最終的には不要なったコードが含まれることが
多い。
③ このPoCのために作成したコードを、プロダクトコードに組み込むと、プロダクトの品
質を低下させてしまうため、PoCで検証した事実に基づき、全体的に再設計した
ものを、プロダクトコードに組み込む。
14
15. G10: Canary Model for Explainability
15
① 外部条件を含め完全な⼊⼒データをアーカイブ
② 説明可能なカナリアモデルと説明不可能な本番モデルをランデブー
③ モデル出⼒の異変を検知して、再現や再学習
⼊⼒
デコイモデル データレイク
①
カナリアモデル
(決定⽊等)
本番モデル
(DNN等)
モニタリング・⽐較
(t-digest等)②
モデル
出⼒
モデル
出⼒
再現・再学習
カメラ画像
天気
気温
地理季節
⽇付・時刻
③
16. 実現例(1)
n ParallelM(is now part of DataRobot)社のMLOps(MCenter)
16
https://www.parallelm.com/a-design-pattern-for-explainability-and-reproducibility-in-production-ml/
18. まとめ
n eAIプロセス・パターンチームで整理・検討しているパターンの⼀部を紹介
18
Separation of Concerns and
Modularization of ML Components
Federated Learning
Secure
Aggregation
Deployable
Canary
Model
Microservice Architecture
Data Lake
Kappa Architecture
Discard PoC code
Parameter-Server
AbstractionIsolate Data Workload and Training
Workload to Different Machines
ML Versioning Encapsulate ML models
within rule-base
safeguards
Distinguish Business
Logic from ML Models
ML Gateway Routing
Architecture
ビジネスロジックとの分離関係 Web・マイクロサービス関係
分散・エッジ関係
Lambda Architecture
保守性関係
ビッグデータ・ストリーム基盤関係
説明性・安全性関係