eXplainable AI (XAI)
Black Box AI
2
Input
Output
“Dog”
Black Box AI
3
Input
Black Box
Output
“Dog”
Feature Importance
4
Input
Machine Learning
Output
Feature Importance
5
Input
Machine Learning
Output
Feature importance
Feature Importance
6
Feature Importance
7
Feature 1
Good: 0
Bad: 3
D = 0
Good: 1
Bad: 0
D = 0
0
1
2
Feature 2
Good: 0
Bad: 2
D = 0
Good: 2
Bad: 0
D = 0
0
1
Feature 1 | Feature 2 | Feature 3 | Feature 4 | output |
? | Yes | Low | Medium | Bad |
Yes | Yes | High | Medium | Bad |
? | No | High | Medium | Good |
No | No | Medium | High | Good |
? | No | Medium | Low | Good |
Yes | No | Low | High | Bad |
Yes | No | Medium | High | Bad |
? | Yes | High | Low | Bad |
eXplainable AI
8
Methods for Explainable AI
9
SHapley Additive exPlanations (SHAP)
10
SHapley Additive exPlanations (SHAP)
11
Local Feature Importance
Global Feature Importance
Feature Importance
12
Input
Machine Learning
Output
SHAP
Feature importance
Lab: Wind Turbine Energy Prediction
13
Lab: Wind Turbine Energy Prediction
14
Python: Wind Turbine Energy Prediction
15
Python: SHAP
16
Local Interpretable Model-agnostic Explanations �(LIME)
17
Local Interpretable Model-agnostic Explanations (LIME)
18
Local Interpretable Model-agnostic Explanations (LIME)
19
Marco Tulio Ribeiro, S. S. (2016, August 12). Local interpretable model-agnostic explanations (LIME): An introduction. O'Reilly Media.
How LIME Works
20
LIME
21
Saliency Maps in Explainable AI
Saliency Maps
23
What Regions is AI Focusing On?
24
Activation map (like a heat map)
What Regions is AI Focusing On?
25
Grad-CAM: �Gradient-weighted Class Activation Maps
26
Saliency Maps in Explainable AI
27
Key Concept of Saliency Maps
28
Grad-CAM: Gradient-weighted Class Activation Maps
29
Selvaraju et al. Grad-CAM: Visual explanations from deep networks
via gradient-based localization. ICCV’17
Grad-CAM: Gradient-weighted Class Activation Maps
30
Step 1: Train CNN
31
Convolution
Max pooling
…
Flatten
Convolution and pooling layers
Convolutional Neural Networks
Classification
Fully connected layer
7
9
…
…
Last Feature Maps
Step 2: Forward Pass through the trained CNN
32
2
3
7
0
-7
-3
-2
2
-2
9
1
1
5
0
-2
6
-1
4
-2
4
-5
7
8
0
3
6
4
2
-2
2
-9
5
…
…
…
Flatten
1
2
4
1
6
7
8
5
2
0
3
2
3
4
1
1
…
softmax
Fully connected
Last Feature Maps
Step 3: Compute Gradients and Global Average of the Gradients
33
2
3
7
0
-7
-3
-2
2
-2
9
1
1
5
0
-2
6
-1
4
-2
4
-5
7
8
0
3
6
4
2
-2
2
-9
5
…
…
…
…
Flatten
1
2
4
1
6
7
8
5
2
0
3
2
3
4
1
1
softmax
Last Feature Maps
Fully connected
Step 4: Weight the Feature Maps
34
2
3
7
0
-7
-3
-2
2
-2
9
1
1
5
0
-2
6
-1
4
-2
4
-5
7
8
0
3
6
4
2
-2
2
-9
5
…
…
…
…
Flatten
1
2
4
1
6
7
8
5
2
0
3
2
3
4
1
1
Class Activation Map
softmax
Last Feature Maps
Fully connected
Lab for Grad-CAM: MNIST
35
Convolution
Max pooling
…
Flatten
Convolution and pooling layers
Convolutional Neural Networks
Classification
Fully connected layer
7
9
…
…
Feature Maps
Lab for Grad-CAM: MNIST
36
Convolution
Max pooling
…
Flatten
Convolution and pooling layers
Convolutional Neural Networks
Classification
Fully connected layer
7
9
…
…
Feature Maps
Class Activation Map
Python: Grad-CAM
37
Python: Grad-CAM
38
Result: Grad-CAM
39
Original test image
Saliency map
Resized
Overlapped
CAM: �Class Activation Maps
40
Visualizing Convolutional Neural Networks
41
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba.
Learning Deep Features for Discriminative Localization. CVPR'16
Fully Connected Layer
42
Convolution
Max pooling
…
Flatten
Convolution and pooling layers
Convolutional Neural Networks
Classification
Fully connected layer
7
9
…
…
Last Feature Maps
Global Average Pooling (GAP)
43
1
2
4
1
6
7
8
5
2
1
0
3
2
3
4
1
Global Avg pooling
3.125
Global Average Pooling (GAP)
44
2
3
7
0
-7
-3
-2
2
-2
9
1
1
5
0
-2
6
-1
4
-2
4
-5
7
8
0
3
6
4
2
-2
2
-9
5
1
2
4
1
6
7
8
5
2
1
0
3
2
3
4
1
3.125
1.625
1.25
Train CNN with Global Average Pooling
45
Convolution
Max pooling
…
7
9
GAP
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Feed New Image into the Trained Network
46
Convolution
Max pooling
…
7
9
GAP
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Feed New Image into the Trained Network
47
Convolution
Max pooling
…
7
9
GAP
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Feed New Image into the Trained Network
48
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
Convolution
Max pooling
…
7
9
GAP
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Class Activation Map (CAM)
49
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
Convolution
Max pooling
…
7
9
GAP
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Class Activation Map
Resize and Overlay
50
Convolution and pooling layers
Convolutional Neural Networks
Classification
GAP
Convolution
Max pooling
…
7
9
GAP
Resize and overlay
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba,
Learning Deep Features for Discriminative Localization, CVPR'16
Class Activation Map
Implementation: Global Average Pooling
51
Implementation: CAM Heatmap
52
1) Predict the class label
2) Select the corresponding CAM based on the predicted class
CAM Heatmap
53
Resize
Overlay
Steel Surface Defects
54
Steel Surface Defects
55
Patches
Inclusion
Scratches
Steel Surface Defect Diagnostics using Deep Convolutional Neural Network and Class Activation Map, Applied Sciences
Steel Surface Defects
56
Patches
Inclusion
Scratches
Steel Surface Defect Diagnostics using Deep Convolutional Neural Network and Class Activation Map, Applied Sciences
Defect regimes are never labeled
Cantilever
57
In collaboration with KIMM
Visually Identify the Region with the Highest Vibration
58
In collaboration with KIMM