It’s time to put your trained model to work!
Dataset
Model
finds
patterns
Model
makes
predictions
Correct actions or decisions!
Which platform did you choose?
Click on the platform you trained your model with to learn more about how to add code to make your project take action!
Tip: Choose one path and follow it. Do not do them all!
Teachable Machine just allows you to train an AI Model. There are many platforms that will allow you to use that model to make something.
- If you are planning on making a Scratch project, we suggest RAISE AI Playground, from MIT, a version of Scratch, because it’s easy to add a Teachable Machine model .
- If you are planning on making a mobile app, MIT App Inventor has an extension you can use to use the model in your app.
The first video shows how to use a Teachable Machine model for snap, clap, whistle sounds (Unit 5) in a Scratch project.
The next video shows you how to use a Teachable Machine image model to make a rock, paper, scissors game in App Inventor. If you need help making the model in Teachable Machine using images, this video will walk you through it.
- Scratch project
- Python project
- Or a mobile app with App Inventor
In this video, you’ll learn to take the Iris identification AI model from Unit 7, and use it in a Scratch project to display the correct iris picture based on sepal and petal measurements.
Models created with the App Inventor Personal Image Classifier or the Personal Audio Classifier can be integrated into a mobile app using MIT App Inventor.
Now code the app so it identifies images of citrus to tell whether it’s healthy or diseased.
ACTIVITY: ADD MODEL TO YOUR PROJECT
- Plan what actions you want your app or Scratch project to take.
- Have your AI model ready.
- Import it into the platform of your choice.
- Code!
Train your AI Model
Remember:
Healthy predictions need healthy data!
Healthy
dataset
Finds
correct
patterns
Healthy
prediction!
Correct actions or decisions!
Do you remember what makes a healthy dataset?
- Lots of data
- Accurate
- Matches your problem and solution
- Different examples of data
- The right kind of data
- You have permission to use it
IT'S TIME FOR YOU TO START TRAINING YOUR DATA!
You should have gathered your data by now… or at least started!
WHETHER IT’S…
Your own training data from your community
and/or
Data gathered from sensors or user input
and/or
Data collected from public datasets
Click on a platform name below to learn more and try out some tutorials.
- Train images, sounds or poses
- Attach devices to capture sensor data
Here are three tutorials to try out Teachable Machine using different data types.
- Image Classification with bananas
- Sound Classification with snaps, claps, and whistles
- Pose classification to detect head tilt
- Train images, sounds, text, or numbers
- Make a Scratch or Python project
- Or a mobile app with App Inventor
This video is an example of a Technovation team using Machine Learning for Kids to make a mobile app to sort biomedical waste.
TRY IT YOURSELF!
In this video, see how to take the Iris public dataset from Unit 6 and train it using Machine Learning for Kids.
- Train images, sounds, or poses
- With your trained dataset you can make a mobile app that uses AI.
WANT TO TRY IT?
In this video, see how you can use the App Inventor image classifier to train an image dataset. This dataset classifies healthy fruit vs diseased fruit.
ACTIVITY: TRAIN YOUR MODEL
- Choose the AI tool you want to use for your Technovation Project.
- Add your examples.
- Train and test your AI model.
Mentor Tip
Best practices: Training models is hard! Even Google gets it wrong. Their AI was trained but still started outputting wrong results! Don’t give up!
Guiding Questions to ask students: How accurate do you want your AI model to be? If it can not be 100% accurate, what is an acceptable answer? 80% of the time? Does that depend on the risk of what you are using the model for? For example self driving cars have to be pretty accurate otherwise they might hurt someone but google search results apparently have a much lower bar.
Mentor tips are provided by support from AmeriCorps.
Collecting Data
Remember, healthy predictions need healthy data!
Healthy
dataset
Finds
correct
patterns
Healthy
prediction!
Correct actions or decisions!
But what makes data healthy data?
Can you make a list?
Did you think of any of these in your list? (click to see)
Healthy data
Lots of data
Accurate
Matches your problem and solution
Different examples of data
The right kind of data
You have permission to use it
Healthy prediction!
Better actions or decisions
THERE ARE 3 WAYS YOU CAN COLLECT HEALTHY DATA
Collect your own training data from
Gather data with
Use data from
What path is right for you?
COMMUNITY
if the information you need is available from your community, and you can get permission to use it.
SENSORS
if you want your app to collect data on its own .
PUBLIC DATASETS
if you need lots and lots of data or you’re solving a problem that is more global.
COMMUNITY DATA
Plan: What type of data do you need from your community? How will you gather it?
SENSOR DATA
Voice assistants like Siri or Alexa have a microphone, which is a sound sensor, to gather data (like what a person is saying)
This smart crosswalk has a light sensor to gather information about how light and dark it is and a motion sensor to detect movement.
Different sensors gather different types of data!
HARDWARE OPTIONS
You will need devices to help you capture your data. Consider using:
Phone
Your phone has many sensors that can be used to gather information... Think mobile app!
Arduino
Small circuit board that can gather data and is built to use AI.
micro:bit
Small circuit board that can gather data and is built to use AI.
Raspberry Pi
Mini-computer (board) as powerful as a laptop!
For more, check out this big list of sensors.
This video from our World Summit 2020 has lots of great information on hardware options!
PUBLIC DATASETS
You might want to use a public dataset if …
You want more complete data.
You want to use a lot of data.
You want accurate data.
WHERE TO FIND PUBLIC DATASETS
Here are some good places to start. (Click images to visit sites.)
Here are some links to sample datasets according to problem types:
- Water issues: World WASH Data
- Life on land issues:
- Climate issues
- Gender inequality: UNDP Gender inequality dataset
Here are some links to sample datasets according to problem types:
- Water issues: World WASH Data
- Life on land issues:
- Climate issues
- Gender inequality: UNDP Gender inequality dataset
WHERE ELSE COULD YOU LOOK?
You can try:
- local organizations
- local schools
- local libraries
- where else?
It’s not easy finding the perfect dataset. Remember to ask for help!
The activity below is practice in finding and using a public dataset and training a model using Machine Learning For Kids. The dataset has information about iris flowers, and the model will predict the type of iris based on length and width of flower parts.
ACTIVITY: TRAIN A MODEL
In the next unit, we’ll use the iris AI model in a Scratch project!
DO THE BEST YOU CAN!
You may not be able to gather the perfect dataset, but gather what you can.
Proxy data is data that is a placeholder for a later version of your dataset.
JUMP IN AND STARTING PUTTING YOUR DATASET TOGETHER!
Check off these items to make sure you create a strong dataset!
Healthy Datasets
DATA FUELS AI
Healthy datasets lead to correct actions with AI!
Healthy datasets have lots of different examples!
IT'S IMPORTANT TO SPEND TIME GATHERING HEALTHY DATA!
If your data is healthy …
Healthy
dataset
Finds
correct
patterns
Healthy
prediction!
Correct actions or decisions!
If your data is not healthy …
Unhealthy
dataset
Finds
bad
patterns
Bad
prediction!
Incorrect actions or decisions!
But how do we make healthy datasets?
Healthy datasets
Lots of data
Different examples of data
The right kind of data
(example: not using pictures if sounds would be better)
REMEMBER OUR MAKE ME HAPPY MODEL?
How
healthy
was this dataset?
Finds
the right
patterns
Correct
prediction
for happy
or sad
Correctly shows a happy or
sad face
Is the Make Me Happy dataset healthy?
Does it have lots of data? Were there equal amounts in each class?
What different examples of data does it have? Could we have added more, different data?
Does it use the right kind of data? Why?
Let’s check if the dataset is healthy!
More than 10 pieces of data means we are off to a good start with lots of data!
We have different example sentences as our different types of data.
Our model uses sentences, so a text dataset (happy and sad sentences) is the right kind of data!
Likely to make the right decision and display the correct happy or sad face!
Can you make the dataset for Make Me Happy better?
Healthy datasets
Lots of data – are there more sentences we can add to the training data?
Different examples of data – are there sentences in another language we should add?
The right kind of data – instead of text should we use audio clips (sound)?
You can make
an even better happy/sad recognizer!
Below are some activities to get you ready to work with datasets! First, you will judge some existing datasets to see if they are healthy, and then you’ll practice planning a dataset for a given problem.
Training an AI Model
Let’s explore how patterns can help AI make predictions and do actions.
Dataset >
finds patterns with learning algorithm >
prediction to make >
actions or decisions!
Dataset
Happy sentences and sad sentences
You will train your dataset with sentences that can be considered happy and others that can be considered sad.
OR
ACTIVITY: HAPPY OR SAD
In this first video, you’ll visit the Machine Learning for Kids website and make a non-AI Scratch project to start.
In this second video, you’ll make your dataset, then train and test it.
This is called supervised learning, because you are carefully watching how your model learns and fixing any issues.
In this third video, you’ll use your model in your Scratch project so the sprite can react using AI.
CONGRATULATIONS!
You’ve trained an AI model! You can always improve your model by adding more examples. Make sure you test your model if you do!
Now test yourself with the AI Models quiz.
How Does AI Work?
Let’s start to explore how Artificial Intelligence actually works!
There are THREE parts to Artificial Intelligence.
DATASET
PATTERNS
PREDICTION
This video is all about the first part, datasets.
Stop and THINK
What ways do you and your family create data everyday using your computer or phone.
- Every Google search
- Words you type into emails
- Every question you ask Alexa/Siri/OK Google
- Connected devices – each time you turn on lights, change room temperature
- Taps you make on your cell phone
- Anything you buy online
- Songs you listen to
- Steps you take walking with your phone
- Videos you watch
This next video will talk about the next parts of AI – patterns and predictions.
Stop and DISCUSS
How does Youtube suggest videos for you to watch? What are the dataset, patterns, and predictions for Youtube?
Dataset
- Past videos you’ve watched
- Videos other people watch
- What you just watched
Patterns
- Find videos that are watched by people who are like you
- Find videos that other people watched after they watched a video like the one you just watched
Prediction
- A list of videos you might like to watch
ACTIVITY: HOW DOES AI WORK?
Stop and Discuss
Based on the activity:
- What did you learn about the data?
- Did anything surprise you?
- Was it hard to figure out which data the AI technology used? Why or why not?
What is AI?
This video will get you thinking about artificial intelligence, and how to tell whether something is AI or not.
Let’s play a game to see if we can tell what uses AI… and why!
DIRECTIONS
For each example, choose which one uses AI … and why!
Base your answers on the questions below.
- Does it understand or sense things?
- Can it learn over time?
- Can it make decisions?
- Can it interact with humans?
- Can it do it on its own or is it following commands?
EXAMPLE
Pick which one you think uses AI.
This alarm clock is set to go off every morning at 6:30am.
This smartwatch can recognize voice commands, monitor your activities and health and give you updates on your day.
This alarm clock is set to go off every morning at 6:30am.
NOT AI!
This smartwatch can recognize voice commands, monitor your activities and health and give you updates on your day. AI
READY? LET'S START!
QUESTION 1
Pick which one you think uses AI.
Vacuum
Roomba
Check the answer
Vacuum not AI
Roomba AI
The Roomba learns the layout of the room and uses that information to plan its best course.
QUESTION 2
Pick which one you think uses AI.
Remote controlled cards
BMW i3 parking assistant
Check the answer
Remote controlled cars not AI
BMW i3 parking assistant AI
The BMW i3 uses AI to back the car into small spaces by using sensing and image recognition.
QUESTION 3
Pick which one you think uses AI.
Prosthetic that responds to user’s thoughts
Prosthetic that responds to user’s movement
Check the answer
Prosthetic that responds to user’s thoughts AI
The prosthetic learns how to perform movement based on brain signals.
Prosthetic that responds to user’s movement not AI
QUESTION 4
Pick which one you think uses AI.
Email predictor
Spell checker
Check the answer
Email predictor AI
The email predictor learns what usually comes next when certain words are written.
Spell checker not AI
ADDITIONAL RESOURCES
This video shows how AI can help people in many ways. It also shows how AI can be harmful to humans in some ways
Web Apps Using AI Models
- Train a machine learning model using Python libraries in a Jupyter Notebook
- Incorporate a trained machine learning model into a Streamlit web app
These are the activities for this lesson:
WORKING WITH MACHINE LEARNING MODELS
Another major feature of Jupyter Notebooks, Python, and Streamlit is the ability to train machine learning models and make predictions.
If you are new to Artificial Intelligence, you might want to view the AI lessons in this curriculum to learn the basics before jumping into the more advanced coding involved here. You can use a user-friendly machine learning model platform like Teachable Machine to make a model and still incorporate it into a Python web app.
If you have had some experience with artificial intelligence and working with datasets using Jupyter Notebooks, this is a good next step for you.
In this lesson, you will learn about some of the Python machine learning libraries, and some of the different machine learning models you can create using Python.
To review, to create a machine learning model, there are 3 main parts.
DATASET
FINDS PATTERNS WITH LEARNING ALGORITHM
PREDICTION!
The dataset is your input for the model. It can include text, images, sounds, or poses. We worked with text and numerical data in Unit 2 using Jupyter Notebooks. We will continue to work with text data in this lesson, in the form of a spreadsheet.
Finding Patterns is essentially building the machine learning model using the dataset. Python contains many libraries that will build an AI model from data. In this curriculum, we will use many of the functions from the scikit-learn package. In addition to the libraries it provides, the website contains lots of excellent information about machine learning and the process of building models. It is a great resource to learn more!
Once you have created your model, the model can be used to predict an outcome based on new information. Once again, Python supplies libraries that enable this.
PREPROCESSING DATA
Before your dataset can be sent to the algorithm for building the model, it must be preprocessed, or “cleaned” so that the model building algorithm can work with it and make the most accurate model possible. In fact, the bulk of the work for creating a machine learning model is in the preprocessing. You will need to look carefully at the data to decide what is important, what can be left out, and what needs to be cleaned up.
What does preprocessing involve? With a text-based dataset, here are some things to deal with.
Null Values
Sometimes the dataset contains blank or null values, especially if the data is survey data. Sometimes you will eliminate any rows that have null data.
However, if the number of samples is low, you may not want to eliminate them. Another option is to replace a null value with some other value. It could be zero, or it could be the average of all the other values for that field.
Outliers
Sometimes the data contains one or two samples that are very different from the rest of the data. This might skew the model. You don't want the outliers to affect how the model is created, so often outliers are eliminated from the dataset.
For example, you might have a dataset where 95% of the samples are people aged 10-30, but you have a few random samples where the people are over 50. Since the vast majority of samples are in the 10-30 age group, you can consider removing the samples from the older age group.
Standardization
Often the numbers in a large dataset vary, depending on what features are represented. For example, you might have age, that varies from 0 to 70, but then you might have salary, that ranges from 0 to 500,000! The scales are very different, so one feature might count more in the model.
To fix, this, you can standardize the data so it's on a single scale. scikit-learn provides a StandardScaler, which updates each features so the mean is 0 and the standard deviation is 1.
Another thing to consider is a balanced number of samples for each class or label. You want to make sure their are about the same number of each class in your dataset.
Encoding
AI likes numbers, not necessarily words. So it helps to have all of the data converted to numbers. scikit-learn provides Encoder functions, so you can easily convert a range of possible text values to a range of numbers.
An example could be activity levels, with sample values sedentary, light, moderate, high. Those responses could be encoded to be values 0, 1, 2, and 3, which is much easier for the model building algorithm to handle.
SPLITTING DATA
Once you have preprocessed your data, you need to split it into a training set and a testing set. The training set will be used to train and create the model. Then you will test your model using the test set to see how it performs.
There are standard ways to split it (usually 75% for training, and 25% for testing) but you can split it however you want. Again, functions are provided so this is all automated for you.
CREATING THE MODEL
The next step is creating the model. A big decision to make is, which algorithm do I use? There are many different supervised learning algorithms to choose from, and it is hard to know which one to use. A good process is to try out several different algorithms and then see which one gives you the best accuracy.
The first step is to decide whether you need a classification algorithm or a regression algorithm. That depends on what you are trying to predict.
Classification algorithms are used to predict discrete targets or classes. For example, classifying email as spam or not spam would be a classification problem
Regression algorithms are used to predict something that is along a continuous range. One example would be predicting how much salary a person will be paid. The prediction is a range of numbers and the output could be any value along that range.
Here are just a few of the popular types of model creation algorithms.
Classification
- Decision Tree
- Random Forest
- K-Nearest Neighbors
- Naive Bayes
- Logistic Regression
- Support Vector Machine
Regression
- Linear regression
- Ridge Regression
- Lasso Regression
- Polynomial Regression
- Bayesian Linear Regression
- Support Vector Regression
Note that some algorithms fall under both types. For example, there is a Decision Tree Classifier as well as a Decision Tree Regressor. And a Support Vector Machine works for classification, and Support Vector Regression works for regression.
So, how do you decide which one to use? You should research to see what other data scientists use for different situations to see what might for for your model. You should also try out some different algorithms with your data and then find which one provides the best accuracy. You can also tweak parameters for a particular algorithm to see if it returns a more accurate model.
scitkit-learn provides functions for all of these algorithms, so it’s straightforward to create the model.
EVALUATING THE MODEL
You want your model to be the best it can be, so you need to evaluate its performance. Two common variables in evaulating a model are bias and variance.
Bias is the difference between the model’s predicted value and the correct value.
Variance is how much the predictions change when different data is used.
You want to achieve a good balance between bias and variance.
High bias -> underfitting.
Underfitting happens when the model is too simple to account for the noise in training data. This can happen if there is not enough data or not enough features (columns), or too much noise in the data. If a model doesn’t perform well on both the training data and the testing data, it signals underfitting.
High variance -> overfitting.
Overfitting happens if you train a model on one set of data and it performs very well, but if you then present it with new data, it does not perform well at all. This can happen if the model is overly complex and it tries to fit too closely to the training data. The model may predict very well on the training data, but then performs poorly on testing data.
One technique to check the performance of a model is cross-validation.
Cross-validation means training your model several times, using different splits of training/testing data each time. Your dataset is split into several folds, or subsets. Then one fold is held out as the validation or test set, and the remaining folds are used to train it. This is performed several times, so each time the training and test sets change.
sciikit-learn also provides a metrics library so you can easily get performance scores for your models.
- accuracy score = correct predictions/total predictions
- precision = true positives/(true positives + false positives)
- recall = true positives/(true positives + false negatives)
- F1 score = (2 x precision x recall)/(precision + recall)
- specificity = true negative/ (true positives + false negatives)
- confusion matrix – shows true positive, true negative, false positive, and false negative counts
By checking metrics from various algorithms, you can choose the best model.
PREDICTING!
Once you have a model that you are satisfied with, you then want to use it in your app.
It is common practice to do the preprocessing, creation, and evaluation of your model using Python, in an environment like Jupyter Notebooks. From there, you can export your model as a file.
Then, within your Streamlit app, you can load the model and use it to make predictions.
In this lesson’s activities, you will go through this entire process using a stroke risk dataset. You will see how to preprocess the data, create models using different algorithms, and then use a model in a simple Streamlit app to predict the risk of stroke, given some input characteristics.
ACTIVITY 1: TRAIN AN AI MODEL IN JUPYTER NOTEBOOK
Explore a Stroke Risk Dataset to build an AI model
- Download a stroke prediction dataset from Kaggle.
- Work with the data in a Jupyter Notebook to:
- Review the data
- Preprocess the data to prepare it for the model
- Create some different models
- Evaluate and choose a model for your app
- Export the model
CHALLENGE
Try out a different model than the ones in the Jupyter Notebook.
- Research the scikit-learn website for other classification algorithms, and look at other model-building examples on Kaggle.
- Choose one algorithm and add the code to your notebook to create the model.
- Use the scikit-learn metrics to check for accuracy.
How does your model perform? Is it better than any of other algorithms in the notebook?
ACTIVITY 2: BUILD A PREDICTION APP
Use your model in a Streamlit App
CHALLENGE
The Iris dataset is a classic dataset that classifies iris flowers into 3 species (setosa, versicolor, and virginica) based on the petal and sepal dimensions.
- Do some research on the dataset to learn its features and targets.
- You can download the dataset and create your own model or use this model (pickle file) created using K-nearest neighbors. Note that no scaler was needed for this dataset. The pickle file contains just the model.
- Import the model and create a Streamlit app to predict the iris species based on the four dataset features.
TECHNOVATION INSPIRATION
Here are some pretty amazing examples from Technovation participants who used Python and Streamlit to build web apps incorporating machine learning models.
T.E.D.D.Y – Text-based Early Distress Detector for Youth , by Team TEDDY of the USA, assists teachers and counselors in the early detection of students’ mental-health concerns. TEDDY uses AI to identify sentences expressing negative sentiment or showing the language patterns expected of individuals with depression. Then, students may be referred to a counselor for support.
REFLECTION
You have gone through the entire process of preprocessing a dataset, building several models, and evaluating and choosing one to use in an app. That is A LOT to learn in one lesson!
REVIEW OF KEY TERMS
- Preprocessing – taking a dataset and making sure the data in it is suitable to train a machine learning model with
- Classification algorithm – an algorithm used to train a machine learning model that will classify or predict discrete values
- Regression algorithm – algorithm used to train a machine learning model to predict a value on a continuous range
- Bias – the difference between the model’s predicted value and the correct value, due to incorrect assumptions that simplify the model
- Variance – the amount of variability in model predictions, when a model is unable to generalize when faced with new data
- Overfitting – when the model fits too well to the training data that it cannot predict well on new data, caused by high variance in the model
- Underfitting – when a model is simplified too much and does not perform well on either training or testing data, caused by high bias or assumptions in the model
ADDITIONAL RESOURCES
Machine Learning
- Geeks for Geeks Machine Learning Tutorial -gives a great introduction and overview of some of the machine learning process and terminology
- Simplilearn’s Scikit-Learn tutorial – goes through a wine quality dataset to practice using scikit-learn in a Jupyter Notebook
- Machine Learning with scikit-learn – a full Youtube playlist by Data School
Streamlit
- Build a Machine Learning Web App from Scratch with Patrick Loeber – another example of building a model and using it in a web app, from start to finish
- Image Classifier with Streamlit, if your model is trained on images
All About AI
- Learn the basics of how artificial intelligence works
These are the activities for this lesson:
HOW DOES AI WORK?
Earlier, you learned how artificial intelligence is being used in different areas to make an extraordinary impact on our daily lives. Let’s go a little deeper into what it is and how it works.
True artificial intelligence is not quite here yet. There doesn’t yet exist a system that completely thinks and acts like a human. When we think of AI in our everyday lives, we are really thinking about machine learning.
When we talk about AI in this curriculum, we’ll really be talking about two subsets of Artificial Intelligence, Machine Learning and Generative AI.
What are they?
Machine Learning
is a subset of AI where a machine (computer) "learns" to identify patterns so it can make predictions.
That's how Youtube can predict the next video you might like to watch, or Facebook can identify your face in an image.
Generative AI
can generate text, images, and sounds. It uses Large Language Models to be able to create content based on lots and lots of existing data.
ChatGPT and DALL-E are current popular examples of generative AI.
Let’s dive deeper into Machine Learning.
MACHINE LEARNING HAS THREE MAIN PARTS
DATASET
FINDS PATTERNS WITH LEARNING ALGORITHM
PREDICTION!
Source: “Learning about Artificial Intelligence: A hub of MIT resources for K-12 students”, MIT Media Lab
DATASETS
- AI needs a LOT of data to learn from. AI uses a dataset, which is just a very large set of data! In today’s world, computers can access more data than ever before. That’s one reason AI has made such huge advances in the past few years.
AI:
- learns from the data
- and eventually can find patterns on its own
- when it takes in new data
- it can make a prediction
- based on the patterns.
STOP AND DISCUSS
Where does AI get its data? Well, it gets a lot from you and me.
In your household, what sorts of data do you create every day through technology?
- Every Google search
- Words you type into emails
- Every question you ask Alexa/Siri/OK Google
- Connected devices - each time you turn on lights, turn on air conditioning or heat
- Taps you make on your cell phone
- Anything you purchase online
- Who you are connected to on social media
- Songs you listen to
- Steps you take
AN EXAMPLE
Let’s step through how Google Maps uses AI to give you directions to where you want to go. Hover over each box to reveal how Google Maps addresses each part.
DATASET
DATASET
- current location
- destination
- mode (walk, car, public transport)
- traffic
FINDS PATTERNS
FINDS PATTERNS
MAKES PREDICTION
MAKES PREDICTION
STOP AND DISCUSS
Now you try it!
Step through the process with Youtube.
- What is the dataset?
- How does Youtube learn?
- What does it predict?
ACTIVITY: AI IN ACTION
Explore some of the websites below to get a taste of what AI can do.
- Could you take the concept in front of you and apply it in a different context?
- What sort of data do you think is needed to make these applications work?
AutoDraw - takes your doodling and predicts what it is you’re trying to draw, very quickly!
X Degrees of separation - takes two art pieces and shows us a bridge of similar artworks that connects the two together.
REFLECTION
Now that you have a glimpse of what it takes to create artificial intelligence, you might want to think about the problem you are solving, and how AI might be useful.
REVIEW OF KEY TERMS
- Artificial Intelligence (AI) – machines/programming that can do tasks normally thought to be done only by humans
- Machine Learning – the subset of AI where a technology is trained with data and “learns” to recognize patterns in order to make predictions
- Generative AI – technology that has the ability to create content like text, images, and and sound
- Large Language Model – an AI model that predicts and generates text, trained using enormous amounts of data
- Datasets – information that is used to teach AI to recognize patterns and predict something
ADDITIONAL RESOURCES
Want to explore some more cool AI?
Find Patterns with AI
- Train a machine learning model to predict something
These are the activities for this lesson:
3 PARTS OF MACHINE LEARNING
Recall that Articifical Intelligence, specifically Machine Learning, has 3 main parts.
Dataset
Find Patterns
Make Prediction
In this lesson, we’re going to focus on the second part, Find Patterns, by training our own AI model that will be able to make a prediction.
There are many free online platforms where you can train an AI model, using supervised learning.
Supervised learning is just as it sounds – you supervise how the model learns by telling it the correct answer.
For example, say you want an AI model to tell if a picture is a dog or a cat.
Your dataset will be lots and lots of pictures of dogs and cats.
You will help train the model by telling it which pictures are dogs and which are cats
PLANNING FOR YOUR MODEL
Your model will predict, or classify something. Often these models are called classification models, for that reason.
First steps:
- What you are classifying? Are they images, text, sounds? This is your data type.
- What are the different possible classifications? For example, dogs and cats. These are your classes. They are also sometimes referred to as labels.
- Gather the appropriate data to train your model. Find lots and lots of varied data to represent each class. For example, lots and lots of pictures of different types of dogs and cats!
RECOMMENDED PLATFORMS
There are many free and open source platforms available to create AI classification models.
We have curated a list of programs and platforms where you can:
- build your model to make a prediction
- then use your model in a mobile or web app to perform an action based on the prediction
Here is a quick overview of what each platform can classify and integrate with.
Platform | Classification Types | Technovation Integration |
---|---|---|
Teachable Machine by Google | images, sounds, poses | App Inventor, Python, other integrations possible |
MachineLearningForKids | images, sounds, text, numbers | Python, App Inventor |
MIT App Inventor | images, sounds, poses | App Inventor |
Ximilar | images | Thunkable, App Inventor, wep apps, using APIs |
ACTIVITY: TRAIN A MACHINE LEARNING MODEL
Build a Rock, Paper Scissors model
Then see your model in action with a simple pre-built javascript interaction.
REFLECTION
You’ve made your first AI model! This should give you a glimpse into the process for making an AI model. All the model creation platforms work in a similar way, although the interfaces may differ slightly.
REVIEW OF KEY TERMS
- AI (or machine learning) Model – artificial intelligence that is trained on a dataset to recognize patterns to predict or classify something
- Supervised Learning – machine learning where a model is trained by telling it correct or incorrect result
- Class – a label that is provided to an AI model so it learns how to classify inputs by its class
ADDITIONAL RESOURCES
If you want to learn more about artificial intelligence and machine learning, here is a great playlist from Daniel Schiffman of New York University