Article
Trustworthy AI with MLOps on AWS
Accelerating artificial intelligence workflows with IBM trustworthy AI framework and MLOps on AWSIn recent years, the rapid development of AI has resulted in its integration into many areas of our lives, such as healthcare, finance, transportation, and manufacturing to improve efficiency, accuracy, and productivity. However, the widespread adoption of AI has also led to concerns regarding the transparency, accountability, and fairness of AI systems. As a result, the concept of trustworthy AI has emerged. The goal of trustworthy AI is to ensure that AI systems are reliable, secure, and ethical. While many business leaders say that trustworthy AI is critical, many organizations have not taken key steps to ensure that their AI is trustworthy and responsible.
Trustworthy AI ensures that AI systems can be trusted to operate safely and effectively in real-world environments. This requires not only technical measures to ensure the security and reliability of the systems, but also ethical considerations to ensure that the systems are fair and unbiased.
One key aspect of trustworthy AI is having explainable AI models. Explainable AI refers to the ability of AI systems to provide clear and understandable explanations of how they arrive at their decisions or recommendations. This is crucial to ensure that AI systems are transparent and accountable and can be trusted by both users and stakeholders.
The lack of explainability in AI models can have significant regulatory and ethical implications. For example, in the healthcare domain, AI models that are used for diagnostic purposes must be able to explain their decisions to doctors and patients. Similarly, in the finance industry, AI models that are used for credit scoring or investment recommendations must be able to provide clear justifications for their decisions.
But, artificial intelligence and machine learning are more than just building models. They require discipline across multiple domains, as shown in the following image.
Figure 1. Combination of data engineering, data science, and operationalization

Organizations are maturing in the data science arena, but they still struggle to integrate and scale data science, analytics, and AI into every day, real-time decision-making. As AI systems make decisions that can impact human lives, it's crucial to ensure that they behave in a manner that is aligned with human values and ethical principles. The following list provides some key issues with AI projects.
Most projects can’t get past the proof-of-concept stage.
- Businesses don’t realize the full benefits of AI because models are not deployed. Or, if they are deployed, it’s not at the speed or scale to meet the needs of the business.
- Models must be rewritten in different languages for deployment.
- A standardized process for elevating models from development to production is missing or flawed.
There is an inefficiency in lifecycle management and monitoring.
- No monitoring is being performed in the production machine learning model.
- No consistent way to monitor the machine learning model in production.
- Model performance must be determined with a manual process that is performed by a data scientist.
- No process to identify model decay or update the machine learning model.
- No inclusion of continuous integration, continuous delivery, continuous testing, and continuous monitoring.
Develop trustworthy AI with MLOps on AWS
One solution to the issues with AI projects is to develop trustworthy AI with machine learning operations (MLOps) on Amazon Web Services (AWS). With an IBM trustworthy AI framework, you can reinvent the way that you develop AI applications with a multidisciplinary approach that is designed to engender trust and consistently run, maintain, and scale AI. This ensures the continuous operation, upkeep, and expansion of AI capabilities while upholding trust and minimizing brand and reputation risks.
Figure 2. Circle of trustworthy AI

Benefits of the governance process
With this governance process, customers get the following benefits:
- The value of AI can be realized only in a scalable production environment to minimize time-to-deploy and time-to-value for AI solutions while minimizing operational risk.
- There are traceable model results and audit trails.
- Implementing production access control helps organizations ensure that only authorized personnel can access and manipulate AI and machine learning models in the production environment, reducing the risk of data breaches and ensuring the integrity and confidentiality of sensitive data.
- There is reproducibility.
- There is trust in the AI/machine learning model. Additionally, monitoring and auditing the models' performance over time can help detect and mitigate any potential issues or biases, further enhancing trust in the models.
- By streamlining the model deployment process, organizations can stay ahead of their competition and respond faster to changing market demands.
- It frees up internal resources, allowing teams to focus on developing new and innovative AI and machine learning models that can further drive business growth.
Figure 3. The business value of AI

Note: The claims and outcomes that are referenced in this article are based on past IBM engagements. Results might vary across clients.
Credit scoring use case
To illustrate the concept, we developed a real-world use case called Credit Scoring. In the financial industry, credit risk modeling is an essential aspect of credit risk management. It involves the assessment of the likelihood of a borrower defaulting on a loan or credit obligation. With advancements in technology, it's now possible to build credit risk models by using machine learning algorithms.
In a credit scoring model, the probability of default is normally presented in the form of a credit score. A higher score refers to a lower probability of default.
Figure 4. Sample credit scorecard

Although there are several common credit factors in credit scoring models, different types of loans might involve different credit factors that are specific to the loan characteristics. For example, the credit factors for a credit card loan might include payment history, age, number of accounts, and credit card utilization. The credit factors for a mortgage loan might include the down payment, job history, and loan size.
This article explores the implementation of a credit risk model that uses Amazon SageMaker, and explains the model's explainability by using the IBM AI Fairness 360 (AIF360) tool.
Amazon SageMaker is a fully managed service that provides a platform to build, train, and deploy machine learning models at scale. It offers various built-in algorithms and frameworks for building custom models. Additionally, it provides a secure and scalable environment for machine learning experimentation, training, and deployment.
First, you must collect and preprocess the data for the credit risk model. This involves cleaning and transforming the data into a format that can be easily used by the machine learning model. After you have the preprocessed data, you can use Amazon SageMaker to train the model.
To train the model, you must select an appropriate algorithm and specify the hyperparameters. Amazon SageMaker provides a range of built-in algorithms such as XGBoost and Linear Learner that can be used to train credit risk models. You can also use custom algorithms by packaging them in a Docker container and deploying them on Amazon SageMaker.
After the model is trained, you can deploy it on Amazon SageMaker for inference. You can also use AWS Lambda to build a serverless application that can call the model API and make credit risk predictions.
The next step is to define the model's explainability by using the IBM AI Fairness 360 tool. AIF360 is a toolkit for assessing, mitigating, and monitoring bias in machine learning models. To use AIF360, you must export the trained model from Amazon SageMaker and import it into the tool. After the model is imported, you can use the tool to evaluate the model's fairness by using various metrics, such as demographic parity and equal opportunity.
Figure 5. IBM bias checking flow

The IBM AI Fairness 360 tool also provides the ability to generate explanations for the model's predictions. This is important for credit risk models because it allows you to understand the factors that contribute to the model's decisions. This can help you identify potential bias in the model and take steps to mitigate the bias.
Figure 6. High-level architecture

User interfaces
This use case uses two tools for different purposes: Amazon QuickSight and Streamlit. Based on the client’s requirement, one system can be used for dashboard visualization and one for a full-fledged web application for advanced user interaction features.
Amazon QuickSight is a business intelligence and analytics tool that is used for creating dashboards and visualizations for business data. QuickSight offers a wide range of features including data preparation, data visualization, and data exploration. It also provides machine learning capabilities for advanced analytics.
Streamlit is an open source Python library that is used for creating interactive web applications for data science and machine learning. Streamlit makes it easy for you to create custom user interfaces for your machine learning models or data analysis projects and to share those applications with others. Streamlit is not a business intelligence tool, but rather a development framework for creating interactive data science applications.
The following sections and images show the Amazon QuickSight dashboard for the Credit Scoring use case. For simplicity, we have the tab in one dashboard so that we can add access control and other functions based on the client needs.
Persona 1: Business team/project owner/data engineer
In this example, the business team or a project owner has an overall view of a solution that is in good working condition, and they want to know about the input, data distribution, and output.
The Data Summary tab is essential for gaining a deeper understanding of customer behavior and preferences, and for making more informed decisions that are tailored to specific customer segments. This tab provides transparency about the data quality and health of the data.
The input and output data summary persona refers to the type of data that is used as input and the type of data that is generated as output. In other words, it refers to the data that is used to create the dashboard and the data that is displayed on the dashboard. The input data that is used in a persona-wise data science dashboard typically includes data on customer demographics, behavior, and preferences.
Figure 7. Data summary tab

Persona 2: Machine learning engineer
While developing solutions, you create hundreds of experiments, and it might become hard to track the models. The ML Model Description tab shows the version information and details about the machine learning models that are used and deployed. These details provide important information about the algorithms and models that are used along with the status.
Figure 8. ML Model Description tab

Some common machine learning version details that are included in the ML Model Description tab are:
Model version: This refers to the version number of the machine learning model that was used to generate insights. This is important because different versions of a model might produce different results and insights.
Model type: This refers to the type of machine learning algorithm that was used to generate insights for each persona. Common model types include regression, classification, clustering, and deep learning.
Model parameters: This refers to the specific parameters and settings that were used in each machine learning model, such as the number of hidden layers in a deep learning model or the learning rate in a regression model.
By providing machine learning version details in the dashboard, you can ensure that you are using the most up-to-date and accurate models to generate insights. This can lead to more accurate predictions and recommendations as well as better overall decision-making based on data-driven insights.
Persona 3: Business user/loan approval agent
Business users and agents must know why the application was approved or rejected. Explainability is an important aspect of any data science dashboard because it enables nontechnical users to make more informed decisions based on the insights generated by the dashboard. This is especially important in fintech and healthcare dashboards, where the insights and recommendations are tailored to specific user groups or individuals.
In other words, explainability refers to how easy it is for a nontechnical user to understand how the insights were generated and how to interpret and act on them. Providing insights helps the agent to better inform the customer for future business and makes the process more transparent.
The Explainability dashboard has an interface that is easy to navigate and understand, with clear explanations of how to use each feature. The insights and recommendations that are presented by the dashboard are explained in plain language, without technical jargon.
Figure 9. Explainability tab

Persona 4: Data scientist
Businesses should be knowledgeable about ethical concerns related to bias and fairness when creating machine learning solutions and using them in the real world. The Bias and Fairness tab is meant to solve these issues. The Bias and Fairness tab shows:
- Metric-like average odds differences: The difference between the odds offered by two different scenarios for the same event.
- Statistical parity differences: The metric used to measure fairness in decision-making algorithms or systems.
- Disparate impact: Identifies discrimination that occurs as a result of a policy or practice that is neutral on its face but has a disproportionately negative impact on a particular group of people.
- Theil index: The metric that is used to measure gender diversity.
- Equal opportunity difference: The fairness metric that is used to evaluate machine learning models and algorithms to detect and quantify potential biases in the outcomes they produce.
Here, we used the IBM AI Fairness 360 package, which is available in open source.
Figure 10. Bias and Fairness tab

You can address bias and fairness concerns in any use case. Businesses can ensure that the insights and recommendations that are generated by the dashboard are fair and unbiased, and that they are designed to meet the needs of all users. This can help to build trust and credibility with users and can ultimately lead to more effective decision-making based on data-driven insights.
We also developed a Streamlit app that can be integrated with AWS and AIF360, providing an open source alternative for the dashboard along with increased capabilities like editing data, interactivity, and multiple input options.
Figure 11. Visualization for credit eligibility tool

Detailed solution architecture
Implementing a credit risk model by using fully managed Amazon SageMaker provides a scalable and secure environment for building, training, and deploying machine learning models. Additionally, using the IBM AI Fairness 360 tool to show the model's explainability helps you understand the factors that contribute to the model's decisions and identify potential bias. Together, these tools can help financial institutions make more informed credit risk decisions while ensuring fairness and transparency.
To ensure speed-to-value, Amazon SageMaker lets you create custom Amazon SageMaker Projects templates, which you can use to instantiate template repositories and continuous integration (CI) and continuous development (CD) pipelines automatically. With Projects templates, the lead data scientists are responsible for instantiating new projects and allocating dedicated teams per new machine learning use cases. In this case, we created a custom Amazon SageMaker Projects template for building the model, training it, and deploying it, by using batch inference. The template is generic and not specific to the Credit Scoring use case, and can easily be repurposed for other machine learning use cases based on tabular data, for example, customer churn.
Figure 12. End-to-end detailed architecture

The following steps outline the workflow of the architecture.
The lead data scientist and the administrator can make the custom Projects template available to the rest of the team through the AWS Service Catalog. After that, anyone within a particular Amazon SageMaker Studio Domain with the required permissions (specified by the administrator), is able to create an instance of the entire MLOps project. The template comes prepopulated with example code that showcases the basic machine learning steps (preprocess, train, evaluate, and register) on an example data set, through an MLOps Pipeline. Data scientists or machine learning engineers can easily change the example code or the data set to match their own use case.
The moment a change in the code happens or a new manual execution is selected, a continuous integration workflow is triggered for building a new model, starting all of the required resources, and running through the MLOps Pipeline. If the model quality meets quality standards, the new model is registered in the Amazon SageMaker Model Registry.
After a data scientist or a machine learning engineer is satisfied with the model’s performance, they can provide a manual approval inside the Amazon SageMaker Model Registry, and a continuous development workflow is triggered for deploying the model version in two phases: staging and production.
In the staging phase, more tests are performed to ensure that the model meets the required expectations. If the model passes the scheduled tests, an Ops persona gives a final manual approval for the model to be moved to production, where it provides predictions on new data. There are a number of deployment variations that the organization can select to implement. In one variation, the model provides batch predictions that are triggered with scheduled or event-based rules (using Amazon EventBridge). Alternatively, they can opt for real-time predictions by deploying the model in endpoints.
After the model’s predictions are stored in an Amazon S3 bucket, detailed analysis of the model’s bias and explainability takes place, and all of the results as well as the model’s insights are visualized in Amazon QuickSight.
Why MLOps with Amazon SageMaker?
Amazon SageMaker provides purpose-built tools for MLOps to help you automate and standardize processes across the machine learning lifecycle. Using Amazon SageMaker MLOps tools, you can easily train, test, troubleshoot, deploy, and govern machine learning models at scale to boost the productivity of data scientists and machine learning engineers while maintaining model performance in production.
There are several reasons why Amazon SageMaker should be the preferred choice for implementing an end-to-end machine learning solution in any domain.
Scalability: Amazon SageMaker provides a highly scalable platform for building, training, and deploying machine learning models. It can handle large volumes of data and compute resources, making it suitable for both small- and large-scale machine learning projects.
Fully managed service: Amazon SageMaker is a fully managed service, which means that AWS takes care of the underlying infrastructure, security, and maintenance. This lets you focus on building and deploying machine learning models, without having to worry about managing infrastructure.
Wide range of algorithms and frameworks: Amazon SageMaker offers a wide range of built-in algorithms and frameworks for building and training machine learning models. This includes popular frameworks such as TensorFlow, PyTorch, and Scikit-learn, as well as algorithms for specific use cases such as XGBoost for regression and classification.
Cost-effective: Amazon SageMaker provides cost-effective pricing models, allowing you to pay for only the resources you use. Additionally, it offers options for reserved instances and spot instances, which can reduce costs even further.
Easy integration with other AWS services: Amazon SageMaker can easily integrate with other AWS services, such as AWS Lambda and AWS Step Functions, to build end-to-end machine learning workflows. This makes it easier to deploy machine learning models in production and automate the entire machine learning pipeline.
Comprehensive security and compliance: Amazon SageMaker offers a range of security features to ensure data privacy, including encryption at rest and in transit, VPC support, and fine-grained access control. Additionally, Amazon SageMaker is compliant with various industry regulations, including HIPAA, SOC 2, and PCI DSS.
Figure 13. Amazon SageMaker MLOps

Why IBM AI Fairness 360?
Using the IBM AI Fairness 360 tool along with Amazon SageMaker provides several benefits:
Identify and mitigate bias: AIF360 can help you identify and mitigate bias in your machine learning models, ensuring fair and unbiased decisions. This is especially important in use cases such as credit risk modeling and customer churn prediction, where biases can have significant financial impacts.
Increased transparency: AIF360 can help businesses increase the transparency of their machine learning models by providing explanations for the model's decisions. This is important for use cases such as healthcare diagnosis, where doctors must understand the reasoning behind the model's diagnosis.
Regulatory compliance: The tool can help you ensure regulatory compliance by identifying and mitigating any potential bias in your machine learning models. This is important for industries such as finance and healthcare, which are heavily regulated.
Improved customer trust: By ensuring fairness and transparency in your machine learning models, you can build trust with your customers. This is especially important in industries such as finance and telecommunications, where customers expect unbiased and transparent decisions.
Figure 14. IBM AI Fairness 360 tool UI/UX

AIF360 is not just a Python package. It is also an interactive experience that provides an introduction to the concepts and capabilities of the toolkit.
One of the reasons that IBM decided to make AIF360 an open source project as a companion to the Adversarial Robustness Toolbox is to encourage the contribution of researchers from around the world to add their metrics and algorithms.
Why IBM AI Explainability 360?
To provide explanations in your everyday life, you rely on a rich and expressive vocabulary, examples and counterexamples, rules and prototypes, and highlights of important characteristics that are present and absent. When interacting with algorithmic decisions, you expect the same level of expressiveness from AI. When it comes to explaining decisions made by algorithms, there is no single approach that works best. There are many ways to explain, and the choice depends on the requirements of the machine learning pipeline.
AI Explainability 360 (AIX360) is a comprehensive open source toolkit of state-of-the-art algorithms that supports the interpretability and explainability of machine learning models.
Figure 15. AI Explainability 360 usage diagram

Here, we highlight two of the algorithms.
The Boolean Classification Rules via Column Generation is an accurate and scalable method of directly interpretable machine learning.
The Contrastive Explanations Method is a local post hoc method that addresses the most important consideration of explainable AI that has been overlooked by researchers and practitioners: explaining why an event happened not in isolation, but why it happened instead of some other event.
Figure 16. AI Explainability 360 decision tree

Trustworthy AI in other industry use cases
Along with the Credit Scoring use case, the IBM Trustworthy AI framework can be applied to other domains and use cases. The following list provides examples of a few industry use cases that combine the properties of Amazon SageMaker and IBM fairness and explainability tools.
Credit risk modeling: A financial institution wants to build a credit risk model that uses Amazon SageMaker to assess the likelihood of a borrower defaulting on a loan or credit obligation. They use a custom algorithm and train the model by using a large data set of historical credit data. They then use the IBM AI Fairness 360 tool to evaluate the model's fairness and explainability, checking for any potential bias in the model's decisions. By doing this, the financial institution can ensure that their credit risk model is accurate, unbiased, and transparent.
Healthcare diagnosis: A healthcare provider wants to build a machine learning model to assist doctors in diagnosing patients with various medical conditions. They use Amazon SageMaker to train the model by using a large data set of patient health records. After training, they use IBM fairness and explainability tools to ensure that the model is fair and transparent. By doing this, the healthcare provider can ensure that their machine learning model is not biased and can provide an explanation for the model's diagnosis.
Predictive maintenance: A manufacturing company wants to build a machine learning model to predict when their equipment will fail, allowing them to perform maintenance before a failure occurs. They use Amazon SageMaker to build the model by using sensor data from their equipment. They then use IBM fairness and explainability tools to ensure that the model is fair and transparent. By doing this, the manufacturing company can ensure that their machine learning model is not biased and can provide an explanation for the model's predictions.
Customer churn prediction: A telecommunications company wants to build a machine learning model to predict which customers are most likely to cancel their service. They use Amazon SageMaker to build the model by using a large data set of customer data. After training, they use IBM fairness and explainability tools to ensure that the model is fair and transparent. By doing this, the telecommunications company can ensure that their machine learning model is not biased and can provide an explanation for the model's predictions.
In all these use cases, Amazon SageMaker provides a scalable and secure platform for building, training, and deploying machine learning models. Additionally, using IBM fairness and explainability tools ensures that the models are unbiased, transparent, and provide explanations for their decisions. This helps businesses make more informed decisions and build trust with their customers by ensuring fairness and transparency in their machine learning models.
Conclusion
In this article, we explained the concept of trustworthy AI and how it is essential to ensure that AI systems can be trusted to operate safely and ethically in real-world environments. The need for explainability in AI models is a key aspect of trusted AI, and the lack of explainability can have significant regulatory and ethical implications. As AI continues to play an increasingly important role in various domains of human life, ensuring that AI systems are trustworthy and transparent will become increasingly important.
IBM Research is focused on developing trustworthy AI, which refers to the development of AI systems that are reliable, transparent, and secure. IBM has several initiatives and recognitions in this field, including the AI Fairness 360 toolkit, the IEEE Global Initiative for Ethical Considerations in AI and Autonomous Systems, the Partnership on AI, and contributions to the ACM Conference on Fairness, Accountability, and Transparency. IBM efforts have helped shape the conversation around ethical and responsible AI development, and the company has been recognized for its leadership in developing trustworthy AI.
In today’s dynamic world, it is critical to be able to quickly respond to market demand. This article explained how IBM frameworks and experience, along with Amazon SageMaker, can help you achieve an automated, enterprise-grade machine learning management platform. However, this is just the starting point on the MLOps adoption journey. Look at this guide for a more detailed roadmap on how enterprises can move across different stages of the MLOps maturity model.
Learn more about how to engage with IBM.
About the authors
- Surabhi Srivastava - Cognitive and Analytics Practice Lead; IBM Consulting, Singapore
- Rohit Singh - Senior Machine Learning Engineer; IBM Consulting, India
- Ram Nagarajan - Data Scientist; IBM Consulting, Singapore
- Hantzley Tauckoor - Solutions Architecture Leader; AWS, Singapore
- Vasileios Vonikakis - Sr. Partner Solution Architect for AI/ML, ASEAN AWS, Singapore
- Ling Yi, Chang - Partner Development Specialist for AI/ML, ASEAN AWS, Singapore