SlideShare a Scribd company logo
1 of 11
XAI
(Explainable artificial intelligence)
Related Researches ver0.1
목차
Explainable Artificial Intelligence
(1) “Why Should I Trust You?” Explaining the Predictions of Any Classifier 2016 (Link)
(2) Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization 2016 (LINK)
(3) Attention Branch Network: Learning of Attention Mechanism for Visual Explanation 2019 (Link)
… will be added
목차 - 향후 스터디 예정 (참조용)
Explainable Artificial Intelligence
https://arxiv.org/ftp/arxiv/papers/1907/1907.07374.pdf
공통 (Why XAI?)
Basic Concept of this research
설명력
정확도
Logistic Simple Tree Complex Tree Deep Neural Net
딥러닝 모델은 뛰어난 성능을 보여주지만, 설명력이 부족하다는 단점이 있으며, 이러한 문제는 현장에 작용
하는데 문제가 된다. 이러한 문제를 해결하기 위한 다양한 연구들을 살펴보고자 한다.
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Basic Concept of this research
전체 주어진 데이터를 설명하는 Global 모델(복잡함)을 설명하는 대신에, 예식하고자 하는 예측 값 근처에 대
해서만 해석 가능한 Local 모델을(해당 값 주변의 데이터만 사용) 학습시키는 방법.
Global 모델은 너무 복잡하여, 해석하는 것이 매우 어렵지만, 예측 값 근처에 대해서만 해석 가능한 Local 모
델은 더 단순한(Linear) 형태로 구성하여 해석 가능하도록 만들 수 있을 것이다 라는 것이 핵심아이디어 .
부가적으로 어떤 모델이 오는지를 전혀 고려하지 않기 때문에 어떤 모델에도 적용할 수 있다는 장점도 존재.
예측 값
예측 값을
변형해서 만
든 데이터
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
1. Interpretable Data Representations
Before we present the explanation system, it is important to distinguish between features and interpretable
data representations. As mentioned before, interpretable explanations need to use a representation that is
understandable to humans, regardless of the actual features used by the model. For example, a possible
interpretable representation for text classification is a binary vector indicating the presence or absence of a
word, even though the classifier may use more complex (and incomprehensible) features such as word
embeddings. Likewise for image classification, an interpretable representation may be a binary vector
indicating the “presence” or “absence” of a contiguous patch of similar pixels (a super-pixel), while the
classifier may represent the image as a tensor with three color channels per pixel. We denote x ∈ R d be
the original representation of an instance being explained, and we use x 0 ∈ {0, 1} d 0 to denote a binary
vector for its interpretable representation.
실제 모델이 어떤 복잡한 Feature 를 사용하는 것과 관계 없이, 설명을 위한 모델에서는 사람이 이해할 수 있
는 단위로 0,1 과 같은 Binary 형태로 표시가 되어야 함.
예를들어 TEXT 라면 단어 단위의 존재 여부, 이미지라면 연속된 어떤 조각의 존재 여부 등으로 사람이 이해
할 수 있도록 구성 되어야 함.
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Fidelity-Interpretability Trade-off
Formally, we define an explanation as a model g ∈ G, where G is a class of potentially interpretable
models, such as linear models, decision trees, or falling rule lists [27], i.e. a model g ∈ G can be readily
presented to the user with visual or textual artifacts. The domain of g is {0, 1} d 0 , i.e. g acts over
absence/presence of the interpretable components. As not every g ∈ G may be simple enough to be
interpretable - thus we let Ω(g) be a measure of complexity (as opposed to interpretability) of the
explanation g ∈ G. For example, for decision trees Ω(g) may be the depth of the tree, while for linear
models, Ω(g) may be the number of non-zero weights. Let the model being explained be denoted
. In classification, f(x) is the probability (or a binary indicator) that x belongs to a certain class1
. We further use πx(z) as a proximity measure between an instance z to x, so as to define locality around
x. Finally, let L(f, g, πx) be a measure of how unfaithful g is in approximating f in the locality defined by
πx. In order to ensure both interpretability and local fidelity, we must minimize L(f, g, πx) while having
Ω(g) be low enough to be interpretable by humans. The explanation produced by LIME is obtained by
the following:
위는 설명 모델이 추구하는 모델은 복잡하지 않으면서, 타겟 데이터(예측)과 주변 데이터(생성)간을 구분하
는 성능 또한 만족 시켜야 한다는 점을 설명하고 있으며, G(설명에 사용할 모델), L(Loss Function,
정해진 Local 구역에서 복잡한 예측 모델 f를 g 가 얼마나 잘 근사하는지 정도(잘 못하는 정도) Omega(g)
모델은 설명 가능할 정도 복잡도 3가지를 어떻게 하느냐에 따라 다양하게 구성 가능하다.
Eq1 :
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Sampling for Local Exploration
We want to minimize the locality-aware loss L(f, g, πx) without making any assumptions about f, since
we want the explainer to be model-agnostic. Thus, in order to learn the local behavior of f as the
interpretable inputs vary, we approximate L(f, g, πx) by drawing samples, weighted by πx. We sample
instances around x’ by drawing nonzero elements of x’ uniformly at random (where the number of such
draws is also uniformly sampled). Given a perturbed sample z’ ∈ {0, 1} d’ (which contains a fraction of
the nonzero elements of x’ ), we recover the sample in the original representation z ∈ R and obtain f(z),
which is used as a label for the explanation model. Given this dataset Z of perturbed samples with the
associated labels, we optimize Eq. (1) to get an explanation ξ(x). The primary intuition behind LIME is
presented in Figure 3, where we sample instances both in the vicinity of x (which have a high weight due
to πx) and far away from x (low weight from πx). Even though the original model may be too complex to
explain globally, LIME presents an explanation that is locally faithful (linear in this case), where the
locality is captured by πx. It is worth noting that our method is fairly robust to sampling noise since the
samples are weighted by πx in Eq. (1). We now present a concrete instance of this general framework.
Loss Function 은 실제모델, 설명모델, 로컬지역에서 타겟과 비교군의 차이 3가지로 이루어지는데, 우리는
여기서 f 를 제외하고 g 를 훈련하고 싶다(어떤 모델에도 적용할 수 있도록). 이를 위해서 Sampling 을 하는
형태로 추정을 한다. Smaple 예시 : {분류 클래스, 변형된 데이터, 원래 데이터와의 거리}
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Sparse Linear Explanations
For the rest of this paper, we let G be the class of linear models, such that g(z 0 ) = wg ·z’. We use the
locally weighted square loss as L, as defined in Eq. (2), where we let πx(z) = exp(−D(x, z) 2 /σ2 ) be an
exponential kernel defined on some distance function D (e.g. cosine distance for text, L2 distance for
images) with width σ.
설명 모델은 무엇이든 될 수 있지만, 여기서는
가장 간단한 선형 모델
TEXT 라면 cosine distance, 이미지라면 L2
텍스트라면 단어의 수, 이미지라면 segment 의
수가 되며, K는 사용자 조정치로 해당 수치 이상
은 무한대 loss 가 되도록 함
※ x 는 특정 Local 위치를 의미하며, 실제로는
원래 훈련셋의 데이터
성능 복잡도
원본 데이터와 생성
데이터간의 거리
(가까우면 1 멀면 0)
원래 모델의 분류 성
능을 얼마나 모방
할 수 있는지 정도
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Practical Explanation
(1) 원본 데이터를 Segment 로 나누고 여러 가지의 조합을 만든다.
(2) 여러가지 조합과 원본과의 거리(유사도)를 구한다.
(3) 새로운 데이터(조합한)를 대상으로 복잡한 모델(예:딥러닝)을 사용하여 예측을 한다
(4) 조합한 데이터 셋 중에서 가장 좋은 결과가 나온 N 개를 선택한다.
(5) 해당 조합의 유사도롤 Weight 로 하는 간단한 선형 모델을 만든다
(6) 간단한 모델을 사용하여, 해당 모델을 설명하도록 한다.
LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier)
Implementation Example
https://github.com/marcotcr/lime https://marcotcr.github.io/lime/tutorials/Li
me%20-%20multiclass.html

More Related Content

What's hot

120427 celluar texture
120427 celluar texture120427 celluar texture
120427 celluar textureCARROTCG
 
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...홍배 김
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderLee Seungeun
 
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Haezoom Inc.
 
8. Logistic Regression
8. Logistic Regression8. Logistic Regression
8. Logistic RegressionJungkyu Lee
 
A neural image caption generator
A neural image caption generatorA neural image caption generator
A neural image caption generator홍배 김
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명홍배 김
 
Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Kiho Hong
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder홍배 김
 
Support Vector Machine Tutorial 한국어
Support Vector Machine Tutorial 한국어Support Vector Machine Tutorial 한국어
Support Vector Machine Tutorial 한국어Jungkyu Lee
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)Tae Young Lee
 
Invertible residual networks Review
Invertible residual networks ReviewInvertible residual networks Review
Invertible residual networks Review수철 박
 
deep encoder, shallow decoder reevaluating non-autoregressive machine transl...
deep encoder, shallow decoder  reevaluating non-autoregressive machine transl...deep encoder, shallow decoder  reevaluating non-autoregressive machine transl...
deep encoder, shallow decoder reevaluating non-autoregressive machine transl...taeseon ryu
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE홍배 김
 
Bidirectional attention flow for machine comprehension
Bidirectional attention flow for machine comprehensionBidirectional attention flow for machine comprehension
Bidirectional attention flow for machine comprehensionWoodam Lim
 
[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer vision[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer visionSusang Kim
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법 홍배 김
 
Convoutional sequence to sequence
Convoutional sequence to sequenceConvoutional sequence to sequence
Convoutional sequence to sequenceWoodam Lim
 

What's hot (20)

120427 celluar texture
120427 celluar texture120427 celluar texture
120427 celluar texture
 
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
 
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
Variational Autoencoder를 여러 가지 각도에서 이해하기 (Understanding Variational Autoencod...
 
8. Logistic Regression
8. Logistic Regression8. Logistic Regression
8. Logistic Regression
 
A neural image caption generator
A neural image caption generatorA neural image caption generator
A neural image caption generator
 
Gan
GanGan
Gan
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명
 
Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)Variational inference intro. (korean ver.)
Variational inference intro. (korean ver.)
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder
 
Support Vector Machine Tutorial 한국어
Support Vector Machine Tutorial 한국어Support Vector Machine Tutorial 한국어
Support Vector Machine Tutorial 한국어
 
Denoising auto encoders(d a)
Denoising auto encoders(d a)Denoising auto encoders(d a)
Denoising auto encoders(d a)
 
Invertible residual networks Review
Invertible residual networks ReviewInvertible residual networks Review
Invertible residual networks Review
 
deep encoder, shallow decoder reevaluating non-autoregressive machine transl...
deep encoder, shallow decoder  reevaluating non-autoregressive machine transl...deep encoder, shallow decoder  reevaluating non-autoregressive machine transl...
deep encoder, shallow decoder reevaluating non-autoregressive machine transl...
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 
Bidirectional attention flow for machine comprehension
Bidirectional attention flow for machine comprehensionBidirectional attention flow for machine comprehension
Bidirectional attention flow for machine comprehension
 
Xai week3
Xai week3Xai week3
Xai week3
 
[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer vision[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer vision
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법
 
Convoutional sequence to sequence
Convoutional sequence to sequenceConvoutional sequence to sequence
Convoutional sequence to sequence
 

More from seungwoo kim

Graph neural network #2-2 (heterogeneous graph transformer)
Graph neural network #2-2 (heterogeneous graph transformer)Graph neural network #2-2 (heterogeneous graph transformer)
Graph neural network #2-2 (heterogeneous graph transformer)seungwoo kim
 
Graph Neural Network #2-1 (PinSage)
Graph Neural Network #2-1 (PinSage)Graph Neural Network #2-1 (PinSage)
Graph Neural Network #2-1 (PinSage)seungwoo kim
 
Graph neural network 2부 recommendation 개요
Graph neural network  2부  recommendation 개요Graph neural network  2부  recommendation 개요
Graph neural network 2부 recommendation 개요seungwoo kim
 
Graph Neural Network 1부
Graph Neural Network 1부Graph Neural Network 1부
Graph Neural Network 1부seungwoo kim
 
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanisms
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanismsEnhancing VAEs for collaborative filtering : flexible priors & gating mechanisms
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanismsseungwoo kim
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsseungwoo kim
 
Siamese neural networks+Bert
Siamese neural networks+BertSiamese neural networks+Bert
Siamese neural networks+Bertseungwoo kim
 
MRC recent trend_ppt
MRC recent trend_pptMRC recent trend_ppt
MRC recent trend_pptseungwoo kim
 
NLP Deep Learning with Tensorflow
NLP Deep Learning with TensorflowNLP Deep Learning with Tensorflow
NLP Deep Learning with Tensorflowseungwoo kim
 

More from seungwoo kim (10)

Graph neural network #2-2 (heterogeneous graph transformer)
Graph neural network #2-2 (heterogeneous graph transformer)Graph neural network #2-2 (heterogeneous graph transformer)
Graph neural network #2-2 (heterogeneous graph transformer)
 
Graph Neural Network #2-1 (PinSage)
Graph Neural Network #2-1 (PinSage)Graph Neural Network #2-1 (PinSage)
Graph Neural Network #2-1 (PinSage)
 
Graph neural network 2부 recommendation 개요
Graph neural network  2부  recommendation 개요Graph neural network  2부  recommendation 개요
Graph neural network 2부 recommendation 개요
 
Graph Neural Network 1부
Graph Neural Network 1부Graph Neural Network 1부
Graph Neural Network 1부
 
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanisms
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanismsEnhancing VAEs for collaborative filtering : flexible priors & gating mechanisms
Enhancing VAEs for collaborative filtering : flexible priors & gating mechanisms
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendations
 
Albert
AlbertAlbert
Albert
 
Siamese neural networks+Bert
Siamese neural networks+BertSiamese neural networks+Bert
Siamese neural networks+Bert
 
MRC recent trend_ppt
MRC recent trend_pptMRC recent trend_ppt
MRC recent trend_ppt
 
NLP Deep Learning with Tensorflow
NLP Deep Learning with TensorflowNLP Deep Learning with Tensorflow
NLP Deep Learning with Tensorflow
 

XAI recent researches

  • 2. 목차 Explainable Artificial Intelligence (1) “Why Should I Trust You?” Explaining the Predictions of Any Classifier 2016 (Link) (2) Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization 2016 (LINK) (3) Attention Branch Network: Learning of Attention Mechanism for Visual Explanation 2019 (Link) … will be added
  • 3. 목차 - 향후 스터디 예정 (참조용) Explainable Artificial Intelligence https://arxiv.org/ftp/arxiv/papers/1907/1907.07374.pdf
  • 4. 공통 (Why XAI?) Basic Concept of this research 설명력 정확도 Logistic Simple Tree Complex Tree Deep Neural Net 딥러닝 모델은 뛰어난 성능을 보여주지만, 설명력이 부족하다는 단점이 있으며, 이러한 문제는 현장에 작용 하는데 문제가 된다. 이러한 문제를 해결하기 위한 다양한 연구들을 살펴보고자 한다.
  • 5. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Basic Concept of this research 전체 주어진 데이터를 설명하는 Global 모델(복잡함)을 설명하는 대신에, 예식하고자 하는 예측 값 근처에 대 해서만 해석 가능한 Local 모델을(해당 값 주변의 데이터만 사용) 학습시키는 방법. Global 모델은 너무 복잡하여, 해석하는 것이 매우 어렵지만, 예측 값 근처에 대해서만 해석 가능한 Local 모 델은 더 단순한(Linear) 형태로 구성하여 해석 가능하도록 만들 수 있을 것이다 라는 것이 핵심아이디어 . 부가적으로 어떤 모델이 오는지를 전혀 고려하지 않기 때문에 어떤 모델에도 적용할 수 있다는 장점도 존재. 예측 값 예측 값을 변형해서 만 든 데이터
  • 6. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) 1. Interpretable Data Representations Before we present the explanation system, it is important to distinguish between features and interpretable data representations. As mentioned before, interpretable explanations need to use a representation that is understandable to humans, regardless of the actual features used by the model. For example, a possible interpretable representation for text classification is a binary vector indicating the presence or absence of a word, even though the classifier may use more complex (and incomprehensible) features such as word embeddings. Likewise for image classification, an interpretable representation may be a binary vector indicating the “presence” or “absence” of a contiguous patch of similar pixels (a super-pixel), while the classifier may represent the image as a tensor with three color channels per pixel. We denote x ∈ R d be the original representation of an instance being explained, and we use x 0 ∈ {0, 1} d 0 to denote a binary vector for its interpretable representation. 실제 모델이 어떤 복잡한 Feature 를 사용하는 것과 관계 없이, 설명을 위한 모델에서는 사람이 이해할 수 있 는 단위로 0,1 과 같은 Binary 형태로 표시가 되어야 함. 예를들어 TEXT 라면 단어 단위의 존재 여부, 이미지라면 연속된 어떤 조각의 존재 여부 등으로 사람이 이해 할 수 있도록 구성 되어야 함.
  • 7. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Fidelity-Interpretability Trade-off Formally, we define an explanation as a model g ∈ G, where G is a class of potentially interpretable models, such as linear models, decision trees, or falling rule lists [27], i.e. a model g ∈ G can be readily presented to the user with visual or textual artifacts. The domain of g is {0, 1} d 0 , i.e. g acts over absence/presence of the interpretable components. As not every g ∈ G may be simple enough to be interpretable - thus we let Ω(g) be a measure of complexity (as opposed to interpretability) of the explanation g ∈ G. For example, for decision trees Ω(g) may be the depth of the tree, while for linear models, Ω(g) may be the number of non-zero weights. Let the model being explained be denoted . In classification, f(x) is the probability (or a binary indicator) that x belongs to a certain class1 . We further use πx(z) as a proximity measure between an instance z to x, so as to define locality around x. Finally, let L(f, g, πx) be a measure of how unfaithful g is in approximating f in the locality defined by πx. In order to ensure both interpretability and local fidelity, we must minimize L(f, g, πx) while having Ω(g) be low enough to be interpretable by humans. The explanation produced by LIME is obtained by the following: 위는 설명 모델이 추구하는 모델은 복잡하지 않으면서, 타겟 데이터(예측)과 주변 데이터(생성)간을 구분하 는 성능 또한 만족 시켜야 한다는 점을 설명하고 있으며, G(설명에 사용할 모델), L(Loss Function, 정해진 Local 구역에서 복잡한 예측 모델 f를 g 가 얼마나 잘 근사하는지 정도(잘 못하는 정도) Omega(g) 모델은 설명 가능할 정도 복잡도 3가지를 어떻게 하느냐에 따라 다양하게 구성 가능하다. Eq1 :
  • 8. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Sampling for Local Exploration We want to minimize the locality-aware loss L(f, g, πx) without making any assumptions about f, since we want the explainer to be model-agnostic. Thus, in order to learn the local behavior of f as the interpretable inputs vary, we approximate L(f, g, πx) by drawing samples, weighted by πx. We sample instances around x’ by drawing nonzero elements of x’ uniformly at random (where the number of such draws is also uniformly sampled). Given a perturbed sample z’ ∈ {0, 1} d’ (which contains a fraction of the nonzero elements of x’ ), we recover the sample in the original representation z ∈ R and obtain f(z), which is used as a label for the explanation model. Given this dataset Z of perturbed samples with the associated labels, we optimize Eq. (1) to get an explanation ξ(x). The primary intuition behind LIME is presented in Figure 3, where we sample instances both in the vicinity of x (which have a high weight due to πx) and far away from x (low weight from πx). Even though the original model may be too complex to explain globally, LIME presents an explanation that is locally faithful (linear in this case), where the locality is captured by πx. It is worth noting that our method is fairly robust to sampling noise since the samples are weighted by πx in Eq. (1). We now present a concrete instance of this general framework. Loss Function 은 실제모델, 설명모델, 로컬지역에서 타겟과 비교군의 차이 3가지로 이루어지는데, 우리는 여기서 f 를 제외하고 g 를 훈련하고 싶다(어떤 모델에도 적용할 수 있도록). 이를 위해서 Sampling 을 하는 형태로 추정을 한다. Smaple 예시 : {분류 클래스, 변형된 데이터, 원래 데이터와의 거리}
  • 9. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Sparse Linear Explanations For the rest of this paper, we let G be the class of linear models, such that g(z 0 ) = wg ·z’. We use the locally weighted square loss as L, as defined in Eq. (2), where we let πx(z) = exp(−D(x, z) 2 /σ2 ) be an exponential kernel defined on some distance function D (e.g. cosine distance for text, L2 distance for images) with width σ. 설명 모델은 무엇이든 될 수 있지만, 여기서는 가장 간단한 선형 모델 TEXT 라면 cosine distance, 이미지라면 L2 텍스트라면 단어의 수, 이미지라면 segment 의 수가 되며, K는 사용자 조정치로 해당 수치 이상 은 무한대 loss 가 되도록 함 ※ x 는 특정 Local 위치를 의미하며, 실제로는 원래 훈련셋의 데이터 성능 복잡도 원본 데이터와 생성 데이터간의 거리 (가까우면 1 멀면 0) 원래 모델의 분류 성 능을 얼마나 모방 할 수 있는지 정도
  • 10. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Practical Explanation (1) 원본 데이터를 Segment 로 나누고 여러 가지의 조합을 만든다. (2) 여러가지 조합과 원본과의 거리(유사도)를 구한다. (3) 새로운 데이터(조합한)를 대상으로 복잡한 모델(예:딥러닝)을 사용하여 예측을 한다 (4) 조합한 데이터 셋 중에서 가장 좋은 결과가 나온 N 개를 선택한다. (5) 해당 조합의 유사도롤 Weight 로 하는 간단한 선형 모델을 만든다 (6) 간단한 모델을 사용하여, 해당 모델을 설명하도록 한다.
  • 11. LIME(Why Should I Trust You?” Explaining the Predictions of Any Classifier) Implementation Example https://github.com/marcotcr/lime https://marcotcr.github.io/lime/tutorials/Li me%20-%20multiclass.html