Slide 1

Slide 1 text

1 MLOps in Mercari Group's Trust and Safety ML Team PyCon JP 2024 Calvin Janitra Halim

Slide 2

Slide 2 text

2 Team Trust and Safety ML Position ML Engineer Work MLOps, Data Analysis, etc. Hobbies Music Production, Jamming Career 2021-04 ~ 2023-12 Rakuten 2024-01 ~ Mercari Email [email protected] [email protected] GitHub, Qiita, Spotify, Soundcloud: CJHJ LinkedIn, Medium, X: My name Calvin Janitra Halim

Slide 3

Slide 3 text

3 Agenda 1. Introduction a. What’s Trust and Safety? b. ML Team’s Responsibilities 2. System Architecture a. Marketplace Service Architecture b. Fintech Service Architecture 3. Automation Steps a. MLOps Overview b. Experimentation c. Feature store d. Training e. Deployment f. Monitoring 4. Struggles and Learnings 5. Closing

Slide 4

Slide 4 text

4 Introduction

Slide 5

Slide 5 text

5 What’s Trust and Safety? Japan Region Fintech Marketplace

Slide 6

Slide 6 text

6 What’s Trust and Safety? Trust and Safety To ensure a safe and secure marketplace Fraud detection Monitoring Prevent policy violations

Slide 7

Slide 7 text

7 ML Team’s Responsibilities ● Item Moderation ● Account Moderation ● Transaction Moderation Fintech Marketplace

Slide 8

Slide 8 text

8 System Architectures

Slide 9

Slide 9 text

9 Marketplace Service Architecture (Realtime)

Slide 10

Slide 10 text

10 Fintech Service Architecture (Batch)

Slide 11

Slide 11 text

11 Service Architecture - Feature Update

Slide 12

Slide 12 text

12 FT Service Architecture - Inference

Slide 13

Slide 13 text

13 FT Service Architecture - Sync Results

Slide 14

Slide 14 text

14 MLOps Overview Adapted from this GCP doc with modification Automation

Slide 15

Slide 15 text

15 MLOps Overview Adapted from this GCP doc with modification

Slide 16

Slide 16 text

16 Automation Steps

Slide 17

Slide 17 text

17 Experimentation Model comparison Data loading EDA Evaluation Error analysis

Slide 18

Slide 18 text

18 Package as a template notebook Experimentation Model comparison To facilitate the collection of results from models based on different configurations, we use the Vertex AI's experiment feature. Data loading We usually use Feast to make it easier to perform point-in-time joins in historical features. EDA E.g. univariate analysis helps us determine which features will contribute to the model’s performance. Evaluation PR-AUC and Feature importances are what we usually check to evaluate models. And also some other business metrics. Error analysis A deep dive into false positives and false negatives is really helpful for identifying the types of patterns the model could miss, as well as any bugs in the data we use. write from scratch

Slide 19

Slide 19 text

19 Creating and Using Features

Slide 20

Slide 20 text

20 Creating and Using Features Define feature tables as dbt models Table dependencies, SQL parameterized values, validation

Slide 21

Slide 21 text

21 Creating and Using Features Sync between offline and online feature stores Less discrepancy

Slide 22

Slide 22 text

22 Model Training Automate training through GitOps Sync config between repo and trained model

Slide 23

Slide 23 text

23 Model Deployment

Slide 24

Slide 24 text

24 Model Deployment Track trained models through GitOps and model registry

Slide 25

Slide 25 text

25 Model Deployment Flexible Deployment Types!

Slide 26

Slide 26 text

26 Deploying Pipelines Automate pipeline compl. and config through GitOps

Slide 27

Slide 27 text

27 Model Monitoring

Slide 28

Slide 28 text

28 Struggles and Learnings

Slide 29

Slide 29 text

29 Risks and Costs Risks Automations Optimizations Reviews & Approvals Cost Monitor & Reduce

Slide 30

Slide 30 text

30 Struggle with Tools Ended up with Vertex AI Feature Store dbt Dataflow BigQuery BigTable Offline features Online features Vertex AI Endpoint or Ended up with Vertex AI Model Registry GKE Pod

Slide 31

Slide 31 text

31 Closing https://github.com/CJHJ