AI for Beginners: What Is AI?

This lesson explains what artificial intelligence is and how it is used in everyday life.

AI for Beginners: What Is AI?

This article was originally written in Chinese and translated into English by AI.

Introduction

This lesson explains what artificial intelligence is and how it is used in everyday life.

For learning resources, see the frequently updated Artificial Intelligence Learning Checklist.

1. The Story of Artificial Intelligence

1.1 A History of Artificial Intelligence (to be expanded when inspiration strikes)

Since the birth of the computer—and even before it—pioneers have tried to use machines to simulate human intelligence.

Alan Turing, the father of computer science

In 1950, Alan Turing proposed the Turing test in “Computing Machinery and Intelligence.”

The Turing test: an evaluator is separated from two participants, one human and one machine, and asks them arbitrary questions through a device such as a keyboard. After repeated tests, if more than 30% of evaluators cannot determine which participant is the machine, the machine has passed the test and is considered to possess human intelligence.

Participants at the Dartmouth workshop

The 1956 Dartmouth workshop proposed that “every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it.”

At this workshop, a name was established for a new field: artificial intelligence.

AI was formally born as an academic discipline.

From 1956 to the present, artificial intelligence has experienced two “AI winters.” For more about its history, see Section 1.5 of Zhihua Zhou’s Machine Learning.

Today, the rapid growth of computing resources and data has brought artificial intelligence into its third wave of development, and it is gradually improving our lives.

1.2 Artificial Intelligence in Everyday Life

The film I, Robot gave many viewers an intuitive impression of artificial intelligence.

When you hear “artificial intelligence,” your first thought may be of the robots in I, Robot or Westworld: robots with bodies that can move and experience emotions.

Those are indeed examples of artificial intelligence. However, the AI in our lives today may be a little “disappointing” by comparison.

Today’s practical AI is not a talkative robot with independent thoughts. It is software focused on solving a problem in one particular field.

Examples include Google Translate, WeChat’s speech-to-text feature, facial-recognition entry at high-speed railway stations, autofocus on phone cameras, and smart Bluetooth speakers.

Other fascinating areas under research include:

  • AI-generated art
  • AI composition and writing
  • Voice generation
  • Converting two-dimensional images into three-dimensional models
  • ...

In the future, artificial intelligence will become indispensable in autonomous driving, industrial manufacturing, healthcare, security, customer service, and many other fields.

2. Machine Learning and Artificial Intelligence

2.1 What Is Machine Learning?

Before explaining machine learning, let me ask you a question.

What is the sum of the integers from 1 to 10?

This is easy enough to calculate mentally: 55. What about this?

What is the sum of the integers from 1 to n?

Anyone who knows how to program can write a few lines of code that simply add the numbers together.

sum = 0
for i in range(n):
    sum += i+1

With a little more sophistication, we can use the formula for the sum of an arithmetic sequence and finish in a single line.

sum = (1+n)*n/2

The formula above is an “accurate and complete description of how to solve a problem,” commonly known as an algorithm. Put more plainly, it is a method for solving a problem.

For the problem of summing integers, an algorithm is easy to find: start at one and add each number in turn. Yes, even such a simple method is an algorithm.

Similarly, given a quadratic equation in one variable, we can write the quadratic formula in code—another algorithm—to obtain its roots.

It seems that for many problems, once we know the algorithm—the method for solving the problem—we can keep calculating until we reach the answer.

Now consider the following problem and try to devise an algorithm for it:

You have data about tens of thousands of homes in Beijing, including their area, location, and price. Estimate the price of a home with an area of A square meters at location B.

Or consider this one:

You have thousands of images of lung-cancer cells and tens of thousands of images of normal lung cells. How can you predict whether a particular lung cell is cancerous?

For the house-price problem, perhaps after manually reviewing all the data and relying on intuition, we could write an algorithm like this:

if the house is within Beijing's Third Ring Road:
    price = area * 100000 + other factors
elif the house is within Beijing's Fifth Ring Road:
    price = area * 80000 + other factors
...

The ring-road boundaries and the prices of 100,000 or 80,000 yuan per square meter are merely intuitive guesses. They lack a theoretical basis and are inaccurate.

The second problem is even harder. A cancer specialist generally needs years or even decades of clinical experience to identify cancer cells with high accuracy. Expressing that expertise as code made up of if, else, and for statements is nearly impossible.

If our intuition is unreliable in the face of so much data, can we let the computer study the data and derive an algorithm itself?

In other words, can we find an algorithm that can:

Learn from data and derive a corresponding algorithm on its own?

Learn an algorithm from known data and apply it effectively to new data. This kind of learning is machine learning. Definitions of machine learning have long varied; this is only my own understanding, not a precise definition.

A common English definition of machine learning comes from Mitchell:

A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.

Mitchell, 1997

Zhihua Zhou’s Machine Learning translates the definition into Chinese as follows:

Suppose P is used to evaluate a computer program’s performance on some class of tasks T. If the program improves its performance on tasks in T by using experience E, then we say that, with respect to T and P, the program has learned from E.

This definition may be rather complicated. It is enough to understand machine learning as the study of learning algorithms from data.

2.2 Artificial Intelligence and Its Branches

Here we will examine the differences between artificial intelligence, machine learning, and deep learning.

Artificial intelligence means using machines to create intelligence.

In the broadest sense, artificial intelligence refers to machines with thoughts and self-awareness. AI is still at an early stage of development, however, and today’s systems can only simulate individual aspects of human perception, such as object recognition and speech-to-text transcription. Big-data applications such as shopping recommendations and route planning for congested periods are also sometimes included under AI, even though they may not appear closely related to human perception.

Suppose you have just learned to program and are asked to design an AI chatbot. What would you do?

The most obvious idea might look like this:

if the other person says "hello" or "hi":
    return "hello"
if the other person asks "what is the weather today?":
    return "Today's weather is " + look_up_weather()
if the other person says "find me a flight for tomorrow":
    return look_up_flights(tomorrow)
...

Clearly, manually defining every situation in code based on human experience is clumsy because the number of possible situations is infinite. Software also becomes very difficult to maintain once it contains thousands or tens of thousands of rules.

Alternatively, we could take a slightly more intelligent approach:

1. First, divide the other person's words into nouns, verbs, adjectives, and so on.
2. Use the words identified in step one to analyze the sentence's grammar.
3. Try to understand the meaning of the sentence.
4. Generate an appropriate response.

This approach seems more logical to us; it resembles the way we learn a foreign language. Yet it remains unclear how steps two, three, and four should actually be implemented.

Early AI researchers did indeed follow a logic-based approach. Some projects attempted to “hard-code knowledge about the world in a formal language” and then use rules of logical reasoning to solve problems. The Cyc project launched in 1989 is one example.

As research progressed, however, logic-based approaches encountered more and more difficulties. This way of implementing AI gradually fell out of favor.

What better ways are there to implement artificial intelligence?

Recall the machine learning introduced earlier: allowing a system to learn an algorithm from data.

If we had tens of millions of legally obtained chat records, we could let a program study them and learn how to respond on its own.

How to learn from this data is the problem that machine learning must solve. Later articles will discuss a variety of methods. At worst, the simplest method would be to search tens of millions of chat messages for the statement most similar to the user’s question and reply with the next message in the database.

This shows that artificial intelligence can be implemented in many ways, and machine learning is one of them. Machine learning is also the dominant approach today: almost every AI system used in daily life is implemented through machine learning.

Before using many classical machine-learning algorithms, such as naive Bayes, decision trees, and SVMs, we often need to process the data manually. A house, for example, may have dozens or even hundreds of directly or indirectly related attributes: floor area, latitude and longitude, street, floor number, number of rooms, and so on. In the Kaggle house-price competition, prices must be predicted from 79 attributes. We need to analyze how important each attribute is to the final result, discard or combine attributes in a step called data preprocessing, and produce new, more meaningful attributes called representations.

In many cases, the quality of data preprocessing directly determines the final quality of a machine-learning algorithm. In other words, with classical machine-learning algorithms, data preprocessing becomes the ceiling on the performance of our AI.

How can we break through that ceiling? One answer is representation learning. If we already let computers learn algorithms from data, we can let them go one step further: first learn how to extract valuable content from raw data, then learn from that content. In other words, the system first learns meaningful representations of the data.

Representation learning is generally used in fields such as image and audio processing. For house-price prediction, different attributes vary too much in type: floor area is numeric, the street is text, and whether a home faces north and south is Boolean. We therefore usually preprocess such data manually to obtain more meaningful attributes, or representations.

We can extend representation learning further:

  • Learn valuable content from the raw data.
  • Learn from that valuable content to obtain higher-level content.
  • Learn from the higher-level content to obtain still higher-level content.
  • ...

The result is a “tower” in which the content of every layer is learned from the layer below it. We call this approach to representation learning deep learning.

From Figure 1.2 of Deep Learning

The illustration from Deep Learning above helps explain the idea. When a deep-learning algorithm studies an image, the raw input consists of pixels. The first layer learns edges, the second learns corners and contours, and the third learns more complex shapes. Eventually, the system can recognize whether an image shows a person, a car, or an animal. This is only an intuitive description; few people can explain exactly what every layer has learned.

In short, machine learning is one way to implement artificial intelligence. Deep learning is an approach to representation learning, and representation learning is a form of machine learning.

The logical relationship among artificial intelligence, machine learning, and deep learning

Summary and Further Reading

  • People have long tried to use machines to simulate human intelligence—artificial intelligence, or AI. Although AI is already used in everyday life, each system is specialized and can operate only in a particular field.
  • Machine learning is the study of “learning algorithms from data.”
  • Artificial intelligence, machine learning, and deep learning are three distinct concepts.
    • Artificial intelligence: the attempt to create intelligence with machines.
    • Machine learning is one way to implement artificial intelligence. Other methods include manually programming every rule.
    • Deep learning is a type of machine-learning algorithm. Other machine-learning algorithms include SVMs, decision trees, and Bayesian estimation.
  • Applications of machine learning include data mining, computer vision, natural-language processing, and robotic decision-making.

Appendix: Course Plan

I call this tutorial series the “AI Handbook” because I prefer to think of it as a guide rather than a conventional tutorial.

I am also a learner on the road to AI. When I first encountered the field, I remember being overwhelmed by a bewildering array of resources. I did not know where to begin, could not find suitable practice projects, and wasted a great deal of time reading the same basic material over and over in different tutorials.

As someone with a little experience to share, I will therefore collect the lessons from my own AI studies and the knowledge I consider valuable into a handbook—a guide.

I will explain the foundational knowledge needed to begin studying AI as comprehensively and thoroughly as possible, progressing from simple ideas to advanced ones. I will do my best to:

  1. Arrange the content logically from introductory to advanced, making it completely reliable for beginners.
  2. Use one guide to introduce the fundamentals and provide references for deeper study, avoiding overlap among tutorials and saving a great deal of time searching for materials.
  3. Provide accompanying practice code. The guide will explain how to use packages while focusing even more on code that demonstrates the underlying principles, rather than encouraging readers to become mere “package importers.”
  4. Serve as a resource finder for beginners, allowing them to locate the relevant chapter and further reading for each field and algorithm quickly.

Note: to arrange the introductory material appropriately, the handbook’s overall structure may change frequently. Existing articles may also be revised and expanded.

Readers are strongly advised to have a foundation in Python as well as calculus, linear algebra, and probability.

This guide will broadly cover:

  • Machine learning
    • Machine-learning fundamentals: basic concepts, algorithmic principles, and code implementations
    • Data mining: feature engineering and practical applications
  • Deep learning
    • Deep-learning fundamentals: core concepts and TensorFlow
    • Computer vision
    • Natural-language processing
    • Reinforcement learning

Author: M小白

To be continued...