Reader small image

You're reading from  The Self-Taught Cloud Computing Engineer

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781805123705
Edition1st Edition
Right arrow
Author (1)
Dr. Logan Song
Dr. Logan Song
author image
Dr. Logan Song

Dr. Logan Song is the enterprise cloud director and chief cloud architect at Dito. With 25+ years of professional experience, Dr. Song is highly skilled in enterprise information technologies, specializing in cloud computing and machine learning. He is a Google Cloud-certified professional solution architect and machine learning engineer, an AWS-certified professional solution architect and machine learning specialist, and a Microsoft-certified Azure solution architect expert. Dr. Song holds a Ph.D. in industrial engineering, an MS in computer science, and an ME in management engineering. Currently, he is also an adjunct professor at the University of Texas at Dallas, teaching cloud computing and machine learning courses.
Read more about Dr. Logan Song

Right arrow

Amazon Machine Learning Services

We discussed cloud databases and big data analytics in previous chapters. Part of the data analytics spectrum, machine learning (ML) involves building models or algorithms that enable computers to analyze and learn from data, identify patterns, relationships, and trends that can be used to make predictions or decisions.

Cloud-based ML platforms provide a range of tools and services to support ML workflows of data preparation, feature engineering, model training, tuning, and deployment. Cloud ML can be used for computer vision, natural language processing (NLP), and many other predictive analytics tasks. The Amazon cloud provides platforms for engineers and data scientists to develop ML models from end to end. In this chapter, we will discuss the following topics:

  • ML basics: What is ML? What are the objectives of ML? What problems can be solved using ML? What are some basic ML problems?
  • Amazon SageMaker: A fully managed AWS ML service...

ML basics and ML pipelines

What is ML? ML is a subfield of artificial intelligence (AI) that focuses on building models and algorithms to learn patterns and relationships from data and make predictions or decisions. A typical ML project involves the following process – the so-called ML pipeline:

  • Problem framing: Define ML problems from business projects
  • Data collection: Collect data from various sources, which may involve data labeling
  • Data evaluation: Examine the data using statistical tools
  • Feature engineering: Select and extract model features and targets
  • Model training: Train the model with the training dataset
  • Model verification: Verify the model with the verification dataset
  • Model testing: Test the model with the testing dataset
  • Model deployment: Deploy the ML model to production

Figure 6.1 shows the ML pipeline, which is an iterative process to collect data and develop ML models for deployment:

Figure 6.1 – ML pipeline

Figure...

Amazon SageMaker

Amazon SageMaker provides a fully managed cloud platform for users to develop ML models from end to end. Some of the key features of Amazon SageMaker are as follows:

  • Data preparation: Amazon SageMaker provides various tools to preprocess and prepare data
  • Model training algorithms: SageMaker provides built-in algorithms for supervised learning, unsupervised learning, and reinforcement learning
  • Model deployment: After the ML model is trained and validated, SageMaker provides tools for model deployment, either as a batch transform job or a real-time endpoint
  • Scalability: SageMaker is a fully managed service, which means that AWS takes care of all the infrastructure and scaling, so the data scientists can focus on building better models rather than worrying about infrastructure
  • Integration: SageMaker integrates with other AWS services, such as S3, AWS Glue, and AWS Lambda, so data scientists can easily access and use datasets stored in AWS
...

DL basics

DL was introduced in 2012. The basic idea is to mimic the human brain and construct artificial neural networks (ANNs) to train models. A typical multi-layer ANN has three types of layers: an input layer, one or more hidden layers, and an output layer. Figure 6.15 shows an ANN that has one input layer, two hidden layers, and an output layer. In the ANN, a circular node represents a perceptron, and a line represents the connection from the output of one perceptron to the input of another.

Figure 6.15 – A multi-layer ANN

Figure 6.15 – A multi-layer ANN

The objective of DL model training is the same as ML: minimize the loss function, which is defined as the gap between the model’s predicted value and the actual value. Different from traditional ML algorithms, DL uses the activation function to add nonlinearity to the model training process.

In a typical DL model, we define the following to construct a neural network:

  • The layers of the model (input layer...

Amazon computer vision solutions

Computer vision is the automated extraction of information from digital images. To solve computer vision problems, Amazon provides Rekognition – a fully managed service using DL to analyze images and videos. Here are some key features of Amazon Rekognition:

  • Object and scene detection: Rekognition can identify objects and scenes within an image or video frame, including vehicles, buildings, animals, and landscapes.
  • Facial analysis and facial comparison: Rekognition can detect faces in images and videos and perform facial analysis, including facial recognition, gender identification, age estimation, and facial expression analysis. It can compare and match faces from different images.
  • Text detection: Rekognition can detect and extract text in images and videos, including printed and handwritten text.
  • Custom labels: Rekognition also allows you to create custom labels for specific objects or scenes that are important to your business...

Amazon’s NLP solutions

Amazon offers a range of NLP solutions:

  • Amazon Comprehend, which is a service to perform sentiment analysis, entity recognition, and topic modeling on large volumes of unstructured text
  • Amazon Transcribe, which converts speech to text and supports multiple languages and a variety of audio formats
  • Amazon Polly, which is a text-to-speech service
  • Amazon Translate, which provides high-quality translations for a variety of languages
  • Amazon Lex, which is a service for building chatbots and conversational interfaces

Amazon Comprehend

Amazon Comprehend uses DL algorithms to analyze and understand text data in multiple languages. Amazon Comprehend can perform the following functions:

  • Language detection: Automatically detect the language of the text data, which is useful in multilingual applications
  • Sentiment analysis: Determine the sentiment of text data: positive, negative, or neutral
  • Entity recognition: Identify...

Summary

In this chapter, we have discussed AWS ML services. We started by introducing ML concepts and the ML pipeline, then dove into Amazon SageMaker, which provides fully managed end-to-end ML services. We then introduce DL concepts and examined the AWS computer vision and NLP solutions using DL pretrained models.

So far, we have explored AWS cloud services such as compute, storage, networking, databases, big data, and ML. In the next chapter, we will discuss another important cloud topic: Amazon cloud security.

Practice questions

Questions 1-4 are based on the following use case.

ML case #1

An engineer is training an Amazon SageMaker model to detect as many true malignant tumors (MTs) from MRI images as possible. The model features are shown in Figure 6.18.

Figure 6.18 – Model features: x and y

Figure 6.18 – Model features: x and y

The initial models were underfitting, so they put in a lot of effort and finally got two models working. Their confusion matrixes are shown in Figure 6.19:

Figure 6.19 – Confusion matrixes for models A and B

Figure 6.19 – Confusion matrixes for models A and B

1. How should they synthesize the two features, x and y?

A. x*x + y*y

B. x+y

C. x*y

D. x*10 + y*10

2. What is the precision for model B?

A. 74%

B. 84%

C. 18%

D. 50%

3. What may have helped them improve the initial model?

A. Add more features to the model

B. Add L1 regularization

C. Add L2 regularization

D. Increase the learning rate

4. Which of the following statements is...

Answers to the practice questions

1. C

2. A

3. A

4. A

5. D

6. D

7. A

8. B

9. A

10. D

11. A

12. D

13. A

14. C

15. B

lock icon
The rest of the chapter is locked
You have been reading a chapter from
The Self-Taught Cloud Computing Engineer
Published in: Sep 2023Publisher: PacktISBN-13: 9781805123705
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Dr. Logan Song

Dr. Logan Song is the enterprise cloud director and chief cloud architect at Dito. With 25+ years of professional experience, Dr. Song is highly skilled in enterprise information technologies, specializing in cloud computing and machine learning. He is a Google Cloud-certified professional solution architect and machine learning engineer, an AWS-certified professional solution architect and machine learning specialist, and a Microsoft-certified Azure solution architect expert. Dr. Song holds a Ph.D. in industrial engineering, an MS in computer science, and an ME in management engineering. Currently, he is also an adjunct professor at the University of Texas at Dallas, teaching cloud computing and machine learning courses.
Read more about Dr. Logan Song