SlideShare a Scribd company logo
1 of 29
Download to read offline
2021 IEEE International Conference on Electronic Technology, Communication
and Information (ICETCI 2021)
Software Engineering Patterns for Machine
Learning Applications
Hironori Washizaki
Professor at Waseda University, Tokyo, Japan
washizaki@waseda.jp http://www.washi.cs.waseda.ac.jp/
Supported by JST MIRAI eAI JPMJMI20B8 https://www.jst.go.jp/mirai/jp/program/super-smart/JPMJMI20B8.html
• 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)
• Hironori Washizaki, Foutse Khomh, Yann-Gaël Guéhéneuc, Hironori Takeuchi, Satoshi Okuda, Naotake Natori, Naohisa Shioura,
“Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2”, the 27th Conference on Pattern
Languages of Programs in 2020 (PLoP’20)
• Hironori Washizaki, Hironori Takeuchi, Foutse Khomh, Naotake Natori, Takuo Doi, Satoshi Okuda, “Practitioners’ insights on
machine-learning software engineering design patterns: a preliminary study,” 36th IEEE International Conference on Software
Maintenance and Evolution (ICSME 2020), Late Breaking Ideas track
• Yasuhiro Watanabe, Hironori Washizaki, Kazunori Sakamoto, Daisuke Saito, Kiyoshi Honda, Naohiko Tsuda, Yoshiaki Fukazawa,
Nobukazu Yoshioka, “Preliminary Literature Review of Machine Learning System Development Practices,” 45th IEEE Computer
Society Signature Conference on Computers, Software and Applications (COMPSAC 2021), Fast Abstract
• Jati H. Husen, Hnin Thandar Tun, Nobukazu Yoshioka, Hironori Washizaki and Yoshiaki Fukazawa, “Goal-Oriented Machine
Learning-Based Component Development Process,” ACM/IEEE 24th International Conference on Model Driven Engineering
Languages and Systems (MODELS 2021), Poster
Prof. Dr. Hironori Washizaki
• Professor and the Associate Dean of the Research
Promotion Division at Waseda University in Tokyo
• Visiting Professor at the National Institute of Informatics
• Outside Directors of SYSTEM INFORMATION and
eXmotion
• Research and education projects
• Leading a large-scale grant at MEXT enPiT-Pro Smart
SE
• Leading framework team of JST MIRAI eAI project
• Professional contributions
• IEEE Computer Society Vice President for Professional
and Educational Activities
• Editorial Board Member of MDPI Education Sciences
• Steering Committee Member of the IEEE Conference on
Software Engineering Education and Training (CSEE&T)
• Associate Editor of IEEE Transactions on Emerging
Topics in Computing
• Advisory Committee Member of the IEEE-CS COMPSAC
• Steering Committee Member of Asia-Pacific Software
Engineering Conference (APSEC)
• Convener of ISO/IEC/JTC1 SC7/WG20
Agenda
• ML software engineering and patterns
• Literature review of software engineering
patterns for ML applications
• Classification of ML patterns
• Practitioners’ insights on ML patterns
3
4
Street Cafe
Problem: Needs to have a place where
people can sit lazily, legitimately, be on
view, and watch the world go by…
Solution: Encourage local cafes to spring
up in each neighborhood. Make them
intimate places, with several rooms, open
to a busy path … Alexander, Christopher, et al. A Pattern Language. Oxford University Press, 1977.
https://unsplash.com/photos/8IKf54pc3qk https://unsplash.com/photos/zACLEreWKXE
Towards a pattern language
… OK, so, to attract many
people to our city, Small
Public Squares should be
located in the center. At the
SMALL PUBLIC SQUARE,
make Street Cafes be
Opening to the Street ...
5
Small Public
Square
Street
Cafe
Opening to the
Street
https://unsplash.com/photos/EdpbTj3Br-Y
https://unsplash.com/photos/GqurqYbj7aU
https://unsplash.com/photos/zFoRwZirFvY
ML software engineering:
Induction (and abduction)
6
Goal Data
Model Behavior
Goal Model Behavior Data
Conventional software engineering: Deduction
ML software engineering: Induction (and abduction)
H. Maruyama, “Machine Learning Engineering and Reuse of AI Work Products,” The First International Workshop on Sharing
and Reuse of AI Work Products, 2017
Hironori Washizaki, “Towards Software Value Co-Creation with AI”, The 44th IEEE Computer Society Signature Conference
on Computers, Software, and Applications (COMPSAC 2020), Fast Abstract
ML software engineering needs patterns!
• Bridge between abstract paradigms and
concrete cases/tools
– Documenting Know-Why, Know-What and
Know-How
– Reusing solutions and problems
– Getting consistent architecture
• Common language among stakeholders
– Software engineers, data scientist, domain
experts, network engineers, …
7
Paradigm
Case
Tool
FW
Instruction
?
?
Practices and patterns in ML-SE
• Researchers and practitioners studying
best practices strive to design Machine
Learning (ML) systems and software.
• Some practices are formalized as
patterns.
(NOTE: NOT handle ML model patterns.)
8
Data Lake for ML
K. M. Hazelwood, et al., Applied Machine Learning at Facebook: A Datacenter Infrastructure Perspective, HPCA 2018
Different Workloads in Different Computing Environments (e.g., Facebook)
https://unsplash.com/photos/_HPlEmsKgP0
FBLearner
Feature Store
FBLearner
Flow
FBLearner
Predictor
Trained
model
Deployed
model
Features
Data
FBLearner
Feature Store
FBLearner
Flow
FBLearner
Predictor
Storage CPU CPU + GPU CPU
H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
Structured
data
Unstructured
data
Problem and goal
• ML system architecture and design patterns at different
abstraction levels are not well classified and studied.
• Thus, we conducted a survey of software developers and
an Systematic Literature Review.
9
Well-documented patterns
Different Workloads in Different
Computing Environments
Practices with less
information
Data Lake
for ML
Scholarly papers
Gray documents
Agenda
• ML software engineering and patterns
• Literature review of software engineering
patterns for ML applications
• Classification of ML patterns
• Practitioners’ insights on ML patterns
10
Research questions
• RQ1. Does academic and gray literature address the
design of ML systems and software?
– 19 scholarly and 19 gray documents identified
– 15 SE patterns for ML applications extracted
• RQ2. Can ML patterns be classified?
– Categories of scopes: Topology, programming and model
– Quality attributes: ISO/IEC 25010:2011 System and
software product quality attributes, ML model and
prediction quality attributes
• RQ3. How do practitioners perceive ML patterns?
– Questionnaire-based survey for 600+ developers
– Developers were unfamiliar with most ML patterns,
although there were several major patterns used by 20%
11
RQ1. Does academic and gray literature address
the design of ML systems and software?
• Systematic Literature Review (SLR)
– Scholar papers: Engineering Village
– Gray documents: Google
• 19 scholarly papers and 19 gray documents identified
• 15 patterns extracted
12
((((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
Numbers of documents per year
13
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
• ML application systems have recently become popular due to
the promotion of artificial intelligence.
• Since 2008, academic and gray documents have discussed
good (bad) practices of ML application systems design.
H. Washizaki, et al., Studying Software Engineering Patterns for Designing Machine Learning Systems, IWESEP 2019
Agenda
• ML software engineering and patterns
• Literature review of software engineering
patterns for ML applications
• Classification of ML patterns
• Practitioners’ insights on ML patterns
14
RQ2. Can ML patterns be classified?
• Model operation patterns that focus on ML models
• Programming patterns that define the design of a
particular component
• Topology patterns that define the entire system
architecture.
15
Training data
Trained model Prediction
Training
Infrastructure
Input data
Programming
patterns
Serving
Infrastructure
Model
operation
patterns
Topology patterns
H. Washizaki, et al., Practitioners’ insights on machine-learning software engineering design patterns: a preliminary study, ICSME 2020
Topology patterns
16
Pattern Problem Solution
Different Workloads in
Different Computing
Environments
It is necessary to separate and
quickly change the ML data
workload …
Physically isolate different workloads to
separate machines…
Distinguish Business
Logic from ML Models
The overall business logic should be
isolated from the ML models …
Separate the business logic and the
inference engine, loosely coupling the
business logic and ML-specific dataflows.
ML Gateway Routing
Architecture
Difficult to set up and manage
individual endpoints for each
service…
Install a gateway before a set of
applications …
Microservice
Architecture for ML
ML applications may be confined to
some
“known” ML frameworks …
Provide well-defined services to use for
ML frameworks….
Lambda Architecture
for ML
Real-time data processing requires
scalability,
fault tolerance, predictability …
The batch layer keeps producing views
while the speed layer creates the
relevant real-time views …
Kappa Architecture for
ML
It is necessary to deal with huge
amount of
data with less code resource …
Support both real-time data processing
and continuous reprocessing with a
single stream processing engine …
H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
Distinguish Business Logic from ML Models
• Problem: Business logic should be isolated from ML models so that they can
be changed without impacting rest of business logic.
• Solution: Separate the business logic and the inference engine, loosely
coupling the business logic and ML-specific dataflows.
17
H. Yokoyama, Machine Learning System Architectural Pattern for Improving Operational Stability, ICSA-C, 2019
H. Washizaki, et al., Software Engineering Patterns for Machine Learning Applications (SEP4MLA), AsianPLoP 2020
Data Layer
Logic Layer
Presentation Layer
User
Interface
Database
Data
Collection
Data Lake
Business
Logic
Data
Processing
Inference
Engine
Real
World
Business
Logic
Specific
ML
Specific
Architectural Layers
Deployed as ML System
Business Logic Data Flow
ML Runtime Data Flow
ML Development Data Flow
Legend
Usage of Distinguish Business Logic from ML Models
18
Data Layer
Logic Layer
Presentation Layer
User Interface
(Chatbot UI)
Web App
Front-end
Slack
Business Logic
(Chatbot Logic)
Web App
Back-end
Slack
Data Collection
(Dataset)
Datasets
Nagoya Univ.
Conversation
Corpus
Data Processing
(Text to Vector Transformer)
NN Model
pre- and post-
processing
TensorFlow
Inference Engine
(Language Model)
NN Model TensorFlow
Database
(Previous Q&A Store)
DB Server (None)
Data Lake
(Vectorized Corpus)
Word
Vector
TensorFlow
(Text)
Users
Data
Source
Input
Output
Datasets
ML
Input
ML Output
Architectural Elements
(Example Role as Chatbot)
What How
Business Logic Data Flow
ML Development Data Flow
ML Runtime Data Flow
Input Data
Output Data
Input Data
Datasets
Word
Vector
Legend
Programming patterns
19
Pattern Problem Solution
Data Lake for ML We cannot foresee the kind of
analyses that will be performed on
the data …
Store data, which range from structured
to unstructured, as “raw” as possible
into a data storage …
Separation of
Concerns and
Modularization of ML
Components
ML applications must accommodate
regular and frequent changes to
their ML components …
Decouple at different levels of
complexity from the simplest to the
most complex …
Encapsulate ML
Models within Rule-
based Safeguards
ML models are known to be unstable
and vulnerable to adversarial attacks,
drifts, …
Encapsulate functionality in the
containing system using deterministic
and verifiable rules …
Discard PoC Code The code created for Proof of
Concept (PoC) often includes code
that sacrifices maintainability …
Discard the code created for the PoC
and rebuild maintainable code …
H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
Encapsulate ML Models within
Rule-based Safeguards
• Problem: ML models are known to be unstable and vulnerable to
adversarial attacks, noise, and data drift.
• Solution: Encapsulate functionality provided by ML models and deal
with the inherent uncertainty in the containing system using
deterministic and verifiable rules.
• Know usage: E.g. Apollos’s object detection [Peng20]
20
Business
Logic API
Rule-based
Safeguard
Inference
(Prediction)
Encapsulated
ML model
Input
Output
Rule
H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
Z. Peng, et al., A First Look at the Integration of Machine Learning Models in Complex Autonomous Driving Systems, ESEC/FSE’20
Model operation patterns
21
Pattern Problem Solution
Parameter-Server
Abstraction
For distributed learning, widely
accepted abstractions are lacking …
Distribute both data and workloads over
worker nodes, while the server nodes
maintain globally shared parameters …
Data Flows Up, Model
Flows Down
Standard ML approaches require
centralizing the training data on one
machine …
Enable mobile devices to collaboratively
learn while keeping all the training data
on the device as federated learning …
Secure Aggregation The system needs to communicate
and aggregate model updates in a
secure and scalable way …
Encrypt data from each device and
calculate totals and averages without
individual examination …
Deployable Canary
Model
A surrogate ML that approximates
the behavior of best model must be
built to provide explainability …
Run the explainable inference pipeline
in parallel to monitor prediction
differences …
ML Versioning ML models and their different
versions may change the behavior of
the overall ML applications …
Record the ML model, dataset, and code
to ensure a reproducible training and
inference processes …
H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
Deployable Canary Model
• Problem: A surrogate ML that approximates the behavior of the
best ML model must be built to provide explainability.
• Solution: Run the explainable inference pipeline in parallel with
the primary inference pipeline to monitor prediction differences.
• Known usage: Image-based anomaly detection at factory
22
S. Ghanta et al., Interpretability and reproducibility in production machine learning applications, ICMLA 2018
Input
Decoy model Data lake
Canary model
(E.g., Decision
tree)
Production
model
(E.g., DNN)
Monitoring
and
comparison
Output
Output
Reproduce
and
retraining
23
Pattern Perfor
mance
Compa
tibility
Relia
bility
Securi
ty
Maintai
nability
Porta
bility
Robus
tness
Explaina
bility
Accur
acy
Different Workloads in Different
Computing Environments
X X
Distinguish Business Logic from
ML Models
X
ML Gateway Routing
Architecture
X X
Microservice Architecture for ML X X X
Lambda Architecture for ML X X
Kappa Architecture for ML X X
Data Lake for ML X X X
Separation of Concerns and
Modularization of ML
Components
X
Encapsulate ML Models within
Rule-based Safeguards
X
Discard PoC Code X
Parameter-Server Abstraction X X
Data Flows Up, Model Flows
Down
X X X
Secure Aggregation X X X
Deployable Canary Model X X
ML Versioning X X X
Agenda
• ML software engineering and patterns
• Literature review of software engineering
patterns for ML applications
• Classification of ML patterns
• Practitioners’ insights on ML patterns
24
RQ3. Practitioners’ insights on quality
• Surveyed 300+ developers, 46 answered in ML development
• What product quality attributes considered?
– Maintainability, reliability, security, and usability
• What model and prediction quality attributes?
– Robustness, accuracy, and explainability
• Maintainability, reliability, robustness and accuracy are well
handled by ML patterns. There are demands for having ML
patterns addressing security, usability, and explainability,
which are not handled well now.
25
3
3
4
13
19
20
20
21
28
0 20 40
(not considered)
Compatibility
Portability
Performance efficiency
Usability
Reliability
Security
Maintainability
Functional suitability
10
4
20
21
26
0 10 20 30
(not considered)
Fairness
Accuracy
Explainability
Robustness
H. Washizaki, et al., Practitioners’ insights on machine-learning software engineering design patterns: a preliminary study, ICSME 2020
Practitioners’ insights on ML design patterns
• Surveyed 600+
developers, 118
answered
• Have you ever
referred to ML
patterns?
– Major:
ML Versioning,
Microservice
Architecture for
ML
– None:
Secure
Aggregation,
Data Flows Up
(aka. Federated
Learning)
26
Knew it Didn’t know it
0 20 40 60 80 100 120
Data Flows Up, Model Flows Down
Secure Aggregation
Deployable Canary Model
Kappa Architecture for ML
Parameter-Server Abstraction
Different Workloads in Different Computing…
Encapsulate ML models within rule-base…
ML Gateway Routing Architecture
Lambda Architecture for ML
Separation of Concerns and Modularization of…
Distinguish Business Logic from ML Models
Data Lake for ML
Discard PoC code
Microservice Architecture for ML
ML Versioning
Used it Never used it Consider using it Not consider
Practitioners’ insights on ML design patterns
• Have you ever referred to ML patterns?
– Developers were unfamiliar with most ML patterns, although there
were several major patterns used by 20+% of the respondents.
– For all patterns, most respondents indicated that they would
consider using them in future designs.
– Promoting existing ML patterns will increase their utilization
• How do you solve and share design challenges of ML
application systems?
– 37 (i.e., 31%) organized design patterns and past design results.
– As respondents become more organized in their approach to design
problems by reuse, the pattern usage ratio increased.
– Development teams and organizations will reuse more ML patterns
as they become more consistent in their reuse approach.
27
Design solution and reuse practice #Respondents #Patterns
used
Pattern
usage ratio
Lv3. Organizing, reusing patterns (and past results) 37 64 11.5%
Lv2. Reusing externally documented patterns 31 50 10.8%
Lv1. Resolving problems in an ad-hoc way 37 35 6.3%
Others 13 3 1.5%
Conclusion
• ML software engineering needs patterns!
– As bride and common language
• Literature review of academic and gray literature
– 19 scholarly and 19 gray documents identified.
– 15 SE patterns for ML applications extracted.
– Patterns at https://eai-transfer.github.io/ml-design-pattern/en/
– ML patterns can be classified by scopes and quality attributes
• Survey of practitioners’ insights
– Developers were unfamiliar with most ML patterns, although
there were several major patterns used by 20% (such as ML
Versioning and Microservice Architecture for ML)
– 31% organized design patterns and past design results.
– As respondents become more organized in their approach to
design problems by reuse, the pattern usage ratio increased. 28
Future research direction
• Identify ML patterns addressing specific quality attributes
that are not handled well now
– Security, usability, and explainability
• Investigate the impact of patterns on quality attributes of
systems
• Analyze relationships among patterns including related
ones towards a pattern language
– V. Lakshmanan et al., “Machine Learning Design Patterns,”
O’Reilly, 2020.
– Y. Shibui, “Machine Learning System Design Patterns”,
https://github.com/mercari/ml-system-design-pattern, 2020.
• Integration into framework to handle from requirements
ton implementations and testing/debugging
29
Jati H. Husen, Hnin Thandar Tun, Nobukazu Yoshioka, Hironori Washizaki and Yoshiaki Fukazawa, “Goal-Oriented Machine
Learning-Based Component Development Process,” ACM/IEEE 24th International Conference on Model Driven Engineering
Languages and Systems (MODELS), Poster

More Related Content

What's hot

Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - IntroductionModel-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Marco Brambilla
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
Slideshare
 
Agile Project Management
Agile Project ManagementAgile Project Management
Agile Project Management
Abdullah Khan
 
Ch22-Software Engineering 9
Ch22-Software Engineering 9Ch22-Software Engineering 9
Ch22-Software Engineering 9
Ian Sommerville
 
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Jordi Cabot
 
Software requirements engineering lecture 01
Software requirements engineering   lecture 01Software requirements engineering   lecture 01
Software requirements engineering lecture 01
Abdul Basit
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
koolkampus
 
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
Sri Ambati
 

What's hot (20)

Maturing Agile SDLC & workflow improvements
Maturing Agile SDLC & workflow improvementsMaturing Agile SDLC & workflow improvements
Maturing Agile SDLC & workflow improvements
 
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and PrometheusRobust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
Robust MLOps with Open-Source: ModelDB, Docker, Jenkins, and Prometheus
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - IntroductionModel-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
 
ML Drift - How to find issues before they become problems
ML Drift - How to find issues before they become problemsML Drift - How to find issues before they become problems
ML Drift - How to find issues before they become problems
 
Ml ops past_present_future
Ml ops past_present_futureMl ops past_present_future
Ml ops past_present_future
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
 
Architecture vs Design
Architecture vs DesignArchitecture vs Design
Architecture vs Design
 
Introduction to formal methods
Introduction to formal methodsIntroduction to formal methods
Introduction to formal methods
 
What is MLOps
What is MLOpsWhat is MLOps
What is MLOps
 
Agile Project Management
Agile Project ManagementAgile Project Management
Agile Project Management
 
Architectural structures and views
Architectural structures and viewsArchitectural structures and views
Architectural structures and views
 
Ch22-Software Engineering 9
Ch22-Software Engineering 9Ch22-Software Engineering 9
Ch22-Software Engineering 9
 
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
Model-Driven Software Engineering in Practice - Chapter 8 - Model-to-model tr...
 
MLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleMLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at Scale
 
Software requirements engineering lecture 01
Software requirements engineering   lecture 01Software requirements engineering   lecture 01
Software requirements engineering lecture 01
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
 
DDD - 4 - Domain Driven Design_ Architectural patterns.pdf
DDD - 4 - Domain Driven Design_ Architectural patterns.pdfDDD - 4 - Domain Driven Design_ Architectural patterns.pdf
DDD - 4 - Domain Driven Design_ Architectural patterns.pdf
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
Design Patterns for Machine Learning in Production - Sergei Izrailev, Chief D...
 

Similar to Software Engineering Patterns for Machine Learning Applications

What do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A SurveyWhat do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A Survey
Obeo
 
Unifying an Introduction to Artificial Intelligence Course ...
Unifying an Introduction to Artificial Intelligence Course ...Unifying an Introduction to Artificial Intelligence Course ...
Unifying an Introduction to Artificial Intelligence Course ...
butest
 

Similar to Software Engineering Patterns for Machine Learning Applications (20)

Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Iwesep19.ppt
 
Landscape of IoT and Machine Learning Patterns
Landscape of IoT and Machine Learning PatternsLandscape of IoT and Machine Learning Patterns
Landscape of IoT and Machine Learning Patterns
 
Studying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning SystemsStudying Software Engineering Patterns for Designing Machine Learning Systems
Studying Software Engineering Patterns for Designing Machine Learning Systems
 
Patterns for New Software Engineering: Machine Learning and IoT Engineering P...
Patterns for New Software Engineering: Machine Learning and IoT Engineering P...Patterns for New Software Engineering: Machine Learning and IoT Engineering P...
Patterns for New Software Engineering: Machine Learning and IoT Engineering P...
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
 
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
 
What do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A SurveyWhat do Practitioners Expect from the Meta-modeling Tools? A Survey
What do Practitioners Expect from the Meta-modeling Tools? A Survey
 
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdfCS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
CS251 Intro. to SE [Lec. 0 - Course Introduction & Plan] Spring 2022.pdf
 
Se research update
Se research updateSe research update
Se research update
 
Introduction to MDE
Introduction to MDEIntroduction to MDE
Introduction to MDE
 
CSE_2014 SE MODULE 1 V.10 (2).pptx
CSE_2014 SE MODULE 1 V.10 (2).pptxCSE_2014 SE MODULE 1 V.10 (2).pptx
CSE_2014 SE MODULE 1 V.10 (2).pptx
 
Data-X-v3.1
Data-X-v3.1Data-X-v3.1
Data-X-v3.1
 
Unifying an Introduction to Artificial Intelligence Course ...
Unifying an Introduction to Artificial Intelligence Course ...Unifying an Introduction to Artificial Intelligence Course ...
Unifying an Introduction to Artificial Intelligence Course ...
 
CSE_2014 SE MODULE 1 V.10.pptx
CSE_2014 SE MODULE 1 V.10.pptxCSE_2014 SE MODULE 1 V.10.pptx
CSE_2014 SE MODULE 1 V.10.pptx
 
Data-X-Sparse-v2
Data-X-Sparse-v2Data-X-Sparse-v2
Data-X-Sparse-v2
 
202212APSEC.pptx.pdf
202212APSEC.pptx.pdf202212APSEC.pptx.pdf
202212APSEC.pptx.pdf
 
Critiquing CS Assessment from a CS for All lens: Dagstuhl Seminar Poster
Critiquing CS Assessment from a CS for All lens: Dagstuhl Seminar PosterCritiquing CS Assessment from a CS for All lens: Dagstuhl Seminar Poster
Critiquing CS Assessment from a CS for All lens: Dagstuhl Seminar Poster
 
NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)NL based Object Oriented modeling - EJSR 35(1)
NL based Object Oriented modeling - EJSR 35(1)
 
Cse 8th sem syllabus
Cse 8th sem syllabusCse 8th sem syllabus
Cse 8th sem syllabus
 

More from Hironori Washizaki

More from Hironori Washizaki (20)

IEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateIEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions Update
 
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
 
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
 
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
 
Joseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about ArchitectureJoseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about Architecture
 
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
 
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
 
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
 
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
 
スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介
 
DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方
 
対応性のある運用のパターン
対応性のある運用のパターン対応性のある運用のパターン
対応性のある運用のパターン
 
モデル訓練のパターン
モデル訓練のパターンモデル訓練のパターン
モデル訓練のパターン
 
パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度
 
データ表現のパターン
データ表現のパターンデータ表現のパターン
データ表現のパターン
 
機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクル機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクル
 
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
 
機械学習デザインパターンおよび機械学習システムの品質保証の取り組み
機械学習デザインパターンおよび機械学習システムの品質保証の取り組み機械学習デザインパターンおよび機械学習システムの品質保証の取り組み
機械学習デザインパターンおよび機械学習システムの品質保証の取り組み
 
Rubric-based Assessment of Programming Thinking Skills and Comparative Evalua...
Rubric-based Assessment of Programming Thinking Skills and Comparative Evalua...Rubric-based Assessment of Programming Thinking Skills and Comparative Evalua...
Rubric-based Assessment of Programming Thinking Skills and Comparative Evalua...
 
機械学習デザインパターン Machine Learning Design Patterns
機械学習デザインパターン Machine Learning Design Patterns機械学習デザインパターン Machine Learning Design Patterns
機械学習デザインパターン Machine Learning Design Patterns
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

Software Engineering Patterns for Machine Learning Applications

  • 1. 2021 IEEE International Conference on Electronic Technology, Communication and Information (ICETCI 2021) Software Engineering Patterns for Machine Learning Applications Hironori Washizaki Professor at Waseda University, Tokyo, Japan washizaki@waseda.jp http://www.washi.cs.waseda.ac.jp/ Supported by JST MIRAI eAI JPMJMI20B8 https://www.jst.go.jp/mirai/jp/program/super-smart/JPMJMI20B8.html • 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) • Hironori Washizaki, Foutse Khomh, Yann-Gaël Guéhéneuc, Hironori Takeuchi, Satoshi Okuda, Naotake Natori, Naohisa Shioura, “Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2”, the 27th Conference on Pattern Languages of Programs in 2020 (PLoP’20) • Hironori Washizaki, Hironori Takeuchi, Foutse Khomh, Naotake Natori, Takuo Doi, Satoshi Okuda, “Practitioners’ insights on machine-learning software engineering design patterns: a preliminary study,” 36th IEEE International Conference on Software Maintenance and Evolution (ICSME 2020), Late Breaking Ideas track • Yasuhiro Watanabe, Hironori Washizaki, Kazunori Sakamoto, Daisuke Saito, Kiyoshi Honda, Naohiko Tsuda, Yoshiaki Fukazawa, Nobukazu Yoshioka, “Preliminary Literature Review of Machine Learning System Development Practices,” 45th IEEE Computer Society Signature Conference on Computers, Software and Applications (COMPSAC 2021), Fast Abstract • Jati H. Husen, Hnin Thandar Tun, Nobukazu Yoshioka, Hironori Washizaki and Yoshiaki Fukazawa, “Goal-Oriented Machine Learning-Based Component Development Process,” ACM/IEEE 24th International Conference on Model Driven Engineering Languages and Systems (MODELS 2021), Poster
  • 2. Prof. Dr. Hironori Washizaki • Professor and the Associate Dean of the Research Promotion Division at Waseda University in Tokyo • Visiting Professor at the National Institute of Informatics • Outside Directors of SYSTEM INFORMATION and eXmotion • Research and education projects • Leading a large-scale grant at MEXT enPiT-Pro Smart SE • Leading framework team of JST MIRAI eAI project • Professional contributions • IEEE Computer Society Vice President for Professional and Educational Activities • Editorial Board Member of MDPI Education Sciences • Steering Committee Member of the IEEE Conference on Software Engineering Education and Training (CSEE&T) • Associate Editor of IEEE Transactions on Emerging Topics in Computing • Advisory Committee Member of the IEEE-CS COMPSAC • Steering Committee Member of Asia-Pacific Software Engineering Conference (APSEC) • Convener of ISO/IEC/JTC1 SC7/WG20
  • 3. Agenda • ML software engineering and patterns • Literature review of software engineering patterns for ML applications • Classification of ML patterns • Practitioners’ insights on ML patterns 3
  • 4. 4 Street Cafe Problem: Needs to have a place where people can sit lazily, legitimately, be on view, and watch the world go by… Solution: Encourage local cafes to spring up in each neighborhood. Make them intimate places, with several rooms, open to a busy path … Alexander, Christopher, et al. A Pattern Language. Oxford University Press, 1977. https://unsplash.com/photos/8IKf54pc3qk https://unsplash.com/photos/zACLEreWKXE
  • 5. Towards a pattern language … OK, so, to attract many people to our city, Small Public Squares should be located in the center. At the SMALL PUBLIC SQUARE, make Street Cafes be Opening to the Street ... 5 Small Public Square Street Cafe Opening to the Street https://unsplash.com/photos/EdpbTj3Br-Y https://unsplash.com/photos/GqurqYbj7aU https://unsplash.com/photos/zFoRwZirFvY
  • 6. ML software engineering: Induction (and abduction) 6 Goal Data Model Behavior Goal Model Behavior Data Conventional software engineering: Deduction ML software engineering: Induction (and abduction) H. Maruyama, “Machine Learning Engineering and Reuse of AI Work Products,” The First International Workshop on Sharing and Reuse of AI Work Products, 2017 Hironori Washizaki, “Towards Software Value Co-Creation with AI”, The 44th IEEE Computer Society Signature Conference on Computers, Software, and Applications (COMPSAC 2020), Fast Abstract
  • 7. ML software engineering needs patterns! • Bridge between abstract paradigms and concrete cases/tools – Documenting Know-Why, Know-What and Know-How – Reusing solutions and problems – Getting consistent architecture • Common language among stakeholders – Software engineers, data scientist, domain experts, network engineers, … 7 Paradigm Case Tool FW Instruction ? ?
  • 8. Practices and patterns in ML-SE • Researchers and practitioners studying best practices strive to design Machine Learning (ML) systems and software. • Some practices are formalized as patterns. (NOTE: NOT handle ML model patterns.) 8 Data Lake for ML K. M. Hazelwood, et al., Applied Machine Learning at Facebook: A Datacenter Infrastructure Perspective, HPCA 2018 Different Workloads in Different Computing Environments (e.g., Facebook) https://unsplash.com/photos/_HPlEmsKgP0 FBLearner Feature Store FBLearner Flow FBLearner Predictor Trained model Deployed model Features Data FBLearner Feature Store FBLearner Flow FBLearner Predictor Storage CPU CPU + GPU CPU H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20 Structured data Unstructured data
  • 9. Problem and goal • ML system architecture and design patterns at different abstraction levels are not well classified and studied. • Thus, we conducted a survey of software developers and an Systematic Literature Review. 9 Well-documented patterns Different Workloads in Different Computing Environments Practices with less information Data Lake for ML Scholarly papers Gray documents
  • 10. Agenda • ML software engineering and patterns • Literature review of software engineering patterns for ML applications • Classification of ML patterns • Practitioners’ insights on ML patterns 10
  • 11. Research questions • RQ1. Does academic and gray literature address the design of ML systems and software? – 19 scholarly and 19 gray documents identified – 15 SE patterns for ML applications extracted • RQ2. Can ML patterns be classified? – Categories of scopes: Topology, programming and model – Quality attributes: ISO/IEC 25010:2011 System and software product quality attributes, ML model and prediction quality attributes • RQ3. How do practitioners perceive ML patterns? – Questionnaire-based survey for 600+ developers – Developers were unfamiliar with most ML patterns, although there were several major patterns used by 20% 11
  • 12. RQ1. Does academic and gray literature address the design of ML systems and software? • Systematic Literature Review (SLR) – Scholar papers: Engineering Village – Gray documents: Google • 19 scholarly papers and 19 gray documents identified • 15 patterns extracted 12 ((((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
  • 13. Numbers of documents per year 13 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 • ML application systems have recently become popular due to the promotion of artificial intelligence. • Since 2008, academic and gray documents have discussed good (bad) practices of ML application systems design. H. Washizaki, et al., Studying Software Engineering Patterns for Designing Machine Learning Systems, IWESEP 2019
  • 14. Agenda • ML software engineering and patterns • Literature review of software engineering patterns for ML applications • Classification of ML patterns • Practitioners’ insights on ML patterns 14
  • 15. RQ2. Can ML patterns be classified? • Model operation patterns that focus on ML models • Programming patterns that define the design of a particular component • Topology patterns that define the entire system architecture. 15 Training data Trained model Prediction Training Infrastructure Input data Programming patterns Serving Infrastructure Model operation patterns Topology patterns H. Washizaki, et al., Practitioners’ insights on machine-learning software engineering design patterns: a preliminary study, ICSME 2020
  • 16. Topology patterns 16 Pattern Problem Solution Different Workloads in Different Computing Environments It is necessary to separate and quickly change the ML data workload … Physically isolate different workloads to separate machines… Distinguish Business Logic from ML Models The overall business logic should be isolated from the ML models … Separate the business logic and the inference engine, loosely coupling the business logic and ML-specific dataflows. ML Gateway Routing Architecture Difficult to set up and manage individual endpoints for each service… Install a gateway before a set of applications … Microservice Architecture for ML ML applications may be confined to some “known” ML frameworks … Provide well-defined services to use for ML frameworks…. Lambda Architecture for ML Real-time data processing requires scalability, fault tolerance, predictability … The batch layer keeps producing views while the speed layer creates the relevant real-time views … Kappa Architecture for ML It is necessary to deal with huge amount of data with less code resource … Support both real-time data processing and continuous reprocessing with a single stream processing engine … H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
  • 17. Distinguish Business Logic from ML Models • Problem: Business logic should be isolated from ML models so that they can be changed without impacting rest of business logic. • Solution: Separate the business logic and the inference engine, loosely coupling the business logic and ML-specific dataflows. 17 H. Yokoyama, Machine Learning System Architectural Pattern for Improving Operational Stability, ICSA-C, 2019 H. Washizaki, et al., Software Engineering Patterns for Machine Learning Applications (SEP4MLA), AsianPLoP 2020 Data Layer Logic Layer Presentation Layer User Interface Database Data Collection Data Lake Business Logic Data Processing Inference Engine Real World Business Logic Specific ML Specific Architectural Layers Deployed as ML System Business Logic Data Flow ML Runtime Data Flow ML Development Data Flow Legend
  • 18. Usage of Distinguish Business Logic from ML Models 18 Data Layer Logic Layer Presentation Layer User Interface (Chatbot UI) Web App Front-end Slack Business Logic (Chatbot Logic) Web App Back-end Slack Data Collection (Dataset) Datasets Nagoya Univ. Conversation Corpus Data Processing (Text to Vector Transformer) NN Model pre- and post- processing TensorFlow Inference Engine (Language Model) NN Model TensorFlow Database (Previous Q&A Store) DB Server (None) Data Lake (Vectorized Corpus) Word Vector TensorFlow (Text) Users Data Source Input Output Datasets ML Input ML Output Architectural Elements (Example Role as Chatbot) What How Business Logic Data Flow ML Development Data Flow ML Runtime Data Flow Input Data Output Data Input Data Datasets Word Vector Legend
  • 19. Programming patterns 19 Pattern Problem Solution Data Lake for ML We cannot foresee the kind of analyses that will be performed on the data … Store data, which range from structured to unstructured, as “raw” as possible into a data storage … Separation of Concerns and Modularization of ML Components ML applications must accommodate regular and frequent changes to their ML components … Decouple at different levels of complexity from the simplest to the most complex … Encapsulate ML Models within Rule- based Safeguards ML models are known to be unstable and vulnerable to adversarial attacks, drifts, … Encapsulate functionality in the containing system using deterministic and verifiable rules … Discard PoC Code The code created for Proof of Concept (PoC) often includes code that sacrifices maintainability … Discard the code created for the PoC and rebuild maintainable code … H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
  • 20. Encapsulate ML Models within Rule-based Safeguards • Problem: ML models are known to be unstable and vulnerable to adversarial attacks, noise, and data drift. • Solution: Encapsulate functionality provided by ML models and deal with the inherent uncertainty in the containing system using deterministic and verifiable rules. • Know usage: E.g. Apollos’s object detection [Peng20] 20 Business Logic API Rule-based Safeguard Inference (Prediction) Encapsulated ML model Input Output Rule H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20 Z. Peng, et al., A First Look at the Integration of Machine Learning Models in Complex Autonomous Driving Systems, ESEC/FSE’20
  • 21. Model operation patterns 21 Pattern Problem Solution Parameter-Server Abstraction For distributed learning, widely accepted abstractions are lacking … Distribute both data and workloads over worker nodes, while the server nodes maintain globally shared parameters … Data Flows Up, Model Flows Down Standard ML approaches require centralizing the training data on one machine … Enable mobile devices to collaboratively learn while keeping all the training data on the device as federated learning … Secure Aggregation The system needs to communicate and aggregate model updates in a secure and scalable way … Encrypt data from each device and calculate totals and averages without individual examination … Deployable Canary Model A surrogate ML that approximates the behavior of best model must be built to provide explainability … Run the explainable inference pipeline in parallel to monitor prediction differences … ML Versioning ML models and their different versions may change the behavior of the overall ML applications … Record the ML model, dataset, and code to ensure a reproducible training and inference processes … H. Washizaki, et al. Software Engineering Patterns for Machine Learning Applications (SEP4MLA) – Part 2, PLoP’20
  • 22. Deployable Canary Model • Problem: A surrogate ML that approximates the behavior of the best ML model must be built to provide explainability. • Solution: Run the explainable inference pipeline in parallel with the primary inference pipeline to monitor prediction differences. • Known usage: Image-based anomaly detection at factory 22 S. Ghanta et al., Interpretability and reproducibility in production machine learning applications, ICMLA 2018 Input Decoy model Data lake Canary model (E.g., Decision tree) Production model (E.g., DNN) Monitoring and comparison Output Output Reproduce and retraining
  • 23. 23 Pattern Perfor mance Compa tibility Relia bility Securi ty Maintai nability Porta bility Robus tness Explaina bility Accur acy Different Workloads in Different Computing Environments X X Distinguish Business Logic from ML Models X ML Gateway Routing Architecture X X Microservice Architecture for ML X X X Lambda Architecture for ML X X Kappa Architecture for ML X X Data Lake for ML X X X Separation of Concerns and Modularization of ML Components X Encapsulate ML Models within Rule-based Safeguards X Discard PoC Code X Parameter-Server Abstraction X X Data Flows Up, Model Flows Down X X X Secure Aggregation X X X Deployable Canary Model X X ML Versioning X X X
  • 24. Agenda • ML software engineering and patterns • Literature review of software engineering patterns for ML applications • Classification of ML patterns • Practitioners’ insights on ML patterns 24
  • 25. RQ3. Practitioners’ insights on quality • Surveyed 300+ developers, 46 answered in ML development • What product quality attributes considered? – Maintainability, reliability, security, and usability • What model and prediction quality attributes? – Robustness, accuracy, and explainability • Maintainability, reliability, robustness and accuracy are well handled by ML patterns. There are demands for having ML patterns addressing security, usability, and explainability, which are not handled well now. 25 3 3 4 13 19 20 20 21 28 0 20 40 (not considered) Compatibility Portability Performance efficiency Usability Reliability Security Maintainability Functional suitability 10 4 20 21 26 0 10 20 30 (not considered) Fairness Accuracy Explainability Robustness H. Washizaki, et al., Practitioners’ insights on machine-learning software engineering design patterns: a preliminary study, ICSME 2020
  • 26. Practitioners’ insights on ML design patterns • Surveyed 600+ developers, 118 answered • Have you ever referred to ML patterns? – Major: ML Versioning, Microservice Architecture for ML – None: Secure Aggregation, Data Flows Up (aka. Federated Learning) 26 Knew it Didn’t know it 0 20 40 60 80 100 120 Data Flows Up, Model Flows Down Secure Aggregation Deployable Canary Model Kappa Architecture for ML Parameter-Server Abstraction Different Workloads in Different Computing… Encapsulate ML models within rule-base… ML Gateway Routing Architecture Lambda Architecture for ML Separation of Concerns and Modularization of… Distinguish Business Logic from ML Models Data Lake for ML Discard PoC code Microservice Architecture for ML ML Versioning Used it Never used it Consider using it Not consider
  • 27. Practitioners’ insights on ML design patterns • Have you ever referred to ML patterns? – Developers were unfamiliar with most ML patterns, although there were several major patterns used by 20+% of the respondents. – For all patterns, most respondents indicated that they would consider using them in future designs. – Promoting existing ML patterns will increase their utilization • How do you solve and share design challenges of ML application systems? – 37 (i.e., 31%) organized design patterns and past design results. – As respondents become more organized in their approach to design problems by reuse, the pattern usage ratio increased. – Development teams and organizations will reuse more ML patterns as they become more consistent in their reuse approach. 27 Design solution and reuse practice #Respondents #Patterns used Pattern usage ratio Lv3. Organizing, reusing patterns (and past results) 37 64 11.5% Lv2. Reusing externally documented patterns 31 50 10.8% Lv1. Resolving problems in an ad-hoc way 37 35 6.3% Others 13 3 1.5%
  • 28. Conclusion • ML software engineering needs patterns! – As bride and common language • Literature review of academic and gray literature – 19 scholarly and 19 gray documents identified. – 15 SE patterns for ML applications extracted. – Patterns at https://eai-transfer.github.io/ml-design-pattern/en/ – ML patterns can be classified by scopes and quality attributes • Survey of practitioners’ insights – Developers were unfamiliar with most ML patterns, although there were several major patterns used by 20% (such as ML Versioning and Microservice Architecture for ML) – 31% organized design patterns and past design results. – As respondents become more organized in their approach to design problems by reuse, the pattern usage ratio increased. 28
  • 29. Future research direction • Identify ML patterns addressing specific quality attributes that are not handled well now – Security, usability, and explainability • Investigate the impact of patterns on quality attributes of systems • Analyze relationships among patterns including related ones towards a pattern language – V. Lakshmanan et al., “Machine Learning Design Patterns,” O’Reilly, 2020. – Y. Shibui, “Machine Learning System Design Patterns”, https://github.com/mercari/ml-system-design-pattern, 2020. • Integration into framework to handle from requirements ton implementations and testing/debugging 29 Jati H. Husen, Hnin Thandar Tun, Nobukazu Yoshioka, Hironori Washizaki and Yoshiaki Fukazawa, “Goal-Oriented Machine Learning-Based Component Development Process,” ACM/IEEE 24th International Conference on Model Driven Engineering Languages and Systems (MODELS), Poster