Detect Products on Shelves with an Optimized Algorithm

If your object detection use case involves identifying products on shelves, use this algorithm that's optimized for retail execution scenarios.

Use the retail execution algorithm to create a model that's optimized to detect items displayed on retail shelves. This algorithm creates a model that has the same functionality as a model created with the standard image detection algorithm; but the model’s detection accuracy (mAP) is typically better for the retail use case.

📘

Note

Use these algorithms only with object detection datasets. If you use these algorithms with other types of image datasets, the training process returns an error.

How to Use the Retail Algorithm

To use the retail execution algorithm, first create a dataset that has a type of image-detection. Then train the dataset to create a model and specify an algorithm of retail-execution. The cURL command is as follows.

curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "name=<MODEL_NAME>" -F "datasetId=<DATASET_ID>" -F "algorithm=retail-execution" https://api.einstein.ai/v2/vision/train

If you don't specify the algorithm parameter, the training process uses the default algorithm of object-detection-v1.

These calls take the algorithm parameter.

  • Train a model—POST /v2/vision/train
  • Retrain a model—POST /v2/vision/retrain

Is the Retail Algorithm Right for You?

If you're uncertain whether a model created with retail algorithm will give you the best results, you can do an experiment.

  • Train your object detection dataset with the retail algorithm by passing the algorithm parameter with a value of retail-execution. The cURL call looks like this command.
curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "name=<MODEL_NAME>" -F "datasetId=<DATASET_ID>" -F "algorithm=retail-execution" https://api.einstein.ai/v2/vision/train
  • Make a note of the model ID.

  • Train your object detection dataset with the default algorithm by omitting the algorithm parameter. When you omit the parameter, the training process uses the default algorithm. The cURL call looks like this command.

curl -X POST -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -F "name=<MODEL_NAME>" -F "datasetId=<DATASET_ID>" https://api.einstein.ai/v2/vision/train
  • Make a note of the model ID.

  • Get the model metrics for each model using this cURL command.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache" https://api.einstein.ai/v2/vision/models/<MODEL_ID>
  • Compare the two models by looking at:
  • Each model’s meanAveragePrecision value
  • Each label’s averagePrecision value.

Higher values indicate a better model.