Content Moderation bases its moderation service on the global image library of Alibaba Cloud by default, which can meet most of the moderation needs. To meet specific business needs, Content Moderation also supports custom image libraries. You can manage images to be blocked, passed, or reviewed separately in different custom image libraries to handle emergencies.

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 consist of feedback-based image libraries and user-created 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, such as disabling or deleting a feedback-based image library.
  • User-created image libraries are created by you to moderate images in a specific or a type of moderation scenario. You can manage the images in user-created image libraries and perform operations on user-created image libraries.
Note You can create up to 10 user-created image libraries and add up to 10,000 images to each user-created image library.

When using 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 using the API or SDK. For more information, see the following methods:

Manage feedback-based image libraries

  1. Log on to the Alibaba Cloud Content Moderation console.
  2. In the left-side navigation pane, choose Moderation API > Risk library management.
  3. On the Risk library management page that appears, click the Image Library tab. On this tab, find the target feedback-based image library and click Manage in the Operations column.
    The Image Library tab lists all custom image libraries. The libraries marked with System and named in SCENARIO_FEEDBACK_WHITE or SCENARIO_FEEDBACK_BLACK format are feedback-based image libraries. For example, the PORN_FEEDBACK_BLACK library is a blacklist that consists of samples added by the system and is used to moderate images for pornographic content.Manage feedback-based image libraries
  4. On the Manage Image Library page that appears, perform the following operations 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 Detail dialog box that appears, view the respective numbers of images and videos that hit the image, the time when the image was added, and the ID of the image.View details
    • Click Select File and upload images to the current image library.
      Note You can upload images in PNG, JPG, JPEG, or BMP format. The size of an image cannot exceed 5 MB. You can upload up to 20 images at a time.
      Manage images
    • Click Delete to delete an image. Alternatively, select multiple images and click Delete Selected at the bottom of the page.

Create and manage custom image libraries

  1. Log on to the Alibaba Cloud Content Moderation console.
  2. In the left-side navigation pane, choose Moderation API > Risk library management. On the Risk library management page, click the Image Library tab.
  3. On the Image Library tab, click New.Create a custom image library
  4. In the New dialog box that appears, set relevant parameters and click OK. The following table describes the parameters.
    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 readable 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.
    • Live: moderates images or videos for undesirable scenes, where the value of the scenes parameter contains live in API requests.
    Category The category of moderation results returned based on the custom image library. Valid values:
    • Black: If the images to be moderated hit samples in the image library, the machine-assisted moderation result returns the suggestion parameter with a value of block.
    • Review: If the images to be moderated hit samples in the image library, the machine-assisted moderation result returns the suggestion parameter with a value of review.
    • White: If the images to be moderated hit samples in the image library, the machine-assisted moderation result returns the suggestion parameter with 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.

    Set this parameter as needed. We recommend that you submit a ticket to Alibaba Cloud to seek technical support.

    Create a custom image library
    The custom image library is created. The status of the created image library is enabled by default.
  5. Manage images in the created image library. Return to the Image Library tab. Find the target image library and click Manage in the Operations column. You can manage images on the Manage Image Library page that appears.
    • Query images by setting the Image ID and Time parameters.
    • Click an image. In the Detail dialog box that appears, view the respective numbers of images and videos that hit the image, the time when the image was added, and the ID of the image.View details
    • Click Select File and upload images to the current image library.
      Note You can upload images in PNG, JPG, JPEG, or BMP format. The size of an image cannot exceed 5 MB. You can upload up to 20 images at a time.
      Manage images
    • Click Delete to delete an image. Alternatively, select multiple images and click Delete Selected at the bottom of the page.
  6. Delete, modify, or disable an image library. Return to the Image Library tab. Select the target image library and click Delete, Modify, or Disable in the Operations column to perform the corresponding operation.