Use Amazon Augmented AI with Amazon Rekognition - Amazon SageMaker

Use Amazon Augmented AI with Amazon Rekognition

Amazon Rekognition makes it easy to add image analysis to your applications. The Amazon Rekognition DetectModerationLabelsAPI operation is directly integrated with Amazon A2I so that you can easily create a human loop to review unsafe images, such as explicit adult or violent content. You can use DetectModerationLabels to configure a human loop using a flow definition ARN. This enables Amazon A2I to analyze predictions made by Amazon Rekognition and sent results to a human for review they meet the conditions set in your flow definition.

You can set the following activation conditions when using the Amazon Rekognition task type:

  • Trigger human review for labels identified by Amazon Rekognition based on the label confidence score.

  • Randomly send a sample of images to humans for review.

You can set these activation conditions using the Amazon SageMaker console when you create a human review workflow, or by creating a JSON for human loop activation conditions and specifying this as input in the HumanLoopActivationConditions parameter of CreateFlowDefinition API operation. To learn how specify activation conditions in JSON format, see JSON Schema for Human Loop Activation Conditions in Amazon Augmented AI and Use Human Loop Activation Conditions JSON Schema with Amazon Rekognition.


When using Augmented AI with Amazon Rekognition, create Augmented AI resources in the same AWS Region you use to call DetectModerationLabels.

Get Started: Integrate a Human Review into an Amazon Rekognition Image Moderation Job

To integrate a human review into an Amazon Rekognition, see the following topics:

After you've created your flow definition, see Using Augmented AI with Amazon Rekognition to learn how to integrate your flow definition into your Amazon Rekognition task.

End-to-end Demo Using Amazon Rekognition and Augmented AI

For an end-to-end example that demonstrates how to use Amazon Rekognition with Augmented AI, you can use Amazon Augmented AI (Amazon A2I) integration with Amazon Rekognition [Example] in an Amazon SageMaker Notebook instance.

To use Amazon Textract with Augmented AI using a Amazon SageMaker Notebook

  1. If you do not have an active Amazon SageMaker Notebook instance, create one by following the instructions in Step 2: Create an Amazon SageMaker Notebook Instance.

  2. When your Notebook instance is active, choose Open JupyterLab to the right of the Notebook instance's name. It may take a few moments for JupyterLab to load.

  3. Select the icon to clone a GitHub repository into your workspace.

  4. Enter the amazon-a2i-sample-jupyter-notebooks repository HTTPS URL.

  5. Choose CLONE.

  6. Open the notebook Amazon Augmented AI (Amazon A2I) integration with Amazon Rekognition [Example].

  7. Follow the instructions in the notebook to configure your flow definition and human loop and run the cells.

  8. To avoid incurring unnecessary charges, when you are done with the demo stop and delete your notebook instance in addition to any Amazon S3 buckets, IAM roles, and CloudWatch Events resources created during the walkthrough.

A2I Rekognition Worker Console Preview

When they're assigned a review task in an Amazon Rekognition workflow, workers might see UI similar to the following:

You can customize this interface in the Amazon SageMaker console when you create your human review definition, or by creating and using a custom template. To learn more, see Create a Worker UI.