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. Content Moderation supports custom image libraries. You can customize image libraries to ensure that moderation results meet your specific business needs. You can specify the images to be blocked, passed, or reviewed in different custom image libraries to meet specific management needs.

Background information

Custom image libraries can be divided into blacklists, whitelists, and review lists to suit for different 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 libraries that you create to moderate images in a specific moderation scenario or a specific type of moderation scenario. 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. 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 Alibaba Cloud Content Moderation console.
  2. In the left-side navigation pane, choose Machine audit > Risk Libraries.
  3. On the Risk Libraries page, click the Custom Image Library tab, and click Create Image Library.
  4. In the Create Image Library dialog box, set the parameters and click OK.
    Table 1. Parameter description
    Parameter Description
    Name The name of the custom image library. The name can be up to 20 characters in length.
    Scene The moderation scenario to which the custom image library applies. Valid values:
    • Pornographic Content: moderates images or videos for pornographic content.
    • Violent or Terroristic Content: moderates images or videos for terrorist content.
    • Ad: moderates images or videos for ad violations.
    • Undesirable Scene: moderates images or videos for undesirable scenes.
    List Category The category of the moderation result that is returned based on the custom image library. Valid values:
    • Block list: If the images to be moderated hit samples in the image library, the machine-assisted moderation result is block.
    • Review List: If the images to be moderated hit samples in the image library, the machine-assisted moderation result is review.
    • Trust list: If the images to be moderated hit samples in the image library, the machine-assisted moderation result is pass.
    BizType The business scenario to which the custom image library applies. You can specify different image libraries in API requests to meet your 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 can be used only if they are 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 about 15 minutes.
    • Query images by setting the Image ID, Time , and Sample ID 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.
    • Click Select File and upload images to the current image library.
      Note Images in the PNG, JPG, JEPG, and BMP formats are supported. A single file must be smaller than 5 MB. A maximum of 20 images can be uploaded at a time.
    • Click Delete for an image to delete the image. Alternatively, select multiple images and click Batch Delete in the lower part of the page.

Delete, modify, or disable an image library

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