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

説明可能AIの基礎と研究動向

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

 説明可能AIの基礎と研究動向

2024年度 統計数理研究所 医療健康データ科学研究センターシンポジウム 講演資料

Avatar for Yuya Yoshikawa

Yuya Yoshikawa

July 24, 2024
Tweet

More Decks by Yuya Yoshikawa

Other Decks in Research

Transcript

  1. ⾃⼰紹介 最近の研究トピック −説明可能AI (解釈可能な機械学習) −動作認識 2 吉川 友也 (よしかわ ゆうや)

    千葉⼯業⼤学 ⼈⼯知能・ソフトウェア技術研究センター 上席研究員 博⼠(⼯学) − 2015年 奈良先端科学技術⼤学院⼤学
  2. 本講演で想定する機械学習(予測)モデル 4 ⼊⼒ 𝒙 ∈ ℝ! モデル 𝑓" 出⼒ 𝑦

    ∈ ℝ 回帰モデル (例: 年収予測) 勤続 年数 会社 規模 東京 在住 5.2 325 1 年収 562.6 ⼊⼒ 𝒙 ∈ ℝ#×%×& モデル 𝑓" 出⼒ 𝒚 ∈ 0,1 ' 0.1 0.9 0 0 イヌ ネコ ⾃動⾞ ⼈ 分類モデル (例: 画像分類)
  3. 0 20 40 60 80 100 Jan-16 Jul-16 Jan-17 Jul-17

    Jan-18 Jul-18 Jan-19 Jul-19 Jan-20 Jul-20 Jan-21 Jul-21 Jan-22 Jul-22 Jan-23 Jul-23 Jan-24 説明可能AI (Explainable AI; XAI) • モデルの複雑化や訓練データの⼤規模化により、機械学習を⽤いて ⾼精度の予測が可能になった⼀⽅で、モデルのブラックボックス化 が進み、モデルの挙動を把握することは困難になった • 説明可能AIは、モデルの⼊出⼒の関係や、モデル内部のパラメータ の挙動の解析を⾏うことで、モデルの振る舞いを⼈が理解できるよ うにする技術 • 年々、説明可能AIの需要は⾼まっている 5 “Explainable AI”の検索数 (Googleトレンド調べ)
  4. what is the temperature at the center of the earth

    データ種別、因⼦型の局所説明の具体例 表形式データの場合 画像データの場合 テキストデータの場合 6 ⾝⻑ 体重 東京 出⾝ 172 63 1 ⼊⼒ 𝒙 ∈ ℝ! ⾝ ⻑ 体 重 東 京 出 ⾝ 予測結果に対する 各特徴の貢献度を説明 貢献度 + 𝝓 ∈ ℝ! ⾝⻑ 体重 東京 出⾝ 0.8 0.6 -0.1 貢献度 or ⼊⼒ 𝒙 ∈ ℝ"×$×% 予測結果に対する 各ピクセルの貢献度を説明 貢献度 + 𝝓 ∈ ℝ$×% ⼊⼒ 𝒙 = [単語1, 単語2, ⋯ , 単語𝐷] 予測結果に対する 各単語の貢献度を説明 what is the temperature at the center of the earth 貢献度 + 𝝓 ∈ ℝ!
  5. 事後説明 Post-hoc explanation 後付けの説明器が 予測モデルを説明 7 説明⼿法の分類 ⼤域説明 Global/model explanation

    予測モデル全体を説明 局所説明 Local explanation 個々の予測結果を説明 ⾃⼰説明 Ante-hoc explanation 予測モデル⾃⾝が説明 モデル⾮依存 Model-agnostic 予測モデルはブラックボックス として説明 モデル依存 Model-specific 予測モデルの構造や途中計算を 利⽤して説明
  6. 事後説明 Post-hoc explanation 後付けの説明器が 予測モデルを説明 8 説明⼿法の分類 ⼤域説明 Global/model explanation

    予測モデル全体を説明 局所説明 Local explanation 個々の予測結果を説明 ⾃⼰説明 Ante-hoc explanation 予測モデル⾃⾝が説明 モデル⾮依存 Model-agnostic 予測モデルはブラックボックス として説明 モデル依存 Model-specific 予測モデルの構造や途中計算を 利⽤して説明 本講演の 範囲
  7. 局所説明⼿法の分類 [恵⽊ '20] 例: ローン審査をするAIが A⽒の申し込みをリジェクトしたケース 予測に効いた特徴を⽤いて説明 “A⽒と類似の申込みで返済が 滞った事例がある” 事例型説明

    類似した訓練事例を⽰して説明 “A⽒の会社の信⽤度が低かった” 知識型説明 外部知識を利⽤して説明 “もしA⽒の年収が〇〇円以上 であれば審査は通っていた” 反実型説明 予測を変えるために必要なことを説明 9 “A⽒の職業が〇〇だから” 因⼦型説明 予測に効いた特徴を⽤いて説明
  8. AIの透明性と解釈性に関する社会からの要求 12 AIシステムについて、⼈々がどのようなときにそれと関わり結果の正当性を批判 できるのかを理解できるようにするために、透明性を確保し責任ある情報開⽰ を⾏うべきである。 AIに関する経済協⼒開発機構(OECD)原則 内閣府 ⼈間中⼼のAI社会原則 4.1.(6) 公平性、説明責任及び透明性の原則

    2016年 4⽉ G7⾹川 ⼈⼯知能の開発原則の提唱 AIネットワークシステムの動作の説明可能性及び検証可能性を確保すること。 2019年 3⽉ 「AI-Ready な社会」においては、(中略) 公平性及び透明性のある意思決定と その結果に対する説明責任(アカウンタビリティ)が適切に確保されると共に、 技術に対する信頼性(Trust)が担保される必要がある。 2019年 5⽉ EU AI規制法案 (24年5⽉成⽴) 2021年 4⽉ ハイリスク AI システムは、利⽤者が当該システムのアウトプットを解釈し かつそれを適切に使⽤することができるようにするため、当該システムの動作 が⼗分に透明であることを確保する⽅法で、これを設計し及び開発するものと する。
  9. クラス活性化マップに基づく事後⾃⼰説明器: Class Activation Mapping (CAM) 15 GradCAMの 事前準備 [Zhou+ 2016]

    Global Average Pooling (GAP) 1つの活性化マップの平均値を次の1つのニューロンの値にする 𝑤!, 𝑤", ⋯ , 𝑤# 学習可能な重み(linear layer)
  10. クラス活性化マップに基づく事後⾃⼰説明器: Class Activation Mapping (CAM) 16 GradCAMの 事前準備 [Zhou+ 2016]

    , 𝝓 = / 9:; < 𝑤9 𝑨9 𝑨; 𝑨= 𝑨< , 𝝓 貢献度: (ピクセルの) GAPを⼊れてCNNの構造を変えるため 精度への悪影響の可能性あり
  11. クラス活性化マップに基づく事後説明器: Gradient-based Class Activation Map (GradCAM) 17 予測モデルの中間層の微分値を利⽤してCAMの重み 𝑤$ $%!

    # を計算 𝑨; , 𝑨= , ⋯ , 𝑨< 予測ラベル ! 𝑦 活性化マップ GAPである 必要はない GradCAMの重み計算 $% & ! " $𝑨# … 活性化マップに関する 𝑓(𝑥)の微分 𝑤9 = GAP 𝜕𝑓 𝑥 > ? 𝜕𝑨9 重み: , 𝝓 = ReLU / 9:; < 𝑤9 𝑨9 GradCAMの貢献度計算 貢献度: (ピクセルの) [Selvaraju+ 2020]
  12. Local Interpretable Model-agnostic Explanations (LIME) • ⼊⼒点周辺でサロゲートモデルを学習することで、予測に対する 特徴量の貢献を求める − サロゲートモデルとして、局所線形回帰モデルを使⽤

    19 図は[Ribeiro+ 2016] Fig. 3から引⽤ サロゲートモデル 𝑔 𝒛; 𝒘 = , ! 𝑤! 𝑧! ⾝ ⻑ 体 重 東 京 出 ⾝ 貢献度 説明 𝑔 𝒛 の パラメータ 𝒘を推定 𝒘を貢献度として説明 ⼊⼒空間 ℝ" ブラックボックスモデルのための説明⼿法
  13. 摂動に基づく事後説明器: Local Interpretable Model-agnostic Explanations (LIME) 20 特徴量の⼀部をランダムに別の値に置き換えたときの予測モデルの出⼒から 線形回帰モデルを学習し、回帰係数で特徴量の貢献度を説明 ⾝⻑

    体重 東京 出⾝ 172 63 1 ⼊⼒ 𝒙 ⾝⻑ 体重 東京 168 63 1 摂動させた⼊⼒ @ 𝒙& 𝒛; = [0 1 1] 𝒛A = [1 0 0] ⾝⻑ 体重 東京 172 45 0 摂動させた⼊⼒ @ 𝒙' … 摂動させた⼊⼒を𝑀個⽣成 ⼆値ベクトル𝒛を𝑀個⽣成 𝒛で0を持つ特徴を 別の値に置き換え … 摂動させた⼊⼒に対する予測モデルの出⼒を得る 𝑓(𝑥) 0 𝒙# 0 𝒙$ … … … 性別 確率 男性 0.59 ⼥性 0.41 予測確率 @ 𝒚& 性別 確率 男性 0.70 ⼥性 0.30 予測確率 @ 𝒚' … ステップ① ステップ② 予測モデル [Ribeiro+ 2016]
  14. 摂動に基づく事後説明器: Local Interpretable Model-agnostic Explanations (LIME) 21 特徴量の⼀部をランダムに別の値に置き換えたときの予測モデルの出⼒から 線形回帰モデルを学習し、回帰係数で特徴量の貢献度を説明 𝒛から予測確率を当てる重み付き線形回帰を学習

    𝑾∗ = argmin𝑾 / G:; A 𝜋 𝒛G G 𝒚G − 𝑾𝒛G = = + 𝜆 𝑾 = = ※ 𝑾はクラス数×特徴の数のサイズ すべての要素が1のベクトルとの類似度 𝑾∗の𝑐⾏⽬がクラス𝑐への特徴量の貢献度となる 摂動させた⼊⼒に対する予測モデルの出⼒を得る 𝑓(𝑥) 0 𝒙# 0 𝒙$ … … … 性別 確率 男性 0.59 ⼥性 0.41 予測確率 @ 𝒚& 性別 確率 男性 0.70 ⼥性 0.30 予測確率 @ 𝒚' … ステップ② ステップ③ 予測モデル [Ribeiro+ 2016]
  15. ⼤規模⾔語モデル(LLM)に説明を⽣成させる 23 LLMに予測と同時に特徴量の重要度を出⼒させる アプローチ 予測精度 ラベル予測のみ 92% 先に説明、後に予測 85% 先に予測、後に説明

    88% • 説明を出⼒させることで予測精度に影響 があるか? − 影響ある。予測のみの⽅が精度が⾼い。 • 説明の忠実性評価 − LIMEを⽤いた場合よりも忠実性評価は少し悪い 評価尺度 LIME LLM⽣成 Comprehensiveness (↑) 重要な単語を除いた際の確信度の差 0.27 0.27 Sufficiency (↓) 重要な単語のみ⽤いた際の確信度の差 0.20 0.22 Decision flip (↑) 重要な単語を除いた際に予測が変わる割合 0.10 0.07 [Huang+ ʻ23] ※LLM⽣成のクセ: 0.5や0.75のような丸められた数値が出やすい
  16. 多岐にわたるXAI研究の⽅向性 • 予測モデルに忠実な説明を⽣成する⽅法 • 効率的(⾼速)に説明を⽣成する⽅法 • 望ましい説明を⽣成する⽅法 • ドメイン固有のデータ構造に適した説明法 •

    予測モデルのアーキテクチャに適した説明法 • 予測モデル⾃⾝が説明できるアーキテクチャ • 説明を他タスクの改善に利⽤ • 説明の定量⽐較法 • 説明がユーザに与える影響の分析 24 ・・・ [Ismail+ ʻ21, Yoshikawa+ ʼ24a] [Zhao+ ʼ21, Situ+ ʻ21] [Alvarez-Melis+ ʻ18, Yoshikawa+ ʼ21] [Ross+ ʼ17, Ying+ ʼ22] [Fernandes+ ʼ22, Satyapriya+ ʻ23] [Abnar+ ʼ20, Wu+ ʻ24] [Doshi-Velez+ ʼ17, Zhou+ ʼ21, Chen+ ʻ22] [Mosca+ ʻ22, Yoshikawa+ ʼ24b] [Panigutti+ ʼ22, Schoeffer+ ʻ22]
  17. 説明は相関関係? 因果関係? 相関関係 • 2つの変数の値が同時に変化 する関係 • 例:特徴 𝑥 が⼤きいとき、出

    ⼒ 𝑦 は⼤きい 因果関係 • ある変数が原因となって、別 の変数に影響を与える関係 • 例:特徴 𝑥 を⼤きくすると、 出⼒ 𝑦 が⼤きくなる 25 LIMEやSHAPは変数間の依存関係を考慮せず、ランダムに特徴の値を変 化させて、特徴の値とモデルの出⼒の関係性を計算する 説明は、特徴とモデルの出⼒の相関関係を⾒るためのもの (LIMEやSHAPによる)
  18. 具体例 〜サブスク契約更新予測モデルの場合〜 26 [Dillon+] SHAP(LIMEに類似)で計算した特徴の貢献度をデータ全体でプロット • Discount (割引率)が⼩さいユーザは、契約更新率が⾼い • Ad

    spend (広告費)が⼤きいユーザは、契約更新率が⾼い • Bugs reported (バグ報告)が多いユーザは、契約更新率が⾼い 分析からわかること(相関関係) 割引を無くし、広告費を上げ、バグを増やせば、契約更新率は上がる? 平均貢献度の⾼い特徴 [Lundberg+ ʻ17]
  19. 説明⼿法を使う上で気をつけたいこと • 説明は、(基本的に)特徴とモデルの出⼒の相関関係を⽰す • 説明が常に予測モデルの振る舞いを反映するとは限らない − 事後説明器は、⼈間が理解可能なモデルで予測モデルの振る舞いを近似して いるので、予測モデルと説明の間でギャップは⽣まれうる • 説明が⼈間にとってわかりやすいとは限らない

    − 予測モデルに忠実であることは、⼈間が⾒てわかりやすいことを保証しない − ⼈間にとってわかりやすいことを保証したい場合、説明の正解を与えて学習 する必要がある • 説明を悪者が利⽤する可能性がある − 説明には予測モデルの内部状態の情報が含まれるため、 それを悪⽤された場合に、訓練データの復元等をされる可能性がある 29
  20. 参考⽂献 1/3 • [恵⽊ ʻ20] 恵⽊正史. “XAI(eXplainable AI)技術の研究動向.” ⽇本セキュリティ・マネジメント学会誌, vol.

    34, no. 1, 2020, https://www.jstage.jst.go.jp/article/jssmjournal/34/1/34_20/_pdf/-char/ja. • [Zhou+ ʻ16] Zhou, Bolei, et al. “Learning Deep Features for Discriminative Localization.” 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, 2016, https://doi.org/10.1109/cvpr.2016.319. • [Selvaraju+ ʻ20] Selvaraju, Ramprasaath R., et al. “Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization.” International Journal of Computer Vision, vol. 128, no. 2, Feb. 2020, pp. 336‒59. • [Ribeiro+ ʻ16] Ribeiro, Marco Tulio, et al. “ʻWhy Should I Trust You?ʼ: Explaining the Predictions of Any Classifier.” arXiv:1602.04938 [cs, Stat], Feb. 2016. arXiv.org, http://arxiv.org/abs/1602.04938. • [Lundberg+ ʻ17] Lundberg, Scott M., and Su-In Lee. “A Unified Approach to Interpreting Model Predictions.” Advances in Neural Information Processing Systems 30, edited by I. Guyon et al., Curran Associates, Inc., 2017, pp. 4765‒74. • [Huang+ ʻ23] Huang, Shiyuan, et al. “Can Large Language Models Explain Themselves? A Study of LLM-Generated Self- Explanations.” arXiv [cs.CL], 17 Oct. 2023, http://arxiv.org/abs/2310.11207. arXiv. • [Panwar+ ʼ20] Panwar, Harsh, et al. “A Deep Learning and Grad-CAM Based Color Visualization Approach for Fast Detection of COVID-19 Cases Using Chest X-Ray and CT-Scan Images.” Chaos, Solitons, and Fractals, vol. 140, Nov. 2020, p. 110190. • [Btd ʼ21] Btd, Written by. “【Data Science Project】 Explainable AI: Brain Tumor Classification with EfficientNet and Gradient- Weighted Class Activation Mapping (Grad-CAM) Visualization.” Medium, 21 Sept. 2021, https://baotramduong.medium.com/explainable-ai-brain-tumor-classification-with-efficientnet-and-gradient-weighted-class- activation-24c57ae6175d. • [Jahmunah+ ʼ22] Jahmunah, V., et al. “Explainable Detection of Myocardial Infarction Using Deep Learning Models with Grad-CAM Technique on ECG Signals.” Computers in Biology and Medicine, vol. 146, July 2022, p. 105550. • [Chaudhury+ 23] Chaudhury, Sushovan, et al. “Deep Transfer Learning for IDC Breast Cancer Detection Using Fast AI Technique and Sqeezenet Architecture.” Mathematical Biosciences and Engineering: MBE, vol. 20, no. 6, Apr. 2023, pp. 10404‒27. • [Blass+ ʻ22] Blass, Ido, et al. “Revisiting the Risk Factors for Endometriosis: A Machine Learning Approach.” Journal of Personalized Medicine, vol. 12, no. 7, July 2022, https://doi.org/10.3390/jpm12071114. 31
  21. 参考⽂献 2/3 • [Ismail+ ʻ21] Ismail, Aya Abdelsalam, et al.

    “Improving Deep Learning Interpretability by Saliency Guided Training.” Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 26726‒39. • [Yoshikawa+ ʼ24a] Yoshikawa, Yuya, and Tomoharu Iwata. “Explanation-Based Training with Differentiable Insertion/Deletion Metric-Aware Regularizers.” Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, edited by Sanjoy Dasgupta et al., vol. 238, PMLR, 02--04 May 2024, pp. 370‒78. • [Zhao+ ʻ21] Zhao, Xingyu, et al. “BayLIME: Bayesian Local Interpretable Model-Agnostic Explanations.” arXiv [cs.AI], 5 Dec. 2020, http://arxiv.org/abs/2012.03058. arXiv. • [Situ+ ʻ21] Situ, Xuelin, et al. “Learning to Explain: Generating Stable Explanations Fast.” Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), Association for Computational Linguistics, 2021, pp. 5340‒55. • [Ross+ ʻ17] Ross, Andrew Slavin, et al. “Right for the Right Reasons: Training Differentiable Models by Constraining Their Explanations.” Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, International Joint Conferences on Artificial Intelligence Organization, 2017, • [Ying+ ʼ22] Ying, Zhuofan, et al. “VisFIS: Visual Feature Importance Supervision with Right-for-the-Right-Reason Objectives.” Advances in Neural Information Processing Systems, vol. abs/2206.11212, June 2022, https://doi.org/10.48550/arXiv.2206.11212. • [Mosca+ ʻ22] Mosca, Edoardo, et al. “GrammarSHAP: An Efficient Model-Agnostic and Structure-Aware NLP Explainer.” Proceedings of the First Workshop on Learning with Natural Language Supervision, edited by Jacob Andreas et al., Association for Computational Linguistics, 2022, pp. 10‒16. • [Yoshikawa+ ʼ24b] Yoshikawa, Yuya, et al. “Explaining Black-Box Model Predictions via Two-Level Nested Feature Attributions with Consistency Property.” arXiv [cs.LG], 23 May 2024, http://arxiv.org/abs/2405.14522. arXiv. • [Abnar+ ʻ20] Abnar, Samira, and Willem Zuidema. “Quantifying Attention Flow in Transformers.” Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Association for Computational Linguistics, 2020, https://doi.org/10.18653/v1/2020.acl-main.385. • [Wu+ ʻ24] Wu, Junyi, et al. “Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision Transformer.” ArXiv, vol. abs/2403.14552, Mar. 2024, https://doi.org/10.48550/arXiv.2403.14552. 32
  22. 参考⽂献 3/3 • [Alvarez+ ʻ18] Alvarez Melis, David, and Tommi

    Jaakkola. “Towards Robust Interpretability with Self-Explaining Neural Networks.” Advances in Neural Information Processing Systems, vol. 31, 2018, https://proceedings.neurips.cc/paper/2018/hash/3e9f0fc9b2f89e043bc6233994dfcf76-Abstract.html. • [Yoshikawa+ ʻ21] Yoshikawa, Yuya, and Tomoharu Iwata. “Gaussian Process Regression With Interpretable Sample-Wise Feature Weights.” IEEE Transactions on Neural Networks and Learning Systems, vol. PP, Dec. 2021, https://doi.org/10.1109/TNNLS.2021.3131234. • [Fernandes+ ʻ22] Fernandes, Patrick, et al. “Learning to Scaffold: Optimizing Model Explanations for Teaching.” Advances in Neural Information Processing Systems, vol. 35, 2022, pp. 36108‒22. • [Satyapriya+ ʻ23] Satyapriya, et al. “Post Hoc Explanations of Language Models Can Improve Language Models.” arXiv [cs.CL], 19 May 2023, http://arxiv.org/abs/2305.11426. arXiv. • [Doshi-Velez+ ʻ17] Doshi-Velez, Finale, and Been Kim. “Towards A Rigorous Science of Interpretable Machine Learning.” arXiv [stat.ML], 28 Feb. 2017, http://arxiv.org/abs/1702.08608. arXiv. • [Zhou+ ʻ21] Zhou, Yilun, et al. “Do Feature Attribution Methods Correctly Attribute Features?” arXiv [cs.LG], 27 Apr. 2021, http://arxiv.org/abs/2104.14403. arXiv. • [Chen+ ʻ22] Chen, Valerie, et al. “Use-Case-Grounded Simulations for Explanation Evaluation.” Advances in Neural Information Processing Systems, 2022, https://doi.org/10.48550/ARXIV.2206.02256. • [Panigutti+ ʼ22] Panigutti, Cecilia, et al. “Understanding the Impact of Explanations on Advice-Taking: A User Study for AI-Based Clinical Decision Support Systems.” CHI Conference on Human Factors in Computing Systems, ACM, 2022, https://doi.org/10.1145/3491102.3502104. • [Schoeffer+ ʻ22] Schoeffer, Jakob, et al. “ʻthere Is Not Enough Informationʼ: On the Effects of Explanations on Perceptions of Informational Fairness and Trustworthiness in Automated Decision-Making.” 2022 ACM Conference on Fairness, Accountability, and Transparency, ACM, 2022, https://doi.org/10.1145/3531146.3533218. • [Dillon+] Be Careful When Interpreting Predictive Models in Search of Causal Insights ̶ SHAP Latest Documentation. https://shap.readthedocs.io/en/latest/example_notebooks/overviews/Be%20careful%20when%20interpreting%20predictive%20mo dels%20in%20search%20of%20causal%20insights.html. Accessed 5 July 2024. 33