Computer Vision on AWS

Book description

Develop scalable computer vision solutions for real-world business problems and discover scaling, cost reduction, security, and bias mitigation best practices with AWS AI/ML services Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Learn how to quickly deploy and automate end-to-end CV pipelines on AWS
  • Implement design principles to mitigate bias and scale production of CV workloads
  • Work with code examples to master CV concepts using AWS AI/ML services

Book Description

Computer vision (CV) is a field of artificial intelligence that helps transform visual data into actionable insights to solve a wide range of business challenges. This book provides prescriptive guidance to anyone looking to learn how to approach CV problems for quickly building and deploying production-ready models.

You’ll begin by exploring the applications of CV and the features of Amazon Rekognition and Amazon Lookout for Vision. The book will then walk you through real-world use cases such as identity verification, real-time video analysis, content moderation, and detecting manufacturing defects that’ll enable you to understand how to implement AWS AI/ML services. As you make progress, you'll also use Amazon SageMaker for data annotation, training, and deploying CV models. In the concluding chapters, you'll work with practical code examples, and discover best practices and design principles for scaling, reducing cost, improving the security posture, and mitigating bias of CV workloads.

By the end of this AWS book, you'll be able to accelerate your business outcomes by building and implementing CV into your production environments with the help of AWS AI/ML services.

What you will learn

  • Apply CV across industries, including e-commerce, logistics, and media
  • Build custom image classifiers with Amazon Rekognition Custom Labels
  • Create automated end-to-end CV workflows on AWS
  • Detect product defects on edge devices using Amazon Lookout for Vision
  • Build, deploy, and monitor CV models using Amazon SageMaker
  • Discover best practices for designing and evaluating CV workloads
  • Develop an AI governance strategy across the entire machine learning life cycle

Who this book is for

If you are a machine learning engineer or data scientist looking to discover best practices and learn how to build comprehensive CV solutions on AWS, this book is for you. Knowledge of AWS basics is required to grasp the concepts covered in this book more effectively. A solid understanding of machine learning concepts and the Python programming language will also be beneficial.

Table of contents

  1. Computer Vision on AWS
  2. Contributors
  3. About the authors
  4. About the reviewer
  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: Introduction to CV on AWS and Amazon Rekognition
  7. Chapter 1: Computer Vision Applications and AWS AI/ML Services Overview
    1. Technical requirements
    2. Understanding CV
      1. CV architecture and applications
      2. Data processing and feature engineering
      3. Data labeling
    3. Solving business challenges with CV
      1. Contactless check-in and checkout
      2. Video analysis
      3. Content moderation
      4. CV at the edge
    4. Exploring AWS AI/ML services
      1. AWS AI services
      2. Amazon SageMaker
    5. Setting up your AWS environment
      1. Creating an Amazon SageMaker Jupyter notebook instance
    6. Summary
  8. Chapter 2: Interacting with Amazon Rekognition
    1. Technical requirements
    2. The Amazon Rekognition console
      1. Using the Label detection demo
      2. Examining the API request
      3. Examining the API response
      4. Other demos
      5. Monitoring Amazon Rekognition
      6. Quick recap
    3. Detecting Labels using the API
      1. Uploading the images to S3
      2. Initializing the boto3 client
      3. Detect the Labels
      4. Using the Label information
      5. Using bounding boxes
      6. Quick recap
    4. Cleanup
    5. Summary
  9. Chapter 3: Creating Custom Models with Amazon Rekognition Custom Labels
    1. Technical requirements
    2. Introducing Amazon Rekognition Custom Labels
      1. Benefits of Amazon Rekognition Custom Labels
    3. Creating a model using Rekognition Custom Labels
      1. Deciding the model type based on your business goal
      2. Creating a model
      3. Improving the model
      4. Starting your model
      5. Analyzing an image
      6. Stopping your model
    4. Building a model to identify Packt’s logo
      1. Step 1 – Collecting your images
      2. Step 2 – Creating a project
      3. Step 3 – Creating training and test datasets
      4. Step 4 – Adding labels to the project
      5. Step 5 – Drawing bounding boxes on your training and test datasets
      6. Step 6 – Training your model
    5. Validating that the model works
      1. Step 1 – Starting your model
      2. Step 2 – Analyzing an image with your model
      3. Step 3 – Stopping your model
    6. Summary
  10. Part 2: Applying CV to Real-World Use Cases
  11. Chapter 4: Using Identity Verification to Build a Contactless Hotel Check-In System
    1. Technical requirements
    2. Prerequisites
      1. Creating the image bucket
      2. Uploading the sample images
      3. Creating the profile table
    3. Introducing collections
      1. Creating a collection
      2. Describing a collection
      3. Deleting a collection
      4. Quick recap
    4. Describing the user journeys
      1. Registering a new user
      2. Authenticating a user
      3. Registering a new user with an ID card
      4. Updating the user profile
    5. Implementing the solution
      1. Checking image quality
      2. Indexing face information
      3. Search existing faces
      4. Quick recap
    6. Supporting ID cards
      1. Reading an ID card
      2. Using the CompareFaces API
      3. Quick recap
    7. Guidance for identity verification on AWS
      1. Solution overview
      2. Deployment process
      3. Cleanup
    8. Summary
  12. Chapter 5: Automating a Video Analysis Pipeline
    1. Technical requirements
      1. Creating the video bucket
      2. Uploading content to Amazon S3
      3. Creating the person-tracking topic
      4. Subscribing a message queue to the person-tracking topic
      5. Creating the person-tracking publishing role
      6. Setting up IP cameras
      7. Quick recap
    2. Using IP cameras
      1. Installing OpenCV
      2. Installing additional modules
      3. Connecting with OpenCV
      4. Viewing the frame
      5. Uploading the frame
      6. Reporting frame metrics
      7. Quick recap
    3. Using the PersonTracking API
      1. Uploading the video to Amazon S3
      2. Using the StartPersonTracking API
      3. Receiving the completion notification
      4. Using the GetPersonTracking API
      5. Reviewing the GetPersonTracking response
      6. Viewing the frame
      7. Quick recap
    4. Summary
  13. Chapter 6: Moderating Content with AWS AI Services
    1. Technical requirements
    2. Moderating images
      1. Using the DetectModerationLabels API
      2. Using top-level categories
      3. Using secondary-level categories
      4. Putting it together
      5. Quick recap
    3. Moderating videos
      1. Creating the supporting resources
      2. Finding the resource ARNs
      3. Uploading the sample video to Amazon S3
      4. Using the StartContentModeration API
      5. Examining the completion notification
      6. Using the GetContentModeration API
      7. Quick recap
    4. Using AWS Lambda to automate the workflow
      1. Implement the Start Analysis Handler
      2. Implementing the Get Results Handler
      3. Publishing function changes
      4. Experiment with the end-to-end
    5. Summary
  14. Part 3: CV at the edge
  15. Chapter 7: Introducing Amazon Lookout for Vision
    1. Technical requirements
    2. Introducing Amazon Lookout for Vision
      1. The benefits of Amazon Lookout for Vision
    3. Creating a model using Amazon Lookout for Vision
      1. Choosing the model type based on your business goals
      2. Creating a model
      3. Starting your model
      4. Analyzing an image
      5. Stopping your model
    4. Building a model to identify damaged pills
      1. Step 1 – collecting your images
      2. Step 2 – creating a project
      3. Step 3 – creating the training and test datasets
      4. Step 4 – verifying the dataset
      5. Step 5 – training your model
    5. Validating it works
      1. Step 1 – trial detection
      2. Step 2 – starting your model
      3. Step 3 – analyzing an image with your model
      4. Step 4 – stopping your model
    6. Summary
  16. Chapter 8: Detecting Manufacturing Defects Using CV at the Edge
    1. Technical requirements
    2. Understanding ML at the edge
    3. Deploying a model at the edge using Lookout for Vision and AWS IoT Greengrass
      1. Step 1 – Launch an Amazon EC2 instance
      2. Step 2 – Create an IAM role and attach it to an EC2 instance
      3. Step 3 – Install AWS IoT Greengrass V2
      4. Step 4 – Upload training and test datasets to S3
      5. Step 5 – Create a project
      6. Step 6 – Create training and test datasets
      7. Step 7 – Train the model
      8. Step 8 – Package the model
      9. Step 9 – Configure IoT Greengrass IAM permissions
      10. Step 10 – Deploy the model
      11. Step 11 – Run inference on the model
      12. Step 12 – Clean up resources
    4. Summary
  17. Part 4: Building CV Solutions with Amazon SageMaker
  18. Chapter 9: Labeling Data with Amazon SageMaker Ground Truth
    1. Technical requirements
    2. Introducing Amazon SageMaker Ground Truth
      1. Benefits of Amazon SageMaker Ground Truth
      2. Automated data labeling
    3. Labeling Packt logos in images using Amazon SageMaker Ground Truth
      1. Step 1 – collect your images
      2. Step 2 – create a labeling job
      3. Step 3 – specify the job details
      4. Step 4 – specify worker details
      5. Step 5 – providing labeling instructions
      6. Step 6 – start labeling
      7. Step 7 – output data
    4. Importing the labeled data with Rekognition Custom Labels
      1. Step 1 – create the project
      2. Step 2 – create training and test datasets
      3. Step 3 – model training
    5. Summary
  19. Chapter 10: Using Amazon SageMaker for Computer Vision
    1. Technical requirements
      1. Fetching the LabelMe-12 dataset
      2. Installing TensorFlow 2.0
      3. Installing matplotlib
    2. Using the built-in image classifier
      1. Upload the dataset to Amazon S3
      2. Prepare the job channels
      3. Start the training job
      4. Monitoring and troubleshooting
      5. Quick recap
    3. Handling binary metadata files
      1. Declaring the Label class
      2. Reading the annotations file
      3. Declaring the Annotation class
      4. Validate parsing the file
      5. Restructure the files
      6. Load the dataset
      7. Quick recap
    4. Summary
  20. Part 5: Best Practices for Production-Ready CV Workloads
  21. Chapter 11: Integrating Human-in-the-Loop with Amazon Augmented AI (A2I)
    1. Technical requirements
    2. Introducing Amazon A2I
      1. Core concepts of Amazon A2I
    3. Learning how to build a human review workflow
      1. Creating a labeling workforce
      2. Setting up an A2I human review workflow or flow definition
      3. Initiating a human loop
    4. Leveraging Amazon A2I with Amazon Rekognition to review images
      1. Step 1 – Collecting your images
      2. Step 2 – Creating a work team
      3. Step 3 – Creating a human review workflow
      4. Step 4 – Starting a human loop
      5. Step 5 – Checking the human loop status
      6. Step 6 – Reviewing the output data
    5. Summary
  22. Chapter 12: Best Practices for Designing an End-to-End CV Pipeline
    1. Defining a problem that CV can solve and processing data
    2. Developing a CV model
      1. Training
      2. Evaluating
      3. Tuning
    3. Deploying and monitoring a CV model
      1. Shadow testing
      2. A/B testing
      3. Blue/Green deployment strategy
      4. Monitoring
    4. Developing an MLOps strategy
      1. SageMaker MLOps features
      2. Workflow automation tools
    5. Using the AWS Well-Architected Framework
      1. Cost optimization
      2. Operational excellence
      3. Reliability
      4. Performance efficiency
      5. Security
      6. Sustainability
    6. Summary
  23. Chapter 13: Applying AI Governance in CV
    1. Understanding AI governance
      1. Defining risks, documentation, and compliance
      2. Data risks and detecting bias
      3. Auditing, traceability, and versioning
      4. Monitoring and visibility
      5. MLOps
      6. Responsibilities of business stakeholders
    2. Applying AI governance in CV
      1. Types of biases
      2. Mitigating bias in identity verification workflows
    3. Using Amazon SageMaker for governance
      1. ML governance capabilities with Amazon SageMaker
      2. Amazon SageMaker Clarify for explainable AI
    4. Summary
  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: Computer Vision on AWS
  • Author(s): Lauren Mullennex, Nate Bachmeier, Jay Rao
  • Release date: March 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781801078689