4. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
RQ1. ML開発者はMLシステムの設計
をどのように捉えて扱っているのか?
• 方法: 760+名の主として企業人へのアンケート調査
• 結果: 9名の回答。MLアーキテクチャ・デザインパタ
ーンについてほとんど知られていない。
4
参照アーキテクチャやパター
ンをMLSの設計において用い
ているか?
Yes No
3 (一般的なアーキテクチャ、
デザイン、クラウドパターン)
5
MLSの要求をどのように獲得
しているか?
パターン テンプレートや
プロセス
アドホック
0 2 7
MLSの非機能的特性をどのよ
うに保証しているか?
パターン プロセス アドホック
1 1 6
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
5. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
RQ2. 学術論文や灰色文献はMLシステム
の設計をどのように扱っているのか?
• 系統的文献調査: Engineering Village+Google
• 学術論文19編、灰色文献19編
5
((((system) OR (software)) AND (machine learning) AND (implementation pattern) OR
(pattern) OR (architecture pattern) OR (design pattern) OR (anti-pattern) OR (recipe) OR
(workflow) OR (practice) OR (issue) OR (template))) WN ALL) + ((cpx OR ins OR kna) WN
DB) AND (({ca} OR {ja} OR {ip} OR {ch}) WN DT)
(system OR software) "Machine learning" (pattern OR "implementation pattern" OR
"architecture pattern" OR "design pattern“ OR anti-pattern OR recipe OR workflow OR
practice OR issue OR template)
"machine implementation pattern" OR "architecture pattern" OR "design pattern“ OR anti-
pattern OR recipe OR workflow OR practice OR issue OR template
Engineering Village
Google
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
6. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
文献の傾向
6
0
1
2
3
4
5
6
7
8
9
10
2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
Scholarly
Gray
• 学術論文と灰色文献のいずれも概ね増加傾向
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
7. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
RQ3. MLアーキテクチャ・デザインパターン
はどのように分類できるか?
• MLパイプラインプロセスおよびISO/IEC 12207:2008
ソフトウェアライフサイクルプロセスによる分類
7
MLパイプラインプロセス (Microsoft)
S. Amershi, et al., “Software engineering for machine learning: a case study,” 41st International
Conference on Software Engineering: Software Engineering in Practice, ICSE (SEIP) 2019
Requirements
Analysis
Architectural
Design
Detailed
Design
Construction
Integration
Qualification
Testing
Software Implementation Process (ISO/IEC 12207:2008)
Model
Requirements
Data
Collection
Data
Cleaning
Feature
Engineering
Data
Labeling
Model
Training
Model
Evaluation
Model
Deployment
Model
Monitoring
8. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
RQ4. MLアーキテクチャ・デザインパターン
にはどのようなものがあるか?
• 文献からのパターン抽出およびプロセス上での分類
• 33パターン候補
8
Req. Analysis 1 1 2 2
Arch. Design 4 4 2 25 9
Detailed Design 3 7 3
Construction 2 13 3
Integration 1 2 8 4
Qualification 3 4 1
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
9. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
当初パターン候補
9
Undeclared Consumers
Abstraction Debt
Big Ass Script Architecture
Parameter-Server Abstraction
Federated Learning
Data Lake
Distinguish Business Logic from
ML Models
Gateway Routing Architecture
Data-Algorithm-Serving-
Evaluator
Closed-Loop Intelligence
Daisy Architecture
Event-driven ML Microservices
Microservice Architecture
Kappa Architecture
Lambda Architecture
Isolate Data Workload and Training Workload to Different
Machines
Wrap Black-Box Packages into Common APIs
Secure Aggregation
ML Versioning pattern
Test the infrastructure independently from the machine
learning
Handshake (Hand Buzzer)
Deployable Canary Model
Decouple Training Pipeline from Production Pipeline
Descriptive Data Type for Rich Information
Design Holistically about Data Collection and Feature Extraction
Reexamine Experimental Branches Periodically
Reuse Code between Training Pipeline and Serving Pipeline
Separation of Concerns and Modularization of ML Components
アーキテクチャパターン (12) デザインパターン(13)
アンチ・アーキテクチャパターン (3)
Multiple-Language Smell
Plain-Old-Data Type Smell
Dead Experimental Codepaths
Pipeline Jungles
Glue Code
アンチ・デザインパターン(5)
10. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
最終アーキテクチャ・デザインパターン
10
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
保守性関係
ビッグデータ・ストリーム基盤関係
説明性・安全性関係
“Engineerable”で拡充させていきたいところ
11. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
ビジネスロジック・サービス関係
• Separation of Concerns and Modularization of ML
Components
– 予測問題ごとにコンポーネント化
• Distinguish Business Logic from ML Models
– ビジネスロジックコンポーネントと機械学習コンポーネントの分
離
• ML Gateway Routing Architecture
– ゲートウェイにより要求に応じてビジネスロジックや推論のサー
ビスへ振り分け
• Microservice Architecture
– マイクロサービス化によるMLやロジックの疎結合
• Data Lake
– 構造化・非構造化データを保存する集中型リポジトリ
11
12. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
データ基盤・分散関係
• Lambda Architecture
– バッチ処理とストリーム処理の併用
• Kappa Architecture
– リアルタイムデータの高速ストリーム処理
• Isolate Data Workload and Training Workload to
Different Machines
– データワークロードと訓練ワークロードを異なるマシンに分離
• Parameter-Server Abstraction
– データ並列の分散機械学習
• Federated Learning
– ローカルデバイスで個別訓練、差分で共有モデル更新
• Secure Aggregation
– プライバシー保護の上で差分の収集
12
13. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
保守性・説明性・安全性関係
• Discard PoC code
– PoCで利用したコードは破棄
• ML Versioning
– 学習データおよび学習データのバージョンを管理
• Deployable Canary Model
– 説明可能なカナリアモデルの併用
• Encapsulate ML models within rule-base
safeguards
– 不確実な機械学習モデルを、検証可能な決定的規
則でカプセル化
13
14. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
関連研究とeAIパターンとの整理
• Machine Learning Design Patterns (Valliappa Lakshmanan, Sara
Robinson, Michael Munn (Google))
– https://medium.com/@lakshmanok/machine-learning-design-patterns-
58e6ecb013d7
– Googleプラットフォーム上でのMLの使いこなしや設計
– Data Representation: Hashed Feature, Reframing, Feature Cross,
Multimodal Input Representations
– Program Representation: Reframing, Multilabel, Ensembles, Cascade,
Neutral Class, Rebalancing
– Modify Model Training: Typical Training Loop, Useful Overfitting,
Checkpoints, Transfer Learning, Distribution Strategy, Hyperparameter
Tuning
• Machine learning system design pattern (澁井 (メルカリ))
– https://github.com/mercari/ml-system-design-pattern
– 機械学習のモデルやワークフローを本番システムで稼働させる作法
– Serving patterns, QA patterns, Training patterns, Operation patterns,
Lifecycle patterns
• eAI ML応用アーキテクチャ・デザインパターン(本講演)
– 系統的文献調査に基づきアーキテクチャや運用パターン中心+信頼性・
説明性関係、eAI (Engineerable) としての後者の拡充方向性
14
15. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
まとめと展望
• 機械学習工学こそ、パターン(ランゲージ)が必要!
• RQ1. MLシステム(MLS)の設計におけるパターンはほとん
ど知られていないか、活用されていない。
• RQ2. 数多くの学術論文や灰色文献がMLSの設計パターン
やプラクティスを扱っている。
• RQ3. MLアーキテクチャ・デザインパターンは、 MLパイプラ
インプロセスおよびISO/IEC 12207ソフトウェアライフサイク
ルプロセスにより分類できる。
• RQ4. 33のパターン候補、最終15パターンを抽出した。
• 展望
– 各パターンの評価、検証: アンケートにご協力ください!
– パターン間の関係整理とパターンランゲージ化へ
– 新たなパターンの特定・拡充、関連研究との位置づけ整理
15
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying Software Engineering Patterns for Designing Machine
Learning Systems,” The 10th International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
Hironori Washizaki, Foutse Khomh, Yann-Gael Gueheneuc, “Software Engineering Patterns for Machine Learning Applications (SEP4MLA),” 9th
Asian Conference on Pattern Languages of Programs (AsianPLoP 2020)
鷲崎 弘宜, 名取 直毅, 竹内 広宜, 奥田 聡, 本田 澄, 土肥 拓生, 内平 直志, “機械学習応用システムのアーキテクチャ・デザインパターンの体系化に向
けて”, ポスター, 第3回機械学習工学研究会(MLSE夏合宿2020)
16. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
16
s1 Developing machine learning products better
and faster at startups
s2 Hidden technical debt in machine learning
systems
s3 Machine learning at facebook: Understanding
inference at the edge
s4 Continuous integration of machine learning
models with ease.ml/ci: Towards a rigorous yet
practical treatment
s5 Uncertainty in machine learning applications: A
practice-driven classification of uncertainty
s6 Software architecture of a learning apprentice
system in medical billing
s7 Cleartk 2.0: Design patterns for machine
learning in UIMA
s8 Solution patterns for machine learning
s9 A survey on security threats and defensive
techniques of machine learning: A data driven
view
s10 Machine learning system architectural pattern
for improving operational stability
a1 Trials and tribulations of developers of
intelligent systems: A field study
a2 A methodology to involve domain experts
and machine learning techniques in the
design of human-centered algorithms
a3 Scaling distributed machine learning with the
parameter server
a4 Machine learning software engineering in
practice: An industrial case study
a5 Software engineering for machine learning: a
case study
a6 Integrated machine learning in the kepler
scientific workflow system
a7 Deep convolutional neural network design
patterns
a8 Practical Machine Learning
a9 Stream Analytics with Microsoft Azure: Real-
time data processing for quick insights using
Azure Stream Analytics
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)
17. 質問 http://sli.do/ #58755
アンケートhttp://u0u1.net/Urae
17
g1 Scaling machine learning at uber with
michelangelo
g2 Federated learning: Collaborative machine
learning without centralized training data
g3 Design patterns for deep learning
g4 Design patterns for machine learning in
production
g5 Patterns (and anti-patterns) for developing
machine learning systems
g6 The mvc for machine learning: Datamodel-
learner (dml)
g7 Rules of machine learning: Best practices for
ml engineering
g8 A design pattern for machine learning with
scala, spray and spark
g9 Closed-loop intelligence: A design pattern for
machine learning
g10 A design pattern for explainability and
reproducibility in production ml
g11 Top trends: Machine learning,
microservices, containers, kubernetes,
cloud to edge. what are they and how do
they fit together?
g12 Daisy architecture
g13 Event-driven architecture
g14 Demystifying data lake architecture
g15 Exploring development patterns in data
science
g16 Architecture of data lake
g17 From insights to value - building a modern
logical data lake to drive user adoption and
business value
g18 Lambda architecture pattern
g19 Busting event-driven myths
Hironori Washizaki, Hiromu Uchida, Foutse Khomh and Yann-Gael Gueheneuc, “Studying
Software Engineering Patterns for Designing Machine Learning Systems,” The 10th
International Workshop on Empirical Software Engineering in Practice (IWESEP 2019)