[Update 2020] Image Classification with IBM Watson Visual Recognition
I tried an exercise from Introduction to Data Science course from cognitiveclass.ai. In this exercise, based on what written in the course description, we will be able to identify various objects and faces (even gender and age) in images.
Actually, the exercise page listed down the step by step which needs to be executed to get the result above. But, when I follow it through, I think there are slight changes in the IBM Watson interface which got me confused. After some exploration in the page itself, I finally found my way to make it work. In order to prevent others stumbled in this confusion, I will list down the step by step for this exercise with pictures in IBM Watson 2020 interface (except for registration page which is I believe is an easy task for all of you). The text in italic mode is the difference from what I got in the exercise page.
IBM Watson Visual Recognition (VR) is a service that uses deep learning algorithms to identify objects and other content in an image. In this hands-on lab, you will use Watson VR to upload and classify images.
Note: To complete this exercise, you will create an IBM Cloud account and provision an instance of the Watson Visual Recognition service. A credit card is NOT required to sign up for an IBM Cloud Lite account and there is no charge associated in creating a Lite plan instance of the Watson VR service.
After completing this lab, you will be able to:
- Access IBM Cloud
- Add resources to your IBM Cloud account
- Add services to your IBM Cloud account
- Create a project in Watson Studio
- Analyze images using Watson VR
Exercise 1: Create an IBM Cloud Account
To access the resources and services that the IBM Cloud provides, you need an IBM Cloud account.
If you already have an IBM Cloud account, you can skip Tasks 1 and 2 and proceed with Task 3: Login to you IBM Cloud account.
Task 1: Sign up for IBM Cloud
1. Go to: Create a free account on IBM Cloud
2. In the Email box, enter your email address and then click the arrow.
3. When your email address is accepted, enter your First Name, Last Name, Country or Region, and create a Password.
Note: To get enhanced benefits, please sign up with your company email address rather than a free email ID like Gmail, Hotmail, etc.
If you would like IBM to contact you for any changes to services or new offerings, then check the box to accept the option to be notified by email.
Then click Create Account to create your IBM Cloud account.
Task 2: Confirm your email address
1. An email is sent to the address that you signed up with.
2. Check your email, and in the email that was sent to you, click Confirm Account.
3. You will receive notification that your account is confirmed.
Click Log In, and you will be directed to the IBM Cloud Login Page.
Task 3: Login to your IBM Cloud account
1. On the Log in to IBM Cloud page, in the ID box, enter your email address and then click Continue.
2. In the Password box, enter your password, and then click Log in.
Exercise 2: Create a Watson Studio Resource
To manage all your projects, you will use IBM Watson Studio. In this exercise, you will add Watson Studio as a Resource.
Task 1: Add Watson Studio as a resource
- On the Dashboard, click Create Resource.
2. In the Catalog, click Services menu. Activate AI/Machine Learning filter to only show correlated services. Then, click Watson Studio.
3. On the Watson Studio page, select the region closest to you, verify that the Lite plan is selected, and then click Create.
5. When the Watson Studio resource is successfully created, you will see the Watson Studio page, Click Get Started.
6. You will have Watson Studio page is opened in a new tab automatically if it successfully set up for you.
Exercise 3: Create a project
To manage all the resources and services that you are working with, you should create a Watson Studio Project. You will begin by creating an empty project, and then adding the resources and services that you need.
Task 1: Create an empty project
- On the Watson Studio Welcome page, click Create a project or New Project+ in Recent Project section.
2. On the Create a project page, click Create an empty project.
3. On the New project page, enter a Name and Description for your project.
4. You must define storage for your project before you can create it. Under Select storage service, click Add.
5. The Cloud Object Storage page will be opened in a new tab. On the Cloud Object Storage page, verify that Lite is selected, and then click Create. If it successfully created, this page will be closed automatically.
6. On the New project page, under Define storage, click Refresh.
7. The cloud object created in the previous step will be assigned and then click Create.
Exercise 4: Add a Watson VR Service instance
This project will focus on analyzing images, so you need to add the Watson Visual Recognition Service. You will also need some images to analyze, so follow the setup steps below to ensure you are prepared.
Before you begin this exercise, you must complete the following steps:
- Collect a set of at least 20 images. You can use your own images, or download them from the internet.
- Store the images in an easy to find location.
Task 1: Add the Visual Recognition Service
- To add services to the project, click Add to project.
2. In the Choose asset type box, click Visual Recognition.
3. In the Associate a service box, click here.
4. On Associate Service page, make sure there is no active filter, hence, it shows all existing services. This is the tricky part because I do not have pictures for an active filter. If there is an active filter, there will be a black bubble with the number of the active filters in the red box area. Close all the active filter by clicking the cross button. In this case, it is still no service.
5. On the same page, click New Service+.
6. Click Visual Recognition service.
7. On the Visual Recognition page, select the region closest to you, verify that the Lite plan is selected, and then click Create.
5. Visual recognition service is successfully created. On the same page, click the checkbox to select the service, then click Associate Service+.
Task 2: Analyze images with Watson VR
- Now you can see all the built-in image classification models that IBM Watson provides! Let’s try the General model.
- To analyze your images, on the Models page, under Prebuilt Models, in the General box, click Test.
2. On the General page, click the Test tab.
3. To upload images, on the Test tab, click Browse.
4. Select the images you want to upload and then click Open.
5. Once you have uploaded your images, Watson Studio Visual Recognition will tell you what it thinks it found in your images! Beside each class of object (or color, age, etc.), it gives you a confidence score (between 0 and 1) showing how confident it is that it found that particular object or feature in your image (0 for lowest confidence and 1 for highest confidence).
6. Use the checkboxes on the left to filter the images. In this example, only images in which Watson VR has detected beige color are displayed.
7. Use the Threshold slider to only display images in which Watson VR has at least 90% confidence of the beige color.
Task 3: Share your results
Follow us on Twitter and send us some of the funniest and most interesting results you found with IBM Watson Visual Recognition!
After doing this exercise, I realized that I got a slightly different result from what I see on the course page which can show age and gender. I googling and found that IBM will no longer offer, develop, or research facial recognition technology. Maybe because of this reason. I do not know for sure, but at least, today I learn something new.
If you want to see this step by step but in video format, you can check it in my Youtube channel.