
Software developers have been actively working with machine learning libraries for several years, solving problems of computer vision and object detection. But the implementation of such tasks (and each machine learning model must be designed, deployed, properly trained, configured and installed) usually requires deep knowledge and skills. With the new IBM PowerAI Vision product, you can avoid it. This product provides an interface in which you can train, customize and test your own model, without going into the details of the implementation of machine learning.
In this guide, I will explain how to use PowerAI Vision to train the system and create a ready-to-use REST API service that you can use to detect and recognize objects in your applications.
PowerAI Vision - Technology Preview
As of December 2017, PowerAI Vision is available for testing as a Technology Preview software product (available for free download on the
developerWorks page), which is installed on Power Systems servers. If you don’t have such a server, you can test this product (completely free of charge!) In the SuperVessel cloud.
Note. This manual describes how to work with PowerAI Vision Technology Preview version 3.0.')
Task
The purpose of this article is to explain the basics of using machine learning to detect objects, and also to show how such training can be implemented using the PowerAI Vision interface. Here is what can be done with it:
- Create and lay out datasets (datasets) for object detection
- Train and apply a trained model on a dataset
- Test models using REST services
The details of setting up frameworks, the connection and use of GPU graphics accelerators, the deployment and configuration of REST services is carried out automatically within the product. However, some learning settings are available through the administration interface.
The end result is a ready-to-use REST API for object detection.
What is needed for recognition?
Sample Image Collection
You can create your own image collection based on the script you want to implement. These are some of the questions that PowerAI Vision can help answer:
- Where are the objects in the image?
- How many objects are in the image?
For example, take photos of bottles of Coca-Cola. Our goal is to create an application that can find and count bottles in images or video clips.
Install PowerAI Vision on Power System
If you already have an IBM Power server with an Nvidia GPU installed, you can install PowerAI Vision for testing. Follow the
link and select "On Premise" - "Download Now". Download PowerAI Vision and install it.
Note. The examples in this article suggest that you use SuperVessel, a cloud-based service for testing PowerAI products.How long will it take?
The steps of preparing and deploying a model in the SuperVessel cloud will not take much time (less than an hour), but considering the model training, the whole process can take an hour and a half. This time, of course, depends on the complexity of the data set and other factors.
Create and train a model
We use cloud SuperVessel
Sign up for
SuperVessel cloud service (it's free).
Create a DataSet
PowerAI Vision supports two machine learning models:
- Object Detection - detection and recognition of objects in the image
- Image Classification - classification of objects in the image
The model of object detection (PowerAI Vision Object Detection) will allow you to detect and recognize objects in an image, as well as count their number. In this article, we consider the training of this particular model.
Create a new data set to train the model:
- In the “My Data Sets” view, click the “Add Dataset” button and then select “For Object Detection” in the drop-down list:

- Think up a name for your data set (for example, “Coke Bottles”) and click “Add Dataset”:

- Download one or more images by dragging them onto a gray rectangle, or click the “Select some” button, and then select and download images from the local disk:

- You can upload multiple images simultaneously in a zip archive.
Note. If you downloaded a zip file and do not see the thumbnails of the files after the download, then the download failed. Try to use lower case file names without special characters or spaces. You can try downloading the files separately to determine which file caused the problem.Create tags and tag objects
- Create one or more tags by clicking the + icon to add a new one. For each type of object to be recognized, you must create a separate tag.
- Mark the object in the image (let's call this process markup) - click first on the tag, and then on the image, around the corresponding object, with the result that a rectangle bounding it will appear. Click Save when you have finished marking the object for the tag.
- Repeat this process first for all tags in the photo, and then for all images. Here is an example of such a marked image:
Council Use the option "Only Show Unlabeled Files" to not see the already marked photos.- Click “Export As Zip File” to download the prepared Dataset. Now that you have spent some time marking, this zip file will allow you not to lose the result of the work done.
Creating DL (Deep Learning) tasks
- Click on My DL in the My Workspace section, and then click the Create New Task button, then Object Detection .
- Give the Detector a name and make sure you select the correct dataset, then click Build Model

Deployment and Testing
- After the model has been trained (the learning process can be controlled visually), click Deploy and Test .

- Test the built model in the PowerAI Vision user interface: click Select to load the image for verification. After loading, an image with found objects and an estimate of the recognition accuracy will be shown below. In our example - three bottles of Coca-cola with an accuracy of 99.9%

- From the command line you can test the program interface of the REST service using the curl command and an image file. Notice that JSON found several bottles and indicated a tag and location for each one.
$ curl --insecure -i -F files=@coke_bottle_23.png https://ny1.ptopenlab.com/AIVision/api/dlapis/9f9d6787-0183-4a1b-be49-751b6ca16724 HTTP/1.1 100 Continue HTTP/1.1 200 OK Server: nginx/1.9.13 Date: Thu, 14 Dec 2017 21:58:26 GMT Content-Type: application/json Content-Length: 508 Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Headers: origin, content-type, accept, authorization Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD Access-Control-Allow-Origin: * { "classified" : [ { "confidence" : 0.9986369013786316 , "ymax" : 578 , "label" : "coca-cola" , "xmax" : 755 , "xmin" : 588 , "ymin" : 29} , { "confidence" : 0.9954010248184204 , "ymax" : 592 , "label" : "coca-cola" , "xmax" : 601 , "xmin" : 437 , "ymin" : 10} , { "confidence" : 0.8161203265190125 , "ymax" : 567 , "label" : "coca-cola" , "xmax" : 426 , "xmin" : 259 , "ymin" : 17}] , "imageUrl" : "http://ny1.ptopenlab.com:443/AIVision/temp/5a26dd3b-d8ba-4e01-8b93-5a43f28e97c7.png" , "result" : "success"}
The cloud free version limits the use of the REST API for 1 hour of operation after deployment. After stopping the service, it can be restarted to resume operation.Brief summary
You have seen how machine learning can work with image samples and create object detection APIs. Since the result is a fully-fledged REST API that returns results to JSON, it is easy to use in any application.
PowerAI Vision is simple and fast to use, providing GPU capabilities to accelerate learning.
The accuracy of the prediction will depend on the quality and size of the test sample. If the data set used for the experiments is too small, then this may affect the quality of the results obtained ... The quality of training depends on time and data. You can increase your data set and thus improve your results.
PS
You can see PowerAI Vision, try it in action, discuss interesting scenarios for using the platform with IBM experts at the IBM stand at the
Opentalks.AI conference.
In addition, employees of
the IBM Client Center in Moscow have unique experience with PowerAI Vision, IBM Watson and cognitive technologies. And they will be happy
to answer your questions .
additional literature
Original article in English;
Object Detection : Object Detection on Wikipedia;
PowerAI Vision : Deep Learning and PowerAI Development
TensorFlow Object Detection : Supercharge your Computer Vision models with the TensorFlow Object Detection API
AI Article : Can Artificial Intelligence Identify Pictures Better than Humans?
From the developers : IBM PowerAI
Several product videos:
www.youtube.com/watch?v=0F5w6q0ZpBIwww.youtube.com/watch?v=nWft6tYVdrcwww.youtube.com/watch?v=qHZRnswzqUI