Porn Detection Event Notification

Last updated: 2021-03-12 11:24:02

    CSS porn detection takes real-time screenshots of suspiciously pornographic video images in live streams and stores them in COS. The porn detection callback is used to push the information of detected pornographic images, including their type, score, and screenshot time. You need to configure the server address receiving porn detection callback messages in the callback template and bind the template to the push domain name. When a porn detection event is triggered by a live stream, the Tencent Cloud CSS backend will call back the pornographic image information to the configured receiving server.

    This document describes the fields in callback message notifications sent by Tencent Cloud CSS after a porn detection callback event is triggered.


    • You need to understand how to configure the callback feature and receive callback messages on Tencent Cloud CSS before reading this document. For more information, please see How to Receive Event Notification.
    • By default, only questionable results will be called back for CSS porn detection.
    • We recommend you use the [type](#type) of an image to determine whether it is pornographic. As the detection results are not 100% accurate and there may be false positives or false negatives, you can confirm them manually if necessary.

    Screencapture Event Parameter Description

    Event type parameters

    Event Type Field Value Description
    CSS porn detection event_type = 317

    Common callback parameters

    Field NameTypeDescription
    t int64 Expiration time, which is the Unix timestamp when the event notification signature expires.
    • The default expiration time of a message notification from Tencent Cloud is 10 minutes. If the time specified by the `t` value in a message notification has elapsed, it can be determined that this notification is invalid, thereby preventing network replay attacks.
    • The format of `t` is a decimal Unix timestamp, i.e., the number of seconds that has elapsed since January 01, 1970 00:00 (UTC/GMT time).
    sign string Security signature of event notification (sign = MD5(key + t)).
    Note: Tencent Cloud splices the encryption `key` and `t`, calculates the `sign` value through MD5, and places it in the notification message. After your backend server receives the notification message, it can confirm whether the `sign` is correct based on the same algorithm and then determine whether the message is indeed from the Tencent Cloud backend.


    <span id="key"></span>key is the callback key in Event Center > CSS Callback, which is mainly used for authentication. In order to protect the security of your data, we recommend you enter it.

    Callback message parameters

    Parameter Required Data Type Description
    tid No Number Alert policy ID. Video content alert: 20001
    streamId No String Stream name
    channelId No string Channel ID
    img Yes string Link to alerted image
    type Yes Array Image type. 0: normal, 1–5: non-compliant, 6–9: others
    confidence Yes Number Confidence level of the detected pornographic image ranges from 0 to 100, which is an overall score factoring in normalScore, hotScore, and pornScore
    normalScore Yes Number Score for normal image
    hotScore Yes Number Score for sexy image
    pornScore Yes Number Score for pornographic image
    level No Number Image level
    ocrMsg No string OCR recognition information of image (if any)
    screenshotTime Yes Number Screenshot time
    sendTime Yes Number Request sent time (UNIX timestamp)
    abductionRisk No Array An array containing the AbductionRisk structure
    gameDetails No Object Game details
    similarScore No Number Score for image similarity
    stream_param No String Push parameter
    app No String Push domain name
    appid No Number APPID
    appname No String Push path


    Parameter Required Data Type Description
    level Yes Number Risk level ranges from 0 to 4. The larger the number, the greater the risk. 3 and 4 indicate maliciousness and we recommend you deal with such images
    type Yes Number Risk type. 20002: porn


    Parameter Required Type Description
    gender No Number Gender [0 (female)–100 (male)]
    age No Number Age
    expression No Number Expression [0 (normal)–50 (smile)–100 (laugh)]
    beauty No Number Attractiveness [0–100]
    x No Number x coordinate of the top-left corner of face frame
    y No Number y coordinate of the top-left corner of face frame
    width No Number Face frame width
    height No Number Face frame height


    Parameter Required Type Description
    battlegrounds No Object PUBG information
    gameList No Array Game list


    Parameter Required Type Description
    name No String Game name
    confidence No Number Probability

    Sample callback message

        "abductionRisk":[ ],