đź“Ł Attention Salesforce Certified Trailblazers! Link your Trailhead and Webassessor accounts and maintain your credentials by December 14th. Learn more.
close
trailhead

Get an Einstein Platform Services Account

Lightning bolt icon used to indicate that the content is for Lightning Experience

Attention, Trailblazer!

Salesforce has two different desktop user interfaces: Lightning Experience and Salesforce Classic. This project is designed for Lightning Experience.

You can learn about switching between interfaces, enabling Lightning Experience, and more in the Lightning Experience Basics module here on Trailhead.

What You’ll Learn

This project introduces you to the Einstein Image Classification API which is part of Einstein Vision. You’ll learn how to:
  • Sign up for an Einstein Platform Services account.
  • Create code elements to call the Einstein Image Classification API from Salesforce.
  • Send an image to the general image classifier and get back a prediction.

Introduction

Artificial Intelligence (AI) is already part of our lives. Whenever you pick up your smartphone, you’re already seeing AI in action—from tailored recommendations to relevant search results. With Einstein Vision, you can harness the power of image recognition to build AI-powered apps fast—all without a data science degree!

Using the Einstein Image Classification API, you can train deep learning models to recognize and classify images. A model is a machine learning construct used to solve a classification problem. The model “learns” from data instead of from explicit rules. In this project, the terms model and classifier mean the same thing.

You design a model by first creating a dataset. Then you define the labels or categories of data in the dataset. Finally, you provide examples of data for each label. When you train the dataset, the system determines the commonalities and differences between the various labels and generalizes the characteristics that define each label. When you send an image to the model, the model predicts which label that image falls into based on the labels specified in your training dataset.

Diagram of how a dataset, model, and prediction are related

You may find some of these terms unfamiliar, so if you’re new to AI and deep learning, fear not! This project is a great way to get started, because we’re using a model that’s already been built. Plus, this project takes you through each step of the way to send in an image and get back a prediction.

Einstein Image Classification lets you use pre-trained classifiers or train your own custom classifiers to solve unique use cases. Creating a custom classifier requires a lot of data. So in this project, you access the pre-built general image classifier from your Salesforce org.

First, you create Apex classes that call the API. Then you create a Visualforce page to tie it all together. Finally, you test all your work by sending this image of a tree frog into the classifier. The classifier returns a prediction of what the image contains.

Image of a tree frog that is sent into the Predictive Vision Service

Get an Einstein Platform Services Account

Before you can access the Einstein Image Classification API, you first create an account and download your key. You can skip this step if you already have an account and key.

If you’ve completed the Einstein Intent API Basics module or the Build a Cat Rescue App That Recognizes Cat Breeds project, you likely already have an account and key.

When you sign up for an account, you’re prompted to log in to your Salesforce org. For this module, you use the username and password for your hands-on Trailhead Playground (TP) org. If you don’t know what a Trailhead Playground org is, or you need to find your TP username and password, check out the Trailhead Playground Management module.

After you log in, you’re prompted to allow the sign-up page to access information in your Salesforce org. Giving access lets the sign-up page retrieve some basic information such as your ID, profile, email, address, and phone number. After your account is created, you can download your key.

Warning

Warning

Be sure you’re logged out of Salesforce before you go through the steps to get an account.

  1. Navigate to the sign-up page at https://api.einstein.ai/signup.
  2. Click Sign Up Using Salesforce.
    The Einstein Platform Services sign up page.
  3. On the Salesforce login page, type your Trailhead Playground username and password and click Log In.
    The Salesforce login page.
  4. Click Allow so the page can access basic information, such as your email address, and perform requests.
    The page that requests access to your Salesforce org.
  5. On the activation page, if you’re using Chrome, click Download Key to save the key locally. The key file is named einstein_platform.pem. If you’re using any other browser, cut and paste your key from the browser into a text file and save it as einstein_platform.pem.
    The page where you download your private key.
    Warning

    Warning

    The Download Key button is only supported in the most recent version of Google Chrome™. If you're using a different browser, you can cut and paste your key into text a file and save it as einstein_platform.pem.

Upload Your Key

The .pem file you downloaded contains your key. You upload your key to Salesforce Files so that the Apex controller class can access it.
  1. In Salesforce, click App Launcher icon, then search for and click Files.
  2. Click Upload Files.
  3. Navigate to the directory where you saved the einstein_platform.pem file, select the file, and click Open.
  4. Click Done to confirm the upload.
    You see the key file in the list of files owned by you.
    The .pem file after you upload it in Salesforce Files.
    Warning

    Warning

    If you plan to use the Einstein Platform Services APIs in an AppExchange package, adhere to the appropriate secret storage guidelines. See the Storing Sensitive Information section in this article.

    That’s it. We won’t check any of your setup. Click Verify Step to proceed to the next step in the project.

retargeting