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 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. For example, you cannot disable or delete a feedback-based image library.
  • User-created 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 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 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 using the API or SDK. For more information, see the following topics:

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 Libraries.
  3. On the Risk Libraries page, click the Custom Image Library tab. On this tab, find the feedback-based image library that you want to manage 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 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 Image Libraries page, 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 Details dialog box, view the number of images or videos that hit the image, the time when the image was added, and the ID of the image.Detail
    • Click Select File and upload images to the current image library.
      Note You can upload images in the 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 Batch Delete in the lower part 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 Libraries. On the Risk Libraries page, click the Custom Image Library tab.
  3. On the Custom Image Library tab, click Create Image Library.Create a custom image library
  4. In the Create Image Library dialog box, set relevant parameters and click OK. The following table describes the parameters of 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 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.

    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 created image library is enabled by default.
  5. Manage images in an image library. Return to the Custom Image Library tab. Find the image library that you want to manage and click Manage in the Actions column. You can manage images on the Image Libraries page.
    • Query images by setting the Image ID and Time parameters.
    • Click an image. In the Details dialog box, view the number of images or videos that hit the image, the time when the image was added, and the ID of the image.Detail
    • Click Select File and upload images to the current image library.
      Note You can upload images in the 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 Batch Delete in the lower part of the page.
  6. Delete, edit, or disable an image library. Return to the Custom Image Library tab. Find the image library that you want to manage and click Delete, Edit, or Disable in the Actions column to perform the corresponding operation.