The Content Moderation Image Moderation Enhanced Edition API provides pre-configured switches for fine-grained risk detection based on common content governance scenarios.
When you first use the service, log on to the console and go to the Rule Configuration page to review the default detection scope settings.
Scenarios
If your business has the following needs, use the Image Moderation Enhanced Edition console to customize detection rules, query results, and view usage statistics.
|
Scenario |
Description |
|
Adjust the detection scope and risk categories to meet your business needs or industry standards.
For example, if your business displays many swimwear images and you do not want them flagged, you can disable the related detection switches in the console. |
|
|
Set different risk detection scopes for multiple business scenarios |
If your business scenarios require different detection scopes for the same service, copy the service to create separate configurations. For example, if you have three businesses (A, B, and C) that all use the Baseline Check ( |
|
Perform targeted or emergency moderation for specific images |
Use the Image Moderation Enhanced Edition console and API for targeted moderation in the following situations:
|
|
Exempt trusted images from risk detection to prevent false positives from moderation algorithms. Examples include marketing materials created by your business, official platform images, or profile photos that have been manually reviewed and approved. |
|
|
Configure custom vocabularies to ignore or flag specific keywords within image text.
|
|
|
If you are using a small model service for image moderation, enable the large model capabilities with a single click to enhance moderation performance. |
|
|
Test the moderation performance of an image service in the console.
|
|
|
Search for and view detailed results of recent image detections for further analysis. |
|
|
Track the volume of recent image detections on the Usage Statistics page. |
Prerequisites
Go to the Content Moderation Enhanced Edition page and activate the Image Moderation Enhanced Edition service.
Before you activate the Image Moderation Enhanced Edition service, make sure that you understand the billing rules for Image Moderation Enhanced Edition. For more information, see Introduction and Billing Information for Image Moderation Enhanced Edition Version 2.0.
Adjust risk detection scope
Adjust the detection scope and risk items to meet your business requirements.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Rules Management tab, find the service that you want to manage, for example, Baseline Check (
baselineCheck). Click Settings in the Actions column. -
On the Detection Scope page, select a detection category to adjust. This example uses Prohibited Content Detection.
-
On the Prohibited Content Detection tab, review the current default settings in the Detection Scope Configuration section. By default, four checks are enabled, and the service returns a corresponding label if a match is found.
The default configuration includes the following four checks: contraband_drug (images suspected of containing drugs or medications), contraband_drug_tii (text in images suspected of describing prohibited drugs), contraband_gamble (images suspected of containing gambling-related items), and contraband_gamble_tii (text in images suspected of describing gambling activities). The default medium risk score range is 50.00–79.99, and the high risk score range is 80.00–100.00. The detection status for all checks is On.
-
Click Edit to enter edit mode and modify the On or Off. For example, turn off the detection switch for the third item.
The third item is contraband_gamble (images suspected of containing gambling-related items). After turning it off, click Save.
-
You can also adjust the Medium risk score and High risk score thresholds to define the returned risk level.
NoteThe risk level is determined based on the following rules:
-
If a detected risk label's confidence score is in the high-risk range, the result is "high risk".
-
If a detected risk label's confidence score is in the medium risk score range, the result is "medium risk".
-
If a detected risk label's confidence score is below the start of the medium risk score range, the result is "low risk".
-
If multiple labels with different risk levels are detected, the highest risk level is returned.
-
If no risk labels are detected, the result is "no risk".
-
If an image matches an entry in a custom blocklist, the result is "high risk".
-
-
Click Save. The new configuration takes effect in about 2 to 5 minutes.
-
Configure differentiated scopes for business scenarios
Copy a service and configure different risk detection scopes for different business scenarios.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Rules Management tab, copy the service for which you want to set a different detection scope. This example uses Baseline Check (
baselineCheck).-
In the service list, find the Baseline Check service and click Copy in the Actions column.
-
In the Copy Service panel, enter a Service name and Service description.
The Service field displays the current service name. You can customize the Service Name (up to 32 characters) and Service Description (up to 64 characters) fields.
-
Click Create to save the copied service information. The new service is available for API calls in 1 to 2 minutes.
-
After the service is created, you can set and edit rules for the copied
baselineCheck_01service. By calling thebaselineCheck_01and originalbaselineCheckservices separately, you can meet the needs of different business scenarios that require different risk detection scopes.
-
Targeted and emergency moderation
Configure a custom image library to flag specific risky images. If a user-uploaded image matches an entry in the library, the service returns a risk label.
-
Log on to the Content Moderation console.
-
Manage your image libraries before configuring them for custom detection. If an existing library already meets your business requirements, you can skip this step.
NoteEach account can create up to 10 image libraries, with a total limit of 100,000 images across all libraries.
-
Create an image library and upload images
-
In the left navigation pane, choose .
-
Click Create Image Library. On the Create Image Library tab, enter a library name and notes, and then click OK.
-
Find the library you created and click Image Detail in the Actions column. The image library list includes columns for Image Library Name, Notes, Image Count, and Update Time.
-
Click Add image. In the Add image dialog box, click Select Image and follow the instructions to upload your images.
You can upload up to 10 images at a time. Each image must be 4 MB or smaller, and we recommend a resolution of at least 256x256 pixels. The upload list displays the status of up to 10 images. To upload more images, click Clear the list and continue uploading images.
Supported image formats include PNG, JPG, JPEG, BMP, and WEBP. You can also drag images directly into the upload area.
-
On the library's details page, view the list of uploaded images. You can also query for and delete images.
-
Query images: Search for images by Image ID or Added At.
-
Delete images: Remove one or more images from the library. Batch deletion is supported.
-
-
-
Maintain an existing image library
-
In the left navigation pane, choose .
-
Find the library you want to maintain. Click Edit in the Actions column to modify its name and notes. Click Image Detail in the Actions column to upload or delete images. The image library list includes columns for Image Library Name, Notes, Image Count, and Update Time.
-
-
-
In the left navigation pane, choose .
-
On the Rules Management tab, find the service that you want to manage, for example, Baseline Check (
baselineCheck). Click Settings in the Actions column. -
On the Detection Scope page, select a detection category to adjust. This example uses Prohibited Content Detection.
-
On the Prohibited Content Detection tab, view the current custom library configuration in the Set Labels by Customized Libraries section.
The page is divided into the Sub-scene Configuration and Custom Library/Vocabulary Configuration sections. The Custom Library/Vocabulary Configuration section displays configuration items for image libraries and vocabularies related to prohibited content detection. For labels ending in
_lib(such ascontraband_drug_lib), an Image Library drop-down list is available. For labels ending in_tii_lib(such ascontraband_drug_tii_lib), a Vocabulary drop-down list is available. You can select a custom image library or vocabulary to trigger the corresponding label upon a match. -
Click Edit to enter edit mode, and then select the custom image library that you want to configure.
For this example, with
contraband_drug_lib, select the desired custom image library from the Image Library drop-down list. -
Click Save to apply the new custom image library configuration.
The new configuration takes effect in your production environment in approximately 2 to 5 minutes. If a user-uploaded image matches an image in the configured library, the service returns the "contraband_drug_lib" label.
-
Exempt trusted images from risk detection
Exempt trusted image libraries from risk detection to prevent false positives on safe content.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Rules Management tab, click Settings in the Actions column for the relevant service.
-
Select the Exemption Configuration tab to modify the exemption settings.
-
On the Exemption Configuration tab, view the list of custom image libraries and their exemption status.
By default, the exemption switches for all libraries are turned off. The Exemption Configuration tab lists the libraries, and you can set the exemption status for each one by using its Exemption Switch.
-
Click Edit and turn on the switch for the library that you want to exempt.
After you turn on the switch, the Exemption Switch for the corresponding library shows On. Click Save to apply the configuration.
-
Click Save to apply the new exemption configuration.
The exemption library takes effect in approximately 2 to 5 minutes. The Alibaba Cloud Content Moderation service compares input images against the images in the selected libraries. If an algorithm detects a match, the system returns the "nonLabel_lib" label and suppresses other risk labels.
-
Customize detection for text within images
Configure custom vocabularies to ignore or flag specific keywords in text within images.
-
Log on to the Content Moderation console.
-
Manage your vocabularies before configuring them for custom detection. If an existing vocabulary already meets your business requirements, you can skip this step.
-
On the page, follow these steps to configure a vocabulary.
-
On the Keyword Library Management tab, click Create Library.
-
In the Create Library panel, enter the required library information.
NoteYou can also create a vocabulary without adding keywords and then add them later as needed. A single account can have up to 20 vocabularies with a total of 100,000 keywords. A single keyword cannot exceed 20 characters. Special characters are not supported.
-
Click Create Library.
If the vocabulary creation fails, an error message is displayed. Follow the message prompts to try again.
-
-
-
In the left navigation pane, choose .
-
On the Rules Management tab, find the service that you want to manage, for example, Baseline Check (
baselineCheck). Click Settings in the Actions column. -
Configure Ignored Keywords.
-
On the Ignoring vocabulary configuration tab, view the list of custom vocabularies and their configuration status.
By default, the ignore switches for all vocabularies are turned off.
The Ignored Words Configuration tab lists your custom vocabularies with columns for Vocabulary Name, Word Count, and Ignore Switch. By default, all ignore switches are off.
-
Click Edit and turn on the switch for the vocabulary that you want to ignore.
After you turn on the switch, the Ignore Switch for the corresponding vocabulary shows On. Click Save to apply the configuration.
-
Click Save to apply the new ignored keywords configuration.
NoteThe ignored keywords configuration takes effect in approximately 2 to 5 minutes. The Content Moderation service ignores the keywords in the selected vocabulary before performing further risk detection. For example, if the text in an image is "Here is a little cat", and you select a vocabulary containing "is" and "a" to be ignored, the service will only analyze "Here little cat" for risks.
-
-
Configure Hit Keywords.
-
On the Detection Scope page, select the detection category that you want to adjust. This example uses Prohibited Content Detection.
-
On the Prohibited Content Detection tab, view the current custom vocabulary configuration in the Set Labels by Customized Libraries section.
NoteIn the Set Labels by Customized Libraries section, you can set a custom vocabulary for all labels that end with
tii, which indicates that a risk was detected in the text of an image.The Custom Library/Vocabulary Configuration section displays configuration options for each label. Rows for labels ending in
_tii_lib(such ascontraband_drug_tii_libandcontraband_gamble_tii_lib) provide a Vocabulary drop-down list. -
Click Edit to enter edit mode, and then select the custom vocabulary that you want to configure.
For this example, with
contraband_drug_tii_lib, select the desired custom vocabulary from the Vocabulary drop-down list. -
Click Save to apply the new custom vocabulary configuration.
The new configuration takes effect in your production environment in approximately 2 to 5 minutes. If the text in a user-uploaded image matches a keyword in the configured vocabulary, the service returns the "contraband_drug_tii_lib" label.
-
Enable large models for small services
If you are using a small model service for image moderation, you can enable the large model capabilities with a single click to enhance moderation performance.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Rules Management tab, find the service that you want to manage, for example, Baseline Check (
baselineCheck). Click Settings in the Actions column. -
On the Detection Scope page, select the Enable LLM Moderation checkbox.
-
In the confirmation dialog box that appears, click OK to enable the large model capabilities.
NoteThe feature takes effect in 3 to 5 minutes. After you enable this feature, the system returns large model results alongside your existing small model results without affecting them. For more information about the returned results, see VlContent.
Test image moderation online
Test image moderation performance directly in the console by using image URLs or local files.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Online test page, select the Image tab.
-
Test the image moderation.
-
From the Service drop-down list, select the service that you want to test.
NoteBefore you start the test, we recommend adjusting the rules for the service on the Rule Configuration page. For more information, see Adjust the risk detection scope for images.
-
The DataId and Supplementary Information parameters are optional. Enter values based on your needs. For more information about the parameters, see the Image Moderation API reference.
-
Provide images by entering an Image URL or using Local Image Upload. You can input up to 100 images at a time.
-
Click Test to start the moderation test on the input images. The results are displayed in the moderation result area.
-
Query detailed detection results
Query detailed detection results for specific images by requestId, dataId, or returned label.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Detection Results page, enter query conditions to search for detection results.
-
Supported query conditions include: requestId, dataId, service, and returned label.
NoteBy default, results are displayed in reverse chronological order, with a maximum of 50,000 entries. The Content Moderation console stores query results for the last 30 days. We recommend storing the data or logs from each API call for long-term analysis.
If you disagree with a moderation result, you can submit feedback. In the Actions column for the specific item, select No violation false alarm or Violation missed from the Feedback drop-down list.
-
The Returned Label search filter allows you to search by label. You can enter multiple labels separated by commas (,).
The Returned Label filter supports two matching options: = (equals) and != (not equals), with two pre-configured quick options: =nonLabel and !=nonLabel.
For example, to search for all records that have a hit label, set the Returned Label filter to !=nonLabel.
-
To view detailed information, click a specific image or click Details in the Actions column. The details panel displays an image preview, Hit Labels, Request Time, requestId, dataId, Image URL, and the complete Returned Result in JSON format.
-
View usage statistics
Track recent image detection volumes to inform your moderation and governance strategies.
-
Log on to the Content Moderation console.
-
In the left navigation pane, choose .
-
On the Dashboards page, select a time range to query or export usage data.
-
Query usage: You can view daily or monthly usage statistics. Data is stored for one year, and you can query up to two months of data at a time. The page displays a bar chart of call volume for each service within the selected time range.
-
Export usage: Click the
icon in the upper-right corner to export usage data by day or by month.The exported report is in Excel format and includes only services with call volumes. The following table describes the fields.
Field
Description
Unit
Account UID
UID of the account that exported the data.
N/A
service
The called detection service.
N/A
Usage
Total number of calls.
Count
Date
Date when the statistics were collected.
Day/Month
-
View service hit details: Below the usage statistics, the console details the label hits for each called service, displayed as a daily call volume chart and a label proportion treemap.
-
Call volume column chart: Shows the number of daily requests that hit risk labels versus those that did not.
-
Label proportion treemap: Shows the overall distribution of hit labels, arranged in descending order of proportion. Labels with the same prefix have the same background color.

-
-