Image embedding

Updated at:

The Image Embedding operator converts images from an input dataset into normalized vector representations. This topic describes how to configure the Image Embedding operator.

Prerequisites

  • You must purchase the unstructured data feature for your instance to use workflows.

  • A workflow has been created. For more information, see Create and manage a workflow.

Permissions

In a Basic project, project administrators, developers, analysts, and custom project roles with the Dataset - Use permission can use any dataset within the project as an input or output for the operator.

Supported file formats

The Image Embedding operator supports the jpg and png image formats.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Develop > Data Development.

  2. In the top navigation bar of the Develop page, select a project.

  3. In the left-side navigation pane, choose Data Processing > Workflow. In the Workflow list, click the target workflow to open its canvas. From the Operator Library on the left, drag the Image Embedding operator onto the canvas. In the Image Embedding pane on the right, configure the following parameters.

    Parameter

    Description

    Step name

    The name of the operator. It can contain any characters and be up to 256 characters long.

    Input configuration

    Dataset

    Select the dataset to process. You can select a hybrid dataset. After you select a dataset, you must also select a version. By default, the first version in ascending order is selected.

    If this operator follows another, its input dataset is typically the output of the upstream operator.

    Input field

    The storage URL of the input image. You must select a source field from the input dataset. You can select only fields for which the Is URL parameter is set to Yes.

    Filter (Optional)

    Enter a SQL WHERE clause to filter the input data. You can use global system variables, such as ${bizdate} for the business date.

    Model configuration

    Model

    This parameter is automatically set based on the output field's vector configuration and cannot be changed.

    Note

    Vector dimension (Optional)

    The model converts an image into a high-dimensional vector. Each dimension captures a specific aspect of the image. This parameter is automatically set based on the output field's vector configuration and cannot be changed.

    Output configuration

    Dataset

    You can select the source dataset or another dataset. If the source dataset's metadata table lacks a primary key, another dataset is used for the output by default.

    • If you select another dataset, you must also specify a hybrid dataset and its version as the output dataset. By default, the first version in ascending order is selected. You can also select a different version of the source dataset.

    • If you select the source dataset, the operator writes the generated metadata to the metadata table of the same source dataset version.

    Loading policy

    If the metadata table of the selected output dataset has a primary key, update on primary key conflict is selected by default. Otherwise, append data is selected by default.

    • Append data: Appends new data to the target table. An error is reported if a primary key or constraint conflict occurs.

    • Update on primary key conflict: If a primary key or constraint conflict occurs, the existing row with the same primary key is deleted before the new data is inserted.

    • Overwrite: Deletes all data from the target table before writing the new data.

    Note

    If you select source dataset as the output dataset, only the update on primary key conflict loading policy is supported.

    Field mapping

    The Image Embedding operator has one fixed output field:

    vector_result: The vectorized result (floating-point vector).

    By default, the operator's output field is mapped to the field of the same name in the output dataset. You can also manually select a target field for a custom mapping. In addition, you can map pass-through fields from the source dataset to the target dataset. Manage field mappings using the following options:

    • Add Output Field: Adds a new, empty row for field mapping. This feature is available only when you select another dataset as the output dataset.

    • Batch Mapping: Allows you to perform batch manual mapping, map by name, or map by position. This feature is available only when you select another dataset as the output dataset.

    • Delete Mapping: Click the Delete icon to remove the field mapping for that row. You cannot delete the mapping for the operator's fixed output field.

  4. After you complete the configuration, click Save in the top menu bar of the canvas.

    After configuring the operator, connect it to upstream or downstream operators to build a complete workflow.