By, uav-jp 13/04/2022

What is AI framework: Basics of AI development for in-house, efficient creation of machine learning model --Active Summary: Nikkei Cross Tech Active

The use of AI (artificial intelligence) is spreading to companies. In addition to the AI ​​built into products, user companies are increasingly using their own AI for image processing and natural language processing. Therefore, it is important to improve the efficiency of AI development.

In this article, AI researcher Kanako Onishi explains the definition, advantages and disadvantages, basic functions, price quotes, points of utilization, etc. of the AI ​​framework that streamlines the development of AI. At the same time, we will introduce case studies and related solutions from the article of Nikkei Cross Tech Active.

First public release: 2021/12/6 Table of contents 1. What is AI framework? 2. Advantages / disadvantages of introducing AI framework 3. Basic functions of deep learning AI framework 4. Typical AI framework 5. AI Key points for utilizing the framework 6. Typical examples of AI framework 7. Related products and services of AI framework 8. New press release of AI framework * "1. What is AI framework?" "2 "Advantages and Disadvantages of Introducing AI Frameworks" "3. Basic Functions of Deep Learning AI Frameworks" "4. Typical AI Frameworks" "5. Points for Utilizing AI Frameworks" Written by Kanako Onishi

The current AI is mainly using machine learning models. Therefore, "developing an AI (system)" often refers to the development of a system that utilizes a machine learning model. Since the machine learning model is sometimes called an "AI model", the name of the AI ​​model is used here.

The AI ​​model calculates the output using "parameters" according to the "architecture" for the input. The architecture determines the structure of the AI ​​model, and there are, for example, Transformer, CNN (convolutional neural network), LSTM (Long ShortTerm Memory), and so on. The parameter is the weighting factor inside the AI ​​model. The parameters of the AI ​​model need to be trained (tuned) based on the data, and the one in the completed learning state is called the "trained AI model".

In the development of AI systems, the phrase "creating an AI model" is often used, but it often refers to creating a trained AI model. It is this trained AI model that is built into the AI ​​system.

The AI ​​framework is software that implements the architecture of the AI ​​model and learns the parameters. We have prepared a set of code that implements the functions required to create an AI model. It is mainly provided as open source software (OSS). Some software is suitable for implementing deep learning, while others are suitable for implementing machine learning models that are not deep learning. Details will be explained in "4. Typical AI Framework" below.

Knowledge of programming languages ​​is required to use the AI ​​framework. Nowadays, AI human resources may have a strong image of using the programming language "Python". This is because Python has become a language supported by most AI frameworks, and it has a variety of machine learning-related libraries (reusable software components), making it easy to develop AI models. Is.

Return to table of contents

As a method of developing an AI system, there are methods such as utilizing an AI framework, programming from scratch, using a service that can create an AI model with no code, and using a publicly available learned AI model. be.

In the following, we will explain the advantages / disadvantages of using the AI ​​framework while comparing it with (1) the method of programming from scratch and (2) the method of using a service that can create an AI model with no code. Since the method using the published AI model often requires the introduction of the AI ​​framework, it is not included in the comparison here, and "5. Points for utilizing the AI ​​framework" described later. I will explain the features.

It is possible to develop AI from scratch without using an AI framework, but it seems that few people now implement it without using an AI framework. If you need to implement it from scratch without using an AI framework, it's probably someone who is trying to create the AI ​​framework itself.

Even if you read the latest papers and implement the new architecture (the structure of the AI ​​model) described in it, you often do not have to program from scratch with the AI ​​framework.

Advantages / disadvantages of introducing an AI framework compared to the method of programming from scratch
merit
Demerit

A service that allows you to create an AI model with no code is characterized by the fact that anyone can easily create an AI model on a GUI (Graphical User Interface). Recently, various products and services have appeared.

Advantages / disadvantages of introducing an AI framework compared to the method of using a service that can create an AI model with no code
merit
Demerit
Return to table of contents

There are various types of AI frameworks, but here we will discuss the "deep learning AI framework" that is often used in fields where AI is extremely powerful, such as image recognition, voice recognition, and natural language processing. Introducing various functions.

The AI ​​model architecture consists of a combination of components such as MLP (Multilayer Perceptron) and CNN (Convolutional Neural Network). Many of these components have already been implemented in the AI ​​framework.

Users can implement a new AI model architecture by combining the components provided by the AI ​​framework. Even the latest architectures can often be implemented with these combinations.

In order to efficiently learn data and tune parameters with a large-scale AI model, it is essential to use a GPU (Graphics Processing Unit) that processes simple calculations in parallel with a large number of cores. Without GPU support, everything would have to be calculated on the CPU, and data learning wouldn't end in a realistic amount of time. Therefore, GPU support is an essential feature of deep learning AI frameworks.

Return to table of contents

Many AI frameworks are open source. Here, we will introduce three typical software for machine learning. The programming language Python is the most used in the development of AI systems, and many AI frameworks can use Python to write programs that define architectures and perform data learning.

A machine learning framework that is open source. Various machine learning algorithms are implemented, widely used and well documented. However, since the support of neural networks (deep learning) is not sufficient, if you want to utilize neural networks, you often use "PyTorch" or "TensorFlow" introduced below.

A deep learning framework published in open source. It supports large-scale learning using GPU. It also has an ecosystem of tools and libraries needed for development.

An open source deep learning framework developed by Google. It supports large-scale learning using GPU. It also has an ecosystem of tools and libraries needed for development.

There used to be a variety of deep learning frameworks, but these days they have converged on TensorFlow and PyTorch.

Return to table of contents

When using the AI ​​framework, it is also possible to utilize learned AI models published by various companies and organizations. You can use it freely as long as it is within the terms of use. "TensorFlow Hub," "PyTorch Hub," and "Hugging Face Hub" are famous sites where trained AI models are published. You can use it as it is, or you can tune it for yourself.

If you want to use the trained AI model as it is, you can develop an AI system just by incorporating the trained AI model you want to use. There is no need to collect or learn learning data.

However, the accuracy of the developed AI system (adaptation rate, recall rate, etc.) depends on the accuracy of the trained AI model. If the trained AI model you choose doesn't give you the accuracy you want, you'll have to tune the AI ​​model yourself. In addition, the trained AI model cannot change the model size (the number of parameters, which affects the amount of calculation and memory usage), so if it is too large, it will be necessary to prepare a machine with higher performance than expected.

The technique of tuning and using a trained AI model according to one's purpose is now widely used. This is because less training data is required than creating an AI model from scratch, and learning time is shorter than learning from scratch. The problem of model size remains, but the benefits of tuning and using publicly available trained AI models outweigh the benefits.

The trained AI model also has a pattern provided as a Web API published on the Internet. In this case, there is no need to introduce an AI framework, but the trained AI model cannot be tuned for yourself.

Both AI frameworks are widely used, so you can choose whatever you like. However, depending on the following situations, it is often necessary to use either one.

However, both AI frameworks offer similar functionality, so if you get used to one, you'll soon be able to use the other.

When you create an AI model, incorporate it into your system, and start using it, it will start working with the accuracy of the original test. However, the accuracy of the AI ​​model often declines little by little as it continues to be used.

This is because, although data that can be judged from the learned data is initially input, unexpected data that cannot be judged from the learned data increases with the passage of time. For example, if you develop a conversation AI that trains conversation data, the conversation between humans and AI may be successful at first. However, new topics are constantly emerging in the world. Conversation AI that has not learned these will gradually become unable to keep up with conversations with people.

It is very important to maintain the accuracy of AI models that are used to solve real-life tasks, not just conversational AI, by creating them once and updating them regularly.

Return to Table of Contents Return to Table of Contents Return to Table of Contents Kanako Onishi Dr. AI Researcher (Science). She is engaged in research and development of dialogue AI at NTT DoCoMo and NICT. Since October 2020, she has been working for a major IT company as an AI planner. She is involved in the design and introduction of AI. As a side business, she also gives lectures, writes articles, and supervises artificial intelligence. Her books include "The easiest AI super-introduction" (Mynavi Publishing) and "Super-practice! This book to become an AI human resource is OK even with zero programming knowledge ”(Gakken Plus, supervised)