Hands-On Artificial Intelligence on Amazon Web Services

Book description

Perform cloud-based machine learning and deep learning using Amazon Web Services such as SageMaker, Lex, Comprehend, Translate, and Polly

Key Features

  • Explore popular machine learning and deep learning services with their underlying algorithms
  • Discover readily available artificial intelligence(AI) APIs on AWS like Vision and Language Services
  • Design robust architectures to enable experimentation, extensibility, and maintainability of AI apps

Book Description

From data wrangling through to translating text, you can accomplish this and more with the artificial intelligence and machine learning services available on AWS.

With this book, you'll work through hands-on exercises and learn to use these services to solve real-world problems. You'll even design, develop, monitor, and maintain machine and deep learning models on AWS.

The book starts with an introduction to AI and its applications in different industries, along with an overview of AWS artificial intelligence and machine learning services. You'll then get to grips with detecting and translating text with Amazon Rekognition and Amazon Translate. The book will assist you in performing speech-to-text with Amazon Transcribe and Amazon Polly. Later, you'll discover the use of Amazon Comprehend for extracting information from text, and Amazon Lex for building voice chatbots. You will also understand the key capabilities of Amazon SageMaker such as wrangling big data, discovering topics in text collections, and classifying images. Finally, you'll cover sales forecasting with deep learning and autoregression, before exploring the importance of a feedback loop in machine learning.

By the end of this book, you will have the skills you need to implement AI in AWS through hands-on exercises that cover all aspects of the ML model life cycle.

What you will learn

  • Gain useful insights into different machine and deep learning models
  • Build and deploy robust deep learning systems to production
  • Train machine and deep learning models with diverse infrastructure specifications
  • Scale AI apps without dealing with the complexity of managing the underlying infrastructure
  • Monitor and Manage AI experiments efficiently
  • Create AI apps using AWS pre-trained AI services

Who this book is for

This book is for data scientists, machine learning developers, deep learning researchers, and artificial intelligence enthusiasts who want to harness the power of AWS to implement powerful artificial intelligence solutions. A basic understanding of machine learning concepts is expected.

Downloading the example code for this ebook: You can download the example code files for this ebook on GitHub at the following link: https://github.com/PacktPublishing/Hands-On-Artificial-Intelligence-on-Amazon-Web-Services. If you require support please email: customercare@packt.com

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Artificial Intelligence on Amazon Web Services
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Section 1: Introduction and Anatomy of a Modern AI Application
  7. Introduction to Artificial Intelligence on Amazon Web Services
    1. Technical requirements
    2. What is AI?
      1. Applications of AI
        1. Autonomous vehicles
        2. AI in medical care
        3. Personalized predictive keyboards
      2. Why use Amazon Web Services for AI?
    3. Overview of AWS AI offerings
      1. Hands-on with AWS services
        1. Creating your AWS account
        2. Navigating through the AWS Management Console
        3. Finding AWS services
        4. Choosing the AWS region
        5. Test driving the Amazon Rekognition service
        6. Working with S3
        7. Identity and Access Management
    4. Getting familiar with the AWS CLI
      1. Installing Python
        1. Installing Python on macOS
        2. Installing Python on Linux
        3. Installing Python on Microsoft Windows
          1. Windows 10
          2. Earlier Windows versions
      2. Installing the AWS CLI
      3. Configuring the AWS CLI
      4. Invoking the Rekognition service using the AWS CLI
    5. Using Python for AI applications
      1. Setting up a Python development environment
        1. Setting up a Python virtual environment with Pipenv
        2. Creating your first Python virtual environment
    6. First project with the AWS SDK
    7. Summary
    8. References
  8. Anatomy of a Modern AI Application
    1. Technical requirements
    2. Understanding the success factors of artificial intelligence applications
    3. Understanding the architecture design principles for AI applications
    4. Understanding the architecture of modern AI applications
    5. Creation of custom AI capabilities
    6. Working with a hands-on AI application architecture
      1. Object detector architecture
      2. Component interactions of the Object Detector
      3. Creating the base project structure
    7. Developing an AI application locally using AWS Chalice
    8. Developing a demo application web user interface
      1. Deploying AI application backends to AWS via Chalice
      2. Deploying a static website via AWS S3
    9. Summary
    10. Further reading
  9. Section 2: Building Applications with AWS AI Services
  10. Detecting and Translating Text with Amazon Rekognition and Translate
    1. Making the world smaller
    2. Understanding the architecture of Pictorial Translator 
      1. Component interactions of Pictorial Translator 
    3. Setting up the project structure
    4. Implementing services
      1. Recognition service – text detection
      2. Translation service – translating text
      3. Storage service – uploading files
      4. A recommendation on unit testing
    5. Implementing RESTful endpoints
      1. Translate the image text endpoint
      2. Upload the image endpoint
    6. Implementing the web user interface
      1. index.html
      2. scripts.js
    7. Deploying Pictorial Translator to AWS
    8. Discussing project enhancement ideas
    9. Summary
    10. Further reading
  11. Performing Speech-to-Text and Vice Versa with Amazon Transcribe and Polly
    1. Technical requirements
    2. Technologies from science fiction
    3. Understanding the architecture of Universal Translator
      1. Component interactions of Universal Translator
    4. Setting up the project structure
    5. Implementing services
      1. Transcription service – speech-to-text
      2. Translation Service – translating text
      3. Speech Service – text-to-speech
      4. Storage Service – uploading and retrieving a file
    6. Implementing RESTful endpoints
      1. Translate recording endpoint
      2. Synthesize speech endpoint
      3. Upload recording Endpoint
    7. Implementing the Web User Interface
      1. index.html
      2. scripts.js
    8. Deploying the Universal Translator to AWS
    9. Discussing the project enhancement ideas
    10. Summary
    11. References
  12. Extracting Information from Text with Amazon Comprehend
    1. Technical requirements
    2. Working with your Artificial Intelligence coworker
    3. Understanding the Contact Organizer architecture
      1. Component interactions in Contact Organizer
    4. Setting up the project structure
    5. Implementing services
      1. Recognition Service – text detection
      2. Extraction Service – contact information extraction
      3. Contact Store – save and retrieve contacts
      4. Storage Service – uploading and retrieving a file
    6. Implementing RESTful endpoints
      1. Extract Image Information endpoint
      2. Save contact and get all contacts endpoints
      3. Upload image endpoint
    7. Implementing the web user interface
      1. Index.html
      2. scripts.js
    8. Deploying the Contact Organizer to AWS
    9. Discussing the project enhancement ideas
    10. Summary
    11. Further reading
  13. Building a Voice Chatbot with Amazon Lex
    1. Understanding the friendly human-computer interface
    2. Contact assistant architecture
    3. Understanding the Amazon Lex development paradigm
    4. Setting up the contact assistant bot
      1. The LookupPhoneNumberByName intent
        1. Sample utterances and slots for LookupPhoneNumberByName
        2. Confirmation prompt and response for LookupPhoneNumberByName
        3. Fulfillment for LookupPhoneNumberByName using AWS Lambda
          1. DynamoDB IAM role for LookupPhoneNumberByName
        4. Fulfillment lambda function for LookupPhoneNumberByName
        5. Amazon Lex helper functions
        6. The intent fulfillment for LookupPhoneNumberByName
        7. Test conversations for LookupPhoneNumberByName
      2. The MakePhoneCallByName intent
        1. Sample utterances and lambda initialization/validation for MakePhoneCallByName
        2. Slots and confirmation prompt for MakePhoneCallByName
        3. Fulfillment and response for MakePhoneCallByName
        4. Test conversations for MakePhoneCallByName
      3. Deploying the contact assistant bot
    5. Integrating the contact assistant into applications
      1. Intelligent assistant service implementation
      2. Contact assistant RESTful endpoint
    6. Summary
    7. Further reading
  14. Section 3: Training Machine Learning Models with Amazon SageMaker
  15. Working with Amazon SageMaker
    1. Technical requirements
    2. Preprocessing big data through Spark EMR
    3. Conducting training in Amazon SageMaker
      1. Learning how Object2Vec Works
      2. Training the Object2Vec algorithm
    4. Deploying the trained Object2Vec and running inference
    5. Running hyperparameter optimization (HPO)
    6. Understanding the SageMaker experimentation service
    7. Bring your own model – SageMaker, MXNet, and Gluon
    8. Bring your own container – R model
    9. Summary
    10. Further reading
  16. Creating Machine Learning Inference Pipelines
    1. Technical requirements
    2. Understanding the architecture of the inference pipeline in SageMaker
    3. Creating features using Amazon Glue and SparkML
      1. Walking through the prerequisites
      2. Preprocessing data using PySpark
      3. Creating an AWS Glue job
    4. Identifying topics by training NTM in SageMaker
    5. Running online versus batch inferences in SageMaker
      1. Creating real-time predictions through an inference pipeline
      2. Creating batch predictions through an inference pipeline
    6. Summary
    7. Further reading
  17. Discovering Topics in Text Collection
    1. Technical requirements
    2. Reviewing topic modeling techniques
    3. Understanding how the Neural Topic Model works
    4. Training NTM in SageMaker
    5. Deploying the trained NTM model and running the inference
    6. Summary
    7. Further reading
  18. Classifying Images Using Amazon SageMaker
    1. Technical requirements
    2. Walking through convolutional neural and residual networks
    3. Classifying images through transfer learning in Amazon SageMaker
      1. Creating input for image classification
      2. Defining hyperparameters for image classification
    4. Performing inference through Batch Transform
    5. Summary
    6. Further reading
  19. Sales Forecasting with Deep Learning and Auto Regression
    1. Technical requirements
    2. Understanding traditional time series forecasting
      1. Auto-Regressive Integrated Moving Average (ARIMA )
      2. Exponential smoothing
    3. How the DeepAR model works
      1. Model architecture
      2. Arriving at optimal network weights 
    4. Understanding model sales through DeepAR
      1. Brief description of the dataset
      2. Exploratory data analysis
      3. Data pre-processing
      4. Training DeepAR
    5. Predicting and evaluating sales
    6. Summary
    7. Further reading
  20. Section 4: Machine Learning Model Monitoring and Governance
  21. Model Accuracy Degradation and Feedback Loops
    1. Technical requirements
    2. Monitoring models for degraded performance
    3. Developing a use case for evolving training data – ad-click conversion
    4. Creating a machine learning feedback loop
      1. Exploring data
      2. Creating features
      3. Using Amazon's SageMaker XGBoost algorithm to classify ad-click data
      4. Evaluating model performance
    5. Summary
    6. Further reading
  22. What Is Next?
    1. Summarizing the concepts we learned in Part I
    2. Summarizing the concepts we learned in Part II
    3. Summarizing the concepts we learned in Part III
    4. Summarizing the concepts we learned in Part IV
    5. What's next?
      1. Artificial intelligence in the physical world
        1. AWS DeepLens
        2. AWS DeepRacer
        3. Internet of Things and AWS IoT Greengrass
      2. Artificial intelligence in your own field
    6. Summary
  23. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Hands-On Artificial Intelligence on Amazon Web Services
  • Author(s): Subhashini Tripuraneni, Charles Song
  • Release date: October 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781789534146