Hands-On Artificial Intelligence on Amazon Web Services: Decrease the time to market for AI and ML applications with the power of AWS
()
About this ebook
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.
Related to Hands-On Artificial Intelligence on Amazon Web Services
Related ebooks
Learning AWS: Design, build, and deploy responsive applications using AWS Cloud components, 2nd Edition Rating: 0 out of 5 stars0 ratingsAmazon Web Services Bootcamp: Develop a scalable, reliable, and highly available cloud environment with AWS Rating: 0 out of 5 stars0 ratingsExpert AWS Development: Efficiently develop, deploy, and manage your enterprise apps on the Amazon Web Services platform Rating: 0 out of 5 stars0 ratingsDesigning AWS Environments: Architect large-scale cloud infrastructures with AWS Rating: 0 out of 5 stars0 ratingsLearn AWS Serverless Computing: A beginner's guide to using AWS Lambda, Amazon API Gateway, and services from Amazon Web Services Rating: 0 out of 5 stars0 ratingsWeb Development with Angular and Bootstrap: Embrace responsive web design and build adaptive Angular web applications, 3rd Edition Rating: 0 out of 5 stars0 ratingsAWS Security Cookbook: Practical solutions for managing security policies, monitoring, auditing, and compliance with AWS Rating: 0 out of 5 stars0 ratingsHybrid Cloud for Developers: Develop and deploy cost-effective applications on the AWS and OpenStack platforms with ease Rating: 0 out of 5 stars0 ratingsAWS Administration - The Definitive Guide: Design, build, and manage your infrastructure on Amazon Web Services, 2nd Edition Rating: 0 out of 5 stars0 ratingsHands-On Cloud Solutions with Azure: Architecting, developing, and deploying the Azure way Rating: 0 out of 5 stars0 ratingsMastering AWS Security: Create and maintain a secure cloud ecosystem Rating: 0 out of 5 stars0 ratingsBuilding Serverless Web Applications Rating: 0 out of 5 stars0 ratingsMachine Learning with the Elastic Stack: Expert techniques to integrate machine learning with distributed search and analytics Rating: 0 out of 5 stars0 ratingsStream Analytics with Microsoft Azure: Real-time data processing for quick insights using Azure Stream Analytics Rating: 0 out of 5 stars0 ratingsHands-On Machine Learning with Azure: Build powerful models with cognitive machine learning and artificial intelligence Rating: 0 out of 5 stars0 ratingsJulia Programming Projects: Learn Julia 1.x by building apps for data analysis, visualization, machine learning, and the web Rating: 0 out of 5 stars0 ratingsHyperledger Cookbook: Over 40 recipes implementing the latest Hyperledger blockchain frameworks and tools Rating: 0 out of 5 stars0 ratingsGenerative AI-Powered Assistant for Developers: Accelerate software development with Amazon Q Developer Rating: 0 out of 5 stars0 ratingsAWS SysOps Cookbook: Practical recipes to build, automate, and manage your AWS-based cloud environments, 2nd Edition Rating: 0 out of 5 stars0 ratingsAWS Certified SysOps Administrator – Associate Guide: Your one-stop solution for passing the AWS SysOps Administrator certification Rating: 0 out of 5 stars0 ratingsBig Data Analytics with Hadoop 3: Build highly effective analytics solutions to gain valuable insight into your big data Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
2084: Artificial Intelligence and the Future of Humanity Rating: 4 out of 5 stars4/5Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5The Algorithm of the Universe (A New Perspective to Cognitive AI) Rating: 5 out of 5 stars5/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5Midjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5ChatGPT For Dummies Rating: 4 out of 5 stars4/5The Business Case for AI: A Leader's Guide to AI Strategies, Best Practices & Real-World Applications Rating: 0 out of 5 stars0 ratingsChatGPT For Fiction Writing: AI for Authors Rating: 5 out of 5 stars5/5The Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5AI for Educators: AI for Educators Rating: 5 out of 5 stars5/5Enterprise AI For Dummies Rating: 3 out of 5 stars3/5101 Midjourney Prompt Secrets Rating: 3 out of 5 stars3/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 3 out of 5 stars3/5The ChatGPT Handbook Rating: 0 out of 5 stars0 ratingsCoding with AI For Dummies Rating: 0 out of 5 stars0 ratingsChatGPT 4 $10,000 per Month #1 Beginners Guide to Make Money Online Generated by Artificial Intelligence Rating: 0 out of 5 stars0 ratingsKiller ChatGPT Prompts: Harness the Power of AI for Success and Profit Rating: 2 out of 5 stars2/5Prompt Engineering ; The Future Of Language Generation Rating: 4 out of 5 stars4/5
Reviews for Hands-On Artificial Intelligence on Amazon Web Services
0 ratings0 reviews
Book preview
Hands-On Artificial Intelligence on Amazon Web Services - Subhashini Tripuraneni
Hands-On Artificial Intelligence on Amazon Web Services
Decrease the time to market for AI and ML applications with the power of AWS
Subhashini Tripuraneni
Charles Song
BIRMINGHAM - MUMBAI
Hands-On Artificial Intelligence on Amazon Web Services
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Pravin Dhandre
Acquisition Editor: Aditi Gour
Content Development Editor: Nazia Shaikh
Senior Editor: Ayaan Hoda
Technical Editor: Dinesh Chaudhary
Copy Editor: Safis Editing
Project Coordinator: Kirti Pisat
Proofreader: Safis Editing
Indexer: Priyanka Dhadke
Production Designer: Aparna Bhagat
First published: October 2019
Production reference: 1041019
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78953-414-6
www.packt.com
Packt.com
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Fully searchable for easy access to vital information
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and, as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the authors
Subhashini Tripuraneni has several years of experience leading AI initiatives in financial services and convenience retail. She has automated multiple business processes and helped to create a proactive competitive advantage for businesses via AI. She is also a seasoned data scientist, with hands-on experience building machine learning and deep learning models in a public cloud. She holds an MBA from Wharton Business School, with a specialization in business analytics, marketing and operations, and entrepreneurial management. In her spare time, she enjoys going to theme parks and spending time with her children. She currently lives in Dallas, TX, with her husband and children.
Charles Song is a solutions architect with a background in applied software engineering research. He is skilled in software development, architecture design, and machine learning, with a proven ability to utilize emerging technologies to devise innovative solutions. He has applied machine learning to many research and industry projects, and published peer-reviewed papers on the subject. He holds a PhD in computer science from the University of Maryland. He has taught several software engineering courses at the University of Maryland for close to a decade. In his spare time, he likes to relax in front of his planted aquariums, but also enjoys martial arts, cycling, and snowboarding. He currently resides in Bethesda, MD, with his wife.
About the reviewer
Doug Ortiz is an experienced enterprise cloud, big data, data analytics, and solutions architect who has architected, designed, developed, re-engineered, and integrated enterprise solutions. His other areas of expertise include Amazon Web Services, Azure, Google Cloud, business intelligence, Hadoop, Spark, NoSQL databases, and SharePoint, to name but a few. He is also the founder of Illustris, LLC.
Huge thanks to my wonderful wife, Milla, Maria, Nikolay, and our children, for all their support.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Table of Contents
Title Page
Copyright and Credits
Hands-On Artificial Intelligence on Amazon Web Services
About Packt
Why subscribe?
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Introduction and Anatomy of a Modern AI Application
Introduction to Artificial Intelligence on Amazon Web Services
Technical requirements
What is AI?
Applications of AI
Autonomous vehicles
AI in medical care
Personalized predictive keyboards
Why use Amazon Web Services for AI?
Overview of AWS AI offerings
Hands-on with AWS services
Creating your AWS account
Navigating through the AWS Management Console
Finding AWS services
Choosing the AWS region
Test driving the Amazon Rekognition service
Working with S3
Identity and Access Management
Getting familiar with the AWS CLI
Installing Python
Installing Python on macOS
Installing Python on Linux
Installing Python on Microsoft Windows
Windows 10
Earlier Windows versions
Installing the AWS CLI
Configuring the AWS CLI
Invoking the Rekognition service using the AWS CLI
Using Python for AI applications
Setting up a Python development environment
Setting up a Python virtual environment with Pipenv
Creating your first Python virtual environment
First project with the AWS SDK
Summary
References
Anatomy of a Modern AI Application
Technical requirements
Understanding the success factors of artificial intelligence applications
Understanding the architecture design principles for AI applications
Understanding the architecture of modern AI applications
Creation of custom AI capabilities
Working with a hands-on AI application architecture
Object detector architecture
Component interactions of the Object Detector
Creating the base project structure
Developing an AI application locally using AWS Chalice
Developing a demo application web user interface
Deploying AI application backends to AWS via Chalice
Deploying a static website via AWS S3
Summary
Further reading
Section 2: Building Applications with AWS AI Services
Detecting and Translating Text with Amazon Rekognition and Translate
Making the world smaller
Understanding the architecture of Pictorial Translator
Component interactions of Pictorial Translator
Setting up the project structure
Implementing services
Recognition service – text detection
Translation service – translating text
Storage service – uploading files
A recommendation on unit testing
Implementing RESTful endpoints
Translate the image text endpoint
Upload the image endpoint
Implementing the web user interface
index.html
scripts.js
Deploying Pictorial Translator to AWS
Discussing project enhancement ideas
Summary
Further reading
Performing Speech-to-Text and Vice Versa with Amazon Transcribe and Polly
Technical requirements
Technologies from science fiction
Understanding the architecture of Universal Translator
Component interactions of Universal Translator
Setting up the project structure
Implementing services
Transcription service – speech-to-text
Translation Service – translating text
Speech Service – text-to-speech
Storage Service – uploading and retrieving a file
Implementing RESTful endpoints
Translate recording endpoint
Synthesize speech endpoint
Upload recording Endpoint
Implementing the Web User Interface
index.html
scripts.js
Deploying the Universal Translator to AWS
Discussing the project enhancement ideas
Summary
References
Extracting Information from Text with Amazon Comprehend
Technical requirements
Working with your Artificial Intelligence coworker
Understanding the Contact Organizer architecture
Component interactions in Contact Organizer
Setting up the project structure
Implementing services
Recognition Service – text detection
Extraction Service – contact information extraction
Contact Store – save and retrieve contacts
Storage Service – uploading and retrieving a file
Implementing RESTful endpoints
Extract Image Information endpoint
Save contact and get all contacts endpoints
Upload image endpoint
Implementing the web user interface
Index.html
scripts.js
Deploying the Contact Organizer to AWS
Discussing the project enhancement ideas
Summary
Further reading
Building a Voice Chatbot with Amazon Lex
Understanding the friendly human-computer interface
Contact assistant architecture
Understanding the Amazon Lex development paradigm
Setting up the contact assistant bot
The LookupPhoneNumberByName intent
Sample utterances and slots for LookupPhoneNumberByName
Confirmation prompt and response for LookupPhoneNumberByName
Fulfillment for LookupPhoneNumberByName using AWS Lambda
DynamoDB IAM role for LookupPhoneNumberByName
Fulfillment lambda function for LookupPhoneNumberByName
Amazon Lex helper functions
The intent fulfillment for LookupPhoneNumberByName
Test conversations for LookupPhoneNumberByName
The MakePhoneCallByName intent
Sample utterances and lambda initialization/validation for MakePhoneCallByName
Slots and confirmation prompt for MakePhoneCallByName
Fulfillment and response for MakePhoneCallByName
Test conversations for MakePhoneCallByName
Deploying the contact assistant bot
Integrating the contact assistant into applications
Intelligent assistant service implementation
Contact assistant RESTful endpoint
Summary
Further reading
Section 3: Training Machine Learning Models with Amazon SageMaker
Working with Amazon SageMaker
Technical requirements
Preprocessing big data through Spark EMR
Conducting training in Amazon SageMaker
Learning how Object2Vec Works
Training the Object2Vec algorithm
Deploying the trained Object2Vec and running inference
Running hyperparameter optimization (HPO)
Understanding the SageMaker experimentation service
Bring your own model – SageMaker, MXNet, and Gluon
Bring your own container – R model
Summary
Further reading
Creating Machine Learning Inference Pipelines
Technical requirements
Understanding the architecture of the inference pipeline in SageMaker
Creating features using Amazon Glue and SparkML
Walking through the prerequisites
Preprocessing data using PySpark
Creating an AWS Glue job
Identifying topics by training NTM in SageMaker
Running online versus batch inferences in SageMaker
Creating real-time predictions through an inference pipeline
Creating batch predictions through an inference pipeline
Summary
Further reading
Discovering Topics in Text Collection
Technical requirements
Reviewing topic modeling techniques
Understanding how the Neural Topic Model works
Training NTM in SageMaker
Deploying the trained NTM model and running the inference
Summary
Further reading
Classifying Images Using Amazon SageMaker
Technical requirements
Walking through convolutional neural and residual networks
Classifying images through transfer learning in Amazon SageMaker
Creating input for image classification
Defining hyperparameters for image classification
Performing inference through Batch Transform
Summary
Further reading
Sales Forecasting with Deep Learning and Auto Regression
Technical requirements
Understanding traditional time series forecasting
Auto-Regressive Integrated Moving Average (ARIMA )
Exponential smoothing
How the DeepAR model works
Model architecture
Arriving at optimal network weights
Understanding model sales through DeepAR
Brief description of the dataset
Exploratory data analysis
Data pre-processing
Training DeepAR
Predicting and evaluating sales
Summary
Further reading
Section 4: Machine Learning Model Monitoring and Governance
Model Accuracy Degradation and Feedback Loops
Technical requirements
Monitoring models for degraded performance
Developing a use case for evolving training data – ad-click conversion
Creating a machine learning feedback loop
Exploring data
Creating features
Using Amazon's SageMaker XGBoost algorithm to classify ad-click data
Evaluating model performance
Summary
Further reading
What Is Next?
Summarizing the concepts we learned in Part I
Summarizing the concepts we learned in Part II
Summarizing the concepts we learned in Part III
Summarizing the concepts we learned in Part IV
What's next?
Artificial intelligence in the physical world
AWS DeepLens
AWS DeepRacer
Internet of Things and AWS IoT Greengrass
Artificial intelligence in your own field
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Preface
Hands-On Artificial Intelligence on Amazon Web Services teaches you about the various artificial intelligence and machine learning services available on AWS. Through practical hands-on exercises, you'll learn how to use these services to generate impressive results. You will be able to design, develop, monitor, and maintain machine learning and deep learning models on AWS effectively.
The book starts with an introduction to AI and its applications in different industries along with an overview of AWS on AI/machine learning services and platforms. It will teach you all about detecting and translating text with Amazon Rekognition and Amazon Translate. You will learn how to perform speech-to-text with the help of Amazon Transcribe and Amazon Polly.
It covers the use of Amazon Comprehend for extracting information from text and Amazon Lex for building voice chatbots. You will gain an understanding of the key capabilities of Amazon SageMaker – wrangling big data, discovering topics in text collections, and classifying images. Lastly, the book explores sales forecasting with deep learning and auto regression and model accuracy degradation.
By the end of this book, you will have all the knowledge required to work with and implement AI in AWS through immersive hands-on exercises covering all the aspects of the model life cycle.
Who this book is for
This book is ideal for data scientists, machine learning developers, deep learning researchers, and AI enthusiasts who want to use the power of AWS services to implement powerful AI solutions. A basic understanding of machine learning concepts is expected.
What this book covers
Chapter 1, Introduction to Artificial Intelligence on Amazon Web Services, introduces the umbrella term AI,
which includes machine learning and deep learning. We will cover some of the hottest topics in AI, including image recognition, natural language processing, and speech recognition. We will provide a high-level overview of AWS' AI and machine learning services and platforms. AWS offers both managed services for ready-to-use AI/machine learning capabilities and managed infrastructures to train your own custom machine learning models. We will provide guidance on when to leverage managed services and when to train custom machine learning models. You will learn how to install and configure your development environment. We will guide you through the process of setting up for Python, the AWS SDK, and web development tools you will need for the hands-on projects in later chapters. We will also help you to verify your environment setup with working code that interacts with AWS platforms programmatically.
Chapter 2, Anatomy of a Modern AI Application, dives into the architecture and components of a modern AI application. We start to introduce patterns and concepts of a well-architected application; these will help you to design production-grade intelligent solutions. Not only will these concepts help you to rapidly experiment with and prototype solutions, but they will also help you to develop solutions that are flexible, extensible, and maintainable throughout the application life cycle. You will build the skeleton of a target architecture, which you will fill out in later chapters.
Chapter 3, Detecting and Translating Text with Amazon Rekognition and Translate, demonstrates how to build your first AI application that can translate foreign texts appearing in pictures into their native language. You will get hands-on experience with Amazon Rekognition and Amazon Translate. You will first build a reusable framework with AI and machine learning capabilities from AWS, and then build the application on top of that framework. We will demonstrate how separation between the capabilities and application logic can lead to flexibility and reusability; a concept that will become increasingly clear as the hands-on projects continue in later chapters.
Chapter 4, Performing Speech-to-Text and Vice Versa with Amazon Transcribe and Polly, shows you how to build an application that can translate voice conversations to and from different languages. You will get hands-on experience with Amazon Transcribe and Amazon Polly. Not only will you continue to build out the reusable framework of AI capabilities, but you will also reuse the translation capability of the framework that you built in the previous chapter. This will reinforce the concepts and benefits of well-architected production-ready AI solutions to increase experimentation and speed to market.
Chapter 5, Extracting Information from Text with Amazon Comprehend, demonstrates how you can build an application that can extract and organize information from photos of business cards. You will gain hands-on experience of Amazon Comprehend and reuse the text detection capability from previous chapters. In addition to this, we will introduce the concept of human-in-the-loop. You will build a human-in-the-loop graphical user interface that can allow users to verify and even correct information extracted by Amazon Comprehend.
Chapter 6, Building a Voice Chatbot with AWS Lex, enables you to continue the hands-on project by building a voice chatbot to look up business card contact information that was extracted and stored in the previous project. You will get hands-on experience of building a chatbot with Amazon Lex and integrating the chatbot interface into the application as a digital assistant.
Chapter 7, Working with Amazon SageMaker, explores the key capabilities of Amazon SageMaker – from wrangling big data to training and deploying a built-in model (Object2Vec), to identifying the best performing model to bring your own model and container to the SageMaker ecosystem. We illustrate each of the components through the book ratings dataset. First, we predict the rating of a book for a given user; that is, a book that the user has never rated. Second, we automate hyperparameter optimization with SageMaker's HPO capability, while also discovering the best performing model and its corresponding train and test sets through SageMaker search. Third, we illustrate how seamless it is to bring your model and container to SageMaker, avoiding the effort required to rebuild the same model in SageMaker. By the end of this chapter, you will know how to leverage all the key features of Amazon SageMaker.
Chapter 8, Creating Machine Learning Inference Pipelines, walks you through how SageMaker and other AWS services can be employed to create machine learning pipelines that can process big data, train algorithms, deploy trained models, and run inferences—all while using the same logic for data processing during model training and inference.
Chapter 9, Discovering Topics in Text Collection, introduces a new topic. In all the preceding NLP chapters, you learned how to use several NLP services offered by Amazon. In order to have fine-grained control over the model training and deployment, and to build models for scale, we'll use algorithms in Amazon SageMaker.
Chapter 10, Classifying Images Using Amazon SageMaker, follows on from what you have learned about Amazon Rekognition. Here, you'll learn how to classify your own images beyond the predetermined images classified by the Rekognition API. In particular, we will focus on labeling our own image dataset and using SageMaker's image classification algorithm to detect custom images. We will learn how to conduct transfer learning from ResNet50, a pretrained deep residual learning model trained on ImageNet (an image database organized by nouns and supported by Stanford University and Princeton University).
Chapter 11, Sales Forecasting with Deep Learning and Autoregression, explains how deep learning and autoregression (DeepAR) can be used for sales forecasting. In particular, a thorough understanding will be gained of Long Short Term Memory (LSTM), a form of Recurrent Neural Networks (RNNs). RNNs are networks with loops, allowing information to persist, connecting previous information to the present task. Autoregression uses observations from previous time steps as input to the regression equation to predict the value at the next time step. By the end of this chapter, you will have built a robust sales forecasting model with Amazon SageMaker.
Chapter 12, Model Accuracy Degradation and Feedback Loops, explains why models degrade in production. To illustrate this, we discuss how to predict ad-click conversion for mobile apps. As new data becomes available, it is important to retrain models to achieve optimal production performance.
Chapter 13, What Is Next?, summarizes the concepts that we have learned so far. Additionally, we will briefly discuss the AI frameworks and infrastructures that AWS offers.
To get the most out of this book
A basic understanding of machine learning and AWS concepts is expected.
Download the example code files
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at www.packt.com.
Select the Support tab.
Click on Code Downloads.
Enter the name of the book in the Search box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Artificial-Intelligence-on-Amazon-Web-Services. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781789534146_ColorImages.pdf.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: Let's create a directory for the project and name it ObjectDetectionDemo.
A block of code is set as follows:
{
Image
: {
Bytes
: ...
}
}
Any command-line input or output is written as follows:
$ brew install python3
$ brew install pip3
Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The capability is built using deep learning techniques such as automatic speech recognition (ASR) and natural language understanding (NLU) in order to convert speech into text and to recognize intents within text."
Warnings or important notes appear like this.
Tips and tricks appear like this.
Get in touch
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
Section 1: Introduction and Anatomy of a Modern AI Application
This section aims to introduce artificial intelligence (AI) and provide an overview of AI capabilities offered by Amazon Web Services (AWS). It will provide a step-by-step setup for AI development on AWS, including the AWS Software Development Kit (SDK) and Python development toolset. Additionally, it will give an introduction to the components and architecture of a modern AI application.
This section comprises the following chapters:
Chapter 1, Introduction to Artificial Intelligence on Amazon Web Services
Chapter 2, Anatomy of a Modern AI Application
Introduction to Artificial Intelligence on Amazon Web Services
In this chapter, we will start with a high-level overview of artificial intelligence (AI), including its history and the broad set of methods that it uses. Then, we will take a look at a few applications of AI that have the potential to profoundly change our world. With growing interests in AI, many companies, including Amazon, are offering a plethora of tools and services to help developers create intelligent-enabled applications. We will provide a high-level overview of AI offerings from Amazon Web Services, and we will also provide our guidance on how to best leverage them. Being a hands-on book, we will quickly dive into intelligent-enabled application development with Amazon Web Services.
We will cover the following topics:
Overview of AI and its applications.
Understanding the different types of Amazon Web Services offerings for AI.
How to set up an Amazon Web Servicesaccount and the environment for intelligent-enabled application development.
Get hands-on experience with Amazon Rekognition and other supporting services.
Develop our first intelligent-enabled application.
Technical requirements
This book's GitHub repository, which contains the source code for this chapter, can be found at https://github.com/PacktPublishing/Hands-On-Artificial-Intelligence-on-Amazon-Web-Services.
What is AI?
AI is an umbrella term that describes a branch of computer science that aims to create intelligent agents. The field of AI is highly technical and specialized; there is a broad set of theories, methods, and technologies in AI that allow computers to see (computer vision), to hear (speech recognition), to understand (natural language processing), to speak (text-to-speech), and to think (knowledge reasoning and planning).
It may seem that AI is a buzzword of our current times, but it has existed since the 1950s, when early work on artificial neural networks that mimic led the human brain stirred up excitement for thinking machines. With all the fanfare it receives in the media today, it is hard to believe that this field had to endure two AI winters, where interest in AI research and development dwindled. Today, AI has become popular again, thanks to the increased volume of data, cheaper storage, advancements in algorithms, and an increase in computing power.
One of the most important subfields of AI is machine learning (ML). ML is such a prominent part of AI that these two terms are often used interchangeably today. ML is the most promising set of techniques to achieve AI. These techniques gave us a new way to program computers through self-learning algorithms that can derive knowledge from data. We can train ML models that can look for patterns and draw conclusions like humans would. With these self-learning algorithms, the data itself has become the most valuable asset. Data has become the competitive advantage in industries; it is the new intellectual property. Between similar ML techniques (even inferior ML techniques), the best data will win.
What's old is