By default, Content Moderation provides the moderation service by using the global risky image library of Alibaba Cloud. This library can meet most moderation needs. To meet specific business needs, Content Moderation also supports custom image libraries. You can manage images to be blocked, passed, and reviewed in different custom image libraries to meet specific management requirements.

Background information

Custom image libraries can be divided into blacklists, whitelists, and review lists based on the purposes. If custom image libraries are used for moderation, the images to be moderated that hit samples in custom image libraries are tagged with the corresponding category of moderation results. The moderation result for images that hit samples in blacklists is block. The moderation result for images that hit samples in whitelists is pass. The moderation result for images that hit samples in review lists is review. Custom image libraries include feedback-based image libraries and self-managed image libraries:
  • Feedback-based image libraries are automatically created to accommodate the images that are reviewed. By default, you can use feedback-based image libraries to moderate images in all moderation scenarios of the same type. You can manage the images in feedback-based image libraries. However, you cannot perform operations on feedback-based image libraries. For example, you cannot disable or delete a feedback-based image library.
  • Self-managed image libraries are created by you to moderate images in a specific moderation scenario or a specific type of moderation scenarios. You can manage the images in self-managed image libraries and perform operations on self-managed image libraries.
Note You can create up to 10 self-managed image libraries and add up to 10,000 images to each self-managed image library.

When you use the Content Moderation API, you can use custom image libraries to moderate images or videos for pornographic content, terrorist content, ad violations, and undesirable scenes.

This topic describes how to manage custom image libraries for the Content Moderation API in the Alibaba Cloud Content Moderation console. In addition to operations in the console, you can also manage custom image libraries by calling API operations or using Content Moderation SDKs. For more information, see the following topics:

Procedure

  1. Log on to the Content Moderation console.
  2. In the left-side navigation pane, choose Moderation API > Risk Libraries.
  3. Click the Custom Image Library tab. On this tab, click Create Image Library.
  4. In the Create Image Library dialog box, set the parameters in the Parameters for creating an image library table and click OK.
    Table 1. Parameters for creating an image library
    Parameter Description
    Name The name of the custom image library. The name can be up to 64 characters in length. We recommend that you give the image library a meaningful name.
    Scene The moderation scenario to which the custom image library applies. Valid values:
    • Porn: moderates images or videos for pornographic content, where the value of the scenes parameter contains porn in API requests.
    • Terrorism: moderates images or videos for terrorist content, where the value of the scenes parameter contains terrorism in API requests.
    • Ad: moderates images or videos for ad violations, where the value of the scenes parameter contains ad in API requests.
    • Undesirable Scene: moderates images or videos for undesirable scenes, where the value of the scenes parameter contains live in API requests.
    List Category The category of moderation results that are returned based on the custom image library. Valid values:
    • Blacklist: If the images to be moderated hit samples in the image library, the machine-assisted moderation result contains the suggestion parameter that has a value of block.
    • Review List: If the images to be moderated hit samples in the image library, the machine-assisted moderation result contains the suggestion parameter that has a value of review.
    • Whitelist: If the images to be moderated hit samples in the image library, the machine-assisted moderation result contains the suggestion parameter that has a value of pass.
    bizType The business scenario to which the custom image library applies. You can specify different image libraries in API operations to meet business needs. For example, you can use the bizType parameter to specify the image library to be applied in a specific moderation scenario. The bizType parameter takes effect in the following ways:
    • If the bizType parameter in a moderation request is set to A, the image libraries of which the bizType parameter is set to A are used for moderation. These image libraries must be enabled.
    • In other cases, all enabled image libraries are used for moderation.
    The custom image library is created. The created image library is enabled by default.
  5. On the Custom Image Library tab, find the created image library and click Manage in the Actions column.
    The Custom Image Library tab lists all custom image libraries. The libraries marked with System and named in the SCENARIO_FEEDBACK_WHITE or SCENARIO_FEEDBACK_BLACK format are feedback-based image libraries. For example, the LIVE_FEEDBACK_BLACK library is a blacklist that consists of samples added by the system and is used to moderate images for undesirable scenes.
  6. On the Image Libraries page, perform the following operations to manage images as needed.
    Note You can add and delete images. The operations take effect in 15 minutes.
    • Query images by setting the Image ID and Time parameters.
    • Click an image. In the Details panel, view the number of images or videos that hit the image, the time when the image was added, and the ID of the image. Details panel
    • Click Select File and upload images to the current image library.
      Note You can upload images in the PNG, JPG, JEPG, and BMP formats.
    • Click Delete to delete an image. Alternatively, select multiple images and click Batch Delete in the lower part of the page.

Manage image libraries

On the Custom Image Library tab, you can click Delete, Edit, and Disable in the Actions column to delete, modify, or disable a self-managed image library.