Skip to content
Forward Education logoForward Education logo
Using a Wave to Illustrate Bias in AI Machine Learning Models

Using a Wave to Illustrate Bias in AI Machine Learning Models

Think about the last time you waved hello to someone. Did you use your right hand or your left hand? Did you wave really big and enthusiastically or small gently? Were your fingers spread wide or maybe you waved like you were the Queen? You may not realize it, but this example can be used to perfectly illustrate the concept of bias in AI machine learning models with your students.

Using a micro:bit and CreateAI, we can build a machine learning model that can be trained to recognize all sorts of different waves. Through this process, students will discover how data samples can create bias in AI systems, how computers interpret data, and our responsibility as users of this AI technology. 

How Machine Learning Models work 

In order to understand how this example of a ‘wave’ relates to the world of AI and computer science, let’s take a look at how machine learning models work. At its core, machine learning models are trained to identify patterns and make decisions based on data rather than being explicitly programmed.

If we were to record a sample of you waving, we could then train a machine learning model to recognize when you’re actually waving verses just giving a thumbs up. Using the micro:bit and CreateAI, we can measure this by using the x, y, z accelerometer values (more on this process below). 

But what happens when our machine learning model fails to recognize the wave of your friend who’s left-handed because you only trained it on your right-handed wave? This illustrates bias in our AI model because we only trained it on limited samples, and therefore the model favours our right-handed wave over other types of waves.

We can use this simple example to understand how this bias can have real world impacts. One example of this occurs today in facial recognition systems. Some government studies have shown that facial recognition systems have a harder time recognizing the faces of different racial groups. This means that some facial recognition systems are biased towards the faces of caucasian individuals. 

Creating this Experience in the Classroom  

At Forward Education, we love this waving example because it takes complex AI literacy topics and makes them tangible and easy to comprehend. With a few simple tools, educators can take this waving analogy and use a micro:bit and CreateAI to build a real machine learning model that detects different kinds of waves! 

Activity Introduction

Ask students in the classroom to start waving at each other. Ask them to observe how their wave might differ from their classmates: 

  • Right hand vs. left hand 

  • Big wave vs small 

  • Fingers spread apart vs together 

  • How might you interpret the person’s emotions based on the wave? (Excited, happy, sad, tired) 


Using the micro:bit and CreateAI to build a Machine Learning Model 

In order to create our ‘wave detector’ we will use a micro:bit, CreateAI, and a battery pack with a wrist strap (like CHARGE). This activity is best done individually but could be facilitated in pairs. 

  1. Follow the prompts in CreateAI to connect your micro:bit to the program.

  2. Have students record at least three samples of their individual wave with the micro:bit assembly attached to their wrist. The micro:bit should be securely attached so it’s in a consistent position each time a sample is recorded.

  3. In order for the wave detector to decide if a wave is occurring or not, it will need another action to compare against. Have the students record a second hand gesture like a thumbs up, jazz hands or something similar.

  4. Adding a third action for ‘resting’ is good practice. This will help the machine learning model differentiate between waving, your second action, or doing nothing at all. 

Training the Machine Learning Model 

Once all the actions and data samples have been added to CreateAI, you can click the button that says ‘Train model’. 


Testing the Model 

Now it's time to test your machine learning model! Perform each gesture and see how accurately the model predicts each action by using the 'certainty' percentage metric. 

This is where you can ask students to think back to all those different types of waves. When they trained their model, they just recorded their individual wave, but how well would the model recognize a wave with your left hand? What about one of those other wave variations from the introductory activity?

AI Literacy Inquiry 

Ask the students to question the accuracy of their machine learning models based on those different types of waves.

  • Does the model have a hard time detecting different types of waves?
  • Does the model sometimes get confused between a wave and another kind of hand gesture?

These unpredictable outcomes illustrate bias in our machine learning model based on the limited data our model was trained on. 

We can also start to think about things like fairness, consequences, responsibility, and other ethical considerations when it comes to AI. By using our wave detector and a little bit of code, we could program our wave detector to play a fun song and show a smiley face on the micro:bit LEDs every time a wave is detected (more on this later).

We could go around waving at our classmates and hearing a fun song. But what if all of the sudden, that wave detector doesn’t work because it’s not detecting our friend’s wave that may be a little bit different than ours? Is this fair? Our wave detector doesn’t work for other users.

What sort of consequences might this have? Our friend might feel excluded because they can’t use the wave detector device like everyone else. What is our responsibility as the creator of the wave detector? As the creator of this machine learning model it is our responsibility to make sure the device works for all users, and all wave types. How could we improve the accuracy of the model for everyone by adding additional data samples in CreateAI?

What about our responsibility as users of the wave detector? Just because the wave detector didn’t detect a certain type of wave does that mean our wave is wrong? Or that it’s not a real wave? Of course not. Maybe someone is just left-handed, or maybe culturally they wave differently. It’s our responsibility as users of AI to question the outcomes of the machine learning model and not take them at face value. We need to think critically about how the data the model was built on may affect the produced results. 

 

Improving the Machine Learning Model 

With all of those AI literacy topics in mind, we can revisit our CreateAI model to improve it and hopefully make it better for all users. You can go back to your data set and add additional samples for each action, accounting for things like left-handed waves, big waves, small waves etc. 

Retrain your model and test its accuracy again. Once the model is improved we can go on to add some code to trigger different sounds or LEDs when a wave or other action is detected. 


Using the ML Model to Trigger Code Outputs

Once you’ve trained an improved machine learning model in CreateAI you could stop there, but you also have the ability to use that model to trigger different code outputs for each action. In CreateAI, you’ll see a button to open your model in MakeCode. In MakeCode you’re now able to use each of your train action models as inputs. By putting other code blocks inside of those inputs you’ll be able to trigger various reactions when an action is detected. 

Have students add LED and sound blocks that make sense for each different type of action. Download this code from MakeCode and test out your full wave detector project!

Real World CreateAI Projects 

Now that you understand how to build a machine learning model with CreateAI, and how AI systems like this can be used in the real world, you can start to come up with ideas about how to use this technology for real applications!  

Instead of waving, could we train our model to recognize different sign language gestures and play sounds to help someone better communicate? There are so many ways we could use the micro:bit’s accelerometer and CreateAI to build a machine learning model that helps people! 


AI for Good Competition 

If you come up with a solid idea using micro:bit and CreateAI you can submit it to our AI for Good Competition! The AI for Good Competition challenges students to identify a problem area in their community that could benefit from machine learning technology and design a functioning prototype to solve that problem. There’s up to $10K in prizes available across different age divisions. 

For teachers, we have a separate division where educators can submit lesson plan ideas for teaching AI and AI literacy like we have demonstrated in this post. Every educator that submits a qualifying lesson plan will receive a CHARGE for micro:bit for FREE! 

For Competition details and to register, please visit: https://forwardedu.com/pages/ai-for-good-competition


Additional Resources

 

Cart 0

Your cart is currently empty.

Start Shopping
close
close
close
I have a question
sparkles
close
product
Hello! I am very interested in this product.
gift
Special Deal!
sparkles