AI and Machine Learning

Machine learning is a cutting-edge topic in industry and academia. This module is guided by the emergent AI4K12 framework, which includes ideas for how to teach machine learning. Early activities include exploring and classifying real Twitter data using the already-familiar block-based programming environment. Students examine data features from several demo Twitter accounts and use this information to develop their own classification rules. As a class, students can group by certain data features (tweets, vs retweets, etc.) to see how that affects the presence of bots in clusters. Once familiar with classification, students build simple classifiers using datasets of 100s of Twitter accounts. An important component of this module is ethics in ML and biases perpetuated from the pre-existing datasets on which algorithms are trained. Articles and stories from the news are incorporated into these discussions. The second machine learning unit takes a deeper look at classifiers. Students work with ML services, such as IBM Watson, classifying text to detect sentiment such as bullying or not bullying. Students are able to modify the training sets to see how that influences the effectiveness of the algorithm. Students then make modifications to the ML algorithm parameters, and eventually design their own learning systems.

Table of Contents

Unit 0: Intro to AI/ML Module and NetsBlox

Estimated Duration
  • 45 minutes – Intro to NetsBlox
  • 45 minutes – Draw Square
  • 45 minutes – Quilting & Variables Activity
  • Total: 135 minutes (2 h, 15 min)
Activities

Unit 1: Introduction to Artificial Intelligence – AI and Drawing

Estimate Duration
  • 60 Intro AI Slides & Ranking AI
  • 60 minutes AI & Drawing 
  • Total: 120 minutes (2 hours)
Lesson Summary

Students will:

  • Explore a program that uses ML
  • Explore the data that trained that program
  • Explore how Google deals with the bias that entered that data
Learning Objectives

Students will learn that:

  • Machines make decisions based on data provided to them
  • Data contains the bias of the people who entered it
  • Considering bias allows you to think about how to counteract it
Vocabulary

Bias, Data, Model, Machine Learning, Algorithm, Artificial Intelligence (AI)

Activities
Resources

Unit 2: Algorithms and Search

Estimated Duration
  • 20 minutes Searches Slides
  • 20 minutes Intro to Breadth First Slides
  • 120 minutes Exercises 1-4 BFS
  • 80 minutes Exercises 5 & 6
  • Total 4 hours
Lesson Summary

Students will learn about graph traversal methods and navigate through graphs that are representative of geographic maps and contact tracing through social networks.

Learning Objectives

Students will be able to:

  • Understand what an algorithm is and how it works
  • Learn how AI agents find the shortest path between two points
  • Understand how this technology affects our lives (i.e., applications of technology)
Vocabulary

Breadth First Search, Nodes, Paths, Branches, Graph, Tree, Traversal, Weights, Neighbors, Pruning, Algorithm, Shortest Path, Intelligence, Artificial Intelligence (AI)

Activities
Resources

Unit 3: Machine Learning

Estimated Duration
  • 15 Machine Learning Current Event
  • 45 Unplugged Activity/Game
  • 60 Twitter Bot Activity
  • Total 2 hours
Lesson Summary

Following an introduction to the main three areas of machine learning (supervised, unsupervised, and reinforcement), students will have a more in-depth activity on a supervised learning technique: classification. Understanding that classification uses labeled data, students will learn how models classify humans and bots.

Learning Objectives

Students will:

  • Understand the difference between AI and ML
  • Learn how classification and misclassification and the labeling that affects how the model classifies
Vocabulary

Classification, Binary, Bot

Activities
  • Introduction to Classification/Misclassification
  • NetsBlox/Unplugged Twitter Bot Classification
Student Resources
Teacher Resources

Unit 4: Intro to Natural Language Processing and Sentiment Analysis

Estimated Duration
  • 120 minutes – Sentiment analysis 
  • Total 2 hours
Lesson Summary

In this lesson, students will learn about natural language programming as an AI application. Then they will apply sentiment analysis to two different forms of media (tweets and song lyrics).

Learning Objectives

Students will:

  • learn about sentiment analysis on natural language applications (i.e., music lyrics).
Vocabulary

Natural language; sentiment analysis; polarity; API

Activities

Introduction to NLP and Sentiment Analysis.
Twitter Sentiment Write (unplugged movies reviews).
Music (song lyrics) Sentiment using Genius API (NetsBlox/ view in python).

Student Resources
Teacher Resources

Unit 5: Music Sentiment Analysis

Estimated Duration

120 minutes Project (Netsblox or Python) (up to 5 hours)

Lesson Summary

The project teaches students about list comparisons, and they are tasked with finding “groups” of musicians (music sentiment) to compare to the sentiment analysis.

Note: This is also an opportunity to transition into talking about small datasets and how, although the results are interesting, they are NOT statistically significant.

Learning Objectives

Students will:

  • learn about comparing sentiment analysis between different musicians (i.e., music lyrics)
  • learn about formulating a research question and hypothesis
  • learn about small batch data analysis and how to talk about results
Vocabulary

List comparisons

Activities

Comparison of sentiments across groups (Netsblox/Python – user choice)

Teacher Resources

Unit 6: Bias in Datasets and Ethics in AI/ML

Estimated Duration
  • 20 minutes (Introduction to Ethics)
  • 30 minutes (Activity 1) 
  • 60 minutes  researching topic 
  • 60 minutes writing 
  • 30 minutes – presentation prep
  • 100 minutes – oral presentation
  • Total 5 hours
Lesson Summary

Fairness, Accountability, and Transparency is a rising areas in machine learning. Since ML models are trained on real-life (or synthetic) data, any real-life biases will be inputted into models’ learning. For example, if you want to create a model to automate reading resumes and you give the model the kind of resume that the company typically accepts. However, all of these resumes have common white American male names (like Paul, Harry, George, and William). Then the model you train on these resumes may be biased toward women or names not included in the training set.

Students will learn about how research has accounted for these kinds of biases and the steps that can be taken to prevent bias in machine learning.  

Learning Objectives

Students will:

  • study different ethical dilemmas in AI/ML
  • observe the impacts of bias and learn how to mitigate it generally
  • gain an understanding of data representation
Vocabulary

Fairness; Accountability; Transparency; Bias; Discrimination; Underrepresentation; Overrepresentation; bias mitigation; data augmentation

Activities
  • Present on an ethical dilemma with a solution
Teacher Resources

Unit 7: Other ML Techniques

Estimated Duration
  • 10 Minutes (Introduction to Neural Networks)
  • 20 minutes (Reasoning Problem Introduction)
  • 15 Minutes (Imitation Learning Activity)
  • 15 minutes (Reasoning Problems Activity)
Lesson Summary

Students will learn about the internal structure of neural networks.
Students will learn how imitation learning works with the Learn to Catch NetsBlox Activity.

Learning Objectives

Students will:

  • categorize real-world problems as classification, prediction, sequential decision problems, combinatorial search, heuristic search, adversarial search, logical deduction, or statistical inference.
  • list an algorithm that could be used to solve each type of reasoning problem
Vocabulary

Neural networks; node layers; optimization function; sequential decision making; combinatorial search; heuristic search; adversarial search; logical deduction; statistical inference

Activities
  • Intro to Neural Network
  • Machine Learning Reasoning Crossword Puzzle
  • Find My Reason!
Teacher Resources

Unit 8: Deep Neural Networks

Estimated Duration
  • 60 minutes (Activity 1)
  • 30 minutes (Activity 2)
  • 120 minutes (Activity 3) 
  • Total 3.5 hours
Lesson Summary

Students will learn about features and neural networks by working with the Tensorflow Playground. They will learn about how neural networks mimic the human mind. They will train a multilayer neural network using the backpropagation learning algorithm and describe how the weights of the neurons and the outputs of the hidden units change as a result of learning.

Learning Objectives

Students will:

  • be able to describe the following neural network architectures and their uses: feed-forward network, 2D convolutional network, recurrent network, generative adversarial network
Vocabulary

Features; weights; deep learning; backpropagation

Activities
  • TensorFlow Playground Activity
  • Square Root Predictions Machine Learning – Parsons Problem
  • Better Machine Learning
Student Resources
Teacher Resources

Unit 9 Real World Applications of AI/ML

Estimated Duration
  • 120 minutes (AI & Environment)
  • 120 minutes (AI & Criminal Justice)
  • Total 4 hours
Lesson Summary

Students will learn about real-world application of AI and ML in three domains: the arts, environment, and criminal justice system.

Learning Objectives

Students will:

  • gain an understanding of how previous concepts are actualized in applications
  • see examples of computer science intersecting with other domains that may not seem intuitive
Vocabulary

Computer vision, pixel, metadata, processor, GPU

Activities
Resources