Artificial intelligence technology (hereinafter referred to as AI) is one of the outstanding discoveries and creations of human beings, which represents the future for at least several decades. In traditional programming, engineers turn their ideas and business into code, and computers run according to the logic set by the code. AI, on the other hand, gives a computer a “mind of its own”. It can “see”, “hear”, “speak”, “move”, “understand”, “distinguish” and “think”, just like a living creature.

AI is particularly effective in image recognition and text processing, and has been applied to human life, such as face recognition, dialogue, license plate recognition, target detection and target classification in urban smart brain project.

Next, we will learn about the requirements of image classification, the preconditions for task completion and task practice.

Image classification and target detection requirements

AI has a wide range of capabilities and applications, and here we are focusing on image classification.

Image classification, in fact, is the recognition and classification of the main objects in the image. For example, distinguishing between a helicopter and a dog among many random pictures. Or given an image, tell the computer to distinguish the categories of the main objects in the image.

Target detection refers to the detection of the target position in the picture. For example, in smart transportation projects, road surveillance cameras capture the position of vehicles in the picture. Target detection involves two techniques: classification and location. That is to say, first determine whether there is a specified target in the picture, and then determine the location of the target in the picture.

Such technology will be used for facial-recognition clocking, video surveillance alerts, parking lots, highway tollbooths and smart urban transportation.

The steps of computer image recognition

We can regard the computer as a child, it has the ability to “distinguish” before, must experience “see” and “understanding” these two steps, after reading a lot of pictures, it will form their own “cognition”, that is, to obtain the “distinguish” ability.

To put it simply, the AI engineer must prepare many different images, mark out the objects in a large number of images, and then ask the computer to extract the features in each image, resulting in “cognition.”

Think about it. When you were little, how could you tell a duck from a goose?

Are they judged by their characteristics?

Learn and program the conditions required to achieve the task

After understanding the requirements and procedures, we also need to prepare some conditions:

  • First, you have to be an IT engineer.
  • And then you have some grounding in math and statistics.
  • You also need to understand the way computers process images.
  • If there are lots of images, you need a computer with a high GPU, otherwise the computer “learns” very slowly.

With the above conditions, and then through a short time (a few days or a week) of learning, we will be able to complete the task of image classification.

For an additional topic, can anyone be an AI engineer?

The threshold of AI is relatively high, first of all, you must have advanced mathematics, statistical learning and programming, and then you must have a strong learning ability. For IT engineers:

  • The programming basics are fine
  • Learning ability depends on the individual, but time and effort will surely lead to progress
  • The foundation of advanced mathematics, need to make up well
  • Statistics study foundation, also have to make up well
  • No financial pressure

If you want to become an AI engineer, an “advanced degree” is almost a must. Whether it’s first-tier Internet companies or emerging AI unicorns, they all set a “master’s degree” for AI engineers. Unless a particularly excellent and talented junior college or undergraduate, it is impossible to have the opportunity to work as an AI engineer in such an enterprise.

AI in hardware, software, data and talent are very expensive, ordinary IT engineers just learn about IT, far from the requirements of commercial products.

Ordinary small and medium-sized enterprises rarely have the qualifications and economic capacity to attract highly educated and excellent AI engineers, which leads to the concentration and tilt of resources.

To commercialize the image classification technology, the computer has to go through the steps of “seeing,” “recognizing,” and “resolving,” and then turn it into a Web service.

But I just want to integrate face recognition or image classification into my project. Is that so difficult?

I am just a small enterprise, want to add “family recognition”, “stranger alert”, “fire alarm” and “biological intrusion alert” functions in the original ordinary video surveillance system, without the above conditions and economic input, can not be realized?

I’m so upset!

Any good ideas?

Introduction to ModelArts and conditions

ModelArts, a product of Huawei Cloud, is a one-stop AI development platform for developers.

It provides machine learning and deep learning with massive data preprocessing and semi-automated annotation, large-scale distributed Training, automated model generation, and end-to-end cloud model on-demand deployment capabilities, helping users to quickly create and deploy models and manage full-cycle AI workflows.

It provides users with the following optional modes:

  • Automatic learning mode with zero coding experience and zero AI experience
  • Full process development mode with AI development experience

At the same time, it integrates the whole process of AI development. Such as data annotation, model training, parameter optimization, service deployment, open interface, etc., this is the “full cycle AI workflow”.

Also, operations on the platform are visual.

These conditions provide an opportunity for individual developers and companies who want to apply AI technology to their products, but have no choice. This is important! It can be said that ModelArts shortens the commercial time of AI and reduces the corresponding economic cost, time cost and labor cost.

What’s more, Huawei Cloud ModelArts has prepared a lot of tutorials for users. Even inexperienced users can implement their OWN AI needs as long as they follow the tutorial instructions.

Just think about it. That’s great!

Experience it!

Image classification service practice

This time we demonstrate how to build an AI service for image classification in automatic learning mode with zero AI foundation and zero coding experience.

Preparation and related Settings

First, open the official website of Huawei Cloud, move the mouse to the menu of “EI Enterprise Intelligence” in the navigation bar, and select “AI Development Platform ModelArts” from the popup options.

After entering the Home page of ModelArts, you can browse the introduction of ModelArts.

Click the “Go to Console” button at the Banner and the page will jump to the ModelArts console. The console is generally divided into several areas:

Area 2 has image classification in automatic learning mode. Move the mouse over the icon and click the “Start experiencing” button that pops up. If you are a new user of huawei cloud, the web page prompts you to enter the access key and private access key.

Developers without keys can click the link on the page and follow the instructions to obtain the keys. After obtaining the two keys, fill them in the box and click “OK” button.

At this point, the project creation process is officially entered. Click the “Create project” button in “Image Classification” (Huawei cloud has prepared a corresponding tutorial for users, which is very considerate).

In the create project page, we need to fill in two or three configurations. It should be noted that the project is billed on demand. This time we just experience it, and we don’t train or store too much data, so the cost is very low, so don’t worry about it.

The project name can be set to an easy to remember one as required, in this case I set it to ImageclF-test-Pro. In the storage selection of training data, click the folder icon in the input box and create a new OBS bucket in the popup TAB

Create a folder in the bucket

Finally, enter a description and click the “Create Project” button at the bottom right corner of the page.

Upload pictures and annotations

After the project is created, we need to prepare multiple pictures for training. The pictures should be as clear as possible, with more than 2 categories and no less than 5 pictures for each category.

Of course, the more data, the richer the form, and the more accurate the labeling, the better the training results and the better the AI service experience will be.

Here I have 45 pictures of helicopters, tanks and dogs.

After importing them in batches, check the same type of pictures and add labels to multiple pictures at a time.

After the three types of images are annotated one by one, the images in the “Unannotated” TAB of the left image annotation will be empty, while the annotated images can be seen in the “annotated” TAB.

The training set

The TAB bar on the right shows each category and the corresponding number of pictures. The training Settings below allow us to set the upper limit of the training duration, and the reasoning time in advanced Settings.

We don’t need to understand how this works, but we can use the default value or adjust it slightly, such as changing the upper limit of the training duration to 0.2.

Start training

After setting, click “Start training” button to enter the training state, and wait for a period of time patiently (the less pictures, the shorter the training time).

Training status is displayed on the left side of the training page, such as initialization, running, and running success/failure. After the training is completed, information such as running time, accuracy rate, evaluation result and training parameters will be given on the right side.

Automated deployment of services

Our goal is to build an AI service for image classification, so click the “deploy” button on the left after the training, and the automatic deployment process will be entered at this time.

After a short wait (about 10 minutes), the deployment is complete and the page is divided into three columns.

Zone 1 on the left is deployment status and control. The second area in the middle can test image classification online, the third area on the right shows the results of online testing (including accuracy), and the fourth area on the right provides an API interface for us to integrate into the Web application.

Online prediction, training results testing

Let’s test this out by preparing a few untagged images that can include dogs, helicopters, and tanks. Click the “Upload” button in the middle 2 area and select an image, then click the “Forecast” button.

In less than 1 second, area 3 on the right will return the result of this prediction:

{
    "predicted_label": "Dog"."scores": [["Dog"."0.840"
        ],
        [
            "Helicopter"."0.084"
        ],
        [
            "Tank"."0.076"]]}Copy the code

This time, we uploaded pictures containing dogs, and the returned prediction results showed that the label of this prediction was “dog”, and listed several categories with high reliability and corresponding reliability (1 means 100% certainty), among which the highest is “0.840- dog”.

Try uploading pictures of helicopters this time.

The returned prediction results are as follows:

{
    "predicted_label": "Helicopter"."scores": [["Helicopter"."0.810"
        ],
        [
            "Dog"."0.114"
        ],
        [
            "Tank"."0.075"]]}Copy the code

Try the tank again

The returned prediction results are as follows:

{
    "predicted_label": "Tank"."scores": [["Tank"."0.818"
        ],
        [
            "Dog"."0.092"
        ],
        [
            "Helicopter"."0.090"]]}Copy the code

From the results of several tests, we can see that the prediction results are very accurate, and the credibility of the given is relatively high. The pictures prepared this time are not very many, nor are the forms very rich, but the prediction effect is very good, I have to say that huawei cloud ModelArts development team has made a lot of optimization for this, even better than my own (deep learning beginner level) code using convolutional neural network training and prediction results.

If you want to integrate it into a Web application, just follow the instructions in the interface Call Guide provided on the page.

Release resources

If it’s not for commercial use, just for learning and practice, remember to click the “Stop” button in the first area on the left when you’re done. Enter OBS in the search box on the Huawei cloud navigation bar. Click the search result to go to the OBS home page. Then click Management Console on the OBS home page to access the OBS console and delete the bucket created previously. This will not tie up resources and will not incur costs.

summary

After experiencing ModelArts, I felt very nice!

Each place has a hint or tutorial guide, the operation process is smooth, there is no lag, error and other problems.

Batch data annotation is so useful! Batch import, batch labeling, automatic counting, comfortable!

The training was very fast, probably using a cloud GPU, so I could finish training quickly even if MY computer didn’t have a graphics card.

Before, I still considered whether learning AI needs to prepare stronger hardware equipment. Now, when operating on ModelArts, I do not need to consider these conditions.

This time, we’re going to experience automatic learning, which is simple and easy to use. For professional AI engineers, full process development is an option. Batch data annotation, local code writing, local debugging, cloud training, cloud deployment, etc.

Great!

Interested developers can go to Huawei Cloud ModelArts to experience.


Note: the pictures in this article are from the Internet, through the search engine.