Share
Embed
速習 Machine Learning Lens
JAWS-UG AI/ML #15 https://jawsug-ai.connpass.com/event/263957/ の登壇資料です
AWS の提供する機械学習のベストプラクティス集である Machine Learning Lens について概要と感想を述べています https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/machine-learning-lens.html
Asei Sugiyama
January 17, 2023
Transcript
36 slides
-
自己紹介 杉山 阿聖 (@K_Ryuichirou) Software Engineer @ Citadel AI Advisor
@ Money Forward Organizer @ MLSE 機械学習オペレーション WG 機械学習図鑑 共著 -
TOC What is the Machine Learning Lens? <- Quick introduction
of Machine Learning Lens 感想 & まとめ -
What is the Machine Learning Lens? AWS Well-Architected Framework Pillars
AWS Well-Architected Lens -
AWS Well-Architected Framework AWS の提供するアーキテクチャ のベストプラクティス集 クラウド上でワークロードを設 計および実行するための主要な 概念、設計原則、アーキテクチ ャのベストプラクティスについ
て説明しています AWS Well-Architected – 安全で効率的なクラウドアプリケーション https://aws.amazon.com/jp/architecture/well-architected/ -
Pillars オペレーショナルエクセレ ンスの柱 セキュリティの柱 信頼性の柱 パフォーマンス効率の柱 コスト最適化の柱 持続可能性の柱 AWS Well-Architected
– 安全で効率的なクラウドアプリケーション https://aws.amazon.com/jp/architecture/well-architected/ -
AWS Well-Architected Lens 特定領域に AWS Well- Architected Framework を適用 したもの
AWS Well-Architected が提供 するガイダンスを、機械学習 (ML)、データ分析、(中略) など の特定の業界およびテクノロジ ー領域にも広げます。 AWS Well-Architected – 安全で効率的なクラウドアプリケーション https://aws.amazon.com/jp/architecture/well-architected/ -
Motivation 機械学習基盤を構築した際に TFX (Google) を参考にした Amazon の考える機械学習システム についての設計思想を知りたいと思 っていた Machine
Learning Lens は特定のプ ラットフォームに依存しないドキュ メントであるため確認した TFX: A TensorFlow-Based Production-Scale Machine Learning Platform https://research.google/pubs/pub46484/ -
TOC What is the Machine Learning Lens? Quick introduction of
Machine Learning Lens <- 感想 & まとめ -
Quick introduction of Machine Learning Lens Structure of the Machine
Learning Lens Business goal ML problem framing ML lifecycle architecture diagram Data processing Model development Deployment Monitoring -
Structure of the Machine Learning Lens 機械学習システムのライフサイクル を6つのフェーズに整理 それぞれのフェーズにおけるベスト プラクティスを
AWS Well- Architected Framework の観点から 述べる Well-Architected machine learning lifecycle - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/well- architected-machine-learning-lifecycle.html -
Business goal: Picked up pillars MLOE-01: Develop right skills with
accountability and empowerment 機械学習に特化したものではなく通常の Agile について述べている 機械学習で組織づくりについて言及しているドキュメントは珍しい Two-pizza rule を機械学習の専門家を含めて実現することはチャレンジ に見える -
ML problem framing: Picked up pillars (1/2) MLOE-02: Establish ML
roles and responsibilities 機械学習プラットフォームの運用に必要なロール一覧 非常に多岐にわたる クロスファンクショナルチームが互いにコラボレーションして運用する ことを想定 -
参考: ロール一覧 (1/2) Business analyst Domain expert Data architect Data
engineer AI/ML architect Data scientist Data analyst MLOE-02: Establish ML roles and responsibilities - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning- lens/mloe-02.html -
参考: ロール一覧 (2/2) ML engineer MLOps engineer IT auditor Model
risk manager Cloud and security engineer Software engineer MLOE-02: Establish ML roles and responsibilities - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning- lens/mloe-02.html -
ML problem framing: Picked up pillars (2/2) MLREL-03: Adopt a
machine learning microservice strategy 機械学習の実装にマイクロサービスのパターンを用いることを推奨 Machine Learning Lens をよく表したプラクティス -
ML lifecycle architecture diagram Machine Learning Lens におけるもっとも重要なページ ML lifecycle
with data processing sub-phases included ML lifecycle with detailed phases and expanded components Lineage tracker -
ML lifecycle with data processing sub-phases included Machine Learning Lens
の Data Processing 以降のプロセスを細分化 ML lifecycle architecture diagram - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/ml-lifecycle- architecture-diagram.html -
ML lifecycle with detailed phases and expanded components ML lifecycle
architecture diagram - Machine https://docs.aws.amazon.com/wellarchitecte learning-lens/ml-lifecycle-architecture-diagr -
Lineage tracker: コードとデータと生成物のバージョン管理 ML lifecycle architecture diagram - Machine Learning
Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/ml-lifecycle- architecture-diagram.html -
Data processing: 概要 機械学習で用いるデータを 用意するフェーズ データの収集と準備 準備はさらに前処理と特徴 量エンジニアリングに分か れる データの探索的な分析のた
めに可視化を行う ML lifecycle phase - Data processing - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning- lens/ml-lifecycle-phase-data-processing.html -
Data processing: Picked up pillars MLOE-08: Document data processing データ処理パイプラインのバージョン管理やドキュメントについて
ドキュメントに含めるべき内容についての例 データソースと収集時刻 データ収集プロセス データ収集に用いたスクリプト データ構造 加えた変更や行った処理 MLOE-08: Document data processing - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning-lens/mloe-08.html -
Model development: 概 要 機械学習モデルの訓練、評 価を行う 手動ではなく自動化した継 続的訓練 Feature Store
を前提として いるのは特徴的 Model training, tuning - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning- lens/model-training-tuning.html -
Model development: Picked up pillars (1/2) MLSEC-10: Protect against data
poisoning threats 訓練データへの悪意あるデータの混入に備えるというプラクティス たとえば、購入した高評価レビューや、意図的な低評価レビューを念頭 に置いたものと思われる セキュリティの手法や異常検知アルゴリズムが対策としてあげられてい る -
Model development: Picked up pillars (1/2) MLPER-06: Optimize training and
inference instance types 訓練・推論時で最適なインスタンスを選択するというプラクティス GPU は訓練に向き、CPU は大抵の推論をカバーするとされている 実際はさらに多くの選択肢があるため要検証 -
Deployment: 概要 訓練済みのモデルを本番環 境にデプロイする 本番環境でのテスト (カナリ アリリース、A/B テスト) を 実施
要件を踏まえてバッチ処理 やオンライン処理を考慮 ML lifecycle phase - Deployment - Machine Learning Lens https://docs.aws.amazon.com/wellarchitected/latest/machine-learning- lens/ml-lifecycle-phase-deployment.html -
Deployment: Picked up pillars MLSEC-11: Protect against adversarial and malicious
activities 悪意のある入力がなされないように保護するプラクティス 機械学習アルゴリズムのロバスト性を確認 同じような入力が繰り返されていないか監視 切り戻しができるようリニエージを管理 -
Monitoring: Picked up pillars (1/2) MLPER-13: Evaluate data drift ドリフトを検知するようデータを監視
ドリフト発生時には再学習を実施 MLPER-14: Monitor, detect, and handle model performance degradation モデルのパフォーマンスを計測 モデルの性能劣化時にはアラートを出す -
Monitoring: Picked up pillars (2/2) MLPER-17: Include human-in-the-loop monitoring Human-in-the-loop
をモデルのモニタリングに利用する 人手でつけたラベルとモデルの出力を比較することで、モデルの性能を モニタリングする -
TOC What is the Machine Learning Lens? Quick introduction of
Machine Learning Lens 感想 & まとめ <- -
感想 (1/2) "Adopt a machine learning microservice strategy" という内容 全部を最初からやるのは非現実的
(とくに企画段階と監視に関する運用 設計) なので、自組織の状況に合わせてカスタマイズが必要 -
まとめ Machine Learning Lens は AWS の考える機械学習システムのベストプ ラクティスを記述したもの 機械学習システムの6つのフェーズについて、5つの観点からベストプラ クティスを述べている
まずは ML lifecycle architecture diagram を理解するのが良さそう 全部を最初からやるのは非現実的 (とくに監視に関する運用設計) なの で、自組織の状況に合わせてカスタマイズが必要