Configure risk libraries
Content Moderation lets you create custom image libraries to customize detection results for your business needs. You can use a custom image library for scenarios such as Pornography Detection, Terrorism Detection, and Spam Ad Detection for images and videos. You can also use a custom image library to block, pass, or flag specific images for manual review.
Background information
Custom image libraries are categorized as blacklists, whitelists, and review lists. When an image matches a sample in a library, it receives the corresponding moderation result: block for blacklists, pass for whitelists, and review for review lists. There are two types of custom image libraries: feedback-based and self-managed.
-
A feedback-based image library is automatically generated from your human review records and applies by default to all image moderation tasks in the same scene. You can manage images within a feedback-based library but cannot disable or delete the library itself.
-
A self-managed image library is one that you create and manage. You can apply it to a specific moderation task or scene and manage both the images and the library itself.
You can create up to 10 self-managed image libraries and add up to 10,000 image samples to each library.
Procedure
-
Log on to the Alibaba Cloud Content Moderation console.
In the left-side navigation pane, choose .
-
On the Risk Libraries page, click the Custom Image Library tab, and then click Create Image Library.
-
In the Create Image Library dialog box, configure the parameters as described in the following table and click OK.
Table 1. Create Image Library parameters
Parameter
Description
Name
Enter a name for the image library. The name can be up to 20 characters in length.
Detection Scene
Select the scene where the library applies. Valid values:
-
Pornographic Content: moderates images and videos for pornographic content (the
scenesparameter in an API request includesporn). -
Violent or Terroristic Content: moderates images and videos for terrorist content (the
scenesparameter in an API request includesterrorism). -
Texts or Objects on Image: moderates images and videos for ad violations (the
scenesparameter in an API request includesad). -
Undesirable Scene: moderates images and videos for undesirable scenes (the
scenesparameter in an API request includeslive).
Suggestion
Select the library's purpose. Valid values:
-
Block list: If content matches a sample in this library, the moderation result is
block. -
Review List: If content matches a sample in this library, the moderation result is
review. -
Trust list: If content matches a sample in this library, the moderation result is
pass.
BizType
BizType lets you apply different image libraries for different business needs. For example, you can specify which image library to use in a specific moderation request. The logic is as follows:
-
If a library is configured with
BizType="A"and a moderation API request also specifiesBizType="A", only the library withBizType="A"is used for moderation, provided that the library is enabled. -
In all other cases, all enabled libraries are used for moderation.
NoteRisk libraries with a BizType do not apply to OSS content moderation.
After you create a custom image library, it is enabled by default.
-
-
On the Custom Image Library tab, find the target library and click Modify in the Actions column.
The Custom Image Library tab lists all custom image libraries. Feedback-based image libraries are marked with a System tag and are named in the
SCENE_FEEDBACK_WHITE/BLACKformat. For example, LIVE_FEEDBACK_BLACK is a feedback-based blacklist for the undesirable scene. -
On the Library Management page, perform the following operations as needed.
NoteChanges to the library, such as adding or deleting image samples, take about 15 minutes to take effect.
-
Search for images by Image ID, Time range, or Sample ID.
-
Click an image to open its Details panel. You can view information such as the recent hit count, addition time, and risky image ID.
-
Click Select File to upload images to the library.
NoteYou can upload images in PNG, JPG, JPEG, and BMP formats. Each file must be smaller than 5 MB. You can upload up to 20 images at a time. We recommend that you upload typical samples captured from multiple angles, backgrounds, and lighting conditions to improve the library's capability to recognize similar images.
-
To delete a single image, click Delete below the image. To delete multiple images, select them and click Batch delete.
-
Related operations
For a self-managed image library, you can click Delete, Edit, or Disable in the Actions column on the Custom Image Library tab to manage the library.
What to do next
After you configure a risk library, you can use the OSS compliance detection feature. However, you must first configure message notifications. For more information, see Configure message notifications.