使用图像和视频审核 API
在 Amazon Rekognition Image API 中,您可以使用 DetectModerationLabels 同步检测不当、不必要或冒犯性内容,也可以使用 StartMediaAnalysisJob 和 GetMediaAnalysisJob 操作异步检测此类内容。您可以使用 StartContentModeration 和 GetContentModeration 操作,从而借由 Amazon Rekognition Video API 异步检测此类内容。
标签类别
Amazon Rekognition 使用三级分层分类来标记不当、不必要或冒犯性内容的类别。每个分类等级 1(L1)的标签都有许多分类等级 2 标签(L2),而某些分类等级 2 标签可能有分类等级 3 标签(L3)。这允许对内容进行分层分类。
对于检测到的每个审核标签,API 还会返回 TaxonomyLevel,其中包含该标签所属的等级(1、2 或 3)。例如,可以根据以下分类对一张图像进行标记:
L1:私密部位的不明显裸露以及接吻,L2:明显裸露,L3:暗示裸露。
注意
我们建议使用 L1 或 L2 类别来审核您的内容,仅使用 L3 类别来移除您不想审核的特定概念(即,根据您的审核政策来检测可能不想归类为不当、不必要或冒犯性内容的内容)。
下表显示了类别级别与每个级别可能的标签之间的关系。要下载审核标签列表,请单击此处。
| 顶级类别(L1) | 第二级类别(L2) | 第三级类别(L3) | 定义 |
|---|---|---|---|
| Explicit | Explicit Nudity | Exposed Male Genitalia | Human male genitalia, including the penis (whether erect or flaccid), the scrotum, and any discernible pubic hair. This term is applicable in contexts involving sexual activity or any visual content where male genitals are displayed either completely or partially. |
| Exposed Female Genitalia | External parts of the female reproductive system, encompassing the vulva, vagina, and any observable pubic hair. This term is applicable in scenarios involving sexual activity or any visual content where these aspects of female anatomy are displayed either completely or partially. | ||
| Exposed Buttocks or Anus | Human buttocks or anus, including instances where the buttocks are nude or when they are discernible through sheer clothing. The definition specifically applies to situations where the buttocks or anus are directly and completely visible, excluding scenarios where any form of underwear or clothing provides complete or partial coverage. | ||
| Exposed Female Nipple | Human female nipples, including fully visible and partially visible aerola (area surrounding the nipples) and nipples. | ||
| Explicit Sexual Activity | N/A | Depiction of actual or simulated sexual acts which encompasses human sexual intercourse, oral sex, as well as male genital stimulation and female genital stimulation by other body parts and objects. The term also includes ejaculation or vaginal fluids on body parts and erotic practices or roleplaying involving bondage, discipline, dominance and submission, and sadomasochism. | |
| Sex Toys | N/A | Objects or devices used for sexual stimulation or pleasure, e.g., dildo, vibrator, butt plug, beats, etc. | |
| Non-Explicit Nudity of Intimate parts and Kissing | Non-Explicit Nudity | Bare Back | Human posterior part where the majority of the skin is visible from the neck to the end of the spine. This term does not apply when the individual's back is partially or fully occluded. |
| Exposed Male Nipple | Human male nipples, including partially visible nipples. | ||
| Partially Exposed Buttocks | Partially exposed human buttocks. This term includes a partially visible region of the buttocks or butt cheeks due to short clothes, or partially visible top portion of the anal cleft. The term does not apply to cases where the buttocks is fully nude. | ||
| Partially Exposed Female Breast | Partially exposed human female breast where one a portion of the female's breast is visible or uncovered while not revealing the entire breast. This term applies when the region of the inner breast fold is visible or when the lower breast crease is visible with nipple fully covered or occluded. | ||
| Implied Nudity | An individual who is nude, either topless or bottomless, but with intimate parts such as buttocks, nipples, or genitalia covered, occluded, or not fully visible. | ||
| Obstructed Intimate Parts | Obstructed Female Nipple | Visual depiction of a situation in which a female's nipples is covered by opaque clothing or coverings, but their shapes are clearly visible. | |
| Obstructed Male Genitalia | Visual depiction of a situation in which a male's genitalia or penis is covered by opaque clothing or coverings, but its shape is clearly visible. This term applies when the obstructed genitalia in the image is in close-up. | ||
| Kissing on the Lips | N/A | Depiction of one person's lips making contact with another person's lips. | |
| Swimwear or Underwear | Female Swimwear or Underwear | N/A | Human clothing for female swimwear (e.g., one-piece swimsuits, bikinis, tankinis, etc.) and female underwear (e.g., bras, panties, briefs, lingerie, thongs, etc.) |
| Male Swimwear or Underwear | N/A | Human clothing for male swimwear (e.g., swim trunks, boardshorts, swim briefs, etc.) and male underwear (e.g., briefs, boxers, etc.) | |
| Violence | Weapons | N/A | Instruments or devices used to cause harm or damage to living beings, structures, or systems. This includes firearms (e.g., guns, rifles, machine gunes, etc.), sharp weapons (e.g., swords, knives, etc.), explosives and ammunition (e.g., missile, bombs, bullets, etc.). |
| Graphic Violence | Weapon Violence | The use of weapons to cause harm, damage, injury, or death to oneself, other individuals, or properties. | |
| Physical Violence | The act of causing harm to other individuals or property (e.g., hitting, fighting, pulling hair, etc.) or other act of violence involving crowd or multiple individuals. | ||
| Self-Harm | The act of causing harm to oneself, often by cutting body parts such as arms or legs, where cuts are typically visible. | ||
| Blood & Gore | Visual representation of violence on a person, a group of individuals, or animals, involving open wounds, bloodshed, and mutilated body parts. | ||
| Explosions and Blasts | Depiction of a violent and destructive burst of intense flames with thick smoke or dust and smoke erupting from the ground. | ||
| Visually Disturbing | Death and Emaciation | Emaciated Bodies | Human bodies that are extremely thin and undernourished with severe physical wasting and depletion of muscle and fat tissue. |
| Corpses | Human corpses in the form of mutilated bodies, hanging corpses, or skeletons. | ||
| Crashes | Air Crash | Incidents of air vehicles, such as airplanes, helicopters, or other flying vehicles, resulting in damage, injury, or death. This term applies when parts of the air vehicles are visible. | |
| Drugs & Tobacco | Products | Pills | Small, solid, often round or oval-shaped tables or capsules. This term applies to pills presented as standalones, in a bottle, or a transparent packet and does not apply to a visual depiction of a person taking pills. |
| Drugs & Tobacco Paraphernalia & Use | Smoking | The act of inhaling, exhaling, and lighting up burning substances including cigarettes, cigars, e-cigarettes, hookah, or joint. | |
| Alcohol | Alcohol Use | Drinking | The act of drinking alcoholic beverages from bottles or glasses of alcohol or liquor. |
| Alcoholic Beverages | N/A | Close up of one or multiple bottles of alcohol or liquor, glasses or mugs with alcohol or liquor, and glasses or mugs with alcohol or liquor held by an individual. This term does not apply to an individual drinking from bottles or glasses of alcohol or liquor. | |
| Rude Gestures | Middle Finger | N/A | Visual depiction of a hand gesture with middle finger is extended upward while the other fingers are folded down. |
| Gambling | N/A | N/A | The act of participating in games of chance for a chance to win a prize in casinos, e.g., playing cards, blackjacks, roulette, slot machines at casinos, etc. |
| Hate Symbols | Nazi Party | N/A | Visual depiction of symbols, flags, or gestures associated with Nazi Party. |
| White Supremacy | N/A | Visual depiction of symbols or clothings associated with Ku Klux Klan (KKK) and images with confederate flags. | |
| Extremist | N/A | Images containing extremist and terrorist group flags. |
并非 L2 类别中的每个标签都有 L3 类别中支持的标签。此外,“产品”和“毒品和烟草用具及使用”L2 标签下的 L3 标签并非详尽无遗。这些 L2 标签涵盖了提及的 L3 标签之外的概念,在这种情况下,API 响应中仅返回 L2 标签。
您确定内容适合应用程序的程度。例如,可以接受带暗示性内容的图像,但无法接受包含裸体的图像。要筛选图像,请使用 DetectModerationLabels(图像)和 GetContentModeration(视频)返回的 ModerationLabel 标签数组。
内容类型
API 还可以识别动画或插图内容类型,该内容类型将作为响应的一部分返回:
动画内容包括视频游戏和动画(例如卡通、连环画、漫画、动画)。
插图内容包括素描、绘画和速写。
置信度
您可以通过指定 MinConfidence 输入参数,设置 Amazon Rekognition 在检测不当内容时使用的置信度阈值。不会返回检测的置信度低于 MinConfidence 的不当内容的标签。
指定小于 50% 的 MinConfidence 值时,可能会返回大量假阳性结果(即较高召回率、较低精度)。另一方面,指定大于 50% 的 MinConfidence 可能会返回较少的假阳性结果(即较低召回率、较高精度)。如果您没有为 MinConfidence 指定值,则 Amazon Rekognition 会返回检测的置信度不低于 50% 的不当内容的标签。
ModerationLabel 数组包含前面类别的标签和估计的已识别内容准确度的置信度。顶级标签将与已识别的任何第二级标签一起返回。例如,Amazon Rekognition 可能返回具有高置信度得分的“明显裸露”作为顶级标签。这也许能够满足筛选需求。但如有必要,您可以使用第二级标签(例如“男性裸体图”)的置信度得分来实现更高粒度的筛选。有关示例,请参阅检测不当图像。
版本控制
Amazon Rekognition Image 和 Amazon Rekognition Video 都返回了用于检测不当内容的审核检测模型的版本(ModerationModelVersion)。
排序和汇总
使用 GetContentModeration 检索结果时,您可以对结果进行排序和汇总。
排序顺序 – 返回的标签数组按时间进行排序。要按标签进行排序,请为 NAME 在 SortBy 输入参数中指定 GetContentModeration。如果此标签在视频中多次出现,则会有 ModerationLabel 元素的多个实例。
标签信息 – ModerationLabels 数组元素包含一个 ModerationLabel 对象,该对象反过来包含标签名称和 Amazon Rekognition 在检测到的标签的准确性中具有的置信度。时间戳是检测到 ModerationLabel 的时间,定义为视频开始后经过的毫秒数。对于按视频SEGMENTS汇总的结果,将返回 StartTimestampMillis、EndTimestampMillis 和 DurationMillis 结构,它们分别定义了片段的开始时间、结束时间和持续时间。
汇总 – 指定返回结果时的汇总方式。默认为按 TIMESTAMPS 汇总。您也可以选择按 SEGMENTS 汇总,即在某个时间段内汇总结果。只返回在分段期间检测到的标签。
自定义审核适配器状态
自定义审核适配器可能处于以下状态之一:TRAINING_IN_PROGRESS、TRAINING_COMPLETED、TRAINING_FAILED、DELETING、DEPRECATED 或 EXPIRED。有关这些适配器状态的完整说明,请参阅管理适配器。
注意
Amazon Rekognition 既不是权威,也不以任何方式声称会彻底筛选不当或冒犯性内容。此外,图像和视频审核 API 不会检测图像是否包含非法内容,例如,儿童性虐待材料。