Skip to content

Commit 7333f60

Browse files
committed
Update README contents
1 parent 4e81a74 commit 7333f60

File tree

11 files changed

+195
-162
lines changed

11 files changed

+195
-162
lines changed

0-Prerequisites/README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
## 0-Prerequsites
1+
## 0 Prerequsites
22

3-
**Supported Regions (January 2021)**
4-
Amazon Rekognition Custom Labels is available in US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), and Asia Pacific (Seoul). [Latest](https://docs.aws.amazon.com/general/latest/gr/rekognition.html)
3+
**Supprted Regions (June 2021)**
4+
[Amazon Rekognition Custom Labels](https://aws.amazon.com/rekognition/custom-labels-features/) is available in US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Europe (Ireland), Europe (London), Europe (Frankfurt), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific (Seoul). [Latest](https://docs.aws.amazon.com/general/latest/gr/rekognition.html).
55

6-
1. Select one of the Rekognition Custom Labels supported regions from above to deploy this demo.
7-
2. Verify Amazon SageMaker Labeling Workforces Setup
8-
As part of the CloudFormation deployment process, we can optionally deploy an **Amazon SageMaker Private Workforce** with an associated **Amazon Cognito User Pool**. However since you can only have one private workforce per region, we cannot deploy over an existing private workforce. To verify whether you have a private workforce already, go to [Amazon SageMaker Label workforces](https://console.aws.amazon.com/sagemaker/groundtruth#/labeling-workforces), select the region that you want to use, and then select the **Private** tab. You should see one of three possible setups below:
9-
- No Private Workforce
6+
- Have an AWS account with [AWS Identity and Access Management](https://aws.amazon.com/iam/) (IAM) permissions to launch the provided [AWS CloudFormation](https://aws.amazon.com/cloudformation/) template.
7+
- Decide on one of the Rekognition Custom Labels supported Regions in which to deploy this solution.
8+
- As part of the CloudFormation deployment process, you can optionally deploy an [Amazon SageMaker Ground Truth](https://aws.amazon.com/sagemaker/groundtruth/) private workforce with an associated [Amazon Cognito](https:///aws.amazon.com/cognito/) user pool. Because you can only have one private workforce per Region, you can’t deploy over an existing private workforce. To verify whether you have a private workforce already, go to the **Labeling workforces** page on the Amazon SageMaker console, choose the Region that you want use, and choose the **Private tab**. You should see three possible setups:
9+
10+
- **No Private workforce** - In this setup, SageMaker deploys a private workforce and a private team for you. When you’re prompted to enter a value for A2IPrivateTeamName in the CloudFormation template, leave it blank.
1011
![No Private Workforce Image](no-private-workforce.png)
11-
When you are prompted to enter a *A2IPrivateTeamName* in the CloudFormation template, leave it blank. We will deploy a private workforce and a private team for you.
1212

13-
- Private Workforce without Private Teams
13+
- **Private workforce without private teams** – In this setup, you need to create a private team first. Choose **Create private team** and follow the instructions to create a team. When you’re prompted to enter a value for A2IPrivateTeamName in the CloudFormation template, enter your newly created private team name.
1414
![Private Workforce Without Team Image](private-workforce-without-teams.png)
15-
Click **Create private team** to create a private team. When you are prompted to enter a *A2IPrivateTeamName* in the CloudFormation template, enter your newly created Private Team name.
1615

17-
- Private Workforce with Private Teams
16+
- **Private workforce with private teams** – In this setup, you can use your existing private team or create a new one. We recommend that you create a new private team. When you’re prompted to enter a value for A2IPrivateTeamName in the CloudFormation template, enter your private team name.
1817
![Private Workforce With Team Image](private-workforce-with-teams.png)
19-
You can use your existing Private Team or create a new one as instructed above. When you are prompted to enter a *A2IPrivateTeamName* in the CloudFormation template, enter your newly created Private Team name.
2018

21-
3. Initialize Rekognition Custom Labels
22-
Before you can use Rekognition Custom Labels you need to initialize it for that region. Go to [Amazon Rekognition Customs Label](https://console.aws.amazon.com/rekognition/custom-labels) and select **Projects** from the menu on the left.
23-
- If you see the Project screen with or without projects, then your region is initialized.
24-
- If you see a message "First time set up", follow the instruction to create the S3 bucket. We won't use the default bucket in this demo but it is part of the required initialization process.
19+
20+
- You need to initialize Rekognition Custom Labels for your selected Region before you can use Rekognition Custom Labels. On the Rekognition Custom Labels console, choose **Projects** in the navigation pane and take one of the following actions:
21+
- If you see the **Projects** page with or without projects, then your Region is initialized.
22+
- If you’re prompted with a message for first-time setup, follow the instructions to create the default [Amazon Simple Storage Service](http://aws.amazon.com/s3) (Amazon S3) bucket. We don’t use the default S3 bucket with this solution, but it’s part of the Rekognition Custom Labels initialization process.
2523

2624
Next Step: [Deployment](../1-Deployment/)

1-Deployment/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
## 1-Deployment
1+
## 1 Deploy the solution resources
22

3-
**Deploy CloudFormation Template**
4-
The provided CloudFormation template deploys the complete architecture.
3+
We show you how to use [AWS CloudFormation](https://console.aws.amazon.com/cloudformation) to deploy the required and optional AWS resources for this solution.
54

6-
1. Go to [AWS CloudFormation](https://console.aws.amazon.com/cloudformation) and select the region from the previous step.
7-
2. Create a new stack with the provided template **rekognition-a2i-automate-workflow.yml**.
8-
3. Click **Next**
9-
4. For **Stack name**, enter a name.
10-
5. For **A2IPrivateTeamName**, leave it blank if you don't have a SageMaker Private Workforce. If you have a SageMaker Private Workforce, enter the Private Team name, not the ARN. Please see previous Step 0-Prerequsites for information.
11-
6. For **SNSEmail**, enter a valid email address for this demo.
12-
7. Click **Next**.
13-
8. On the **Configure stack options** screen, click **Next**.
14-
8. On the **Review** screen, scroll down to accept "I acknowledge that AWS CloudFormation might create IAM resources with custom names."
15-
9. Click **Create stack**
5+
1. Sign in to the [AWS Management Console](https://aws.amazon.com/console/) with your IAM username and password.
6+
2. Go to [AWS CloudFormation](https://console.aws.amazon.com/cloudformation).
7+
3. Choose your **AWS Region** (as noted in the prerequisites).
8+
4. Create a new stack with the provided template ``rekognition-a2i-automate-workflow.yml``.
9+
5. Choose **Next**
10+
6. For **Stack name**, enter a name.
11+
7. For **A2IPrivateTeamName**, leave it blank if you don't have a SageMaker private workforce. If you have a private workforce, enter the private team name, not ARN.
12+
8. For **SNSEmail**, enter a valid email address.
13+
9. Choose **Next**.
14+
10. Choose **Next** on the **Configure stack options** screen.
15+
11. Scroll down to select **I acknowledge that AWS CloudFormation might create IAM resources with custom names** on the **Review** screen.
16+
12. Choose **Create stack**.
1617

17-
**Notes**
18-
- You will receive an email from "AWS Notification - Subscription Confirmation", please click "Confirm subscription" to confirm.
19-
- If we are deploying a Private Team for you from Step. 5, you will receive an email "Your temporary password" with your username and temporary password. You will need that later to perform the A2I human label tasks.
18+
The CloudFormation stack takes about 5 minutes to complete. You should receive an email “AWS Notification - Subscription Confirmation” asking you to confirm a subscription. Choose **Confirm subscription** in the email to confirm the subscription. Additionally, if AWS CloudFormation deployed the private work team for you, you should receive an email “Your temporary password” with a username and temporary password. You need this information later to access the Amazon A2I web UI to perform the human labeling tasks.
2019

2120
Next Step: [2-Parameter-Store](../2-Parameter-Store/)

2-Parameter-Store/README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
## 2-Parameter-Store
1+
## 2 Understanding the parameters
22

3-
**AWS System Manager Parameter Store**
4-
We provide a set of configurable parameters for the **Model Operator** to use to control the MLOps process. Go to [AWS Systems Manager Parameter Store](https://console.aws.amazon.com/systems-manager/parameters). You should see list of parameters similar the ones below.
3+
Because model performance can change over inference results, you need to implement an automated ML workflow that can continuously retrain a model with newly captured and human-labeled images. In addition, you need to consider adding flexibility into the ML workflow to allow for change without requiring development rework as business objectives evolve over time. Developing a customizable ML workflow that behaves similar to a business rule engine requires significant upfront investment, which can be a resource challenge.
54

6-
**Note:** The parameter store uses string to store value regardless of type. Do NOT use comma separator for numeric values.
5+
In this demo, we provide a set of configurable parameters for you to use to customize the ML workflow. Go to [AWS Systems Manager Parameter Store](https://console.aws.amazon.com/systems-manager/parameters). You should see a list of 8 parameters as shown below:
76

8-
- **Automatic-Training-Poll-Frequency**
9-
This is the polling frequency (in integer minutes) on how often the Amazon EventBridge Scheduled Rule is triggered to initiate the check for automatic model training. As you update this value, the value is applied to the rule by a Lambda function.
10-
- **Enable-A2I-Workflow**
11-
This value (true/false) determines whether an A2I Human Loop is created regardless of the confidence level from the custom label detection result.
12-
- **Enable-Automatic-Training**
13-
This value (true/false) determines whether automatic model training is enabled/disabled. When this value is updated to true, a Lambda function enables the EventBride Scheduled Rule. When the value is updated to false, a Lambda function disables the EventBride Scheduled Rule.
14-
- **For-System-Use-Only**
15-
Do NOT modify this value. This is a reserved parameter consisting of environmental variables and operation data. The value is used and updated by Lambda functions.
16-
- **Minimum-Label-Detection-Confidence**
17-
Rekognition Custom Labels returns a Confidence between 0-100 on each detection. The Minimum Confidence (Float 0.00-100.00) determines whether a detection result is acceptable. If the detection Confidence is greater than or equal to the Minimum Confidence, then the detection is accepted. If not, the image is sent to A2I process, provided that Enable-A2I-Workflow is enabled.
18-
- **Minimum-F1-Score**
19-
This value is the minimum F1 Score (Float 0.00-1.00) that evaluate a newly trained model with a status of TRAINING-COMPLETE to accept for deployment. If the F1 Score is greater or equal to the minimum F1 Score, the model will be deployed. If not, the model is marked as failed training.
20-
- **Minimum-Inference-Units**
21-
This value (Int), with a minimum of 1, inference unit to use for the running Rekognition Customs Label model. A single inference unit represents 1 hour of processing and can support up to 5 Transaction Pers Second (TPS). Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.
22-
- **Minimum-Untrained-Images**
23-
The value (Int) represents the minimum number of untrained or newly added images that will qualify the state machine to start a new model training process on the scheduled polled event. At the instance the polled event is triggered, a Lambda function first determines the total number of training images in the designated S3 folder. Next it retrieves the value "previous_trained_images" from the parameter "For-System-Use-Only". If the difference between the total number of images in S3 and the previous_trained_images is greater than or equal to minimum untrained images, then it will trigger a new model training. On a successful training, a Lambda updates the previous_trained_images with the current total number of images trained.
7+
- **Automatic-Training-Poll-Frequency** - This is the polling frequency (in integer minutes) on how often the [Amazon EventBridge](https://aws.amazon.com/eventbridge/) Schedule rule is triggered to initiate the check for automatic model training. As you update this value, the value is applied to the rule by an [AWS Lambda](http://aws.amazon.com/lambda) function.
8+
- **Enable-A2I-Workflow** - This value (`true/false`) determines whether an [Amazon SageMaker](https://docs.aws.amazon.com/sagemaker/latest/dg/a2i-start-human-loop.html) Human Loop is created when the inference confidence level from the [Amazon Rekognition Custom Labels](https://aws.amazon.com/rekognition/custom-labels-features/) detection result is less than the [minimum confidence](https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/detecting-custom-labels.html) as set in the **Minimum-Label-Detection-Confidence** parameter.
9+
- **Enable-Automatic-Training** - This value (`true/false`) determines whether automatic model training is `enabled/disabled`. When this value is updated to `true`, a Lambda function enables the EventBride Schedule rule. When the value is updated to `false`, a Lambda function disables the EventBride Schedule rule.
10+
- **For-System-Use-Only** - Do **NOT** modify this value. This is a reserved parameter consisting of environmental variables and operation data. The value is used and updated by Lambda functions.
11+
- **Minimum-Label-Detection-Confidence** - Rekognition Custom Labels returns a **Confidence** between 0-100 on each detection. The **Minimum Confidence** (Float 0.00-100.00) determines whether a detection result is acceptable. If the detection **Confidence** is greater than or equal to the **Minimum Confidence**, then the detection is accepted. If not, the image is sent to [Amazon Augmented AI](https://aws.amazon.com/augmented-ai/) (Amazon A2I) human labeling process, provided that **Enable-A2I-Workflow** is `enabled`.
12+
- **Minimum-F1-Score** - This value is the minimum [F1 score](https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/gs-step-evaluate-model.html) (Float 0.00-1.00) that determines whether a newly trained model is acceptable for deployment. If the **F1 score** of the trained Model is greater or equal to the **Minimum-F1-Score** value, the model will be deployed. If not, the model is marked as failed training.
13+
- **Minimum-Inference-Units** - This value (Int), with a minimum of `1`, is number of [inference unit](https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/rm-run-model.html) to use for the running Rekognition Customs Label model. A single inference unit represents 1 hour of processing and can support up to 5 Transaction Pers Second (TPS). Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.
14+
- **Minimum-Untrained-Images** - This value (Int) represents the minimum number of untrained or newly added images that will qualify the state machine to start a new model training process. At the instance the polled event is triggered, a Lambda function first determines the total number of training images in the designated S3 folder. Next it retrieves the value `previous_trained_images` from the parameter **For-System-Use-Only**. If the difference between the total number of images in S3 and the previous_trained_images is greater than or equal to minimum untrained images, then it will trigger a new model training. On a successful training, a Lambda function updates the `previous_trained_images` with the current total number of images trained.
15+
16+
17+
**Note:** The Parameter store uses string to store value regardless of type. Do **NOT** use comma separator for numeric values.
2418

2519
Next Step: [3-Model-Training](../3-Model-Training/)

0 commit comments

Comments
 (0)