Duration 21:08
16+
Play
Video

Interpreting ML models with explainable AI

Sara Robinson
Developer Advocate at Google
  • Video
  • Table of contents
  • Video
Google Cloud Next 2020
July 14, 2020, Online, San Francisco, CA, USA
Google Cloud Next 2020
Request Q&A
Video
Interpreting ML models with explainable AI
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free
Add to favorites
6.35 K
I like 0
I dislike 0
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free
  • Description
  • Transcript
  • Discussion

About speaker

Sara Robinson
Developer Advocate at Google

Sara is a developer advocate on the Google Cloud Platform team, focused on machine learning. She helps developers build awesome apps through demos, online content, and events. Before Google she was a developer advocate on the Firebase team. When she's not programming she can be found on a spin bike, listening to the Hamilton soundtrack, or finding the best ice cream in New York.

View the profile

About the talk

We often trust our high-accuracy ML models to make decisions for our users, but it’s hard to know exactly why or how these models came to specific conclusions. Explainable AI provides a suite of tools to help you interpret your ML model’s predictions. Listen to this discussion regarding how to use Explainable AI to ensure our ML models are treating all users fairly. Watch for a presentation on how to analyze image, text, and tabular models from a fairness perspective, using Explanations on AI Platform. Finally, learn how to use the What-if Tool, an open source visualization tool for optimizing your ML model’s performance and fairness.

Speaker: Sara Robinson

Watch more:

Google Cloud Next ’20: OnAir → https://goo.gle/next2020

Subscribe to the GCP Channel → https://goo.gle/GCP

#GoogleCloudNext

AI218

product: Explainable AI, Cloud AutoML, AI Platform Training; fullname: Sara Robinson;

event: Google Cloud Next 2020; re_ty: Publish;

Share

Everyone welcome to interpreting ml models with explainable AI. My name is Sarah Robinson. I'm a developer Advocate on Google Cloud. This is an overview of what I'm going to be covering in a session. I'm going to start by defining some key terms related to model explainability. Then we'll see some examples of what explainability looks like, four different data types. Then we'll dive into the explainable by offering that we have on Google Cloud today. And finally, we'll see them in action with some life. Has started to

understand explainability, I want to set the stage and into the larger concept of responsible. AI benefit Society doesn't reinforce unfair bias. So you can think of it as an umbrella concept and explain ability is a subfield within responsible to other topics like privacy and security. For this is a summary of how explainability fits into the larger, responsible AI picture. I want to talk about fairness and explain ability since their two terms and Concepts that work together and can sometimes be confused. When I talk

about fairness, I'm talking about ensuring that machine learning models, don't reinforce biases and subsequently that they treat all different slices of users of a machine learning models, fairly and equitably. Explainability is one way to ensure fairness explainability refer specifically to understanding how, and why machine learning model makes predictions can also be used outside the context of fairness to do something like maybe explaining why a fraud detection model Plaza particular transaction as fraudulent. Explain ability is a

broad concept and can invoke a variety of related Concepts depending on who's looking at it. So maybe for an executive they might think of explainability as transparency accountability or governance model explainability which is understanding machine learning models make predictions and communicating the inside from that to external stakeholders and folks within an organization that are building these models, So now let's see some examples of what model explainability looks like. This

depends largely on the type of data that you're working with the data that you used to train your model. So it's going to look a bit different for image text and tabular models. Let's take a look for image model. Explainability can highlight the specific pixels or regions in an image that cause a model to predict a certain label for an image. So in this example that image on the left of the dog is the original and the other two images, show, different methods of getting attributions for the pixels in an image that signaled the models prediction. Vertex models,

explained it. All you can tell us the words in a block of text that contributed to a model prediction. So in this example, descendants, how could you not love cake which are model of a sentiment score of .9? We can also see the words, I contributed most to that models prediction of a high sentiment and this is an example of how explainability In fairness can go hand-in-hand in a text, a specifically, a sentiment analysis model. You'd want to make sure that your mama wasn't using identity terms, to determine the model sentiment. In this example, it looks like our model is performing correctly

because it's picking up on emotion words and words like not to make it sentiment prediction. And then finally, for tabular models, explainability is attribution values for each of the features in your model to show how they influence the prediction. This particular example, shows a model that predicts, the duration of a bike trip. And we can see here that the distance of a trip, this specific trip cause the models predicted trickeration to decrease, whereas the max temperature on that day cause the models predicted duration to increase We talked about

model explanation. There are a few different groups of people that need explanations. The first group is data scientist, people who are building models, people who are managing operations and production models, and warming as they expect and try to improve the model. Pictures of ml systems could refer to a few different types of groups of people could refer to someone as benefiting from a prediction of an ml model. Maybe you're using an application that gives you a product recommendation. Could also refer to a

practitioner maybe a doctor, a medical practitioner, who is using machine learning models to determine whether an x-ray contains a particular disease in which case, there is a slight chance to verify that they can trust the models output. Finally, we have public stakeholders involved in regulatory or compliance and this could be somebody within or outside your organization. They're using explanations to determine whether model complies with certain regulations. And if the model is safe and fit for purpose, which of these types of users will take different action

as a result of explanation. So, just to go over this, a little bit of explanations to go back and see where they could improve training data, may be refined features or change the model architecture. And users are using explain ability to have more trust in ml system and be confident that the model is leading them in the right direction. Public stakeholders might take action from explanations by using higher-level. Some reason, models to develop guidance for different Industries on responsible, AI,

Now, let's look at how we can use explainable AI on Google Cloud today. But first, I want to talk about two categories of explainable machine. Learning the first is referred to as host talk exclamation methods. This involves looking at relationships between feature values and a models given prediction independent of model internals things like learned. The other is called message that are interpretable by Design. And this refers to simpler models like linear regression models are decision. Trees are looking specifically at the

architecture of those models to understand explainability machine learning models for tabular data and we recently released a solution for it today, I'm going to be staying in that category will be looking at Now, let's look at the products on Google Cloud where you can use explainable AI, this pyramid provides an overview of the different machine learning offerings that we have on Google Cloud organized by levels of abstraction. The products that are on the bottom. Half of the pyramid, are targeted more

towards data scientist and machine learning Engineers have more of the background of machine Learning Center. Targeted towards data analyst application developers to integrate their application. But may not have as much experience. All right. Now you can use explainable AI on tensorflow model that you deploy to AI platform prediction along with models that you had deployed to Auto. Not able to explain by default later. On the presentation, I'm going to show live demos of both of these schools and how to use explainable AI

with them. The first demo is going to show how use Auto Mall table than in the SEMO. I'm going to show a fraud detection model that was trained on a public inquiry and will show how we can use. Explain an instant level exclamation. The second demo, I built an image classification model trained on medical images using tensorflow and platform with explanations. For the first model, I trained this model using a publicly available data sets from Big query and explain why I provide both Global and instant level

feature at the beach. And I can see overall, which feature is my model relied on most make predictions. And I can also zoom in and see at an instant's level for an individual prediction, which features were most important, or that one prediction. For the second time out I trained a tensorflow model on his chest x-ray dataset available in cattle and I'm going to show how we're going to use. Explain about new, local experience SDK. Exclamation with this SDK is available in Claudia and I can use it to get explanations on a Model that's available with a

loud bang, and prototyping my model without heeding to play at a iPod 4. When your model to add platform with explanations, you can choose the explanation method that you're going to use. So I want introduce the three exclamation method that we have available. All these explanation methods are based on publicly available research that you can check out by going to the links on this side. The first method is called integrated gradient this work with all types of models, that was popular image antiques models,

Simple, chocolate works for tabular models, do with tensorflow and the X-ray method is built on top of integrated, gradients, and Justin's moving to show instead of pixel-based image attribution. It shows region-based attributions. And this is one way that you could deploy explainable models to add platform, showing how to do this using the G Cloud. Google Cloud, feel I to do it. So just look very similar to how you would have. Deployed model version are the explanation would like to use and the number of steps you

like this method to use, and I'll get into that a little bit more in the demo. So now let's go to the demo. I'm going to train my fraud detection model. Using this public big parade is that of credit card transactions. There's a description of the data and the schema most of the columns, in the state of set have been obscured. And here's a preview of what to do to looks like I'm going to run a quick query to show as in the case of many fraud detection, data sets, the data is heavily and balance, meaning that only a very small percentage. Of our examples are fraudulent transactions to

account for this. I have done some down sampling, which means that I've taken just a small sample of the data from our majority class thing. I've also taken the liberty of renaming, the column names that were scared. So let's look at Auto Mall tables. So to import my data I can import it directly from Bakery so I don't need to move my data anywhere. I've already done this. So let's take a look at what the data looks like. I can see a preview of my columns and the different types here. As you can see, I have renamed that many of the columns and I selected my target column now, to train my

model and automile tables. All I need to do is press this train model button and to account for that class and balance that I mentioned addition to the down, sampling. I can also use this optimization objective provided by Automall tables. So in this case, I chose to maximize my models performance on the less common class, in this case are fraudulent transactions. I've already tried this model, so let's take a look. Here we can see many of the different valuation metrics bar model. The confusion Matrix tells us the percentage of examples in our tests that that are model

classified correctly for each class and Jerry care. Most about are fraudulent examples that we can see that are models that are pretty good job with no false positives and it was able to classify 88% of our test examples correctly. Now it's getting to explainable AI. So we get this out of the box. Once we try Dan Automall tables model, we don't have to enable anyting. What does provides is global model level feature importance? So across our tests at the shows us which features are model used, most in influencing its production. And looks like the most important

feature here was whether or not there was a smiley face on the credit card signature followed by his credit card color. Again, I just made up these feature name. So once we have trained and evaluated our model, the next thing I want to do is use it to get predictions and there's a couple of ways to do this in Auto Mall tables. We can do it right in the UI which all chauffeurs Automall tables is just populated each feature with a random value. And what I want to do here is check this generate feature importance box here. We can see the model is 99% confident that this is not a fraudulent

transaction. And here, we can start our future attribution values by the ones with the highest absolute value. So here we can see that. Smiley face signature caused the models prediction confidence to go down whereas the time to exploration cause the production confidence to go up and we can scroll through and look at the other feature attribution values here as well. So that's how we can try out Automall tables and see future importance, that an instant level in the UI. But chances are, we're also want to use the Auto Mall tables prediction API to

generate predictions and get featured importance. So I'm going to show you how to do this in a python notebook. I using the auto amount tables API. So first we'll create an auto mall tables client, and we'll set up some variables for our project and a specific model version. I have provided my inputs in this format. This is an example of a fraudulent transaction. So hopefully our model predicts fraud for this one and notice here that I am setting feature importance to true to get those feature out to be somebody's back in my response. Here, I'm visualizing the future attribution values. We can

see that our model predicted this correctly, 97% confidence that this was a fraudulent transaction. And here, I've grasped the feature attribution values just for the top five features and we can see which features influence our models prediction of frost here. Now that we've seen an example of a tabular model using Auto not tables. I'm going to show a few examples of how to get explanations on an image model, using explainable AI. I'm going to show you how to do it. In Cloud II platform notebook, using the explainable, a is CK which comes

pre-installed in notebooks is still open up my notebook instance here. And in this notebook, I'm going to show you two examples of image classification models. That I've dealt with tensorflow. What? I'm going to highlight is how you can do this All locally from within your notebooks in soon. So I'm going to get explanations of my models without having to deploy them to the club. Both of the models that I'll be using for the SEMO. I've already saved in the tensorflow saved model format. In these directors, here, the first model that I'm going to show you is a model that's been

trained on the image that data set, which can classify images into a thousand different labels ranging from different types of animals food plant excetera. So I've already saved a model assets in the tensor Flow State bottle, format into this directory and know that I'm importing. The explainable a is dka here. When I pointed us to Kansas directory, it's going to generate some meditative that it will need to provide explanations. We can see a stasis in a Json file here and now we're ready to spend a test image to the model. I'm going to send it this image of

a jellyfish. I'm going to see both what labels a model returns for this image. Along with the feature attributions to explain that prediction and again to do this, I am using this load model from local path method and I didn't need to deploy my model to the cloud to take advantage of this. What we see here is the label index for the label. That my model was most confident in, and we can see that the index of 108 corresponds with the label of jellyfish, which is a good sign because this is indeed a jellyfish and looks like our model is 96%

confident in that prediction. And just so you understand what these color coded explanations mean, the yellow brighter regions and image are the regions that contributed most to my models prediction. The darker purple color Creations, are the regions that were at least important in predicting his label. And so what we're trying to say here is that our model is picking up on the right shapes that are associated with this particular label. And this case we can verify that our model is performing correctly. It's looking at shapes in His image that are specific to

that of a jellyfish. The next model will look at is a model that was trained on a chest x-ray dataset in. Kaggle, to predict the presence of one condition that can be found in these over to the first thing we're going to do is save our models, meditator and here were explicitly. Setting the Baseline for this model to be a solid black image and that's what all of our explanations will be relative to. We can preview the metadata here. So we're going to test out our model using this image and our model output is a sigmoid

output which means that it's going to have put a value between 0 and 1. With one indicating that the model things a specific condition is present 0 indicating that it does not. So will first get an explanation and noticed you're that we've set our models step count to 10. This is the number of integral steps that the explanation method is going to use in Computing a pixel attribution. And we can see here that the approximation are exceeds 5%. Now, what this means is that we may not be able to trust the explanations. In this particular example, one way that

we can decrease this error is to increase the number of integral steps were using. So let's try increasing the step. Count to 50 and generate a new explanation. Now, we can see that the approximation era did decreased significantly, but looking closer at this image, the regions that are model seems to be focusing on are not the correct regions associated. With this particular condition for this particular image, our model should have predicted closer to 1. This is likely pointing to a problem with our model or I need to improve the data that was used to train our model since

explanations are only a direct reflection of your model, they're only going to be as good as your model itself. So it looks like here, we need to go back and improve our training data. Perhaps provide a more varied representation of x-rays that have the specific condition present and healthy x-rays confirm. That our model is performing correctly. We have everything right here. Ready to go to deploy our model to add platform. So all you need to do is copy this directory with this metadata file to Google cloud storage and Could do that here. And then we would

run this g-cloud command to deploy our model. And now let's go back to the slides. And finally, hear some resources. If you want to get started with any of the products that I covered in his presentation, I definitely recommend checking out our sample code. We have some example notebooks that show you how to deploy explainable models on a iPod 4. Thank you for watching. If you want to get in touch you can find me on Twitter at essroc, tweet. And I hope you enjoy the rest of next on air.

Cackle comments for the website

Buy this talk

Access to the talk “Interpreting ML models with explainable AI”
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free

Ticket

Get access to all videos “Google Cloud Next 2020”
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free
Ticket

Similar talks

Michael Baldwin
Director, Product Management at Google Cloud AI & Industry Solutions
+ 1 speaker
Tom Shane
Product Manager at Google Cloud AI
+ 1 speaker
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free
Craig Wiley
Director, Product Management CloudAI Platform at Google
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free
Suds Narasimhan
Product Manager at Google Cloud
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free

Buy this video

Video

Access to the talk “Interpreting ML models with explainable AI”
Available
In cart
Free
Free
Free
Free
Free
Free
Free
Free

Conference Cast

With ConferenceCast.tv, you get access to our library of the world's best conference talks.

Conference Cast
636 conferences
26240 speakers
9757 hours of content