A classifier classifies an input (such as an entire image or sentence of text) into different categories. It assigns a confidence score for each class. Hive’s classifier models include the visual classification models and text classification models.

Classification models can be multi-headed, where each group of mutually exclusive model classes belong to a single model head. For example, when an image is run through Hive's visual moderation model, one head might classify sexually not-safe-for-work (NSFW) content while another head might classify the presence of guns.

This concept is illustrated below. This imaginary model has two heads:

  • NSFW classification: general_nsfw, general_suggestive, general_not_nsfw_not_suggestive
  • Gun classification: gun_in_hand, animated_gun, gun_not_in_hand, no_gun

The confidence scores for each model head sum to 1.

{
  "output": [
    {
      "time": 0,
      "classes": [
        {
          "class": "general_nsfw",
          "score": 0.9
        },
        {
          "class": "general_suggestive",
          "score": 0.05
        },
        {
          "class": "general_not_nsfw_not_suggestive",
          "score": 0.05
        },
        {
          "class": "gun_in_hand",
          "score": 0.88
        },
        {
          "class": "animated_gun",
          "score": 0.04
        },
        {
          "class": "gun_not_in_hand",
          "score": 0.04
        },
        {
          "class": "no_gun",
          "score": 0.04
        }
      ]
    }
  ]
}

Name

Description

time

Timestamp in seconds of video or audio frame extracted from the original media. Always 0 for images

classes

List of objects for each output class that the API predicts.

class

Name of predicted class.

score

Confidence score of predicted class.