Platform and Model Design for Responsible AI

Book description

Craft ethical AI projects with privacy, fairness, and risk assessment features for scalable and distributed systems while maintaining explainability and sustainability Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Learn risk assessment for machine learning frameworks in a global landscape
  • Discover patterns for next-generation AI ecosystems for successful product design
  • Make explainable predictions for privacy and fairness-enabled ML training

Book Description

AI algorithms are ubiquitous and used for tasks, from recruiting to deciding who will get a loan. With such widespread use of AI in the decision-making process, it’s necessary to build an explainable, responsible, transparent, and trustworthy AI-enabled system. With Platform and Model Design for Responsible AI, you’ll be able to make existing black box models transparent.

You’ll be able to identify and eliminate bias in your models, deal with uncertainty arising from both data and model limitations, and provide a responsible AI solution. You’ll start by designing ethical models for traditional and deep learning ML models, as well as deploying them in a sustainable production setup. After that, you’ll learn how to set up data pipelines, validate datasets, and set up component microservices in a secure and private way in any cloud-agnostic framework. You’ll then build a fair and private ML model with proper constraints, tune the hyperparameters, and evaluate the model metrics.

By the end of this book, you’ll know the best practices to comply with data privacy and ethics laws, in addition to the techniques needed for data anonymization. You’ll be able to develop models with explainability, store them in feature stores, and handle uncertainty in model predictions.

What you will learn

  • Understand the threats and risks involved in ML models
  • Discover varying levels of risk mitigation strategies and risk tiering tools
  • Apply traditional and deep learning optimization techniques efficiently
  • Build auditable and interpretable ML models and feature stores
  • Understand the concept of uncertainty and explore model explainability tools
  • Develop models for different clouds including AWS, Azure, and GCP
  • Explore ML orchestration tools such as Kubeflow and Vertex AI
  • Incorporate privacy and fairness in ML models from design to deployment

Who this book is for

This book is for experienced machine learning professionals looking to understand the risks and leakages of ML models and frameworks, and learn to develop and use reusable components to reduce effort and cost in setting up and maintaining the AI ecosystem.

Table of contents

  1. Platform and Model Design for Responsible AI
  2. Contributors
  3. About the authors
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
    8. Download a free PDF copy of this book
  6. Part 1: Risk Assessment Machine Learning Frameworks in a Global Landscape
  7. Chapter 1: Risks and Attacks on ML Models
    1. Technical requirements
    2. Discovering risk elements
      1. Strategy risk
      2. Financial risk
      3. Technical risk
      4. People and processes risk
      5. Trust and explainability risk
      6. Compliance and regulatory risk
    3. Exploring risk mitigation strategies with vision, strategy, planning, and metrics
      1. Defining a structured risk identification process
      2. Enterprise-wide controls
      3. Micro-risk management and the reinforcement of controls
    4. Assessing potential impact and loss due to attacks
    5. Discovering different types of attacks
      1. Data phishing privacy attacks
      2. Poisoning attacks
      3. Evasion attacks
      4. Model stealing/extraction
      5. Perturbation attacks
      6. Scaffolding attack
      7. Model inversion
      8. Transfer learning attacks
    6. Summary
    7. Further reading
  8. Chapter 2: The Emergence of Risk-Averse Methodologies and Frameworks
    1. Technical requirements
    2. Analyzing the threat matrix and defense techniques
      1. Researching and planning during the system and model design/architecture phase
      2. Model training and development
      3. ML model live in production
    3. Anonymization and data encryption
      1. Data masking
      2. Data swapping
      3. Data perturbation
      4. Data generalization
      5. K-anonymity
      6. L-diversity
      7. T-closeness
      8. Pseudonymization
      9. Homomorphic encryption
      10. Secure Multi-Party Computation (MPC/SMPC)
    4. Differential Privacy (DP)
      1. Sensitivity
      2. Properties of DP
    5. Hybrid privacy methods and models
    6. Adversarial risk mitigation frameworks
      1. Model robustness
    7. Summary
    8. Further reading
  9. Chapter 3: Regulations and Policies Surrounding Trustworthy AI
    1. Regulations and enforcements under different authorities
      1. Regulations in the European Union
      2. Propositions/acts passed by other countries
    2. Special regulations for children and minority groups
      1. Promoting equality for minority groups
      2. Educational initiatives
      3. International AI initiatives and cooperative actions
    3. Next steps for trustworthy AI
      1. Proposed solutions and improvement areas
    4. Summary
    5. Further reading
  10. Part 2: Building Blocks and Patterns for a Next-Generation AI Ecosystem
  11. Chapter 4: Privacy Management in Big Data and Model Design Pipelines
    1. Technical requirements
    2. Designing privacy-proven pipelines
      1. Big data pipelines
      2. Architecting model design pipelines
      3. Incremental/continual ML training and retraining
      4. Scaling defense pipelines
      5. Enabling differential privacy in scalable architectures
    3. Designing secure microservices
      1. Vault
    4. Cloud security architecture
      1. Developing in a sandbox environment
      2. Managing secrets in cloud orchestration services
    5. Monitoring and threat detection
    6. Summary
    7. Further reading
  12. Chapter 5: ML Pipeline, Model Evaluation, and Handling Uncertainty
    1. Technical requirements
    2. Understanding different components of ML pipelines
    3. ML tasks and algorithms
    4. Uncertainty in ML
      1. Types of uncertainty
      2. Quantifying uncertainty
    5. Uncertainty in regression tasks
    6. Uncertainty in classification tasks
    7. Tools for benchmarking and quantifying uncertainty
      1. The Uncertainty Baselines library
      2. Keras-Uncertainty
      3. Robustness metrics
    8. Summary
    9. References
  13. Chapter 6: Hyperparameter Tuning, MLOps, and AutoML
    1. Technical requirements
    2. Introduction to AutoML
    3. Introducing H2O AutoML
    4. Understanding Amazon SageMaker Autopilot
    5. The need for MLOps
    6. TFX – a scalable end-to-end platform for AI/ML workflows
    7. Understanding Kubeflow
    8. Katib for hyperparameter tuning
    9. Vertex AI
      1. Datasets
      2. Training and experiments in Vertex AI
      3. Vertex AI Workbench
    10. Summary
    11. Further reading
  14. Part 3: Design Patterns for Model Optimization and Life Cycle Management
  15. Chapter 7: Fairness Notions and Fair Data Generation
    1. Technical requirements
    2. Understanding the impact of data on fairness
      1. Real-world bias examples
      2. Causes of bias
    3. Defining fairness
      1. Types of fairness based on statistical metrics
      2. Types of fairness based on the metrics of predicted outcomes
      3. Types of fairness based on similarity-based measures
      4. Types of fairness based on causal reasoning
    4. The role of data audits and quality checks in fairness
      1. Assessing fairness
      2. Linear regression
      3. The variance inflation factor
      4. Mutual information
      5. Significance tests
      6. Evaluating group fairness
      7. Evaluating counterfactual fairness
      8. Best practices
    5. Fair synthetic datasets
      1. MOSTLY AI’s self-supervised fair synthetic data generator
      2. A GAN-based fair synthetic data generator
    6. Summary
    7. Further reading
  16. Chapter 8: Fairness in Model Optimization
    1. Technical requirements
    2. The notion of fairness in ML
    3. Unfairness mitigation methods
      1. In-processing methods
    4. Explicit unfairness mitigation
      1. Fairness constraints for a classification task
      2. Fairness constraints for a regression task
      3. Fairness constraints for a clustering task
      4. Fairness constraints for a reinforcement learning task
      5. Fairness constraints for recommendation systems
    5. Challenges of fairness
      1. Missing sensitive attributes
      2. Multiple sensitive attributes
      3. Choice of fairness measurements
      4. Individual versus group fairness trade-off
      5. Interpretation and fairness
      6. Fairness versus model performance
      7. Limited datasets
    6. Summary
    7. Further reading
  17. Chapter 9: Model Explainability
    1. Technical requirements
    2. Introduction to Explainable AI
      1. Scope of XAI
      2. Challenges in XAI
    3. Explain Like I’m Five (ELI5)
    4. LIME
      1. SHAP
    5. Understanding churn modeling using XAI techniques
      1. Building a model
      2. Using ELI5 to understand classifier models
      3. Hands-on with LIME
      4. SHAP in action
    6. CausalNex
    7. DoWhy for causal inference
      1. DoWhy in action
    8. AI Explainability 360 for interpreting models
    9. Summary
    10. References
  18. Chapter 10: Ethics and Model Governance
    1. Technical requirements
    2. Model Risk Management (MRM)
      1. Types of model inventory management
      2. Cost savings with MRM
      3. A transformative journey with MRM
      4. Model risk tiering
      5. Model risk calibration
    3. Model version control
      1. ModelDB
      2. Weights & Biases
    4. Further reading
  19. Part 4: Implementing an Organization Strategy, Best Practices, and Use Cases
  20. Chapter 11: The Ethics of Model Adaptability
    1. Technical requirements
    2. Adaptability framework for data and model drift
      1. Statistical methods
      2. Statistical process control
    3. Understanding model explainability during concept drift/calibration
      1. Explainability and calibration
      2. Challenges with calibration and fairness
    4. Summary
    5. Further reading
  21. Chapter 12: Building Sustainable Enterprise-Grade AI Platforms
    1. Technical requirements
    2. The key to sustainable enterprise-grade AI platforms
      1. Sustainable solutions with AI as an organizational roadmap
      2. Organizational standards for sustainable frameworks
    3. Sustainability practices and metrics across different cloud platforms
      1. Emission metrics on Google Cloud
      2. Best practices and strategies for carbon-free energy
      3. The energy efficiency of data centers
    4. Carbon emission trackers
      1. The FL carbon calculator
      2. Centralized learning carbon emissions calculator
    5. Adopting sustainable model training and deployment with FL
      1. CO2e emission metrics
      2. Comparing emission factors – centralized learning versus FL
      3. Illustrating how FL works better than centralized learning
      4. The CO2 footprint of FL
      5. How to compensate for equivalent CO2e emissions
      6. Design patterns of FL-based model training
      7. Sustainability in model deployments
      8. Design patterns of FL-based model deployments
    6. Summary
    7. Further reading
  22. Chapter 13: Sustainable Model Life Cycle Management, Feature Stores, and Model Calibration
    1. Sustainable model development practices
      1. Organizational standards for sustainable, trustworthy frameworks
    2. Explainability, privacy, and sustainability in feature stores
      1. Feature store components and functionalities
      2. Feature stores for FL
    3. Exploring model calibration
      1. Determining whether a model is well calibrated
      2. Calibration techniques
      3. Model calibration using scikit-learn
    4. Building sustainable, adaptable systems
      1. Concept drift-aware federated averaging (CDA-FedAvg)
    5. Summary
    6. Further reading
  23. Chapter 14: Industry-Wide Use Cases
    1. Technical requirements
    2. Building ethical AI solutions across industries
      1. Biased chatbots
      2. Ethics in XR/AR/VR
    3. Use cases in retail
      1. Privacy in the retail industry
      2. Fairness in the retail industry
      3. Interpretability – the role of counterfactuals (CFs)
    4. Supply chain use cases
      1. Use cases in BFSI
      2. Deepfakes
    5. Use cases in healthcare
      1. Healthcare system architecture using Google Cloud
      2. Survival analysis for Responsible AI healthcare applications
    6. Summary
    7. Further reading
  24. Index
    1. Why subscribe?
  25. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Platform and Model Design for Responsible AI
  • Author(s): Amita Kapoor, Sharmistha Chatterjee
  • Release date: April 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781803237077