Creating blueprints for images - Amazon Bedrock

Creating blueprints for images

Amazon Bedrock Data Automation (BDA) allows you to create custom blueprints for image modalities. You can use blueprints to define the desired output format and extraction logic for your input files. By creating custom blueprints, you can tailor BDA's output to meet your specific requirements. Within one project, you can apply a single image blueprint.

Defining data fields for images

BDA allows you to define the specific fields you want to identify from your images by creating a blueprint. This acts as a set of instructions that guide BDA on what information to extract and generate from your images.

Defining Fields

To get started, you can create a field to identify the information you want to extract or generate, such as product_type. For each field, you need to provide a description, data type, and inference type.

To define a field, you need to specify the following parameters:

  • Description: Provides a natural language explanation of what the field represents. This description helps in understanding the context and purpose of the field, aiding in the accurate extraction of data.

  • Type: Specifies the data type of the field's value. BDA supports the following types:

    • string: For text-based values

    • number: For numerical values

    • boolean: For true or false values

    • array: For fields that can have multiple values of the same type (e.g., an array of strings or an array of numbers)

  • Inference Type: Instructs BDA on how to handle the response generation of the field's value. For images, BDA only support inferred inference type. This means that BDA infers the field value based on the information present in the image.

The following image shows "Add fields" module in the Amazon Bedrock console with the following example fields and values:

  • Field name: product_type

  • Type: String

  • Instruction: What is the primary product or service being advertised, e.g., Clothing, Electronics, Food & Beverage, etc.?

  • Extractions type: Inferred.

Amazon Bedrock UI showing drop down menus and text field to specify image fields.

Here is an example of what that same field definition looks like in a JSON schema, for the API:

"product_type":{ "type": "string", "inferenceType": "inferred", "description": "What is the primary product or service being advertised, e.g., Clothing, Electronics, Food & Beverage, etc.?" }

In this example:

  • The type is set to string, indicating that the value of the product_type field should be text-based.

  • The inferenceType is set to inferred, instructing BDA to infer the value based on the information present in the image.

  • The description provides additional context, clarifying that the field should identify the product type in the image. Example values for product_type field are: clothing, electronics, and food or beverage.

By specifying these parameters for each field, you provide BDA with the necessary information to accurately extract and generate insights from your images.

Blueprint fields examples for advertisement images

Here are some examples of blueprint fields to analyze advertisement images.

Field Instruction Extraction Type Type
product_type What is the primary product or service being advertised? Ex: Clothing, Electronics, Food & Beverage inferred string
product_placement How is the product placed in the advertisement image, e.g., centered, in the background, held by a person, etc.? inferred string
product_size Product size is small if size is less than 30% of the image, medium if it is between 30 to 60%, and large if it is larger than 60% of the image inferred string
image_style Classify the image style of the ad. For example, product image, lifestyle, portrait, retro, infographic, none of the above. inferred string
image_background Background can be" solid color, natural landscape, indoor, outdoor, or abstract. inferred string
image_sentiment Extract the mood of the image, which can be one of 'Positive', 'Negative', 'Neutral' inferred string
promotional_offer Does the advertisement include any discounts, offers, or promotional messages? inferred boolean

Examples of blueprint fields for media search

Here are some examples of blueprint fields to generate metadata from images for media search.

Field Instruction Extraction Type Type
person_counting How many people are in the image? inferred number
indoor_outdoor_classification Is the image indoor or outdoor? inferred string
scene_classification Classify the setting or environment of the image. Ex: Urban, Rural, Natural, Historical, Residential, Commercial, Recreational, Public Spaces inferred string
animal_identification Does the image contain any animals? inferred boolean
animal_type What type of animals are present in the image? inferred string
color_identification Is the image in color or black and white? inferred string
vehicle_identification Is there any vehicle visible in the image? inferred string
vehicle_type What type of vehicle is present in the image? inferred string
watermark_identification Is there any watermark visible in the image? inferred boolean