Students learn about the world’s first self-driving car. They then apply and extend their prior knowledge of functions within the context of artificial intelligence.
Lesson Goals |
Students will be able to…
|
Student-facing Lesson Goals |
|
Materials |
|
Preparation |
|
🔗Supervised Learning 15 minutes
Overview
Students learn about ALVINN (Autonomous Land Vehicle in a Neural Network) as an example of supervised machine learning.
Launch
Meet ALVINN!

ALVINN (short for Autonomous Land Vehicle in a Neural Network) was developed in 1989 by a team of computer scientists at Carnegie Mellon University. ALVINN is the forebear of today’s self-driving cars: a retrofitted Army ambulance equipped with sensors, computers, and actuators (the part of a machine that allows movement). ALVINN had about one-tenth of the processing power of an Apple Watch — but was able to safely drive on a very limited course at 70 miles per hour by the early 1990s! How did it happen?
As with all machine learning, ALVINN required training.
The goal of that training? Learning how to steer.
Here’s what ALVINN’s training entailed:
(1) A person drove the vehicle while a front-facing video camera recorded the road.
-
In the context of supervised learning, the human driver is often referred to as the supervisor.
-
The supervisor demonstrates the learning process.
-
The input-output pairs form the training corpus.
(2) Every two seconds, ALVINN…
-
digitized an image of the road ahead
-
recorded the steering direction chosen by the driver
(3) ALVINN’s training data can be represented as an input-output table, with training images (reduced in resolution to 30x32 pixels) as inputs and their associated corresponding "correct" steering angles as outputs.
| input data | output data |
|---|---|
|
0.02º |
|
-95.2º |
|
135.43º |
Note: These images were selected for illustrative purposes. The 30x32 pixel images produced by ALVINN were of much lower quality!
(4) Using the set of inputs and outputs, ALVINN generates a function for predicting steering angles from Images, which we can summarize using contract notation.
# steer :: (Imageroad-image) -> Number
In the steer function, the Image is the explanatory variable and the steering angle is the response variable.
How does one generate a function? Techniques from statistics do that. We aren’t going to focus on the statistics here. Note that the actual contract for steer would be more complex, including a second Number for the measure of confidence.
The function that we get from statistics is what scientists call a model: a summary of data that captures relationships between variables. Typically, models are lossy, meaning that some of the original information in the dataset was lost through the process of summarizing and compressing the data to build the model. In machine learning, we use algorithms to learn models, which are generally functions.
-
In supervised learning, the abstraction of the function — the act of shrinking the training — takes place after (or sometimes in tandem with) demonstration.
-
In this example, the learned function is so complex that we’re representing it in shorthand, with contract notation.
(5) After training is complete, a human can push ALVINN’s run switch and the vehicle will begin driving. As ALVINN drives, it produces steering angles it learned from the human driver (who demonstrated the steering angle at each segment of the road), along with a numeric of "confidence score" in the angle provided.
If you want your students to see ALVINN in action, now is a good time to view this brief two-minute video.
-
What information does ALVINN process before producing a steering angle?
-
ALVINN instantaneously processes the image of the road in front of it in order to produce a steering angle.
-
When humans make decisions about which way to steer, we are working with a lot of other information besides the image of the road in the moment. What examples can you come up with?
-
We can use maps to give us a sense of what the road might do before we can see it.
-
If a road is curving, we can predict that it will continue to curve.
-
We know that roads don’t curve beyond a certain degree—and if they do, we can expect to see a warning sign ahead of time.
-
We can look at the cars in front of us to better understand how we should steer.
-
If we know that we’re going to be taking a left turn, we might switch lanes and slow down ahead of time.
Computers aren’t people!
In conversations about AI, computers often get anthropomorphized (given human-like traits) when they are not in fact human. This anthropomorphization of AI is a slippery slope that can block students from understanding the mechanics of machine learning.
We urge you to avoid referring to ALVINN as "him" or "he".
Many students will suspect that ALVINN has thoughts and feelings of its own, a misconception that is important to correct.
A machine’s "confidence" is very different from a human’s confidence. When you discuss ALVINN’s "confidence", highlight that this score is a numeric value, which is the result of mathematical computation. All machine learning relies on data, functions, and computation.
In discovering the details of ALVINN’s supervised learning, you may have noticed three big events:
-
Demonstration of the learning process
-
Function abstraction — the machine learning algorithm finds a function that generalizes (hopefully well!) to new, unseen data
-
Use the function! Apply it on new data.
As you explore other examples of supervised learning in this curriculum, you will notice that — regardless of the context — all three phases occur.
Investigate
Let’s apply what we know about machine learning to ALVINN and its training.
With a partner, complete Supervised Machine Learning: Training a Self-Driving Car.
Review students' responses, allowing time for discussion, questions, and disagreement.
While responding to the questions on the worksheet, you hopefully arrived at a few conclusions about ALVINN:
-
At the beginning of training, ALVINN’s guesses about the best steering direction are not good.
-
As ALVINN receives more examples, it becomes better at predicting and can imitate the steering reactions of a human driver.
-
Training on one surface does not help ALVINN on any other surface! Failure to repeat the same training for a variety of road types (two-lane, four-lane, intersections, covered with leaves, covered with snow, etc.) would lead to bad outcomes.
In supervised machine learning, the computer trains on example input-output pairs tagged by a human and learns a function that maps from input to output.
The case of ALVINN is just one example of supervised learning. There are countless others!
-
Spam detection. When email users indicate that an email they have received is spam (demonstration), they are contributing to a massive, labeled dataset that can be used to train a model to classify emails as spam and everything else, implicitly, as not spam. (Although Gmail sometimes asks users if something is “not spam” — see the image, below.) The "supervision" comes from the fact that the training data includes examples of both spam and legitimate emails.

-
Image classification. When you do an image search for "apple", how does the computer know which images are of apples? In 2006, AI researcher Fei-Fei Li began working on the idea for a large visual database (ImageNet) to develop and improve visual object recognition software. ImageNet collects millions of images that have been hand-annotated (demonstration) with object categories. This collection is used for training, to produce a function that can label new images. This labeling is used by image search engines.
-
Handwriting Recognition. The United States Postal Services uses handwritten address interpretation systems to read handwritten addresses on envelopes. The MNIST database (Modified National Institute of Standards and Technology database) is one example of an early database used for the training of such systems; it includes thousands of labelled images of handwritten digits.
Synthesize
-
What is supervised machine learning, and how is ALVINN an example it?
-
In supervised machine learning, the computer trains on example input-output pairs tagged by a human, and learns a function that maps from input to output. ALVINN is an example of supervised machine learning because a human provided the correct steering angles (demonstration), allowing ALVINN to produce a predictor function (function abstraction).
-
How is the problem of Spotify trying to improve its recommendations similar to the problem of ALVINN trying to drive on new surfaces?
Hint: Think back to the case study from Data-Driven Algorithms: Spell Checkers on Michelle’s Spotify use. Recall that, at first, Michelle did not like Spotify’s "Discover Weekly" playlist because the songs did not match her tastes. -
Giving Spotify more data is one possible way that Michelle could get better song recommendations. Similarly, ALVINN will produce safer, more accurate steering instructions when exposed to more training: training on snowy roads, on icy roads, on three-lane highways, etc. With data-driven algorithms, more data produces better results even when the same algorithm is being used!
-
Another option, though, is to use a different algorithm! Just as an improvement to Spotify’s algorithm might result in Michelle enjoying its output more, a change in ALVINN’s contract could produce safer driving. For instance, ALVINN’s programmers could update the contract for it’s function so that the program takes into consideration some history, rather than making all decisions instantaneously. This way, the program could respond appropriately to road signs and other data.
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927).
Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.


