1 of 22

The Arizona STEM Acceleration Project

AI and Ethics: Day 4

2 of 22

Image Recognition, Text Classification, and Bias

A 7th & 8th grade STEM lesson

Janae Thomas

June 2023

3 of 22

Notes for teachers

  • Context: This lesson is the fourth day to a multi-day lesson.
    • Each “activity” can be completed within a class period, depending on time and choice OR over the course of a couple days.
    • Incorporates (social studies) and reading
  • This multi-activity lesson can be used as a stand-alone lesson to help students visualize and analyze the impact of societal bias on AI and what that can mean for our society.
  • Lesson 1
  • Lesson 2
  • Lesson 3
  • Lesson 4

List of Materials

  • Slides
    • Possible printed/guided notes
  • Image Recognition: Devices to access Teachable Machine
  • Text Classification: MIT Word Analogies
  • (Remediation): Digitally saved pictures of dogs and cats — I recommend making a folder
  • (Extension/Enrichment): Copies of the article “Even Kids Can Understand That Algorithms Can Be Biased”

4 of 22

AZ STEM Standards

Computer Science Standards

  • 7.CS.D.1: Identify some advantages, disadvantages, and consequences with the design of computer devices based on an analysis of how users interact with devices.

Science and Engineering Practices

  • ask questions and define problems
  • engage in argument from evidence

ELA Standards

  • 7.W.4: Produce clear and coherent writing in which the development, organization, and style are appropriate to task, purpose, and audience.
  • 7.SL.1: Engage effectively in a range of collaborative discussions (one‐on‐one, in groups, and teacher‐led) with diverse partners on grade 7 topics, texts, and issues, building on others’ ideas and expressing their own clearly.

5 of 22

Objective(s):

  • SWBAT develop algorithms in order to train an image recognition program.
  • SWBAT share personal experiences and opinions about AI and technology utilizing evidence from their own experiences and texts.

6 of 22

Agenda (lesson time)

Day 4 Agenda

  • Image Recognition: 20-30 Minutes
  • AI and Bias: 5-10 Minutes
  • Text Classification: 15-20 Minutes
  • Journal Activity: 5-10 Minutes
  • Day 1: Introduction to AI
  • Day 2: What can be classified as AI
  • Day 3: Ethical Dilemmas and AI
  • Day 4: Image Recognition and Text Classification

7 of 22

Important Vocabulary Review

  • Robots - machines that sense their environment, do calculations of some kind, and then perform an action
  • Technology - skills and tools that people use to achieve goals, often to make life easier
  • Artificial Intelligence (AI) - a program made by people that makes computers do things that seem intelligent, or smart, in the same way that humans are intelligent
  • Ethics - moral guidelines for how people in society should behave if they want to be fair
  • Algorithm - A set of steps or rules to follow in order to solve a problem or accomplish a specific goal.

8 of 22

Image Recognition �(20-30 Minutes)

This activity involves using a FREE website program called Teachable Machine to teach students about how AI uses image recognition.

Have students complete this activity in groups.

  • Teachable Machine is A FREE WEBSITE. If it mentions anything about paying for anything, please don’t.

9 of 22

Image Recognition and AI

Just like a typical algorithm, you have:

INPUT

OUTPUT

CAT

Steps to Change Input

Learn features from training data

An image

A label for the image

10 of 22

Computers and Understanding Images

For a computer to understand an image:

  1. It takes the image and turns it into pixels.
  2. It uses the neural network to combine pixels into features.
    1. All the “edges” are combined together in Layer 1 and 2 to recognize this feature.
  3. With training, it uses features to determine the images’ class.
    • After enough training (more images), it will begin to recognize certain features of “a woman”, for example.

11 of 22

Let’s Try it Together!

We’re going to use a program called Teachable Machine and train it to recognize and classify pictures using our webcams. We’re going to train it how to recognize:

  • Rock
  • Paper
  • Scissors

12 of 22

Your Turn!

Start a new project on Teachable Machine and train it to distinguish between cats and dogs.

  • Upload a variety of images.
  • Think about the specific features that make the two species different.

After training the program, test it!

13 of 22

Image Recognition - Reflection Questions

  • Who was able to program their AI to recognize a cat and a dog majority of the time?
    • What was easy? What was hard?
  • What were some mistakes you all made in the beginning? Were you able to fix the mistakes or adjust accordingly?

Write a 2-4 sentence reflection on the following question:

How can AI image recognition possibly cause ethical dilemmas in the future?

14 of 22

AI and Bias (5-10 Minutes)

Possible Discussion Questions

  • What is algorithmic bias? What causes algorithmic bias?
  • What are some examples of algorithmic bias identified in the video? Who did they impact?
  • If algorithmic bias exists in technology, how might that impact society?
  • Based off what you know about training algorithms, how could this problem be fixed?

15 of 22

Text Classification �(15-20 Minutes)

This activity involves using a free program from MIT.

Have students complete this activity in groups.

  • This website is A FREE WEBSITE. If it mentions anything about paying for anything, please don’t.

16 of 22

Text Classification and AI

Same thing, it’s a simple algorithm:

INPUT

OUTPUT

Steps to Change Input

“Please come here”

“Forward”

Compare input to training data

User speech or text

Corresponding label

17 of 22

Computers and Understanding Words

For a computer to understand words:

  1. It takes the input word(s) and change them into word vectors.
    1. cat - “Living being”, “feline”, “gender”
  2. It uses the input word(s) neighboring words to compare the word(s) to the training data.
    • “cat” is very close to “kitten”

18 of 22

Word Analogies

Sometimes, problems can arise in text classification.

To visualize this, let’s use this website Exploring Word Analogies.

Take some time to look at the other classification, specifically the Jobs graph.

19 of 22

Word Analogies Discussion

  • What did you discover when you looked at Jobs and gender in word analogies?

  • What products do you know of that may use word analogies/embeddings?

  • Sometimes we can’t fix training data. How else might we go about handling bias in AI algorithms?

20 of 22

Let’s think…what could be the problem?

  • Google “Lawyers” vs. “Court Assistant”
    • What do you see?
  • Google “Doctors” vs. “Nurses”
    • What do you see?

21 of 22

Journal Activity (5-10 Minutes)

  • In 4-6 sentences, respond to the following prompt:
    • More and more, we are starting to see more versions of AI being developed and, eventually, utilized by our society at large. Do you feel this a step in the right direction? Why? What are some possible benefits and consequences that can arise from using this technology more often in our society?

22 of 22

Differentiation

  • Any of the slides contain notes can be printed to provide to students to take notes or follow along.
  • Different grouping strategies can be used for all these activities.
  • For the Image Recognition activity, pictures of cats and dogs can be provided as guidance.

Remediation

Extension/Enrichment

  • For the Image Recognition activity, students can be encouraged to train the system to recognize other common pets, like fish, rodents, reptiles, etc.
  • It is possible to upload the Teachable Machine models to block coding programs like Scratch and have the bots recognize an image and act accordingly. This takes a bit of “playing” with the program, but you would export the model and add the Teachable Machine extension to Scratch.
  • The website Most Likely Machine goes into further details about algorithmic bias and gives excellent examples of how it affects people. It also has a cool little game to really show how algorithmic bias comes about!
  • There’s this really good article from Scientific American about algorithms and bias and it can be provided to students using a reading or Kagan strategy.