SlideShare a Scribd company logo
© 2021 AltaML
Computer Vision
Explainability
A Machine Learning
Engineer's Overview
Navaneeth Kamballur Kottayil
AltaML
© 2021 AltaML
Outline
➢ Company introduction
➢ Deep learning and trust and why explainability is needed
➢ Categories of techniques in explainability
○ Basic idea + explanation of a representative method
➢ Case studies
2
© 2021 AltaML
AltaML and Computer Vision
• AltaML is a Canadian applied
Machine learning company that
works with industry partners to
augment their capabilities with
AI&ML.
• AltaML has had great success in
generating value for its partners
with use of computer vision-
based ML systems.
3
LIDAR tree species detection
Construction site monitoring
Industrial damage detection Animal face keypoint detection
Pet health Analysis
Facies (rock type) classification
Deep Learning and Trust
“Deep learning is a black box”
© 2021 AltaML
Why Black Boxes
5
Image reference: https://medium.com/@RaghavPrabhu/cnn-architectures-lenet-alexnet-vgg-googlenet-and-resnet-7c81c017b848
Common questions:
● Clients : “Why does it make this prediction?”
● ML Dev/Data Scientist : “Why does this work?”; “Is my algorithm looking at the right things?”
This is a serious problem even if performance is high.
The picture is classified as a
motorcycle on the basis of the
following set of pixels
© 2021 AltaML
Opening up Black Boxes
6
Image reference:Fei-Fei Li, Justin Johnson, Serena Yeung, CS 231n
We can visualize features
detected at each of the layers.
• Initial layer filters detect Gabor like
edges !
Deeper layer filters convey no
meaningful information.
Results cannot be explained with
visualizations of filter coefficients or outputs.
© 2021 AltaML
Filter Visualization Techniques
7
Basic idea: Synthesize inputs that can maximize a specific neuron activation.
● Input a random noise image as input. Say , to trained CNN.
● Perform a fwd pass of the image.
● Assuming that the filter that one wants to visualize is of index i, such
that activation of the specific layer of interest is
● The visualization of the fitler is obtained by adding the backpropagated gradients from
back to the image (usually with a scale factor to control the amount by which update
is done)
© 2021 AltaML
Explainability
Provide either, a set of pixels or a heat map showing the pixels
that were important for a classification decision.
8
Input
image
Explainability
output
© 2021 AltaML
Explainability
Active field of research with very
large number of research papers,
tools and techniques
Broad categories of research
• Perturbation based methods
• Backpropagation based
methods
• Activation based methods
9
Image reference: Das, Arun, and Paul Rad. "Opportunities and challenges in explainabl
e artificial intelligence (xai): A survey." arXiv preprint arXiv:2006.11371 (2020).
© 2021 AltaML
Perturbation Based Methods
Basic idea: learn the behavior by
perturbing the input and see how
the predictions change.
Image reference: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I trust you?" Explaining the predictions of any
classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.
10
© 2021 AltaML
Perturbation Based Methods
Image reference: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I trust you?" Explaining the predictions of any
classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016.
11
LIME (Local Interpretable Model-Agnostic Explanations)
● Choose the ML model and a reference class to be explained
● Generate perturbations all over the image space (an approximation of this is done
by dividing image to superpixels and randomly turn off superpixels)
● Predict the output Y, for each perturbed image, using the ML model
● Find the contribution of each of the superpixel by, training the following Linear
Ridge Regression on the generated output:
E(Y)= β₀ + ∑ βⱼ Xⱼ
● The β coefficients are regarded as LIME explanation. The superpixels with the
largest weight is the explanation (in terms of pixels)
© 2021 AltaML
Backpropagation Based Methods
Basic idea: Trace the signals from
classification output back to the
input
Image reference:http://www.heatmapping.org/
Paper reference: Binder, Alexander, et al. "Layer-wise relevance propagation for neural networks with
local renormalization layers." International Conference on Artificial Neural Networks. Springer, Cham,
2016.
12
© 2021 AltaML
Backpropagation Based Methods
Image reference:http://www.heatmapping.org/
Paper reference: Binder, Alexander, et al. "Layer-wise relevance propagation for neural networks with
local renormalization layers." International Conference on Artificial Neural Networks. Springer, Cham,
2016.
13
LRP (Layer-wise relevance propagation)
● Choose the ML model and a reference class to be explained
● Start with output neuron of class c (its probability will be considered as relevance
R at output layer) and trace the result to its previous layer with formula
for neuron i, at layer l. In the notation used, is output of neuron j at layer l
● This is continued till the input image
© 2021 AltaML
Activation Based Methods
Image reference: Chattopadhay, Aditya, et al. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks."
2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018.
14
Basic idea: Express classification
results in terms of strength of
feature maps*
* Note that these are feature maps, ie, outputs of filters, NOT filters themselves
© 2021 AltaML
Activation Based Methods
Image reference: Chattopadhay, Aditya, et al. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks."
2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018.
15
GradCAM
● Choose the ML model and a reference class c to be explained
● Choose a set of k, CNN layer outputs, ie, feature maps Ak
● Compute scale factor for the feature maps as
where GAP is average operation on 2D
● GradCAM is computed as
for all of the k chosen feature maps
* Note that these are feature maps, ie, outputs of filters, NOT filters themselves
© 2021 AltaML
Comparisons
16
Perturbation based Backpropagation based Activation based
Advantage
● Model agnostic
● Easy to implement
● No modification to
model
● Quick to compute
Fine-grained
interpretation
● No modification to
model
● Easy to interpret
● Reasonably fast
Disadvantage
● Time consuming to
run
● Need access to
model weights and
architecture
● Sometimes will be
hard to interpret
● Only for CNN
● Different
explanations based
on selected feature
maps
● Minimal modification
of model (in some
implementations)
Courtesy: https://yozey.github.io/files/CNNInterpretability-1-41.pdf
Applications in Use Cases
© 2021 AltaML
Debugging and Building Trust
ML
Used image segmentation to give the ML model only
images of tissue and not the rest of the slide.
Decisions on an entire tissue sample. No further
information provided by the model.
Decision
18
Simulated images are used to respect the privacy agreements
Use case:
Classify high resolution microscopy
slides into normal or abnormal
ML: Image classification problem
Input Images of biopsy
slides
Labels Per tissue label;
[Normal/Abnormal]
© 2021 AltaML
Explanations significantly helped in
building trust in the proposed
model for ML team and doctors.
Doctors identified that the heat
map pointed to the damaged cells
of interest to the doctors.
ML
+
Explanation
Decision
Localized heat map of the cells that contribute
to the decision (not directly available in labels).
19
Debugging and Building Trust
Simulated images are used to respect the privacy agreements
Input Images of biopsy
slides
Labels Per tissue label;
[Normal/Abnormal]
© 2021 AltaML
Use case:
CV model for assessment of pet
health
Input Images from
hospital
Labels Per image label;
[happy/not happy]
Additional Insights Generated
Model predictions ‘rediscovered’ the
idea of Cat Grimace Scale.
20
© 2021 AltaML
Conclusions
• Explainability techniques are vital in
computer vision-based use cases to
explain the decisions of deep
learning-based models.
• Implementation of these techniques
is not expensive.
• Most basic techniques can give a lot
of useful insights.
Fun fact: We found out that grumpy
cat is in fact, not grumpy at all!
21
© 2021 AltaML
Resources
22
Perturbation based explainability: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I
trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international
conference on knowledge discovery and data mining. 2016.
Backpropagation based explainability: Binder, Alexander, et al. "Layer-wise relevance propagation for
neural networks with local renormalization layers." International Conference on Artificial Neural Networks.
Springer, Cham, 2016.
Activation map explainability: Chattopadhay, Aditya, Anirban Sarkar, Prantik Howlader, and Vineeth N.
Balasubramanian. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional
networks." In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 839-847. IEEE,
2018.
Visualizing Convolutional Feature maps: Zeiler, Matthew D., and Rob Fergus. "Visualizing and
understanding convolutional networks." European conference on computer vision. Springer, Cham, 2014.
Explainability in CV survey paper: Das, Arun, and Paul Rad. "Opportunities and challenges in explainable
artificial intelligence (xai): A survey." arXiv preprint arXiv:2006.11371 (2020).
Thank You

More Related Content

PDF
“Introduction to DNN Model Compression Techniques,” a Presentation from Xailient
PDF
“Applying the Right Deep Learning Model with the Right Data for Your Applicat...
PDF
State-of-the-art Image Processing across all domains
PDF
“Getting Started with Vision AI Model Training,” a Presentation from NVIDIA
PDF
Gdc19 junsik hwang_v20190314_upload
PDF
A Distributed Deep Learning Approach for the Mitosis Detection from Big Medic...
PDF
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
PDF
“Modern Machine Vision from Basics to Advanced Deep Learning,” a Presentation...
“Introduction to DNN Model Compression Techniques,” a Presentation from Xailient
“Applying the Right Deep Learning Model with the Right Data for Your Applicat...
State-of-the-art Image Processing across all domains
“Getting Started with Vision AI Model Training,” a Presentation from NVIDIA
Gdc19 junsik hwang_v20190314_upload
A Distributed Deep Learning Approach for the Mitosis Detection from Big Medic...
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
“Modern Machine Vision from Basics to Advanced Deep Learning,” a Presentation...

What's hot (20)

PDF
Cross-Year Multi-Modal Image Retrieval Using Siamese Networks by Margarita Kh...
PPTX
2015 09-21 webinar - 3D SCAN 3D Scanning Storage and Visualization
PDF
“Maintaining DNN Accuracy When the Real World is Changing,” a Presentation fr...
PDF
“A Highly Data-Efficient Deep Learning Approach,” a Presentation from Samsung
PDF
“Case Study: Facial Detection and Recognition for Always-On Applications,” a ...
PDF
Small Deep-Neural-Networks: Their Advantages and Their Design
PPTX
Transfer Learning and Fine-tuning Deep Neural Networks
PDF
"Designing CNN Algorithms for Real-time Applications," a Presentation from Al...
PDF
“A Practical Guide to Implementing ML on Embedded Devices,” a Presentation fr...
PDF
"Designing a Stereo IP Camera From Scratch," a Presentation from ELVEES
PDF
Computer Vision with Deep Learning
PPT
CI image processing
PDF
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
PDF
“High-fidelity Conversion of Floating-point Networks for Low-precision Infere...
PDF
On-Device AI
PPTX
Introduction to deep learning
PPTX
Convolutional Neural Network (CNN)
PPTX
Convolutional Neural Networks for Computer vision Applications
PDF
kanimozhi2019.pdf
PDF
A Survey of Machine Learning Methods Applied to Computer ...
Cross-Year Multi-Modal Image Retrieval Using Siamese Networks by Margarita Kh...
2015 09-21 webinar - 3D SCAN 3D Scanning Storage and Visualization
“Maintaining DNN Accuracy When the Real World is Changing,” a Presentation fr...
“A Highly Data-Efficient Deep Learning Approach,” a Presentation from Samsung
“Case Study: Facial Detection and Recognition for Always-On Applications,” a ...
Small Deep-Neural-Networks: Their Advantages and Their Design
Transfer Learning and Fine-tuning Deep Neural Networks
"Designing CNN Algorithms for Real-time Applications," a Presentation from Al...
“A Practical Guide to Implementing ML on Embedded Devices,” a Presentation fr...
"Designing a Stereo IP Camera From Scratch," a Presentation from ELVEES
Computer Vision with Deep Learning
CI image processing
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
“High-fidelity Conversion of Floating-point Networks for Low-precision Infere...
On-Device AI
Introduction to deep learning
Convolutional Neural Network (CNN)
Convolutional Neural Networks for Computer vision Applications
kanimozhi2019.pdf
A Survey of Machine Learning Methods Applied to Computer ...
Ad

Similar to “Explainability in Computer Vision: A Machine Learning Engineer’s Overview,” a Presentation from AltaML (20)

PPTX
Explainable AI in Industry (KDD 2019 Tutorial)
PPTX
Responsible AI in Industry: Practical Challenges and Lessons Learned
PDF
IRJET- Art Authentication System using Deep Neural Networks
PDF
Blood Cell Image Classification for Detecting Malaria using CNN
PDF
IMAGE CAPTION GENERATOR USING DEEP LEARNING
PDF
Traffic Sign Recognition System
PDF
Neural network
PDF
A Literature Survey on Image Linguistic Visual Question Answering
PDF
Garbage Classification Using Deep Learning Techniques
PDF
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
PDF
IRJET- Implementation of Gender Detection with Notice Board using Raspberry Pi
PDF
IRJET- 3D Object Recognition of Car Image Detection
PDF
PPT Image Caption Generator mini project
PDF
AUTOMATED WASTE MANAGEMENT SYSTEM
PDF
IRJET- Mango Classification using Convolutional Neural Networks
PDF
Partial Object Detection in Inclined Weather Conditions
PDF
深度學習在AOI的應用
PDF
IRJET- Generating 3D Models Using 3D Generative Adversarial Network
PDF
DSDT meetup July 2021
PDF
Image super resolution using Generative Adversarial Network.
Explainable AI in Industry (KDD 2019 Tutorial)
Responsible AI in Industry: Practical Challenges and Lessons Learned
IRJET- Art Authentication System using Deep Neural Networks
Blood Cell Image Classification for Detecting Malaria using CNN
IMAGE CAPTION GENERATOR USING DEEP LEARNING
Traffic Sign Recognition System
Neural network
A Literature Survey on Image Linguistic Visual Question Answering
Garbage Classification Using Deep Learning Techniques
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
IRJET- Implementation of Gender Detection with Notice Board using Raspberry Pi
IRJET- 3D Object Recognition of Car Image Detection
PPT Image Caption Generator mini project
AUTOMATED WASTE MANAGEMENT SYSTEM
IRJET- Mango Classification using Convolutional Neural Networks
Partial Object Detection in Inclined Weather Conditions
深度學習在AOI的應用
IRJET- Generating 3D Models Using 3D Generative Adversarial Network
DSDT meetup July 2021
Image super resolution using Generative Adversarial Network.
Ad

More from Edge AI and Vision Alliance (20)

PDF
“Visual Search: Fine-grained Recognition with Embedding Models for the Edge,”...
PDF
“Optimizing Real-time SLAM Performance for Autonomous Robots with GPU Acceler...
PDF
“LLMs and VLMs for Regulatory Compliance, Quality Control and Safety Applicat...
PDF
“Simplifying Portable Computer Vision with OpenVX 2.0,” a Presentation from AMD
PDF
“Quantization Techniques for Efficient Deployment of Large Language Models: A...
PDF
“Introduction to Data Types for AI: Trade-Offs and Trends,” a Presentation fr...
PDF
“Introduction to Radar and Its Use for Machine Perception,” a Presentation fr...
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
PDF
“Beyond the Demo: Turning Computer Vision Prototypes into Scalable, Cost-effe...
PDF
“Running Accelerated CNNs on Low-power Microcontrollers Using Arm Ethos-U55, ...
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
PDF
“A Re-imagination of Embedded Vision System Design,” a Presentation from Imag...
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
PDF
“Evolving Inference Processor Software Stacks to Support LLMs,” a Presentatio...
PDF
“Efficiently Registering Depth and RGB Images,” a Presentation from eInfochips
PDF
“How to Right-size and Future-proof a Container-first Edge AI Infrastructure,...
“Visual Search: Fine-grained Recognition with Embedding Models for the Edge,”...
“Optimizing Real-time SLAM Performance for Autonomous Robots with GPU Acceler...
“LLMs and VLMs for Regulatory Compliance, Quality Control and Safety Applicat...
“Simplifying Portable Computer Vision with OpenVX 2.0,” a Presentation from AMD
“Quantization Techniques for Efficient Deployment of Large Language Models: A...
“Introduction to Data Types for AI: Trade-Offs and Trends,” a Presentation fr...
“Introduction to Radar and Its Use for Machine Perception,” a Presentation fr...
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
“Beyond the Demo: Turning Computer Vision Prototypes into Scalable, Cost-effe...
“Running Accelerated CNNs on Low-power Microcontrollers Using Arm Ethos-U55, ...
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
“A Re-imagination of Embedded Vision System Design,” a Presentation from Imag...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“Evolving Inference Processor Software Stacks to Support LLMs,” a Presentatio...
“Efficiently Registering Depth and RGB Images,” a Presentation from eInfochips
“How to Right-size and Future-proof a Container-first Edge AI Infrastructure,...

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PDF
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf
A comparative analysis of optical character recognition models for extracting...
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Approach and Philosophy of On baking technology

“Explainability in Computer Vision: A Machine Learning Engineer’s Overview,” a Presentation from AltaML

  • 1. © 2021 AltaML Computer Vision Explainability A Machine Learning Engineer's Overview Navaneeth Kamballur Kottayil AltaML
  • 2. © 2021 AltaML Outline ➢ Company introduction ➢ Deep learning and trust and why explainability is needed ➢ Categories of techniques in explainability ○ Basic idea + explanation of a representative method ➢ Case studies 2
  • 3. © 2021 AltaML AltaML and Computer Vision • AltaML is a Canadian applied Machine learning company that works with industry partners to augment their capabilities with AI&ML. • AltaML has had great success in generating value for its partners with use of computer vision- based ML systems. 3 LIDAR tree species detection Construction site monitoring Industrial damage detection Animal face keypoint detection Pet health Analysis Facies (rock type) classification
  • 4. Deep Learning and Trust “Deep learning is a black box”
  • 5. © 2021 AltaML Why Black Boxes 5 Image reference: https://medium.com/@RaghavPrabhu/cnn-architectures-lenet-alexnet-vgg-googlenet-and-resnet-7c81c017b848 Common questions: ● Clients : “Why does it make this prediction?” ● ML Dev/Data Scientist : “Why does this work?”; “Is my algorithm looking at the right things?” This is a serious problem even if performance is high. The picture is classified as a motorcycle on the basis of the following set of pixels
  • 6. © 2021 AltaML Opening up Black Boxes 6 Image reference:Fei-Fei Li, Justin Johnson, Serena Yeung, CS 231n We can visualize features detected at each of the layers. • Initial layer filters detect Gabor like edges ! Deeper layer filters convey no meaningful information. Results cannot be explained with visualizations of filter coefficients or outputs.
  • 7. © 2021 AltaML Filter Visualization Techniques 7 Basic idea: Synthesize inputs that can maximize a specific neuron activation. ● Input a random noise image as input. Say , to trained CNN. ● Perform a fwd pass of the image. ● Assuming that the filter that one wants to visualize is of index i, such that activation of the specific layer of interest is ● The visualization of the fitler is obtained by adding the backpropagated gradients from back to the image (usually with a scale factor to control the amount by which update is done)
  • 8. © 2021 AltaML Explainability Provide either, a set of pixels or a heat map showing the pixels that were important for a classification decision. 8 Input image Explainability output
  • 9. © 2021 AltaML Explainability Active field of research with very large number of research papers, tools and techniques Broad categories of research • Perturbation based methods • Backpropagation based methods • Activation based methods 9 Image reference: Das, Arun, and Paul Rad. "Opportunities and challenges in explainabl e artificial intelligence (xai): A survey." arXiv preprint arXiv:2006.11371 (2020).
  • 10. © 2021 AltaML Perturbation Based Methods Basic idea: learn the behavior by perturbing the input and see how the predictions change. Image reference: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016. 10
  • 11. © 2021 AltaML Perturbation Based Methods Image reference: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016. 11 LIME (Local Interpretable Model-Agnostic Explanations) ● Choose the ML model and a reference class to be explained ● Generate perturbations all over the image space (an approximation of this is done by dividing image to superpixels and randomly turn off superpixels) ● Predict the output Y, for each perturbed image, using the ML model ● Find the contribution of each of the superpixel by, training the following Linear Ridge Regression on the generated output: E(Y)= β₀ + ∑ βⱼ Xⱼ ● The β coefficients are regarded as LIME explanation. The superpixels with the largest weight is the explanation (in terms of pixels)
  • 12. © 2021 AltaML Backpropagation Based Methods Basic idea: Trace the signals from classification output back to the input Image reference:http://www.heatmapping.org/ Paper reference: Binder, Alexander, et al. "Layer-wise relevance propagation for neural networks with local renormalization layers." International Conference on Artificial Neural Networks. Springer, Cham, 2016. 12
  • 13. © 2021 AltaML Backpropagation Based Methods Image reference:http://www.heatmapping.org/ Paper reference: Binder, Alexander, et al. "Layer-wise relevance propagation for neural networks with local renormalization layers." International Conference on Artificial Neural Networks. Springer, Cham, 2016. 13 LRP (Layer-wise relevance propagation) ● Choose the ML model and a reference class to be explained ● Start with output neuron of class c (its probability will be considered as relevance R at output layer) and trace the result to its previous layer with formula for neuron i, at layer l. In the notation used, is output of neuron j at layer l ● This is continued till the input image
  • 14. © 2021 AltaML Activation Based Methods Image reference: Chattopadhay, Aditya, et al. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks." 2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018. 14 Basic idea: Express classification results in terms of strength of feature maps* * Note that these are feature maps, ie, outputs of filters, NOT filters themselves
  • 15. © 2021 AltaML Activation Based Methods Image reference: Chattopadhay, Aditya, et al. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks." 2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018. 15 GradCAM ● Choose the ML model and a reference class c to be explained ● Choose a set of k, CNN layer outputs, ie, feature maps Ak ● Compute scale factor for the feature maps as where GAP is average operation on 2D ● GradCAM is computed as for all of the k chosen feature maps * Note that these are feature maps, ie, outputs of filters, NOT filters themselves
  • 16. © 2021 AltaML Comparisons 16 Perturbation based Backpropagation based Activation based Advantage ● Model agnostic ● Easy to implement ● No modification to model ● Quick to compute Fine-grained interpretation ● No modification to model ● Easy to interpret ● Reasonably fast Disadvantage ● Time consuming to run ● Need access to model weights and architecture ● Sometimes will be hard to interpret ● Only for CNN ● Different explanations based on selected feature maps ● Minimal modification of model (in some implementations) Courtesy: https://yozey.github.io/files/CNNInterpretability-1-41.pdf
  • 18. © 2021 AltaML Debugging and Building Trust ML Used image segmentation to give the ML model only images of tissue and not the rest of the slide. Decisions on an entire tissue sample. No further information provided by the model. Decision 18 Simulated images are used to respect the privacy agreements Use case: Classify high resolution microscopy slides into normal or abnormal ML: Image classification problem Input Images of biopsy slides Labels Per tissue label; [Normal/Abnormal]
  • 19. © 2021 AltaML Explanations significantly helped in building trust in the proposed model for ML team and doctors. Doctors identified that the heat map pointed to the damaged cells of interest to the doctors. ML + Explanation Decision Localized heat map of the cells that contribute to the decision (not directly available in labels). 19 Debugging and Building Trust Simulated images are used to respect the privacy agreements Input Images of biopsy slides Labels Per tissue label; [Normal/Abnormal]
  • 20. © 2021 AltaML Use case: CV model for assessment of pet health Input Images from hospital Labels Per image label; [happy/not happy] Additional Insights Generated Model predictions ‘rediscovered’ the idea of Cat Grimace Scale. 20
  • 21. © 2021 AltaML Conclusions • Explainability techniques are vital in computer vision-based use cases to explain the decisions of deep learning-based models. • Implementation of these techniques is not expensive. • Most basic techniques can give a lot of useful insights. Fun fact: We found out that grumpy cat is in fact, not grumpy at all! 21
  • 22. © 2021 AltaML Resources 22 Perturbation based explainability: Ribeiro, Marco Tulio, Sameer Singh, and Carlos Guestrin. "" Why should I trust you?" Explaining the predictions of any classifier." Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining. 2016. Backpropagation based explainability: Binder, Alexander, et al. "Layer-wise relevance propagation for neural networks with local renormalization layers." International Conference on Artificial Neural Networks. Springer, Cham, 2016. Activation map explainability: Chattopadhay, Aditya, Anirban Sarkar, Prantik Howlader, and Vineeth N. Balasubramanian. "Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks." In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 839-847. IEEE, 2018. Visualizing Convolutional Feature maps: Zeiler, Matthew D., and Rob Fergus. "Visualizing and understanding convolutional networks." European conference on computer vision. Springer, Cham, 2014. Explainability in CV survey paper: Das, Arun, and Paul Rad. "Opportunities and challenges in explainable artificial intelligence (xai): A survey." arXiv preprint arXiv:2006.11371 (2020).