Einstein
Salesforce Einstein Vision with OCR

Salesforce Einstein Vision with OCR



This article explains about What is Einstein Vision and how Salesforce using Einstein Vision and what are the types etc.,


Einstein Vision

Einstein Vision is an API used to enable your apps with AI-powered image recognition. Leverage pre-trained classifiers, or train your own custom classifiers to solve a vast array of specialized image-recognition use cases. Easily build deep learning models for every use case, including visual search, brand detection, and object identification.

For example, Salesforce Social Studio integrates with this service to expand a marketer’s view beyond just keyword listening. You can “visually listen” to detect attributes about an image, such as detecting your brand logo or that of your competitor in a customer’s photo. You can use these attributes to learn more about your customers’ lifestyles and preferences.

Images contain contextual clues about all aspects of your business, including your customers’ preferences, your inventory levels, and the quality of your products. You can use these clues to enrich what you know about your sales, service, and marketing efforts to gain new insights about your customers and take action. The possibilities are limitless with applications that include:

  • Visual search—Expand the ways that your customers can discover your products and increase sales.
    • Provide customers with visual filters to find products that best match their preferences while browsing online.
    • Allow customers to take photos of your products to discover where they can make purchases online or in-store.
  • Brand detection—Monitor your brand across all your channels to increase your marketing reach and preserve brand integrity.
    • Better understand customer preferences and lifestyles through their social media images.
    • Monitor user-generated images through communities and review boards to improve products and quality of service.
    • Evaluate banner advertisement exposure during broadcast events to drive higher ROI.
  • Product identification—Increase how you can identify your products to streamline sales processes and customer service.
    • Identify product issues before sending out a field technician to increase case resolution time.
    • Discover which products are out of stock or misplaced to streamline inventory restocking.
    • Measure retail shelf-share to optimize product mix and represent top-selling products among competitors.

Salesforce Einstein Vision

Einstein Vision is part of the Einstein Platform Services technologies, and you can use it to AI-enable your apps. Leverage pre-trained classifiers or train your own custom classifiers to solve a vast array of specialized image-recognition use cases. Developers can bring the power of image recognition to CRM and third-party applications so that end users across sales, service, and marketing can discover new insights about their customers and predict outcomes that lead to smarter decisions.

Einstein Vision includes these APIs:

  • Einstein Image Classification—Train deep learning models to recognize and classify images at scale.
  • Einstein Object Detection—Train models to recognize and count multiple distinct objects within an image, providing granular details like each object’s size and location.
  • Einstein OCR (Optical Character Recognition)—Use OCR models to detect alphanumeric text in an image.

Optical Character Recognition (OCR)

Get optical character recognition (OCR) models that detect alphanumeric text in an image with Einstein OCR. You access the models from a single REST API endpoint. Use the retail algorithm to create a model that’s optimized for retail execution scenarios. Please find the summer 20′ release notes.https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_einstein_vision.htm

Detect Text in an Image with Einstein OCR (Generally Available)
Get optical character recognition (OCR) models that detect alphanumeric text in an image with Einstein OCR. Access the models from a single REST API endpoint. Each model has specific use cases, such as business card scanning, product lookup, and digitizing documents and tables.

Watch the below youtube video for more information from salesforce..

Einstein OCR supports 3 models:

1.Detect Text In Image

2.Detect Text in Business Cards

3.Detect Text and Tables

1. Detect Text In the Image:

First, we need to generate an Access token, and so we can make an API request after. To make that sample request, we can use it below.

HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint('https://api.einstein.ai/v2/vision/ocr');
req.setHeader('content-type', 'multipart/form-data; charset="UTF-8"; boundary="1ff13444ed8140c7a32fc4e6451aa76d"');
req.setHeader('Authorization', 'Bearer '+access_token); //replace token with your access token

req.setHeader('Cache-Control', 'no-cache');
string form64 = '';

form64 += HttpFormBuilder.WriteBoundary();
form64 += HttpFormBuilder.WriteBodyParameter('sampleLocation', 'https://jayakrishnasfdcwordpress.com/wp-content/uploads/2018/10/untitled-design.png');
form64 += HttpFormBuilder.WriteBoundary();
form64 += HttpFormBuilder.WriteBodyParameter('modelId', 'OCRModel');
form64 += HttpFormBuilder.WriteBoundary(HttpFormBuilder.EndingType.CrLf);

blob formBlob = EncodingUtil.base64Decode(form64);
string contentLength = string.valueOf(formBlob.size());

req.setBodyAsBlob(formBlob);
req.setHeader('Connection', 'keep-alive');
req.setHeader('Content-Length', contentLength);
req.setTimeout(60*1000);

Http h = new Http();
String resp;
HttpResponse res = h.send(req);

Above I am passing the image URL and second modalId. Besides, I have used OCRModel. This modal is provided by Salesforce OOTB

2. Detect Text in Business Cards

here we need to specify a modelId of OCRModel and task parameter of contact.  Then the model returns the entity type for each text element that it detects.
In the response, we get one extra tag, “attributes,” which will help us decide the entity type.

3. Detect Text and Tables from Images

For the images contains Tables, to return the table data for each text element, In addition to the other parameter, we need to specify the tabulatev2 model and a task parameter value of table.


Thanks for Reading…

Leave a Reply

Your email address will not be published. Required fields are marked *