SlideShare a Scribd company logo
1 of 43
Download to read offline
BUILDING
INTERPRETABLE &
SECURE AI
SYSTEMS USING
PYTORCH
GEETA CHAUHAN
AI PARTNER ENGINEERING
FACEBOOK AI
AGENDA 01
INTERPRETABLE AI
02
SECURE & PRIVACY PRESERVING AI
03
REFERENCES
I N T E R P R E T A B I L I T Y
WHAT IS MODEL INTERPRETABILIT Y ?
“THE ABILIT Y TO DESCRIBE AI MODEL INTERNALS AND PREDICTIONS IN HUMAN
UNDERSTANDABLE TERMS*”
* LH Gilpin, et. al., Explaining explanations: An overview of interpretability of machine learning in IEEE 5th International Conference on data science and advanced analytics (DSAA), 2018
I N C R E A S E D
T R A N S P A R E N C Y
D E B U G G I N GB E T T E R
U N D E R S TA N D I N G
MODEL INTERPRETABILIT Y
Screenshot of the tool
Attributing to dog
Attribution Magnitudes
MODEL INTERPRETABILIT Y LIBRARY FOR PY TORCH
M U LT I M O D A L E A S Y T O U S EE X T E N S I B L E
class MyAttribution(Attribution):
def attribute(self, input, ...):
attributions = self._compute_attrs(input, ... )
# <Add any logic necessary for attribution>
return attributions
visualize_image_attr(attr_algo.attribute(input), ...)
captum.ai
GradientSHAP
DeepLiftSHAP
SHAP Methods Integrated Gradients
Saliency
GuidedGradCam
Attribute model output (or internal neurons) to input
features
LayerGradientSHAP
LayerDeepLiftSHAP
SHAP Methods
LayerConductance
InternalInfluence
GradCam
Attribute model output to the layers of the model
DeepLift
NoiseTunnel (Smoothgrad, Vargrad, Smoothgrad Square)
LayerActivation
LayerGradientXActivationLayerDeepLiftFeatureAblation /
FeaturePermutation
GuidedBackprop /
Deconvolution
AT TRIBUTION ALGORITHMS
Input * Gradient LayerFeatureAblation
LayerIntegratedGradients
Occlusion
Shapely Value Sampling
Gradient
Perturbation
Other
attributions = Attribution(forward_func, ...).attribute(inputs, ...)*
* Check out our Getting Started docs and API:
https://github.com/pytorch/captum
https://captum.ai/api/
GradientAttribution PerturbationAttribution
IntegratedGradients FeatureAblation
... ...
attributions = Attribution(forward_func, ...).attribute(inputs, ...)*
* Check out our Getting Started docs and API:
https://github.com/pytorch/captum
https://captum.ai/api/
the importance of
inputs to forward_func
model's forward function or
any modification of it
EXPL AINING WITH
INTEGRATED GRADIENTS
FEATURE 0
FEATURE 1
FEATURE 2
TARGET 0
TARGET 1
from captum.attr import IntegratedGradients
attr_algo = IntegratedGradients(model)
input = torch.rand(1, 3)
attributions = attr_algo.attribute(input, target=0)
EXPL AINING WITH
INTEGRATED GRADIENTS
from captum.attr import IntegratedGradients
attr_algo = IntegratedGradients(model)
input = torch.rand(1, 3)
attributions = attr_algo.attribute(input, target=0)
FEATURE 0
FEATURE 1
FEATURE 2
TARGET 0
TARGET 1
EXPL AINING WITH
INTEGRATED GRADIENTS
from captum.attr import IntegratedGradients
attr_algo = IntegratedGradients(model)
input = torch.rand(1, 3)
attributions = attr_algo.attribute(input, target=0)
FEATURE 0
FEATURE 1
FEATURE 2
TARGET 0
TARGET 1
OUTPUT
attributions: tensor([[-0.41, 0.54, 0.88]])
EXPL AINING WITH
INTEGRATED GRADIENTS
from captum.attr import IntegratedGradients
attr_algo = IntegratedGradients(model)
input = torch.rand(1, 3)
attributions, delta = attr_algo.attribute(input,
target=0,
return_convergence_delta=True)
FEATURE 0
FEATURE 1
FEATURE 2
TARGET 0
TARGET 1
OUTPUT
attributions: tensor([[-0.41, 0.54, 0.88]])
delta: 0.0190
EXPL AINING WITH
INTEGRATED GRADIENTS
from captum.attr import IntegratedGradients
attr_algo = IntegratedGradients(model)
input = torch.rand(1, 3)
baseline = torch.rand(1, 3)
attributions, delta = attr_algo.attribute(input,
target=0,
return_convergence_delta=True,
n_steps=5000,
baselines=baselines)
FEATURE 0
FEATURE 1
FEATURE 2
TARGET 0
TARGET 1
OUTPUT
attributions: tensor([[0.0, 0.88, -2.45]])
convergence delta: 1.5497e-06
ORIGINAL IMAGE ATTRIBUTING* TO DOG ATTRIBUTING* TO CAT
* MATTHEW D ZEILER, ROB FERGUS, OCCLUSION: VISUALIZING AND UNDERSTANDING CONVOLUTIONAL NETWORKS, IN SPRINGER INTERNATIONAL PUBLISHING SWITZERLAND, 2014
VISUALIZATIONS USING RESNET152 MODEL
VISUALIZING
EXPL ANATIONS OF
A TEXT CL ASSIFICATION
MODEL USING IMDB
DATASET
WITH
CAPTUM INSIGHTS
VISUALIZING
EXPL ANATIONS OF
MULTIMODAL VQA
MODELS
WITH
CAPTUM INSIGHTS
VISUALIZING
EXPL ANATIONS OF
A 3-L AYER MLP MODEL
USING TITANIC DATASET
WITH
CAPTUM INSIGHTS
CASE STUDY FOR BERT MODELS
EXPL AINING BERT MODELS
+ Fine-tuning BERT model for Question Answering on SQUAD dataset
+ Evaluating on Dev Set
Exact Match: 78%
F1-Score: 86%
+ Understanding the importance of different types of word tokens, layers and neurons
+ Already existing research in understanding and visualizing attention heads
+ What Does BERT Look At? An Analysis of BERT's Attention, Clark, et. al. 2019, BlackBoxNLP@ACL
+ ExBERT: A Visual Analysis Tool to Explore Learned Representations in Transformers Models, Hoover, et. al., 2019,
EXPL AINING BERT MODELS FOR QUESTION ANSWERING
text = 'It is important to us to include, empower and support humans of all kinds.'
question = 'What is important to us?'
[CLS]
tokens
what [SEP]to isimportant ?is us it important to us
to include em, and support humans of all kinds .##power
P(Start Position) = 0.72 P(End Position) = 0.73
[SEP]
# explaining layers
for i in range(model.config.num_hidden_layers):
lc = LayerConductance(squad_pos_forward_func,
model.bert.encoder.layer[i])
layer_attributions_start = lc.attribute(
input_embed, baselines=ref_emb, ..., 0))
layer_attributions_end = lc.attribute(
input_embed, baselines=ref_emb, ..., 1))
EXPL AINING BERT MODELS FOR
QUESTION ANSWERING
AT TRIBUTION HEAT MAP OF ALL TOKENS ACROSS ALL 12 BERT L AYERS FOR START POSITION
PREDICTION
AT TRIBUTION HEAT MAP OF ALL TOKENS ACROSS ALL 12 BERT L AYERS FOR END POSITION
PREDICTION
THE LIMITATIONS OF AT TRIBUTIONS
+ Attributions do not capture feature correlations and interactions
+ Finding good baselines is challenging
+ They are difficult to evaluate
+ Attributions do not explain the model globally
FUTURE DIRECTIONS
+ captum.robust
+ adversarial robustness and attacks
+ studying the connections between
model robustness and interpretability
+ captum.metrics
+ model interpretability, sensitivity, trust, infidelity
and robustness related metrics
+ captum.benchmarks
+ benchmarks for different datasets and methodologies
+ sanity checks
+ captum.optim
+ optimization-based visualizations
...
S E C U R E & P R I V A C Y
P R E S E R V I N G A I
IS IT POSSIBLE TO:
answer questions using
data we cannot see?
What do handwritten

digits look like?
◆ Step 1: Download data
◆ Step 2: Download SOTA training script
◆ Step 3: Run script.
Source: Wikipedia Commons
What do tumors
look like in humans?
◆ Step -1: Persuade a VC.
◆ Step 0: Buy a dataset from a hospital.
◆ Step 1: Download millions of tumor images.
Getting access to
private data is HARD!
We SOLVE tasks which
are accessible:
✓ ImageNet
✓ MNIST
✓ CIFAR-10
✓ Librispeech
✓ WikiText-103
✓ WMT
◆ Cancer
◆ Alzheimers
◆ Dementia
◆ Depression
◆ Anxiety
◆ … Covid-19 Cure?
… but what about?
TOOLS
+ Remote Execution
+ OpenMined PySyft
+ Search and Example Data
+ OpenMined PyGrid
+ Differential Privacy
+ OpenMined PyDP
+ Secure Multi-Party Communication
+ CrypTen.ai
INTRODUCING
CRYPTEN import crypten
import torch
crypten.init() # sets up communication
x = torch.tensor([1.0, 2.0, 3.0])
x_enc = crypten.cryptensor(x) # encrypts tensor
x_dec = x_enc.get_plain_text() # decrypts tensor
assert torch.all_close(x_dec, x) # this passes!
y_enc = crypten.cryptensor([2.0, 3.0, 4.0])
xy_enc = x_enc + y_enc # adds encrypted tensors
xy_dec = xy_enc.get_plain_text()
assert torch.all_close(xy_dec, x + y) # this passes!
z = torch.tensor([4.0, 5.0, 6.0])
xz_enc = x_enc + z # adds FloatTensor to CrypTensor
xz_dec = xz_enc.get_plain_text()
assert torch.all_close(xz_dec, x + z) # this passes!
K E Y F E AT U R E S :
• Tensors and CrypTensors coexist and can be mixed
and matched
• Uses standard eager execution — No compilers! Easy
debugging and learning
• Support for Secure multi-party computation (MPC)
A platform for research in machine learning using
secure-computation techniques
B
HELLO
CRYPTENSOR
1. CrypTensor wraps an implementation that does:
1. Arithmetic secret sharing.
2. XOR secret sharing.
3. Conversions between both secret sharings.
4. A large number of operations.
2. CrypTensor exposes these via a PyTorch-like API.
PyTorch LongTensor
Binary (XOR) Sharing
CrypTensor
Arithmetic Sharing
Trusted Party
Numerical Library
Secure Computation Primitives
Secure Computation Protocol
Protocol-Independent Layer
uses
abstracts
uses
AutogradCrypTensor
MPCTensor
B2A/A2B
Conversion
uses
Automatic di erentiation
User-level code Neural networks, etc.
uses
Parties
1. Make a CrypTen Model.
2. Encrypt Data
3. Train!
ENCRYPTED TRAINING
import crypten
crypten.init() # sets up communication
class LogisticRegression(crypten.nn.Module):
def __init__(self):
super().__init__()
self.linear = crypten.nn.Linear(28 * 28, 10)
def forward(self, x):
return self.linear(x)
model = LogisticRegression().encrypt() # encrypts tensor
1. Join Encrypted Data
2. Encrypt Model
3. Train!
Training Across Par ties
import crypten
crypten.init() # sets up communication
alice_images_enc = crypten.load("/tmp/data/alice_images.pth", src=ALICE)
bob_labels_enc = crypten.load("/tmp/data/bob_labels.pth", src=BOB)
model = LogisticRegression().encrypt()
train_model(model, alice_images_enc, bob_labels_enc)
1. Create a PyTorch or ONNX model.
2. Import model into CrypTen.
3. All computations are now encrypted.
PY TORCH / ONNX
INTEGRATION
import torchvision.datasets as datasets
import torchvision.models as models
# download and set up ImageNet dataset:
transform = transforms.ToTensor()
dataset = datasets.ImageNet(
imagenet_folder,
transform=transform,
)
# download pre-trained ResNet-18 model and encrypt it:
model = models.resnet18(pretrained=True)
encrypted_model = crypten.nn.from_pytorch(
model, dataset[0],
)
# do inference on encrypted images with encrypted model:
encrypted_image = crypten.cryptensor(dataset[1])
encrypted_output = encrypted_model(encrypted_image)
output = encrypted_output.get_plain_text() # this works
USE CASES
+ COVID-19 Sols
+ Cancer Research
+ Integrity (eg PhotoDNA project)
+ Federated AI across Enterprise Silos
+ What problems will you solve?
• Captum: https://captum.ai/
• Captum Blog: https://bit.ly/2vHBxJI
• Captum Algorithms Matrix: https://captum.ai/docs/algorithms_comparison_matrix
• Interpreting MultiModal models: https://captum.ai/tutorials/Multimodal_VQA_Interpret
• Interpretable ML Book: https://christophm.github.io/interpretable-ml-book/
• Crypten: https://crypten.ai/
• CrypTen Tutorials: https://github.com/facebookresearch/CrypTen#how-crypten-works
• OpenMined: https://www.openmined.org/
• OpenMined for Covid-19 Apps: https://blog.openmined.org/providing-opensource-privacy-for-covid19/
• Udacity Course: https://www.udacity.com/course/secure-and-private-ai--ud185
• Active Federated Learning Paper: https://arxiv.org/pdf/1909.12641.pdf
• Microsoft PhotoDNA Project: https://www.microsoft.com/en-us/photodna
REFERENCES
QUESTIONS?
Contact:
Email: gchauhan@fb.com
Linkedin: https://www.linkedin.com/in/geetachauhan/

More Related Content

What's hot

MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication CodesDarshanPatil82
 
Block cipher modes of operations
Block cipher modes of operationsBlock cipher modes of operations
Block cipher modes of operationsAkashRanjandas1
 
Web_Mining_Overview_Nfaoui_El_Habib
Web_Mining_Overview_Nfaoui_El_HabibWeb_Mining_Overview_Nfaoui_El_Habib
Web_Mining_Overview_Nfaoui_El_HabibEl Habib NFAOUI
 
The Solr (Multi-Terms) Synonyms Maze (Graphs)
The Solr (Multi-Terms) Synonyms Maze (Graphs)The Solr (Multi-Terms) Synonyms Maze (Graphs)
The Solr (Multi-Terms) Synonyms Maze (Graphs)Bertrand Rigaldies
 
Promoting the re use of open data through ODIP
Promoting the re use of open data through ODIPPromoting the re use of open data through ODIP
Promoting the re use of open data through ODIPOpen Data Support
 
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them allThe Eff monad, one monad to rule them all
The Eff monad, one monad to rule them allEric Torreborre
 
Fairness in Machine Learning and AI
Fairness in Machine Learning and AIFairness in Machine Learning and AI
Fairness in Machine Learning and AISeth Grimes
 
Algorithm and Data Structure - Concept of Algorithm and Data Structure
Algorithm and Data Structure - Concept of Algorithm and Data StructureAlgorithm and Data Structure - Concept of Algorithm and Data Structure
Algorithm and Data Structure - Concept of Algorithm and Data StructureAndiNurkholis1
 
Explainable AI in Healthcare
Explainable AI in HealthcareExplainable AI in Healthcare
Explainable AI in Healthcarevonaurum
 
Explainability and bias in AI
Explainability and bias in AIExplainability and bias in AI
Explainability and bias in AIBill Liu
 
Big data unit 2
Big data unit 2Big data unit 2
Big data unit 2RojaT4
 
Graph based Clustering
Graph based ClusteringGraph based Clustering
Graph based Clustering怡秀 林
 

What's hot (14)

MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Block cipher modes of operations
Block cipher modes of operationsBlock cipher modes of operations
Block cipher modes of operations
 
Web_Mining_Overview_Nfaoui_El_Habib
Web_Mining_Overview_Nfaoui_El_HabibWeb_Mining_Overview_Nfaoui_El_Habib
Web_Mining_Overview_Nfaoui_El_Habib
 
The Solr (Multi-Terms) Synonyms Maze (Graphs)
The Solr (Multi-Terms) Synonyms Maze (Graphs)The Solr (Multi-Terms) Synonyms Maze (Graphs)
The Solr (Multi-Terms) Synonyms Maze (Graphs)
 
Automatic indexing
Automatic indexingAutomatic indexing
Automatic indexing
 
Promoting the re use of open data through ODIP
Promoting the re use of open data through ODIPPromoting the re use of open data through ODIP
Promoting the re use of open data through ODIP
 
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them allThe Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
 
Fairness in Machine Learning and AI
Fairness in Machine Learning and AIFairness in Machine Learning and AI
Fairness in Machine Learning and AI
 
Algorithm and Data Structure - Concept of Algorithm and Data Structure
Algorithm and Data Structure - Concept of Algorithm and Data StructureAlgorithm and Data Structure - Concept of Algorithm and Data Structure
Algorithm and Data Structure - Concept of Algorithm and Data Structure
 
Explainable AI in Healthcare
Explainable AI in HealthcareExplainable AI in Healthcare
Explainable AI in Healthcare
 
Explainability and bias in AI
Explainability and bias in AIExplainability and bias in AI
Explainability and bias in AI
 
Big data unit 2
Big data unit 2Big data unit 2
Big data unit 2
 
Semantic web
Semantic webSemantic web
Semantic web
 
Graph based Clustering
Graph based ClusteringGraph based Clustering
Graph based Clustering
 

Similar to Building Interpretable & Secure AI Systems using PyTorch

Scaling Up AI Research to Production with PyTorch and MLFlow
Scaling Up AI Research to Production with PyTorch and MLFlowScaling Up AI Research to Production with PyTorch and MLFlow
Scaling Up AI Research to Production with PyTorch and MLFlowDatabricks
 
Scaling AI in production using PyTorch
Scaling AI in production using PyTorchScaling AI in production using PyTorch
Scaling AI in production using PyTorchgeetachauhan
 
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...HostedbyConfluent
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...OpenCredo
 
Leveraging Open Source Automated Data Science Tools
Leveraging Open Source Automated Data Science ToolsLeveraging Open Source Automated Data Science Tools
Leveraging Open Source Automated Data Science ToolsDomino Data Lab
 
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...Databricks
 
A tool to evaluate symmetric key algorithms
A tool to evaluate symmetric key algorithmsA tool to evaluate symmetric key algorithms
A tool to evaluate symmetric key algorithmsTharindu Weerasinghe
 
Basic of python for data analysis
Basic of python for data analysisBasic of python for data analysis
Basic of python for data analysisPramod Toraskar
 
The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )Patty Buckley
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with FridaSatria Ady Pradana
 
Smart Data Webinar: Machine Learning Update
Smart Data Webinar: Machine Learning UpdateSmart Data Webinar: Machine Learning Update
Smart Data Webinar: Machine Learning UpdateDATAVERSITY
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData SolutionsTravis Oliphant
 
The Art of Social Media Analysis with Twitter & Python
The Art of Social Media Analysis with Twitter & PythonThe Art of Social Media Analysis with Twitter & Python
The Art of Social Media Analysis with Twitter & PythonKrishna Sankar
 
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012OSCON Byrum
 
Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Animesh Singh
 
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.jsTensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.jsStijn Decubber
 
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 UpdatesNaoki (Neo) SATO
 

Similar to Building Interpretable & Secure AI Systems using PyTorch (20)

ODSC APAC 2022 - Explainable AI
ODSC APAC 2022 - Explainable AIODSC APAC 2022 - Explainable AI
ODSC APAC 2022 - Explainable AI
 
Scaling Up AI Research to Production with PyTorch and MLFlow
Scaling Up AI Research to Production with PyTorch and MLFlowScaling Up AI Research to Production with PyTorch and MLFlow
Scaling Up AI Research to Production with PyTorch and MLFlow
 
Scaling AI in production using PyTorch
Scaling AI in production using PyTorchScaling AI in production using PyTorch
Scaling AI in production using PyTorch
 
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...
Considerations for Abstracting Complexities of a Real-Time ML Platform, Zhenz...
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
 
Leveraging Open Source Automated Data Science Tools
Leveraging Open Source Automated Data Science ToolsLeveraging Open Source Automated Data Science Tools
Leveraging Open Source Automated Data Science Tools
 
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
Analytics Zoo: Building Analytics and AI Pipeline for Apache Spark and BigDL ...
 
A tool to evaluate symmetric key algorithms
A tool to evaluate symmetric key algorithmsA tool to evaluate symmetric key algorithms
A tool to evaluate symmetric key algorithms
 
Basic of python for data analysis
Basic of python for data analysisBasic of python for data analysis
Basic of python for data analysis
 
The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )The Evolution Of Eclipse 1. 1 )
The Evolution Of Eclipse 1. 1 )
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
Smart Data Webinar: Machine Learning Update
Smart Data Webinar: Machine Learning UpdateSmart Data Webinar: Machine Learning Update
Smart Data Webinar: Machine Learning Update
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
SRAVANByCPP
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData Solutions
 
The Art of Social Media Analysis with Twitter & Python
The Art of Social Media Analysis with Twitter & PythonThe Art of Social Media Analysis with Twitter & Python
The Art of Social Media Analysis with Twitter & Python
 
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012The Art of Social Media Analysis with Twitter & Python-OSCON 2012
The Art of Social Media Analysis with Twitter & Python-OSCON 2012
 
Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox Defend against adversarial AI using Adversarial Robustness Toolbox
Defend against adversarial AI using Adversarial Robustness Toolbox
 
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.jsTensorFlow meetup: Keras - Pytorch - TensorFlow.js
TensorFlow meetup: Keras - Pytorch - TensorFlow.js
 
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates
[第45回 Machine Learning 15minutes! Broadcast] Azure AI - Build 2020 Updates
 

More from geetachauhan

Profiling PyTorch for Efficiency & Sustainability
Profiling PyTorch for Efficiency & SustainabilityProfiling PyTorch for Efficiency & Sustainability
Profiling PyTorch for Efficiency & Sustainabilitygeetachauhan
 
Building AI with Security Privacy in Mind
Building AI with Security Privacy in MindBuilding AI with Security Privacy in Mind
Building AI with Security Privacy in Mindgeetachauhan
 
Building AI with Security and Privacy in mind
Building AI with Security and Privacy in mindBuilding AI with Security and Privacy in mind
Building AI with Security and Privacy in mindgeetachauhan
 
Future is private intel dev fest
Future is private   intel dev festFuture is private   intel dev fest
Future is private intel dev festgeetachauhan
 
Decentralized AI Draper
Decentralized AI   DraperDecentralized AI   Draper
Decentralized AI Drapergeetachauhan
 
Decentralized AI: Convergence of AI + Blockchain
Decentralized AI: Convergence of AI + Blockchain Decentralized AI: Convergence of AI + Blockchain
Decentralized AI: Convergence of AI + Blockchain geetachauhan
 
Decentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIDecentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIgeetachauhan
 
Decentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIDecentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIgeetachauhan
 
Deep learning for medical imaging
Deep learning for medical imagingDeep learning for medical imaging
Deep learning for medical imaginggeetachauhan
 
Deep learning for FinTech
Deep learning for FinTechDeep learning for FinTech
Deep learning for FinTechgeetachauhan
 
NIPS - Deep learning @ Edge using Intel's NCS
NIPS - Deep learning @ Edge using Intel's NCSNIPS - Deep learning @ Edge using Intel's NCS
NIPS - Deep learning @ Edge using Intel's NCSgeetachauhan
 
Best Practices for On-Demand HPC in Enterprises
Best Practices for On-Demand HPC in EnterprisesBest Practices for On-Demand HPC in Enterprises
Best Practices for On-Demand HPC in Enterprisesgeetachauhan
 
Deep learning @ Edge using Intel's Neural Compute Stick
Deep learning @ Edge using Intel's Neural Compute StickDeep learning @ Edge using Intel's Neural Compute Stick
Deep learning @ Edge using Intel's Neural Compute Stickgeetachauhan
 
Distributed deep learning optimizations for Finance
Distributed deep learning optimizations for FinanceDistributed deep learning optimizations for Finance
Distributed deep learning optimizations for Financegeetachauhan
 
Distributed deep learning optimizations - AI WithTheBest
Distributed deep learning optimizations - AI WithTheBestDistributed deep learning optimizations - AI WithTheBest
Distributed deep learning optimizations - AI WithTheBestgeetachauhan
 
Distributed deep learning optimizations
Distributed deep learning optimizationsDistributed deep learning optimizations
Distributed deep learning optimizationsgeetachauhan
 
Tensorflow IoT - 1 Wk coding challenge
Tensorflow IoT - 1 Wk coding challengeTensorflow IoT - 1 Wk coding challenge
Tensorflow IoT - 1 Wk coding challengegeetachauhan
 
Intel optimized tensorflow, distributed deep learning
Intel optimized tensorflow, distributed deep learningIntel optimized tensorflow, distributed deep learning
Intel optimized tensorflow, distributed deep learninggeetachauhan
 
Transfer learning for IoT
Transfer learning for IoTTransfer learning for IoT
Transfer learning for IoTgeetachauhan
 
Tensorflow for IoT
Tensorflow for IoTTensorflow for IoT
Tensorflow for IoTgeetachauhan
 

More from geetachauhan (20)

Profiling PyTorch for Efficiency & Sustainability
Profiling PyTorch for Efficiency & SustainabilityProfiling PyTorch for Efficiency & Sustainability
Profiling PyTorch for Efficiency & Sustainability
 
Building AI with Security Privacy in Mind
Building AI with Security Privacy in MindBuilding AI with Security Privacy in Mind
Building AI with Security Privacy in Mind
 
Building AI with Security and Privacy in mind
Building AI with Security and Privacy in mindBuilding AI with Security and Privacy in mind
Building AI with Security and Privacy in mind
 
Future is private intel dev fest
Future is private   intel dev festFuture is private   intel dev fest
Future is private intel dev fest
 
Decentralized AI Draper
Decentralized AI   DraperDecentralized AI   Draper
Decentralized AI Draper
 
Decentralized AI: Convergence of AI + Blockchain
Decentralized AI: Convergence of AI + Blockchain Decentralized AI: Convergence of AI + Blockchain
Decentralized AI: Convergence of AI + Blockchain
 
Decentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIDecentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AI
 
Decentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AIDecentralized AI: Convergence of Blockchain + AI
Decentralized AI: Convergence of Blockchain + AI
 
Deep learning for medical imaging
Deep learning for medical imagingDeep learning for medical imaging
Deep learning for medical imaging
 
Deep learning for FinTech
Deep learning for FinTechDeep learning for FinTech
Deep learning for FinTech
 
NIPS - Deep learning @ Edge using Intel's NCS
NIPS - Deep learning @ Edge using Intel's NCSNIPS - Deep learning @ Edge using Intel's NCS
NIPS - Deep learning @ Edge using Intel's NCS
 
Best Practices for On-Demand HPC in Enterprises
Best Practices for On-Demand HPC in EnterprisesBest Practices for On-Demand HPC in Enterprises
Best Practices for On-Demand HPC in Enterprises
 
Deep learning @ Edge using Intel's Neural Compute Stick
Deep learning @ Edge using Intel's Neural Compute StickDeep learning @ Edge using Intel's Neural Compute Stick
Deep learning @ Edge using Intel's Neural Compute Stick
 
Distributed deep learning optimizations for Finance
Distributed deep learning optimizations for FinanceDistributed deep learning optimizations for Finance
Distributed deep learning optimizations for Finance
 
Distributed deep learning optimizations - AI WithTheBest
Distributed deep learning optimizations - AI WithTheBestDistributed deep learning optimizations - AI WithTheBest
Distributed deep learning optimizations - AI WithTheBest
 
Distributed deep learning optimizations
Distributed deep learning optimizationsDistributed deep learning optimizations
Distributed deep learning optimizations
 
Tensorflow IoT - 1 Wk coding challenge
Tensorflow IoT - 1 Wk coding challengeTensorflow IoT - 1 Wk coding challenge
Tensorflow IoT - 1 Wk coding challenge
 
Intel optimized tensorflow, distributed deep learning
Intel optimized tensorflow, distributed deep learningIntel optimized tensorflow, distributed deep learning
Intel optimized tensorflow, distributed deep learning
 
Transfer learning for IoT
Transfer learning for IoTTransfer learning for IoT
Transfer learning for IoT
 
Tensorflow for IoT
Tensorflow for IoTTensorflow for IoT
Tensorflow for IoT
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Building Interpretable & Secure AI Systems using PyTorch

  • 1. BUILDING INTERPRETABLE & SECURE AI SYSTEMS USING PYTORCH GEETA CHAUHAN AI PARTNER ENGINEERING FACEBOOK AI
  • 2. AGENDA 01 INTERPRETABLE AI 02 SECURE & PRIVACY PRESERVING AI 03 REFERENCES
  • 3. I N T E R P R E T A B I L I T Y
  • 4. WHAT IS MODEL INTERPRETABILIT Y ? “THE ABILIT Y TO DESCRIBE AI MODEL INTERNALS AND PREDICTIONS IN HUMAN UNDERSTANDABLE TERMS*” * LH Gilpin, et. al., Explaining explanations: An overview of interpretability of machine learning in IEEE 5th International Conference on data science and advanced analytics (DSAA), 2018
  • 5. I N C R E A S E D T R A N S P A R E N C Y D E B U G G I N GB E T T E R U N D E R S TA N D I N G MODEL INTERPRETABILIT Y Screenshot of the tool Attributing to dog Attribution Magnitudes
  • 6. MODEL INTERPRETABILIT Y LIBRARY FOR PY TORCH M U LT I M O D A L E A S Y T O U S EE X T E N S I B L E class MyAttribution(Attribution): def attribute(self, input, ...): attributions = self._compute_attrs(input, ... ) # <Add any logic necessary for attribution> return attributions visualize_image_attr(attr_algo.attribute(input), ...) captum.ai
  • 7. GradientSHAP DeepLiftSHAP SHAP Methods Integrated Gradients Saliency GuidedGradCam Attribute model output (or internal neurons) to input features LayerGradientSHAP LayerDeepLiftSHAP SHAP Methods LayerConductance InternalInfluence GradCam Attribute model output to the layers of the model DeepLift NoiseTunnel (Smoothgrad, Vargrad, Smoothgrad Square) LayerActivation LayerGradientXActivationLayerDeepLiftFeatureAblation / FeaturePermutation GuidedBackprop / Deconvolution AT TRIBUTION ALGORITHMS Input * Gradient LayerFeatureAblation LayerIntegratedGradients Occlusion Shapely Value Sampling Gradient Perturbation Other
  • 8. attributions = Attribution(forward_func, ...).attribute(inputs, ...)* * Check out our Getting Started docs and API: https://github.com/pytorch/captum https://captum.ai/api/ GradientAttribution PerturbationAttribution IntegratedGradients FeatureAblation ... ...
  • 9. attributions = Attribution(forward_func, ...).attribute(inputs, ...)* * Check out our Getting Started docs and API: https://github.com/pytorch/captum https://captum.ai/api/ the importance of inputs to forward_func model's forward function or any modification of it
  • 10. EXPL AINING WITH INTEGRATED GRADIENTS FEATURE 0 FEATURE 1 FEATURE 2 TARGET 0 TARGET 1 from captum.attr import IntegratedGradients attr_algo = IntegratedGradients(model) input = torch.rand(1, 3) attributions = attr_algo.attribute(input, target=0)
  • 11. EXPL AINING WITH INTEGRATED GRADIENTS from captum.attr import IntegratedGradients attr_algo = IntegratedGradients(model) input = torch.rand(1, 3) attributions = attr_algo.attribute(input, target=0) FEATURE 0 FEATURE 1 FEATURE 2 TARGET 0 TARGET 1
  • 12. EXPL AINING WITH INTEGRATED GRADIENTS from captum.attr import IntegratedGradients attr_algo = IntegratedGradients(model) input = torch.rand(1, 3) attributions = attr_algo.attribute(input, target=0) FEATURE 0 FEATURE 1 FEATURE 2 TARGET 0 TARGET 1 OUTPUT attributions: tensor([[-0.41, 0.54, 0.88]])
  • 13. EXPL AINING WITH INTEGRATED GRADIENTS from captum.attr import IntegratedGradients attr_algo = IntegratedGradients(model) input = torch.rand(1, 3) attributions, delta = attr_algo.attribute(input, target=0, return_convergence_delta=True) FEATURE 0 FEATURE 1 FEATURE 2 TARGET 0 TARGET 1 OUTPUT attributions: tensor([[-0.41, 0.54, 0.88]]) delta: 0.0190
  • 14. EXPL AINING WITH INTEGRATED GRADIENTS from captum.attr import IntegratedGradients attr_algo = IntegratedGradients(model) input = torch.rand(1, 3) baseline = torch.rand(1, 3) attributions, delta = attr_algo.attribute(input, target=0, return_convergence_delta=True, n_steps=5000, baselines=baselines) FEATURE 0 FEATURE 1 FEATURE 2 TARGET 0 TARGET 1 OUTPUT attributions: tensor([[0.0, 0.88, -2.45]]) convergence delta: 1.5497e-06
  • 15. ORIGINAL IMAGE ATTRIBUTING* TO DOG ATTRIBUTING* TO CAT * MATTHEW D ZEILER, ROB FERGUS, OCCLUSION: VISUALIZING AND UNDERSTANDING CONVOLUTIONAL NETWORKS, IN SPRINGER INTERNATIONAL PUBLISHING SWITZERLAND, 2014 VISUALIZATIONS USING RESNET152 MODEL
  • 16. VISUALIZING EXPL ANATIONS OF A TEXT CL ASSIFICATION MODEL USING IMDB DATASET WITH CAPTUM INSIGHTS
  • 17. VISUALIZING EXPL ANATIONS OF MULTIMODAL VQA MODELS WITH CAPTUM INSIGHTS
  • 18. VISUALIZING EXPL ANATIONS OF A 3-L AYER MLP MODEL USING TITANIC DATASET WITH CAPTUM INSIGHTS
  • 19. CASE STUDY FOR BERT MODELS
  • 20. EXPL AINING BERT MODELS + Fine-tuning BERT model for Question Answering on SQUAD dataset + Evaluating on Dev Set Exact Match: 78% F1-Score: 86% + Understanding the importance of different types of word tokens, layers and neurons + Already existing research in understanding and visualizing attention heads + What Does BERT Look At? An Analysis of BERT's Attention, Clark, et. al. 2019, BlackBoxNLP@ACL + ExBERT: A Visual Analysis Tool to Explore Learned Representations in Transformers Models, Hoover, et. al., 2019,
  • 21. EXPL AINING BERT MODELS FOR QUESTION ANSWERING text = 'It is important to us to include, empower and support humans of all kinds.' question = 'What is important to us?' [CLS] tokens what [SEP]to isimportant ?is us it important to us to include em, and support humans of all kinds .##power P(Start Position) = 0.72 P(End Position) = 0.73 [SEP]
  • 22. # explaining layers for i in range(model.config.num_hidden_layers): lc = LayerConductance(squad_pos_forward_func, model.bert.encoder.layer[i]) layer_attributions_start = lc.attribute( input_embed, baselines=ref_emb, ..., 0)) layer_attributions_end = lc.attribute( input_embed, baselines=ref_emb, ..., 1)) EXPL AINING BERT MODELS FOR QUESTION ANSWERING
  • 23. AT TRIBUTION HEAT MAP OF ALL TOKENS ACROSS ALL 12 BERT L AYERS FOR START POSITION PREDICTION
  • 24. AT TRIBUTION HEAT MAP OF ALL TOKENS ACROSS ALL 12 BERT L AYERS FOR END POSITION PREDICTION
  • 25. THE LIMITATIONS OF AT TRIBUTIONS + Attributions do not capture feature correlations and interactions + Finding good baselines is challenging + They are difficult to evaluate + Attributions do not explain the model globally
  • 26. FUTURE DIRECTIONS + captum.robust + adversarial robustness and attacks + studying the connections between model robustness and interpretability + captum.metrics + model interpretability, sensitivity, trust, infidelity and robustness related metrics + captum.benchmarks + benchmarks for different datasets and methodologies + sanity checks + captum.optim + optimization-based visualizations ...
  • 27. S E C U R E & P R I V A C Y P R E S E R V I N G A I
  • 28. IS IT POSSIBLE TO: answer questions using data we cannot see?
  • 29. What do handwritten
 digits look like? ◆ Step 1: Download data ◆ Step 2: Download SOTA training script ◆ Step 3: Run script.
  • 30. Source: Wikipedia Commons What do tumors look like in humans? ◆ Step -1: Persuade a VC. ◆ Step 0: Buy a dataset from a hospital. ◆ Step 1: Download millions of tumor images.
  • 31. Getting access to private data is HARD!
  • 32. We SOLVE tasks which are accessible: ✓ ImageNet ✓ MNIST ✓ CIFAR-10 ✓ Librispeech ✓ WikiText-103 ✓ WMT ◆ Cancer ◆ Alzheimers ◆ Dementia ◆ Depression ◆ Anxiety ◆ … Covid-19 Cure? … but what about?
  • 33. TOOLS + Remote Execution + OpenMined PySyft + Search and Example Data + OpenMined PyGrid + Differential Privacy + OpenMined PyDP + Secure Multi-Party Communication + CrypTen.ai
  • 35. CRYPTEN import crypten import torch crypten.init() # sets up communication x = torch.tensor([1.0, 2.0, 3.0]) x_enc = crypten.cryptensor(x) # encrypts tensor x_dec = x_enc.get_plain_text() # decrypts tensor assert torch.all_close(x_dec, x) # this passes! y_enc = crypten.cryptensor([2.0, 3.0, 4.0]) xy_enc = x_enc + y_enc # adds encrypted tensors xy_dec = xy_enc.get_plain_text() assert torch.all_close(xy_dec, x + y) # this passes! z = torch.tensor([4.0, 5.0, 6.0]) xz_enc = x_enc + z # adds FloatTensor to CrypTensor xz_dec = xz_enc.get_plain_text() assert torch.all_close(xz_dec, x + z) # this passes! K E Y F E AT U R E S : • Tensors and CrypTensors coexist and can be mixed and matched • Uses standard eager execution — No compilers! Easy debugging and learning • Support for Secure multi-party computation (MPC) A platform for research in machine learning using secure-computation techniques
  • 36. B
  • 37. HELLO CRYPTENSOR 1. CrypTensor wraps an implementation that does: 1. Arithmetic secret sharing. 2. XOR secret sharing. 3. Conversions between both secret sharings. 4. A large number of operations. 2. CrypTensor exposes these via a PyTorch-like API. PyTorch LongTensor Binary (XOR) Sharing CrypTensor Arithmetic Sharing Trusted Party Numerical Library Secure Computation Primitives Secure Computation Protocol Protocol-Independent Layer uses abstracts uses AutogradCrypTensor MPCTensor B2A/A2B Conversion uses Automatic di erentiation User-level code Neural networks, etc. uses Parties
  • 38. 1. Make a CrypTen Model. 2. Encrypt Data 3. Train! ENCRYPTED TRAINING import crypten crypten.init() # sets up communication class LogisticRegression(crypten.nn.Module): def __init__(self): super().__init__() self.linear = crypten.nn.Linear(28 * 28, 10) def forward(self, x): return self.linear(x) model = LogisticRegression().encrypt() # encrypts tensor
  • 39. 1. Join Encrypted Data 2. Encrypt Model 3. Train! Training Across Par ties import crypten crypten.init() # sets up communication alice_images_enc = crypten.load("/tmp/data/alice_images.pth", src=ALICE) bob_labels_enc = crypten.load("/tmp/data/bob_labels.pth", src=BOB) model = LogisticRegression().encrypt() train_model(model, alice_images_enc, bob_labels_enc)
  • 40. 1. Create a PyTorch or ONNX model. 2. Import model into CrypTen. 3. All computations are now encrypted. PY TORCH / ONNX INTEGRATION import torchvision.datasets as datasets import torchvision.models as models # download and set up ImageNet dataset: transform = transforms.ToTensor() dataset = datasets.ImageNet( imagenet_folder, transform=transform, ) # download pre-trained ResNet-18 model and encrypt it: model = models.resnet18(pretrained=True) encrypted_model = crypten.nn.from_pytorch( model, dataset[0], ) # do inference on encrypted images with encrypted model: encrypted_image = crypten.cryptensor(dataset[1]) encrypted_output = encrypted_model(encrypted_image) output = encrypted_output.get_plain_text() # this works
  • 41. USE CASES + COVID-19 Sols + Cancer Research + Integrity (eg PhotoDNA project) + Federated AI across Enterprise Silos + What problems will you solve?
  • 42. • Captum: https://captum.ai/ • Captum Blog: https://bit.ly/2vHBxJI • Captum Algorithms Matrix: https://captum.ai/docs/algorithms_comparison_matrix • Interpreting MultiModal models: https://captum.ai/tutorials/Multimodal_VQA_Interpret • Interpretable ML Book: https://christophm.github.io/interpretable-ml-book/ • Crypten: https://crypten.ai/ • CrypTen Tutorials: https://github.com/facebookresearch/CrypTen#how-crypten-works • OpenMined: https://www.openmined.org/ • OpenMined for Covid-19 Apps: https://blog.openmined.org/providing-opensource-privacy-for-covid19/ • Udacity Course: https://www.udacity.com/course/secure-and-private-ai--ud185 • Active Federated Learning Paper: https://arxiv.org/pdf/1909.12641.pdf • Microsoft PhotoDNA Project: https://www.microsoft.com/en-us/photodna REFERENCES