Blockchain Tethered AI

Book description

Remove your doubts about AI and explore how this technology can be future-proofed using blockchain's smart contracts and tamper-evident ledgers. With this practical book, system architects, software engineers, and systems solution specialists will learn how enterprise blockchain provides permanent provenance of AI, removes the mystery, and allows you to validate AI before it's ever used.

Authors Karen Kilroy, Lynn Riley, and Deepak Bhatta explain that AI's ability to change itself through program synthesis could take the technology beyond human control. With this book, you'll learn an efficient way to solve this problem by building simple blockchain controls for verifying, tracking, tracing, auditing, and even reversing AI. Blockchain tethered AI interweaves the MLOps process with blockchain so that an MLOps system requires blockchain to function, which in turn tethers AI. This guide shows you how.

You will:

  • Learn how to create and power AI marketplaces with blockchain
  • Understand why and how to implement on-chain AI governance
  • Control AI by learning methods to tether it to blockchain networks
  • Use blockchain crypto anchors to detect common AI hacks
  • Learn methods for reversing tethered AI

Table of contents

  1. Preface
    1. Why Does AI Need to Be Tethered?
    2. What You Will Learn
    3. Why We Wrote This Book
    4. A Note to Future Generations
    5. Summary
    6. Conventions Used in This Book
    7. Using Code Examples
    8. O’Reilly Online Learning
    9. How to Contact Us
    10. Acknowledgements
  2. 1. Why Build a Blockchain Truth Machine for AI?
    1. Dissecting AI’s Trust Deficit
    2. Machine Learning Concerns
      1. Opaque Box Algorithms
      2. Genetic Algorithms
      3. Data Quality, Outliers, and Edge Cases
      4. Supervised Versus Unsupervised ML
      5. Reinforcement Learning and Deep Learning
      6. Program Synthesis
      7. Superintelligent Agents
      8. Technological Singularity
    3. Attacks and Failures
      1. Model/Data Drift
      2. Adversarial Data Attacks
      3. Risk and Liability
    4. Blockchain as an AI Tether
      1. Enterprise Blockchain
      2. Distributed, Linked Blocks
      3. Trust and Transparency
      4. Defining Your Use Case
      5. Audit Trail
      6. Local Memory Bank
      7. Shared Memory Bank
      8. Four Controls
      9. Case Study: Oracle AIoT and Blockchain
    5. What’s Next?
  3. 2. Blockchain Controls for AI
    1. Four Blockchain Controls
    2. Blockchain Control 1: Pre-establishing Identity and Workflow Criteria for People and Systems
      1. Establishing Identity
      2. Predetermining Workflow Among Participants
    3. Blockchain Control 2: Distributing Tamper-Evident Verification
      1. Using Crypto Anchors to Verify Data Sets, Models, and Pipelines
      2. Using Blockchain to Detect Common AI Hacks
      3. Understanding Federated Learning and Blockchain
      4. Understanding Model Marketplaces
    4. Blockchain Control 3: Governing, Instructing, and Inhibiting Intelligent Agents
      1. Establishing a Governance Group
      2. Implementing On-Chain Governance
      3. Developing Compliant Intelligent Agents
    5. Blockchain Control 4: Showing Authenticity Through User-Viewable Provenance
      1. Deciding Whether to Trust AI
    6. Summary
  4. 3. User Interfaces
    1. Design Thinking
      1. Web Interfaces
      2. Blockchain Tethered AI User Interfaces
      3. BTA User Mockups
      4. Functionality
      5. Traceability and Transparency
      6. Smartphone and Tablet Apps
      7. Email and Text Notifications
      8. Spreadsheets
    2. Third-Party Systems
      1. Working with APIs
      2. Integrated Hardware
      3. Third-Party Services and Tools
    3. System Security
      1. AI Security
      2. Database Security
      3. Blockchain Security
      4. Additional Security
    4. Summary
  5. 4. Planning Your BTA
    1. BTA Architecture
    2. Sample Model
      1. AI Factsheet: Traffic Signs Detection Model
      2. How the Model Works
    3. Tethering the Model
    4. Subscribing
    5. Controlling Access
      1. Organization Units
      2. Staffings
      3. Users
    6. Analyzing the Use Case
      1. Participants
      2. Assets
      3. Transactions
      4. Smart Contracts
      5. Audit Trail
    7. Summary
  6. 5. Running Your Model
    1. Exercise: Oracle Cloud Setup
      1. Creating a Cloud Provider Account
      2. Creating a Compartment
      3. Creating a Bucket
      4. Creating a Pre-authenticated Request
      5. Creating Oracle Groups
      6. Creating IDCS Groups
      7. Mapping Oracle Groups
      8. Creating a Policy
      9. Generating a Secret Key
    2. Exercise: Building and Training a Model
      1. Exploring the Model Repository
      2. Installing Python and PyTorch
      3. Starting the Notebook
      4. Configuring Boto3
      5. Running Your Notebook
      6. Checking the Bucket
    3. Optimizing Hyperparameters
      1. Learning Rate for Training a Neural Network
      2. Number of Training Epochs Used
      3. Size of the Training Batches
      4. Size of the Hidden Layers
    4. Understanding Metrics
      1. Accuracy
      2. Loss
      3. Precision
      4. Recall
      5. F1 Score
    5. Summary
  7. 6. Instantiating Your Blockchain
    1. Exercise: Setting Up Hyperledger Fabric
      1. Installing Node.js, npm, and NestJS
      2. Understanding Hyperledger Fabric 2.0 Required Nodes
      3. Installing, Configuring, and Launching the Blockchain
    2. Creating and Joining Channels
      1. Creating Channels
      2. Joining Channels
      3. Configuring Anchor Peers
    3. Using Chaincodes
      1. Understanding Response Struct
      2. Using GetTxDateTime
      3. Project (project)
      4. Model Version (model-version)
      5. Model Review (model-review)
      6. Model Artifact (model-artifact)
      7. Model Experiment (model-experiment)
    4. Setting Up the Blockchain Connector
    5. Creating Multiple Blockchain Connectors
    6. Setting Up the Oracle Connector
      1. Configuring Your env File with Your OCI Variables
      2. Starting the Oracle Connector
    7. More About Integrating Blockchain and the Application Layer
      1. Blockchain Connector
      2. query
      3. OC User Service
      4. OC Group
    8. Summary
  8. 7. Preparing Your BTA
    1. Exercise: Installing and Launching Your BTA
      1. Installing the BTA Backend
      2. Understanding Your BTA Backend’s env File
      3. Understanding Your environment.ts File
      4. Launching the BTA Frontend
    2. Exercise: Creating Users and Permissions
      1. Using MailCatcher
      2. Configuring the Super Admin
      3. Creating a New Subscription Account in Your BTA
      4. Configuring Organization Admin’s Node
      5. Configuring Organization Admin’s Channel
      6. Verifying the Subscription
      7. Activating Your Organization Admin
      8. Configuring Access for Your AI Team
    3. Summary
  9. 8. Using Your BTA
    1. Exercise: Recording Critical AI Touchpoints to Blockchain
      1. Adding a New Project
      2. Adding a New Version
      3. Understanding How Training and Testing Data Use Blockchain
      4. Understanding How Models and Algorithms Use Blockchain
      5. Understanding How Inputs and Outputs Use Blockchain
      6. Understanding How Performance Metrics Use Blockchain
      7. Understanding How New Model Versions Use Blockchain
      8. Understanding How the Uploads Work
      9. Reviewing and Approving the Model
      10. Adding AI’s Purpose and Intended Domain
    2. Exercise: Auditing Your BTA
      1. Tracking Your Model’s Training and Test Data Sets
      2. Tracing Your Inputs and Outputs
      3. Verifying Performance Metrics
      4. Tracing Identity of People and AI Systems
      5. Tracking and Tracing Model Development
      6. Identifying Tampering
      7. Reversing Your Blockchain Tethered Model
      8. Checking the Training Data Sets
      9. Checking the Algorithms
      10. Retraining the Model
    3. Summary
  10. Index
  11. About the Authors

Product information

  • Title: Blockchain Tethered AI
  • Author(s): Karen Kilroy, Lynn Riley, Deepak Bhatta
  • Release date: February 2023
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098130480