Unit 1: Artificial Intelligence and Machine Learning

Objective

This unit will discuss about what intelligence and artificial intelligence are. Through several simple experiments with AlphAI, we will introduce the concept of intelligence, and discover that artificial intelligence today is a lot about learning.

We will also introduce the basic concept to AI.

Note: in blue are proposed solutions, or possible answers during the class discussions. These notes appear only in the Teacher Guide, and not in the Student Guide.

Teaching (Intelligence versus Artificial Intelligence)

What is intelligence?

  • Intelligence has the capacity for learning, reasoning, understanding and making decision.

What is artificial intelligence?

  • Artificial intelligence is a computer machine that develop a human quality.  It can mimics and performs same as humans.  It has the capacity for learning, reasoning, understanding and making decision.

Does it exist today, a machine that performs "same as humans"?!

  • No, this does not exist, but there has been a lot of progress since the first researchers started working on the subject in the late 1950s. Today machines can recognize image content, have meaningful conversations, do complex tasks in the industry. But they cannot understand language as intimately as humans, or drive a car in a crowded city traffic.

How is it possible that a machine becomes intelligent?

  • A machine is driven by mechanisms: it merely follows rules. The AIs from years 1960-1990 were based on defining rules that the machines follow to conduct reasoning, for example to solve mathematical equations. But in the years 2000 there has been a big progress with "machine learning".

What is machine learning?

  • We define machine learning as "learning rules" for the machine, so that we do not need to define all the rules for the machine, but it learns some new rules automatically, from examples. Instead of "programming the machine with instructions (rules)", humans can also "train the machine with examples".

What do you mean exactly?

  • We will see with this activity!!

Required Material and Setup

Material:

An arena with 4 walls with red colors.

AI Parameters

See appendix A1

Start the experiment

Place the robot in the arena. Use a white floor for a good contrast with the walls.

Switch on and connect the robot to your PC by pressing the appropriate WiFi or Bluetooth connection button (to see the WiFi button, connect first your PC to the WiFi network emitted by the robot; the password is the same as the network name, for example here ALPHAI-000654).

Set parameters in the left panel controls as indicated in the Appendix A. With the the AI parameters set up correctly, the following neural network will be shown.

All squares are called artificial neurons. They can be "active" (they turn yellow), "inactive" (they are black) or even "negative" (they turn blue). The input neurons of the neural network form a low-resolution image from the robot camera. The output neurons are facing 3 possible actions:

(A) Controlled Driving

Student drives the robot by controlling the actions on the right hand side.

- off the <self drive> button

- off  the <learning> button

- while watching the robot, click the arrows on the right hand side of the screen to move the robot.

- put the robot in the middle of the arena.

- firstly, click the "go forward" arrow to move the robot

- when the robot is about 5 to 10 cm away from the wall, click either the "left turn" or "right turn" to turn away from the wall.

 

Questions:

- Did the robot hit walls?  Why?

- Does the robot have intelligence?  Why?

- Who controls the robot?

- Did the robot move autonomously?

(B) Robot self-drives with no learning

- put the robot in the middle of the arena.

- click the <reset learning>

- off the <learning> button

- click the <self drive> button

- watch how the robot behaves

- click the <reset learning> again and observe, repeat several times

Question:

- Did the robot move autonomously?

- Did the robot hit walls?  Why?

- Does the robot have intelligence?  Why?

 

(C) Robot self-drives with limited learning

We will now discover the concept of machine learning! The AI learns during the training phase where the human gives examples (we will start with only one example). Then it uses what it learnt during the testing phase.

Training

- click the <reset learning>

- off the <self drive> button

- click  the <learning> button

- put the robot in the middle of the arena.

- while watching the robot, click the "go forward" once to move the robot.

- off the <learning> button

Testing

- put the robot in the middle of the area.  

- click the <self drive> button

- What happened?

Question:

- Did the robot move?  How?  Why?

- Did the robot hit walls?  Why?

- Does the robot have intelligence?  Why?

- Does the robot have enough intelligence to avoid hitting the walls?

 

(D) Train the robot to avoid hitting the walls

Training

- click the <reset learning>

- off the <self drive> button

- click  the <learning> button

- put the robot in the middle of the arena.

- while watching the robot, click the arrows on the right hand side of the screen to move the robot (note that you can also use the arrows of your computer keyboard)

- firstly, click the "go forward" arrow to move the robot

- when the robot is about 5 to 10 cm away from the wall, click the "left turn" or "right turn" to avoid hitting the wall.

- repeat the above steps for 5 to 6 times.  

- off the <learning> button

- Go to Testing the result.

 Testing

- put the robot in the middle of the area.  

- click the <self drive> button

- What happened??

You can repeat the training and then the testing, and behave differently in each training session and look at the differences of behavior in the testing. For example: move more to the left or to the right, turn already when we are at 15 cm, or on the contrary only when we are at 2 cm from the wall.

 Question:

- Did the robot move?  How?  Why?

- Did the robot hit walls?  Why?

- Does the robot have intelligence?  Why?

- Does the robot have enough intelligence to avoid hitting the walls?

Discussion

(A) Basic Discussion

How did we manage to get the robot avoiding the walls?

Answer:

  • Through learning (the human trained the robot)

What did training consist of?

Answer:

  • The user drives the robot and the robot learns to reproduce the behavior

What did the robot learn exactly: a sequence of actions? a map of the arena?

Answer:

  • Not a sequence of actions. Not a map of the arena. It learns to take a decision based on the image from the camera.
  • We can do the following experience: move the robot so that it sees a lot of white -> it wants to go forward (). Now put your hand in front of the camera -> it wants to turn. The robot has learnt to go forward when the camera image is bright, and turn when it is dark.

Can we consider the robot intelligent?

Answer:

  • We can say that being able to learn from a few images when to go forward and when to move achieves some level of intelligence. Of course it remains a very limited case of intelligence!

(B) Further Discussion (For advanced students)

Machine Learning relies on "data". What is the "data" here?

Answer:

  • In general "training data" consists of N pairs (input + label). In our case inputs are robot camera images and labels are the choice of action by the user during training. So the "training data" is the set of N pairs (image + action).

How could the robot learn such thing?

Answer:

  • During learning, the connections inside the neural network changed. But we will study this in detail in the following lessons!

 

Summary (Basic concept of AI)

Modern AI is based on Machine Learning.

The base concepts of AI are:

  • Input (e.g. camera image)
  • Output = what we want the AI to be able to choose by itself (e.g. actions of the AlphAI robot)
  • Model/Algorithm = something that is capable of generating outputs from the inputs (e.g. neural network is very famous in machine learning)
  • Training data = set of inputs and outputs that provide examples for learning
  • Learning = a method that trains the model with the training data and make it capable of taking the good decisions.

Learning from examples as here is called Supervised Learning. Another popular way of learning, without examples but with a reward, is called Reinforcement Learning (we will study it in further lessons). 

Appendix A

Sensors (Input) - Remove speed sensor

Sensors (Input) - Camera 8 x 6

Sensors (Input) - Gray Scale

Actions (Output) - left turn, right turn, and stop

AI Setting

Visualization