Salesforce Einstein Vision is a part of Einstein Platform services technology, a set of powerful new APIs that allow force.com and Heroku developers of all skill levels to bring image recognition to CRM and build AI-powered apps fast.
Einstein vision creates easy to build deep learning models for every use case including the
- Visual search,
- Brand detection
- Object identification
- Einstein Image Classification
For example, the top wholesaler is using Salesforce Einstein Vision image recognition to improve their lead qualification process for its restaurant and catering division.
Salesforce Einstein Vision have Visual Search capabilities, the group’s 40 person sales team determines which leads are most likely to buy digital tools by classifying restaurants’ interior and menu and augmenting leads with the right data used to be time-consuming and expensive, but with Salesforce Einstein Vision it’s done in a matter of minutes– with just seconds, streamlining the sales process and delivering new levels of customer success.
How Salesforce Einstein Vision works?
Fig-1 – Einstein Vision Concept
Einstein Vision is a concept from Deep learning and Deep learning is a branch of Machine Learning. Machine learning allows computers to predict more accurately without being explicitly programmed. Salesforce Einstein Vision uses Neural network Algorithms to predict the Image.
Model of Einstein Vision
Fig-2 Model of Einstein Vision
- First, the customer collects images of what they had like to classify.
Then they create a dataset using the Einstein Vision API, which holds all the images used to train the model.
- The most important elements of a dataset are labels and think of a label as a category.
- Once the customer has collected a minimum of 40 images in the label folder, they train the dataset, and the output is a trained model.
- Images can be validated from different data sources, such as a file or URL, against this model. For every check, the identified labels and the probability values are returned.
Steps to use Einstein Vision API in Salesforce
Step-1 – Register for Einstein Platform Services
Fig-3 Steps for Register Einstein API in Salesforce
First, we need to set up a Salesforce Einstein Platform Services Account then, go to Sign Up page for an Einstein Platform Services Account at https://api.einstein.ai/signup and click “Sign up using Salesforce”. After a successful login, it will redirect to the Download Private Key Page. Click “Download Key” to save the key local machine.
Second, Go to the token page at https://api.einstein.ai/token and enter your email and upload the Private key from the local machine and then click “Get Token” which will use in the Einstein API call. Third, upload this private key in Salesforce Files so that the Apex controller class can access it and add the remote site setting of Einstein API in salesforce.
Step 2 – Create & train a dataset in Salesforce Einstein Platform
Create and train the dataset to recognize and classify similar images using labels. We can create folders in a local system with labels and save similar images inside of this folder. Now create a zip file of these folders. This zip is our dataset, we will use this dataset of images and upload it into the Einstein Platform using apex API callout.
Fig-4 Dataset creation
Fig -5 Train/Retrain the dataset
Step 3 – Signature image prediction by Einstein Vision
Upload a test image from Local machine or URL and use Einstein image prediction API. The maximum image file size we can pass to this resource is 5 MB and the supported image file format are PNG, JPG and JPEG.
Prediction for Sentiment
Predicate the sentence as Request and Give the Response as probabilities of a positive, negative and neutral label.
Alternative Way to Use Salesforce Einstein Vision API
- Using CURL
- Using Postman