Slide 1

Slide 1 text

ML ENGINEERING : FROM MODEL TO PRODUCTION FON Kamolphan Liwprasert

Slide 2

Slide 2 text

แนะนําตัว Fon Kamolphan Liwprasert Senior Software Engineer at Agoda Women Techmakers Ambassador Google Developer Experts - Cloud

Slide 3

Slide 3 text

Agenda 🐤 ทําความรู้จักกับ Machine Learning Engineering 🐤 รูปแบบการนํา model ไปประยุกต์ใช้ 🐤 ML in Production 🐤 Tech Stack ที่น่าสนใจ 🐤 แหล่งเรียนรู้ที่น่าสนใจเกี่ยวกับ MLE

Slide 4

Slide 4 text

AI in Real life https://chat.openai.com/chat https://www.midjourney.com/ https://github.com/features/copilot

Slide 5

Slide 5 text

ทําความรู้จักกับ Machine Learning Engineering

Slide 6

Slide 6 text

https://cloud.google.com/solutions/machine-learning/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning Hidden Technical Debt in Machine Learning Systems Elements for ML systems

Slide 7

Slide 7 text

นิยาม AI System แบบง่าย https://youtu.be/VfcY0edoSLU AI System = * Software Engineering DevOps Data Engineering Data Science ML/AI Research ML Engineering Software + Model + DATA

Slide 8

Slide 8 text

High-level of ML Systems 1. Data ▸ Data Engineering Pipelines ▸ Data Quality is a key 🔑 2. Model ▸ Machine Learning Pipelines ▸ Train, Evaluate, Test 󰙤 3. Software ▸ Model Serving & Predictions ▸ Deployment strategies & Infra 🐳☁

Slide 9

Slide 9 text

Machine Learning Engineers are technically proficient programmers who research, build, and design self-running software to automate predictive models. An ML Engineer builds artificial intelligence (AI) systems that leverage huge data sets to generate and develop algorithms capable of learning and eventually making predictions. - Brainstation.io ML Engineer Machine Learning Engineer คือ นักพัฒนาโปรแกรมที่วิจัย สราง และออกแบบ ซอฟตแวรที่สามารถรันโมเดลทำนายผลได และสรางระบบ AI โดยใชประโยชนจากขอมูลจำนวนมาก

Slide 10

Slide 10 text

หน้าที่ของ MLE Machine Learning Engineer

Slide 11

Slide 11 text

Machine Learning Engineer / Software Engineer Model training pipelines / tools work with DS / AI Automate the process of model training using pipelines and tools. (MLOps) Deploy ML model in production & monitoring Productionize the ML models including model versioning and optimization. Online prediction / API High performance model serving with low latency and high availability. Monitor the model prediction and performance for improvement. Integrate ML into application & monitoring

Slide 12

Slide 12 text

MLOps คืออะไร

Slide 13

Slide 13 text

Launching is easy, Operating is hard. ปญหาของ ML คือ ทำยังไงให จัดการดูแลระบบไดในระยะยาว ทําไมต้องมี MLOps CC0 images from pixabay.com

Slide 14

Slide 14 text

MLOps Continuous Training Continuous Monitoring CI/CD Concept drift Logging Canary Deployment A/B Testing Data-Centric AI vs Model-Centric AI Monitoring Healthcheck Testing Data Version Control Experiment Tracking Data Lineage Lifecycle Automation Data Quality Data Labeling Data Augmentation Train & Evaluate Model Versioning Model Serving & Deployment Optimization Error Reporting

Slide 15

Slide 15 text

1 2 3 4 Benefit of MLOps Automate process ชวยลด Technical Debt ในระยะยาว ได Pipeline ที่ดี ทำให data scientist ทำงานรวมกันไดงาย ชวยลดความเสี่ยง และขอผิด พลาด human error ปรับปรุง และ Maintain ได งาย สามารถ scale ได

Slide 16

Slide 16 text

รูปแบบการนํา model ไปประยุกต์ใช้

Slide 17

Slide 17 text

Deep RL ML models Classification / Regression รูปแบบของ Model Computer Vision Object Detection / Image Classification / Face Recognition NLP Translation / Sentiment Analysis / Chatbot / LLM ตัวอยาง RL Robotics / Simulation Controlling problems (Large Language Model) Deep Learning

Slide 18

Slide 18 text

Process: Machine Learning Lifecycle https://ubuntu.com/engage/mlops-guide

Slide 19

Slide 19 text

Process : ML + Dev + Ops ⇒ MLOps https://ubuntu.com/engage/mlops-guide

Slide 20

Slide 20 text

เอา model ไปใช้อย่างไรได้บ้าง https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment Batch Prediction ไมตอง real time Streaming มีขอมูลเขามาตลอดเวลา near-real time API Online prediction ในลักษณะ request/response Edge computing ประมวลผลที่ device ปลายทาง a.k.a Deployment

Slide 21

Slide 21 text

1. Batch prediction: ทํางานแบบ batch @aurimas_gr https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment

Slide 22

Slide 22 text

2. Streaming: ทํางานตามลําดับใน queue @aurimas_gr https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment

Slide 23

Slide 23 text

3. API: Online prediction - model serving @aurimas_gr https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment

Slide 24

Slide 24 text

4. Edge computing: ใช้ device ปลายทาง @aurimas_gr https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment Edge devices

Slide 25

Slide 25 text

Recap: ML Deployment https://www.newsletter.swirlai.com/p/sai-03-machine-learning-deployment Batch Prediction ไมตอง real time Streaming มีขอมูลเขามาตลอดเวลา near-real time API Online prediction ในลักษณะ request/response Edge computing ประมวลผลที่ device ปลายทาง

Slide 26

Slide 26 text

ML in Production

Slide 27

Slide 27 text

Batch Production Centralized Decentralized On-device “Edge” Edge computing Web Mobile Embedded On-Cloud / On-Premise Direct Model serving Streaming API Edge

Slide 28

Slide 28 text

ตัวอยาง Model Serving Centralized: Model Serving https://ubuntu.com/blog/guide-to-ml-model-serving https://www.anyscale.com/blog/serving-ml-models-in-production-common-patterns

Slide 29

Slide 29 text

Edge: Web ML & MediaPipe ❤

Slide 30

Slide 30 text

Demo: MediaPipe https://mediapipe-studio.webapps.google.com/

Slide 31

Slide 31 text

Model Optimization

Slide 32

Slide 32 text

Bonus: PoC & Demo ? Proof of Concept

Slide 33

Slide 33 text

Tech stack ที่น่าสนใจ

Slide 34

Slide 34 text

Update: ML, AI, Data Landscape 2023

Slide 35

Slide 35 text

สรุป Tech stack ที่น่าสนใจ

Slide 36

Slide 36 text

Tools DVC (Data Version Control)

Slide 37

Slide 37 text

For beginner: เริ่มต้นอย่างไร ?

Slide 38

Slide 38 text

ML Engineering = Software Engineering + ML Git: Version Control Docker Kubernetes CI/CD Programming!

Slide 39

Slide 39 text

Things to consider 🎯 การออกแบบระบบ ขึ้นอยูกับ use case และความตองการ ควรพิจารณาอยางถี่ถวน กอนตัดสินใจใช tool ที่เหมาะสม ⚒ 🎯 Pricing 💲: บาง tool มีคาใชจายคอนขางสูง 💸 ตองดูความคุมคาระยะยาว 🎯 Over-engineering : Perfect is the enemy of good xkcd by Randall Munroe. Automation takes a life of its own.

Slide 40

Slide 40 text

https://cloud.google.com/solutions/machine-learning/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning Hidden Technical Debt in Machine Learning Systems Elements for ML systems

Slide 41

Slide 41 text

Rule of Machine Learning Martin Zinkevich https://developers.google.com/machine-learning/guides/rules-of-ml

Slide 42

Slide 42 text

To make great products: do machine learning like the great engineer you are, not like the great machine learning expert you aren’t. Martin Zinkevich https://developers.google.com/machine-learning/guides/rules-of-ml

Slide 43

Slide 43 text

Resource

Slide 44

Slide 44 text

Made With ML https://madewithml.com/

Slide 45

Slide 45 text

AI Engineering Club https://ai-engineering.club/

Slide 46

Slide 46 text

MLOps Zoomcamp https://github.com/DataTalksClub/mlops-zoomcamp

Slide 47

Slide 47 text

Chip Huyen อาจารยวิชา Machine Learning Systems Design มหาวิทยาลัย Stanford (https://stanford-cs329s.github.io/) และผูเขียนหนังสือ Blog: Chip Huyen https://huyenchip.com/blog/

Slide 48

Slide 48 text

Books

Slide 49

Slide 49 text

Q & A

Slide 50

Slide 50 text

Thank You :) FON Kamolphan Liwprasert