Use Feedback to Optimize Your Model

If a model misclassifies an image, you can add that image to the correct label in the dataset. Then you can train the dataset and update the model. This feedback cycle improves the model by adding new data.
With the feedback API calls, you can:
  • Add a misclassified image 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 one using feedback images.

Let’s say you have a model that classifies beaches and mountains. You send in the image alps.jpg to the model to get a prediction. The model responds with a high probability that the image is a beach (in the Beaches class). However, you were expecting a high probability that the image is a mountain (in the Mountains class). The image was misclassified. Use one of the feedback API calls to add the misclassified image with the correct label to the dataset from which the model was created.

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.
curl-X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "modelId=3CMCRC572BD3OZTQSTTUU4733Y" -F "data=@c:\data\alps.jpg" -F "expectedLabel=Mountains" https://api.einstein.ai/v2/vision/feedback

After you add feedback images to the dataset, you can retrain the dataset and update the model.