Add Feedback to a Dataset

If a model misclassifies images, you can use the feedback APIs to add those images to the correct label in the dataset. Then you can train that dataset and update the model.

The Einstein Vision APIs provide various features that let you optimize and retrain your model using feedback. Use these features to:

  • Add a misclassified images to a dataset with the correct label.
  • Get a list of images that were added as feedback to a dataset.
  • Create a model or update an existing model using feedback images.

Let’s look at an example. Let’s say you have an image classification model that classifies beaches and mountains. You send in an image, alps.jpg, to the model to get back a prediction.

The model returns a response that contains a high probability that the image is a beach (in the Beaches class). However, you expect a response that contains a high probability that the image is a mountain (in the Mountains class). This means that the image was misclassified.

The first step is to add the misclassified images to the dataset along with their correct labels. The call you use depends on the type of dataset the model was created from.

Image or Multilabel

For a dataset with a type of image or image-multi-label, you add the misclassified image and label one at a time.

Use the feedback API to add a misclassified image with the correct label to the dataset from which the model was created. Getting back to our scenario, this cURL call adds alps.jpg as a new example to the dataset. The request parameter "expectedLabel=Mountains" specifies that the image is added to the correct class in the dataset. See Create a Feedback Example.

Object Detection

For a dataset with a type of image-detection, you add the misclassified images, labels, and bounding box information in bulk using a .zip file. This cURL call adds the contents of a .zip file to the dataset from which the model was created. The .zip file contains the images and an annotations.csv file that contains the labels and the bounding box coordinates for each image. See Create Feedback Examples From a Zip File.

After you add feedback examples to a dataset, you can query the dataset and return just those examples that were added from the feedback API call.

The API call to get dataset examples takes a source query parameter that lets you specify which examples to return from a dataset. See Get All Examples.

Valid values for this parameter are:

  • all—Return both upload and feedback examples.
  • feedback—Return examples that were created as feedback.
  • upload—Return examples that were created from uploading a .zip file.

If you omit the source parameter, feedback examples aren't returned from this call. The source query parameter can be combined with the offset and count query parameters used for paging.

This cURL call gets examples that were added as feedback from the specified dataset.

The response returns all the examples that were added by calling the feedback API such as the file alps.jpg.