Which algorithm of easydl is more suitable for your image classification application

Time:2020-2-5

I believe that many developers have heard about or tried to Baidu easydl more or less. As a “artifact” of realizing image classification and object detection based on zero algorithm, it supports the use of a small amount of training data and the use of general algorithm training, and can quickly get an image classification model. Recently, Baidu easydl has added a new algorithm autodl transfer (high precision algorithm). Autodl transfer is one of the autodl technologies developed by Baidu. It combines the model network structure search, migration learning technology, and automatic optimization of user data. Compared with the general algorithm, the training time is slightly longer, but it is more suitable for the fine classification scene of images. For example, the general algorithm can be used to distinguish cats and dogs, but if you want to distinguish different kinds of cats, the autodl effect will be better. Let’s take an example to see the application scenarios of these two algorithms.

I don’t know if you usually have dogs. Now there are many kinds of dogs on the street. Many of them are familiar with each other. It’s not easy to name them accurately. The author uses the data of some dogs to train and see the difference between high-precision algorithm and general algorithm.

Step 1: log in to Baidu easydl, ai.baidu.com/easydl. There are steps in it, which are quite clear;

The second step is to create models and datasets. I believe that friends who have used easydl already know how to create it, so this article will not introduce the operation steps in detail;

In the third step, the training model, the author only added two categories of more than 400 images (a single category of data is rich) as training data, namely Samoye and Bomei, in my opinion, the differences between the two kinds of dogs from the appearance characteristics are very small (ignoring the size of the body), which is often unclear.

On the algorithm, select the general algorithm, the training mode is default, and then click training. Because of the small amount of data, the model will be trained in less than one hour. Let’s see the effect.

The accuracy of Top1 is 98.49%, and the performance of general algorithm is very good. Will the autodl algorithm perform better. Let’s use autodl algorithm for training.

Select Baidu autodl transfer algorithm and click training. I thought autodl would be slower, but I finished the training in less than an hour. Let’s see if the effect is better.

As a result, the accuracy of Top1 is 87.94%, which is a little lower than that of general algorithm.

The author decided to increase the number of classification to test the effect of the two algorithms. This time, the number of categories increased to more than 100, including tens of thousands of images. We used the general algorithm and Baidu autodl high-precision algorithm to train respectively, because of the large amount of data, the training time is slightly longer.

The model accuracy of the general algorithm is 84.25%, while the model accuracy of the baidu autodl high-precision algorithm is 86.88%. In terms of the accuracy, the high-precision algorithm is better.

Baidu autodl algorithm is based on migration learning, which is the future of machine learning. Compared with deep learning, it can train a suitable model with a small amount of data.

The author searched a brand-new Pomeranian dog image on the Internet, and then tested the model effect with general algorithm and high-precision algorithm respectively. The result shows that the accuracy of the two training versions (V2 & V4) of high-precision algorithm is higher than that of the two versions (V1 & V3) of general algorithm, which shows that the classification effect of autodl high-precision algorithm is very excellent.

When we distinguish the cat and dog samples, the general algorithm is more cost-effective. However, in the situation that there are a large number of classifications and smaller sample differences to distinguish dog breeds, the ability of the general algorithm “draw inferences from one instance” is relatively weak, and the effect of Baidu autodl high-precision algorithm is better.

Author: Guo Jing

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]