Products

SIGN UPLOG IN

Models / Feedback Loop

Feedback Loop - Images

Overview

The Image Moderation APIs are entirely automated. While they have been trained to achieve best-in-class accuracy, there might be instances where an image is not classified as per your expectations.

In such cases, you can submit the image to the Feedback API. Images submitted to the Feedback API are used to improve the models on a continuous basis. Submitting an image to the Feedback API does not count as an operation and will not impact your billing.

Usage details and examples

To submit an image to the Feedback API, you need three things:

  • the image itself, meaning either a public URL or the raw binary image
  • the name of the model that the image was moderated with (or unknown)
  • your expected class (or unknown)

If you do not know which model the image was moderated with, nor what the expected class should be, you can submit unknown.

The full list of acceptable model and class names is available here:

ModelPossible classes
nuditysafe partial raw bikini chest cleavage lingerie unknown
nudity-2.0safe sexual_activity sexual_display erotica bikini male_chest cleavage lingerie miniskirt male_underwear miniskirt unknown
nudity-2.1safe sexual_activity sexual_display erotica bikini male_chest cleavage lingerie miniskirt male_underwear miniskirt unknown
goresafe gore unknown
gore-2.0safe gore unknown
typephoto illustration unknown
facenone single multiple unknown
wadno-weapons weapons no-alcohol alcohol no-drugs drugs unknown
weaponno-weapons weapons unknown
recreational_drugno-drugs drugs unknown
alcoholno-alcohol alcohol unknown
celebritiesno-celebrity celebrity unknown
textno-text text-artificial text-natural unknown
offensivenot-offensive offensive unknown
scamnot-scam scam unknown
minorno-minor minor unknown
gendermale female unknown
tobaccono-tobacco tobacco unknown
gamblingno-gambling gambling unknown
moneyno-money money unknown
text-contentsafe unsafe unknown
qr-contentsafe unsafe unknown
genaiai not-ai
unknownunknown miss safe

Once you have the image, the model name and the class name, you can submit the image to the API. The request is very similar to the request done for Image Moderation and use your API credentials to authenticate the call:

Example 1

Example 1: Submit a URL to an Image that should have been classified as "safe" by the "nudity-2.0" model.

curl -X POST 'https://api.sightengine.com/1.0/feedback.json' \
    -F 'url=https://example.com/path/image.jpg' \
    -F 'model=nudity-2.0' \
    -F 'class=safe' \
    -F 'api_user={api_user}' \
    -F 'api_secret={api_secret}'

Example 2

Example 2: Submit a raw binary Image that should have been classified as containing "weapons" by the "wad" model.

curl -X POST 'https://api.sightengine.com/1.0/feedback.json' \
    -F 'media=@/path/to/image.jpg' \
    -F 'model=wad' \
    -F 'class=weapons' \
    -F 'api_user={api_user}' \
    -F 'api_secret={api_secret}'

The response received from the API will acknowledge the request with a response like this:

                    
                    
{
  "status": "success",
  "request": {
    "id": "req_VjyxevVQYXQZ1HMbnwtn",
    "timestamp": 1471762434.0244,
    "operations": 0
  },
  "media": {
    "id": "med_KWmB2GQZ29N4MVpVdq5K",
    "uri": "/path/to/image.jpg"
  },
  "message": "Thank you!"
}
                    
                

Was this page helpful?