Upgrade to Pro — share decks privately, control downloads, hide ads and more …

機械学習モデルの解釈可能性について (2020-11-11)

konabuta
November 11, 2020

機械学習モデルの解釈可能性について (2020-11-11)

< OSS X Users Meeting > #29 AI / Deep Learning での講演資料です。
https://eventregist.com/e/OSSX-2020-11

konabuta

November 11, 2020
Tweet

More Decks by konabuta

Other Decks in Technology

Transcript

  1. 機械学習モデルの解釈可能性について
    InterpretML ライブラリのご紹介
    ⼥部⽥啓太
    ⽇本マイクロソフト株式会社
    Cloud Solution Architect – Machine Learning, Deep Learning

    View Slide

  2. ⼥部⽥啓太
    Cloud Solution Architect
    – Machine Learning & Deep Learning
    略歴 : ⽇本マイクロソフト株式会社 カスタマーサク
    セス事業本部 Data & AI クラウドソリューションアー
    キテクト。統計解析ソフトウェアベンダーでのセールス
    エンジニアを経て、2018年 Microsoft に⼊社。
    現在は、Azure Machine Learning を中⼼とした
    AI・機械学習のアーキテクトとしてお客様プロジェクト
    へ技術⽀援を⾏う。また、最新技術をイベント・セミ
    ナーで訴求している。

    View Slide

  3. アジェンダ

    View Slide

  4. アジェンダ

    View Slide

  5. Report

    View Slide

  6. View Slide

  7. View Slide

  8. ⼀⽅で、それに起因する問題が散⾒される ...
    • 構築された機械学習モデルは妥当なものか?信頼できるか?
    • なぜこの予測値になったのか現場に説明できない
    • モデルをどうやって改善すればいいか分からない
    単に精度が⾼い機械学習モデルを開発するだけでなく、
    “モデルの解釈可能性” のアプローチが必要
    ⾼精度の機械学習モデルを実現するために、
    深層学習などの複雑な機械学習アルゴリズムが数多く登場している

    View Slide

  9. モデル開発 推論

    View Slide

  10. https://interpret.ml/

    View Slide

  11. https://github.com/interpretml
    Interpret-text
    ⾃然⾔語処理モデルの解釈可能性
    DiCE
    反実仮想によるモデル解釈
    Interpret
    解釈可能な Glassbox モデルと
    Blackbox なモデル の解釈性を提供
    Interpret-community
    Interpret にある表形式データに対す
    る追加機能
    Azureml-interpret
    Azure Machine Learning の
    Python SDK のラッパー

    View Slide

  12. https://github.com/interpretml
    Interpret-text
    ⾃然⾔語処理モデルの解釈可能性
    DiCE
    反実仮想によるモデル解釈
    Interpret
    解釈可能な Glassbox モデルと
    Blackbox なモデル の解釈性を提供
    Interpret-community
    Interpret にある表形式データに対す
    る追加機能 本⽇の範囲
    Azureml-interpret
    Azure Machine Learning の
    Python SDK のラッパー

    View Slide

  13. https://interpret.ml/
    機械学習モデル解釈・説明のための
    包括的なフレームワーク
    決定⽊
    ルールリスト
    線形回帰・ロジスティック回帰
    EBM

    SHAP
    LIME
    Partial Dependence
    Sensitivity Analysis
    ...

    View Slide

  14. 解釈可能性が⾼い構造を持つ
    機械学習アルゴリズム
    Fever?
    Internal
    Bleeding?
    Stay
    Home
    Stay
    Home
    Go to
    Hospita
    l
    決定⽊
    ルールリスト
    線形回帰・ロジスティック回帰
    Explainable Boosting Machines (EBM)
    ….
    Glass-box
    models

    View Slide

  15. ブラックボックスな
    機械学習モデルの説明
    Model
    Explanation
    Perturb
    Inputs
    Analyze
    SHAP
    LIME
    Partial Dependence
    Sensitivity Analysis
    ...
    Black-box
    explanations

    View Slide

  16. intepret
    interpret-community
    interpret-text interpret にもブラックボックスな
    モデルを解釈する機能はあるけど、
    interpret-community の⽅が
    機能が充実しているよ

    View Slide

  17. アジェンダ

    View Slide

  18. https://interpret.ml/
    機械学習モデル解釈・説明のための
    包括的なフレームワーク
    決定⽊
    ルールリスト
    線形回帰・ロジスティック回帰
    EBM

    SHAP
    LIME
    Partial Dependence
    Sensitivity Analysis
    ...

    View Slide

  19. Explainable boosting machines (EBM)

    View Slide

  20. ž Linear Model
    ž y = β0
    + β1
    x1
    + β2
    x2
    + ... + βn
    xn
    ž Additive Model
    ž y = f1
    (x1
    ) + f2
    (x2
    ) + ... + fn (xn)
    ž Additive Model with Pairwise Interactions (GA2M)
    ž y = Ʃi
    fi (xi) + Ʃij
    fij (xi , xj )

    View Slide

  21. Demo
    ⼯場の品質管理モデルの解釈
    (interpret の EBM モデルによる解釈可能性)
    https://aka.ms/interpretdemo1
    Notebook

    View Slide

  22. Issue#74

    View Slide

  23. View Slide

  24. View Slide

  25. SHAP

    View Slide

  26. 各特徴量がどのくらい寄与
    家の価格の
    予測
    $300,000
    家の価格の
    平均
    $310,000
    差額
    - $10,000

    View Slide

  27. 近くに公園がある
    +$10000
    猫の飼育禁⽌
    -$20000
    安全な地域
    +$10000
    ペンキ禁⽌
    -$10000
    各特徴量がどのくらい寄与

    View Slide

  28. Demo
    ⾃動⾞価格予測モデルの解釈
    (Interpret-community のダッシュボード)
    https://aka.ms/interpretdemo2
    Notebook

    View Slide

  29. 信頼できる機械学習とは?
    https://docs.microsoft.com/ja-JP/azure/machine-learning/concept-responsible-ml

    View Slide

  30. View Slide

  31. アジェンダ

    View Slide

  32. テキストデータの
    モデルの解釈可能性
    https://github.com/interpretml/interpret-text
    Interpret-text

    View Slide

  33. • 古典的な機械学習パイプライン
    • 前処理、エンコーディング、学習、
    ハイパーパラメータチューニングが実装済み
    • サポートしているモデル
    • scikit-learn の線形モデル (coefs_)
    • Tree ベースのアンサンブルモデル (feature_importances)
    • 上記モデルの係数や重要度を利⽤した説明性を提供
    デフォルトの設定 : 1-gram bag-of-words
    + scikit-learn count vectorizer + Logistic regression

    View Slide

  34. ⼀貫性のある解釈
    任意の DNN モデル
    Towards A Deep and Unified Understanding of Deep Neural Models in NLP, Guan et al. [ICML 2019]

    View Slide

  35. Rethinking Cooperative Rationalization: Introspective Extraction and Complement Control, Yu et al. [EMNLP 2019]
    内省的⽣成器
    min-max ゲーム
    予測器 補完的予測器

    View Slide

  36. Classical Text Explainer Unified Information
    Explainer
    Introspective Rationale
    Explainer
    Input model support Scikit-learn linear models
    and tree-based models
    PyTorch PyTorch
    Explain BERT No Yes Yes
    Explain RNN No No Yes
    NLP Pipeline Support Handles text pre-
    processing, encoding,
    training, hyperparameter
    tuning
    Uses BERT tokenizer
    however user needs to
    supply trained/fine-
    tuned BERT model, and
    samples of trained data
    Generator and predictor
    modules handle the required
    text pre-processing.

    View Slide

  37. InterpretML : Understand Models. Build Responsibly.
    interpretML (GitHub)
    機械学習モデル解釈ナイト (エンジニア向け)
    BlackBox モデルの説明性・解釈性技術の実装
    ⼀般化線形モデル (GLM) & ⼀般化加法モデル(GAM)
    Deep Learning Ditial Conference
    [Track4-1] BERT の解剖学 : interpret-text による⾃然⾔語処理 (NLP) のモデル解釈
    Microsoft AI Business School
    Microsoft 責任のある AI

    View Slide

  38. View Slide

  39. View Slide