AWS re:Invent 2020: Understand ML model predictions & biases with Amazon SageMaker Clarify

AWS Events
5 Feb 202124:08

Summary

TLDRIn this re:Invent presentation, Pinar Yilmaz and Michael Sun explore Amazon SageMaker Clarify, a tool designed to demystify machine learning predictions and biases. They define bias in ML, introduce SageMaker Clarify, discuss its application at Prudential, and demonstrate its use in detecting bias and enhancing explainability across the ML lifecycle. The tool's integration into various SageMaker components and its ability to comply with regulatory requirements highlight its comprehensive utility in the financial sector.

Takeaways

  • 📚 Amazon SageMaker Clarify is a tool designed to help understand machine learning predictions and detect biases within models.
  • 🔍 Bias in machine learning is defined as imbalances in prediction accuracy across different groups and is crucial to identify and mitigate throughout the ML lifecycle.
  • 🛠️ SageMaker Clarify offers a suite of APIs and core libraries that integrate with various SageMaker components, aiding in bias detection, mitigation, and model explainability.
  • 📈 The tool is used in practical applications like Bundesliga match facts, where it helps explain the machine learning model's decisions in real-time for a better fan experience.
  • 🏢 Prudential Financials leverages SageMaker Clarify to ensure transparency and trust with regulators, internal stakeholders, and customers by explaining AI decisions and detecting biases.
  • 🔑 SageMaker Clarify is particularly important for regulated industries like insurance, where explainability is key for compliance with laws and maintaining customer trust.
  • 📊 The tool provides a way to generate bias reports and visualize metrics, helping to understand and address class imbalances and feature importance within models.
  • 🔄 SageMaker Clarify can be used to monitor models in production, detecting drift in bias and explainability metrics over time, signaling the need for potential model retraining.
  • 🛑 There's a trade-off between model accuracy and interpretability; simple models may be more interpretable but less accurate, while complex models may be more accurate but harder to understand.
  • 🌐 Various techniques for explainability exist, such as perturbation-based, gradient-based algorithms, and rule extraction, which can be selected and applied according to the use case.
  • 🔬 SageMaker Clarify is being considered for inclusion in Prudential's future AI/ML platform governance, ensuring model explainability is a standard part of their AI practice.

Q & A

  • Who is Pinar Yilmaz and what is her role in the AWS Deep Engine team?

    -Pinar Yilmaz is a senior software engineer in the AWS Deep Engine team. She is responsible for discussing Amazon SageMaker Clarify, a tool that helps in understanding machine learning predictions and biases.

  • What is Amazon SageMaker Clarify and what does it aim to address?

    -Amazon SageMaker Clarify is a tool designed to help users understand the predictions and biases in machine learning models. It provides insights into potential imbalances in the accuracy of predictions across different groups and offers methods to detect and mitigate these biases.

  • What are the three main reasons for addressing bias in the machine learning lifecycle?

    -The three main reasons for addressing bias in the machine learning lifecycle are: 1) During the data science phase to understand inherent biases in the dataset or model, 2) When operationalizing models to provide explanations to stakeholders, and 3) For regulatory purposes to comply with laws and regulations around algorithm behavior and the right to explanations.

  • How does SageMaker Clarify help in the data science phase of a machine learning project?

    -SageMaker Clarify helps in the data science phase by allowing users to run a bias report to understand the bias metrics in the dataset before training begins. This helps in identifying any inherent or embedded biases early in the process.

  • What is the trade-off between accuracy and interpretability in machine learning models?

    -The trade-off between accuracy and interpretability in machine learning models is that simple models, which are easy to understand and interpret by humans, may not provide the desired accuracy. Conversely, complex models like deep learning, which offer high accuracy, can be difficult for humans to understand and interpret, essentially becoming a 'closed box'.

  • Can you explain the concept of 'xGoals' as mentioned in the Bundesliga example?

    -xGoals, as mentioned in the Bundesliga example, refers to expected goals statistics. It uses a machine learning model trained on Amazon SageMaker to determine real-time goal-scoring chances based on 16 different factors. With the help of SageMaker Clarify, Bundesliga can explain the key underlying components that influence the prediction of a certain xGoals value.

  • How does SageMaker Clarify integrate with other SageMaker components?

    -SageMaker Clarify integrates with other SageMaker components such as Studio, Data Wrangler, Debugger, Experiments, Model Monitor, and Pipelines. It offers APIs and core libraries that are used for bias detection, mitigation, and explainability, and are optimized to run on AWS.

  • What is the importance of explainability for a company like Prudential Financials?

    -For Prudential Financials, explainability is crucial as it helps build trust with customers and regulators by providing transparency in how data is collected, features are generated, algorithms are used, and decisions are made by AI systems. It ensures an open and honest dialogue, which is fundamental to the company's relationship with its customers.

  • How does SageMaker Clarify assist in addressing the challenges faced by Prudential Financials in explaining AI models?

    -SageMaker Clarify assists Prudential Financials by offering multiple algorithmic choices that can be easily combined, providing flexibility. It also optimizes and parallelizes algorithms, enabling the company to achieve results more quickly. This helps in explaining the AI models to various stakeholders, including regulators and customers.

  • What are the next steps for Prudential Financials in terms of using SageMaker Clarify?

    -The next steps for Prudential Financials include scaling the tasks by incorporating multiple new use cases and scaling up the dataset and algorithms. They are also actively considering SageMaker Clarify as part of their future governance, ensuring that every model on Prudential's AIML platform will incorporate explainability.

  • How can bias and explainability metrics be monitored over time using SageMaker Model Monitor?

    -Bias and explainability metrics can be monitored over time using SageMaker Model Monitor by deploying an endpoint with data capture enabled and creating a model monitoring schedule. This allows for the visualization and understanding of how these metrics change, ensuring that they remain stable and indicating when it might be necessary to collect more data or retrain the model.

Outlines

00:00

🧑‍💻 Introduction to Amazon SageMaker Clarify

Pinar Yilmaz, a senior software engineer at AWS, introduces Amazon SageMaker Clarify, a tool designed to enhance the understanding of machine learning predictions and detect biases. The session begins with a definition of bias and explainability in the context of machine learning. Pinar outlines the importance of identifying biases and providing explanations throughout the machine learning lifecycle, including the data science phase, operationalization, and regulatory compliance. The talk also touches on the challenges of balancing accuracy with interpretability and the various techniques available for providing model explanations.

05:02

🏆 Bundesliga's Application of Explainability with SageMaker Clarify

The script discusses how the DFL Bundesliga uses Amazon SageMaker Clarify to enhance fan engagement during soccer matches. Bundesliga match facts utilize 'xGoals,' a machine learning model trained on SageMaker, to determine real-time goal-scoring chances based on 16 different factors. SageMaker Clarify helps explain the key components that influence the xGoals predictions, allowing for debugging of the model, increasing confidence in the algorithm, and enabling fans to better understand the scoring chances of players from any position on the field.

10:03

🛡️ SageMaker Clarify's Role in Prudential's AI/ML Practice

Michael Sun, Vice President of Data Science at Prudential Financials, explains how Prudential, a leading financial company, leverages SageMaker Clarify. Prudential uses the tool to ensure transparency in their AI/ML practices, which is critical for building trust with customers and meeting regulatory requirements. The company focuses on explaining data collection, feature generation, bias assignment, and algorithm usage to various stakeholders. SageMaker Clarify aids in addressing the challenges of explaining AI results, especially with large datasets and diverse algorithms, and is being considered for integration into Prudential's future AI governance platform.

15:05

📊 SageMaker Studio Demonstration of Bias Detection and Explainability

The script provides a step-by-step demonstration of how to use SageMaker Studio for detecting bias and generating explainability reports. It starts with running a bias report in Data Wrangler by importing a dataset from an S3 bucket and selecting relevant parameters for the analysis. The process continues with running a processing job in a SageMaker notebook using a pre-trained model and an analysis configuration file. The output is a JSON report containing various metrics, including local and global explanations, pre- and post-training bias metrics. The demonstration also includes using the SHAP library for visualizing feature importance and exploring these metrics within SageMaker Studio.

20:06

🔍 Model Monitoring with SageMaker Clarify

The final paragraph outlines the use of SageMaker Clarify in Model Monitor to continuously detect bias and explainability drift in deployed models. It describes the process of deploying an endpoint with data capture enabled and setting up a model monitoring schedule to collect relevant metrics. The script explains how to visualize and interpret these metrics in SageMaker Studio, ensuring that feature attributions remain stable and bias metrics do not exceed predefined thresholds. This monitoring helps in maintaining model integrity and deciding when to retrain the model based on changes in real-world conditions.

Mindmap

Keywords

💡Amazon SageMaker Clarify

Amazon SageMaker Clarify is a tool designed to help users understand the predictions and biases in machine learning models. It is integral to the video's theme as it is the central focus of the discussion. The script mentions that SageMaker Clarify offers APIs and core libraries for bias detection, mitigation, and explainability, which are crucial for ensuring fairness and transparency in machine learning processes.

💡Bias

In the context of machine learning, bias refers to imbalances in the accuracy of predictions across different groups. The video emphasizes the importance of identifying and addressing bias in datasets and models to ensure fairness and compliance with regulations. For instance, the script explains that bias can be detected during the data science phase and is a key consideration for regulatory purposes.

💡Explainability

Explainability in machine learning pertains to the ability to understand and interpret the predictions made by a model. The video discusses the trade-offs between accuracy and interpretability, highlighting the challenges of using complex models like deep learning that may sacrifice explainability for higher accuracy. SageMaker Clarify is presented as a solution to provide explanations that are consumable by various stakeholders.

💡Machine Learning Lifecycle

The machine learning lifecycle is the process from the initial data collection to the deployment and monitoring of machine learning models. The video outlines the importance of addressing bias and explainability throughout this lifecycle, from the data science phase to operationalizing models and regulatory compliance. SageMaker Clarify is shown to be integrated into various stages of the lifecycle within AWS services.

💡Prudential

Prudential is a financial company mentioned in the video as a case study for the application of SageMaker Clarify. The script discusses how Prudential uses the tool to ensure transparency and trust in their AI practices, particularly in explaining their models to regulators, internal stakeholders, and customers.

💡DFL Bundesliga

The DFL Bundesliga is used as an example in the video to illustrate the practical application of explainability in sports analytics. The Bundesliga uses 'xGoals,' a machine learning model trained on Amazon SageMaker, to determine real-time goal-scoring chances. SageMaker Clarify helps explain the components that influence the model's predictions, enhancing the fan experience.

💡SageMaker Processing Jobs

SageMaker Processing Jobs are used to run tasks on the AWS platform, including the use of SageMaker Clarify for bias and explainability analysis. The video script describes how a first-party container for SageMaker Clarify can be used in these jobs to analyze models and datasets, providing metrics and explanations that help in debugging and increasing confidence in the algorithms.

💡Model Monitoring

Model monitoring is the continuous observation of deployed machine learning models to ensure their performance remains consistent over time. In the video, SageMaker Model Monitor is highlighted as a tool that can track bias and explainability metrics, helping to identify when models may require retraining due to changes in real-world conditions or data drift.

💡SageMaker Studio

SageMaker Studio is an integrated development environment within AWS that provides tools for machine learning. The video script demonstrates how SageMaker Studio can be used to run bias reports and processing jobs, visualize explanations and metrics, and incorporate SageMaker Clarify into the machine learning workflow.

💡Data Wrangler

SageMaker Data Wrangler is a tool for data preparation that is part of the SageMaker suite. The video script explains how Data Wrangler can be used to run a bias report on a dataset before training begins, which is a crucial step in identifying potential biases in the data that could affect model fairness.

💡Regulatory Compliance

Regulatory compliance in the context of the video refers to adhering to laws and regulations regarding algorithm behavior and the right to explanations. The script discusses the importance of understanding model predictions and potential biases to comply with these regulations, which is a key driver for the use of SageMaker Clarify.

Highlights

Amazon SageMaker Clarify is introduced as a tool to understand machine learning predictions and biases.

Bias in machine learning is defined as imbalances in prediction accuracy across different groups.

The importance of addressing bias and explainability throughout the machine learning lifecycle is emphasized.

SageMaker Clarify offers APIs and core libraries integrated into SageMaker for bias detection and mitigation.

Prudential uses SageMaker Clarify to enhance customer trust and comply with regulatory requirements.

The trade-off between model accuracy and interpretability is discussed, with simple models being more interpretable but less accurate.

Complex models like deep learning, with high accuracy, are often less interpretable for humans.

Various techniques for providing explanations in machine learning are mentioned, including perturbation-based and gradient-based algorithms.

SageMaker Clarify is used in practice by Bundesliga to enhance fan experience with explainable machine learning models.

Prudential Financials leverages SageMaker Clarify for its AI/ML practice, focusing on customer service, fraud detection, and regulatory compliance.

The necessity of explainability in insurtech is highlighted, with Prudential emphasizing trust and transparency with customers.

SageMaker Clarify's flexibility and optimization for parallelizing algorithms are praised for improving efficiency.

A demonstration of running a bias report in SageMaker Data Wrangler is provided, showcasing how to analyze dataset bias.

SageMaker Studio is used to run processing jobs that compute bias and explainability metrics for models and datasets.

The use of SHAP library for visualizing feature importance computed by SageMaker Clarify is demonstrated.

Model Monitor in SageMaker is shown to continuously monitor bias and explainability metrics for deployed models.

Amazon SageMaker Clarify's capabilities to detect bias, provide explanations, and generate reports for stakeholders are summarized.

Transcripts

play00:01

Hello, welcome to re:Invent. My name is Pinar Yilmaz.

play00:06

I'm a senior software engineer in the AWS Deep Engine team.

play00:09

Today, I'm going to be talking about Amazon SageMaker Clarify

play00:13

and how this tool helps you understand machine

play00:15

learning predictions and biases.

play00:20

Today, we're going to start off by defining what bias

play00:24

and explainability mean in machine learning.

play00:27

And then, we're going to give an overview of SageMaker Clarify.

play00:31

And then, we're going to talk about how it's used at Prudential,

play00:34

and we're going to finish off with a demo.

play00:40

Bias can be broadly defined

play00:42

as imbalances in the accuracy of predictions

play00:44

across different groups in machine learning.

play00:49

And the main reasons that we would want

play00:51

to do this throughout our machine learning lifecycle is in three folds.

play00:56

First off, in the beginning of the machine learning journey,

play01:00

we will start by the data science phase of the project.

play01:03

And this is when we collect the data, we clean up the data,

play01:07

we prepare the data and get it ready for training

play01:10

and try different algorithms and machine

play01:12

learning models to understand the business use case

play01:15

and how it unfolds.

play01:17

And during this time, it's important to understand

play01:19

if there are inherent or embedded biases

play01:22

in the dataset or the model itself.

play01:25

In the next phase, when we're operationalizing

play01:28

these machine learning models, we would also want to understand

play01:32

how to provide these explanations about the model behavior

play01:36

to different stakeholders. These could be internal or external.

play01:40

Internal could be people such as loan officers,

play01:43

customer service representatives, or forecasting teams.

play01:46

And sometimes, for external parties, it could be even the end-users

play01:50

or the customers of a particular business.

play01:55

The third phase is regulatory purposes.

play01:58

Today, the world governments are coming up with new laws

play02:01

and regulations around the algorithm behavior

play02:04

and right to explanations by citizens.

play02:06

And understanding why the machine

play02:08

learning made a particular prediction,

play02:10

and also if the model was influenced by potential bias,

play02:15

will help you comply with local laws and regulations.

play02:24

You must have seen headlines in the news lately

play02:26

where an algorithm was found to behave in undesirable ways,

play02:31

causing problems and making the headlines.

play02:34

And this is something we would like to avoid,

play02:37

and we would like to intervene as early in the machine

play02:39

learning cycle as possible.

play02:42

When you think about how to implement explainability in practice,

play02:47

the first hurdle you're going to run into

play02:51

is what it means to be accurate and interpretable at the same time.

play02:59

You will quickly find out that there's actually a trade-off.

play03:02

When you use simple models that are easy to understand

play03:04

and interpret by humans, you may not get the accuracy desired,

play03:10

such as rule-based learning or linear regression

play03:13

where you can just look at the rules or the coefficients,

play03:15

and in the case of decision trees just a tree structure,

play03:18

but this may not give you the best predictions

play03:22

with the high accuracy that you would want.

play03:26

Then, when you go for a more complex model such as deep learning,

play03:29

which may have millions and even billions of parameters,

play03:32

then the model becomes essentially a closed box

play03:35

for humans to understand and interpret.

play03:37

So, what do we do?

play03:41

The research area is ripe with many different techniques

play03:45

and algorithms to provide explanations.

play03:49

And these techniques range from perturbations-based, ablation-

play03:52

or permutation-based, gradient-based algorithms

play03:58

using neuron activations and things like sensitivity analysis,

play04:02

saliency masks, rule extraction.

play04:05

All of these techniques are available in the world today.

play04:08

But how do you pick the right method or algorithm for your use case?

play04:12

And once you do, how do you get these explanations in the form

play04:17

appropriate for your use case,

play04:20

and how do you make sure that they are consumable

play04:23

by the internal or external stakeholders,

play04:26

such as are they numerical, textual, or visual?

play04:29

And how to represent them.

play04:33

Let's talk about how the DFL Bundesliga

play04:36

uses explainability in practice.

play04:39

Bundesliga match facts are powered by AWS,

play04:42

and it provides a more engaging fan experience

play04:45

during soccer matches for Bundesliga fans.

play04:48

xGoals, which is short for expected goals statistics,

play04:52

uses a machine learning model trained on Amazon SageMaker,

play04:58

and it allows to determine real-time goal-scoring chances

play05:02

based on 16 different factors.

play05:05

With explainability with Amazon SageMaker Clarify,

play05:09

Bundesliga can explain what some of the key underlying components

play05:12

are to determine what led the machine

play05:14

learning model to predict a certain xGoals value.

play05:17

And knowing the respective feature attributions

play05:20

and the outcomes helps to explain how to debug the model,

play05:24

increase confidence in the algorithm,

play05:27

and fans can evaluate the goal-scoring chances

play05:30

of Bundesliga players from any position in the field.

play05:37

In SageMaker Clarify, what we're offering

play05:40

is a collection of APIs and core libraries.

play05:45

And these tools are broadly integrated into SageMaker.

play05:49

We offer a first-party container to be used

play05:52

as SageMaker processing jobs,

play05:53

which is framework and model agnostic.

play05:58

And our core libraries are used for bias detection,

play06:01

mitigation, and explainability, which is optimized to run on AWS.

play06:06

You can find these tools and features spread throughout

play06:10

different SageMaker components such as Studio,

play06:12

Data Wrangler, Debugger, Experiments, Model Monitor, and Pipelines,

play06:16

and more to come.

play06:19

If you consider the machine learning lifecycle,

play06:23

as we were talking earlier,

play06:24

we start by collecting and preparing data.

play06:27

And SageMaker Data Wrangler will allow you

play06:30

to run a bias report to understand the bias metrics in your dataset

play06:35

before you even start training.

play06:38

Next, we're going to train and tune the model using SageMaker

play06:41

training, autopilot, or hyperparameter tuning.

play06:44

And at the end, we will have a potential viable model,

play06:49

and we can use our processing job

play06:51

with our first-party container to understand

play06:55

the bias metrics and explainability metrics

play06:57

given the combination of the dataset and the model.

play07:00

The next step is to deploy this model in production.

play07:04

When we look at a deployed model,

play07:06

we would also want to monitor the bias metrics

play07:08

and explainability metrics continuously

play07:11

and make sure that these metrics do not vary wildly,

play07:14

indicating that the real-world conditions have changed,

play07:17

and now maybe it's time to collect more data or retrain again.

play07:24

So, to recap, SageMaker features can be used

play07:28

during the data preparation to explain the trained models

play07:36

and detect the bias inherent in the model

play07:38

and the dataset combination,

play07:41

explain the inferences made by these models,

play07:45

and also monitor this model

play07:47

throughout the lifecycle of the model itself.

play07:52

Next, I'd like to invite Michael Sun

play07:55

to talk about how they use SageMaker Clarify at Prudential.

play07:59

Thank you, Pinar. That was great.

play08:01

And hello everybody, my name's Michael Sun.

play08:03

I'm the vice-president of the data science of Prudential Financials.

play08:07

So, today, I'm going to tell you something about Prudential

play08:10

and the current state of the AIML practice in our company.

play08:16

And also, why we think

play08:18

SageMaker Clarify has been such a great tool for us.

play08:23

So, Prudential is one of the largest financial companies in the world.

play08:31

We have tens of millions of customers in the United States

play08:35

and also across over 40 countries.

play08:38

The company was created more than 160 years ago,

play08:42

and over the last 100 years, we've had a deep bond

play08:46

and trust with tens of millions of our customers,

play08:49

providing their financial wellness,

play08:53

protection needs for themselves and their families,

play08:55

and also investment opportunities.

play08:59

When I talk to future data scientists

play09:02

about the current state of AIML at Prudential

play09:06

and also why they should be part of this effort,

play09:10

I would say that, for other companies,

play09:14

understanding the future,

play09:15

predicting the future in terms of both risk and opportunities

play09:19

might be something nice to do,

play09:22

maybe a sort of current fad if you wish.

play09:25

But understanding future risk is a part of our DNA,

play09:30

and it has been for the last 160 years as I said.

play09:34

So, that is why AIML is so important

play09:38

for insurers such as Prudential Financials.

play09:41

So, as we have to build the practice and capability,

play09:45

we have a focus on all manners and aspects

play09:49

of how we can serve our customers better,

play09:51

which includes predicting modality and morbidity risks,

play09:56

providing customer experience, and the best customer experience

play09:59

we can for our customers, fraud detection,

play10:03

which is another key concern for insurers

play10:05

as well as a present danger all of us are facing.

play10:12

So, this is the future of Prudential AIML

play10:17

and is how it's been practiced. It's a huge part of our DNA,

play10:21

and we welcome everybody to take a look at us

play10:24

and please join our efforts.

play10:29

The need for explainability is particularly important

play10:33

for an insurtech company, as we're practicing at Prudential.

play10:39

So, when we talk about AI explainability,

play10:43

what does that mean to us? There are several aspects.

play10:48

We want to be able to tell our regulators

play10:52

and our other stakeholders how our data is collected,

play10:57

what features are generated,

play10:59

how their ways and biases are assigned,

play11:02

and what algorithms were used, how the data is validated,

play11:06

how the [INDISCERNIBLE 00:21:08]

play11:07

are validated. All the aspects are important.

play11:10

As I was saying, we need to explain our results

play11:12

to our external regulators, as well as internal stakeholders.

play11:20

Last but definitely not the least is our customers.

play11:24

As I started by saying that Prudential built

play11:27

all these amazing product and services over 100 years

play11:30

but underpinning all those product services

play11:33

is that deep bond and trust we had to build all those years.

play11:38

And an open and honest dialogue and communication

play11:42

is the basis of every trusting relationship.

play11:45

So, we will not squander that trust by producing something,

play11:49

which we cannot be having an open and honest dialogue

play11:53

with our customer and explain to them why a certain underwriting practice

play11:58

is done the way it is done by AI,

play12:01

or how the pricing structure has come about.

play12:03

So, explainability to us is trust, and that is something we hold sacred

play12:08

and will not sacrifice or anything else.

play12:15

As we try to explain AIML messages to our customers,

play12:21

we're facing similar challenges,

play12:22

as a lot of you probably have already faced.

play12:25

There are multiple approaches for a given problem.

play12:29

So, as we try to explain those algorithms,

play12:32

we often have to sort of juxtapose

play12:34

and be switching from one and to the other.

play12:38

For example, from logistic regression

play12:40

all the way to deep network learning to treat

play12:42

[INDISCERNIBLE 00:22:44] algorithms and back.

play12:44

So, that diversity and real challenge faced about multiple algorithms

play12:54

posed a challenge for us to explain our results.

play12:57

On top of that, our dataset tends to be large.

play13:00

I said we have tens of millions of customers,

play13:03

and those customers have so many touchpoints with us.

play13:07

So, the dataset and computation need to explain algorithms

play13:12

is a huge challenge in and by itself.

play13:17

So, which comes SageMaker Clarify.

play13:21

As Pinar said in her opening remarks,

play13:25

and the team at Amazon AWS,

play13:28

when they set out to tackle these problems,

play13:32

they had those customer needs, customer business problems in mind.

play13:36

And for us, particularly these two areas,

play13:38

the questions that are raised,

play13:39

we found very, very encouraging and promising results

play13:45

working with the AWS teams.

play13:47

First, Clarify offers multiple choices,

play13:52

so we can combine easily. So, that gives us the flexibility.

play13:56

Both of the teams have done an amazing job in optimizing,

play13:59

parallelizing algorithms.

play14:01

So, we found that we can get the same results

play14:04

in a fraction of the time of what we used to take.

play14:06

So, on both accounts, I say Clarify should be a tool you should consider

play14:11

when you are tackling an AI explainability problem.

play14:15

For the next steps, we are actively pursuing scaling the tasks

play14:19

by both including multiple new use cases,

play14:23

as well as scaling up the dataset and multiple algorithms,

play14:26

so we can really test the boundary and how widely it can be incorporated

play14:31

into our data explainability repertoire.

play14:36

As we're building a future AIML platform,

play14:41

a model governance is a key topic as well.

play14:45

SageMaker Clarify is currently being actively considered

play14:49

as part of our future governance.

play14:51

So, every model for Prudential's AIML platform

play14:56

will have this incorporated,

play14:58

and AIML model explainability will be enhanced with this tool.

play15:05

Thanks, everybody, for listening. And back to Pinar.

play15:11

Thank you, Michael.

play15:13

Next, we're going to see how these features are used

play15:16

in SageMaker Studio.

play15:18

First, we will start by showing you

play15:20

how to run a bias report in Data Wrangler.

play15:24

In Data Wrangler, the first step is to import a dataset,

play15:27

and we're going to import our dataset from an S3 bucket.

play15:32

In Data Wrangler, you can run transforms or analyses.

play15:35

Bias report is a form of analysis.

play15:39

So, once we import a dataset, we're going to create a new analysis,

play15:43

and we're going to select Bias Report from the dropdown menu.

play15:47

Next, we're going to select the label,

play15:50

which is the target attribute in our dataset.

play15:54

And the next value that we would like to plug into this report

play15:59

is what constitutes a positive outcome for this use case.

play16:03

So, this is a credit dataset, and the label

play16:06

"good credit having a value of one"

play16:10

means a positive outcome for this particular individual.

play16:16

Next, we're going to select the sensitive group from our dataset.

play16:20

In this dataset, we're going to select age

play16:22

as a sensitive group and indicate that a value of 40,

play16:27

meaning 40 or above, is the sensitive group in this case.

play16:32

And we're going to compute the bias metrics for this sensitive group.

play16:38

We're going to select which bias metrics we want to compute.

play16:41

You can select all and click

play16:45

on the report to see the bias metrics.

play16:49

You can explore these values on the resulting report screen,

play16:55

and the dropdown menus will help you to pull some information

play16:59

about what this metric is, how it's computed,

play17:02

how to interpret and understand the value,

play17:04

and what to do about it,

play17:06

and also links to further reading resources

play17:08

are available right there.

play17:11

You can also look at the bias metrics as a table.

play17:16

And then, once we create this report,

play17:18

we can save it as part of our data flow

play17:23

and use it as a record of our dataset.

play17:35

Next, we're going to look at how to run a processing job

play17:38

to get the bias metrics and explainability metrics

play17:41

for a model and dataset.

play17:44

For this, we're going to use a notebook

play17:47

that we're going to run inside of SageMaker Studio.

play17:52

So, in this notebook, we have already trained and created a model.

play17:58

And we're going to use this model to run a processing job,

play18:02

and we're going to create a processor using the SageMaker Python SDK.

play18:06

For this processor, we're going to provide two inputs,

play18:10

an analysis configuration file, which is a JSON file

play18:12

that contains the various parameters for the algorithms,

play18:16

and the dataset itself.

play18:18

And in the output, we're going to indicate

play18:20

where we would like the job results to go.

play18:23

Once we run this job, we're going to get a

play18:27

JSON report with all the metrics computed from inside the job.

play18:30

This includes the local explanations, global explanations,

play18:34

pre-training and post-training metrics.

play18:38

We can download this file and inspect

play18:40

and consume it right within the notebook.

play18:52

When we explore these metrics,

play18:54

we find that the class imbalance is indicated as a high value here.

play18:58

And we would like to confirm

play19:00

that by running a quick experiment on the dataset

play19:03

and plot the values in a chart,

play19:06

which confirms the class imbalance indicated by this metric.

play19:11

Next, we're going to explore the feature importance,

play19:15

and we're going to use the open-source SHAP library

play19:17

to plot these values, which have already been computed

play19:20

inside the processing job. This is for visualization only.

play19:26

All the computation has already happened

play19:28

inside the processing job, and we have access to the global

play19:31

and the local SHAP values at this time.

play19:37

We can also look at the same values

play19:39

and explore the report visually inside SageMaker Studio.

play19:43

For this, we're going to locate our processing job

play19:46

in experiments as a trial component.

play19:49

And when we describe this trial component,

play19:52

a new tab opens up where we can see all the bias metrics

play19:54

and the feature attributions together in the same tab.

play19:59

The same dropdown menus that we were looking at earlier

play20:02

in Data Wrangler are also available here.

play20:04

And now, we have more metrics,

play20:06

because now we have access to pre-training

play20:08

as well as post-training metrics.

play20:11

Similarly, we have the metrics as a table or the dropdown menus.

play20:23

And we can also explore different facets here,

play20:28

a facet being a sensitive group here

play20:31

as indicated by our configuration file

play20:34

and see different bias metrics computed for each of these groups.

play20:48

Next, we're going to look at how this is used in Model Monitor.

play20:52

So, in Model Monitor, the first step you would want to do

play20:55

is to deploy your endpoint and enable data capture on it.

play21:00

Next, we will have created a model monitoring schedule

play21:04

with a job definition that includes that we would like to collect bias

play21:07

and explainability metrics. And we have already done that here.

play21:12

And next, we're going to explore how these are presented

play21:16

and the endpoint section of SageMaker Studio,

play21:19

and how we can visualize and understand these metrics.

play21:24

So, first, we locate our endpoint,

play21:26

and then when we look at the model insights

play21:29

and the bias report tabs here,

play21:31

we can see that the jobs are running on the schedule that we indicated,

play21:36

and we can visualize different metrics,

play21:38

compare from run to run, and also understand

play21:42

how the feature attributions change over time

play21:44

by looking at individual features

play21:47

and see how they change in ranking over time.

play21:51

So, what we would like to see here is that the features don't change

play21:57

their attributions over time in big increments

play22:02

and they remain relatively stable over time,

play22:04

meaning that the assumptions

play22:06

and the learnings in our dataset and model are still valid.

play22:22

So, in here, what we are looking at right now

play22:25

is the feature attribution for one feature,

play22:28

and see how they change from one run to the next throughout the model

play22:34

monitoring schedule on the live endpoint.

play22:38

Next, we're looking at the bias metrics here.

play22:41

And in here, we can also see the same bias metrics

play22:45

that we were looking at earlier

play22:47

and how they are computed from one run to the next.

play22:51

And we can see if the bias metrics cross thresholds.

play22:56

That would indicate that the model is behaving

play22:59

in a more biased way than we had initially set it up to be.

play23:04

And this might be a sign that the model is behaving

play23:09

in a different way than we would like it to be,

play23:12

and maybe, again, it's time to collect more data and retrain.

play23:22

We can also plot the different metrics over time

play23:27

and use different intervals

play23:29

and different combinations of comparisons.

play23:35

This concludes our demo.

play23:37

So, to recap, Amazon SageMaker Clarify will help you

play23:42

detect bias during data preparation, detect bias in your trained model,

play23:47

detect drift in bias and explainability

play23:49

for the model behavior. And you can use SageMaker Clarify

play23:53

to provide reports to internal and external stakeholders,

play23:56

explain individual predictions, and explain overall model behavior.

play24:01

So, thank you for watching. And thank you, Michael,

play24:04

for joining us here today at re:Invent.

Rate This

5.0 / 5 (0 votes)

関連タグ
Machine LearningBias DetectionExplainabilitySageMakerAI EthicsData ScienceRegulatory ComplianceModel MonitoringPrudential CaseAWS re:InventML Lifecycle
英語で要約が必要ですか?