AI: Train your Model

  • Decide on a platform to train your AI model
  • Gather your initial dataset and start training your AI model for your project

These are the activities for this lesson:

YOUR DATASET

By now you should have gathered your data for your dataset. As a reminder, there are three ways of collecting data:

  1. Collect training data from your community
  2. Invention gathers data with sensors or user input
  3. Use data from public datasets for training data

 

You also should have decided on what type of data you want to use in your dataset – images, text, sounds, or poses. 

Your dataset should meet the following criteria:

  • The right kind of data
  • Lots of examples
  • Varied examples – diverse and representative (unbiased)

TRAINING PROCESS

Input data

By uploading it, or through a webcam for images

Train

Run the data through a learning algorithm.

Test

Using new inputs, check if your model is accurate.

CHOOSE THE PLATFORM

The platform you choose should allow you to:

You are not limited to these platforms, but these are simple and user friendly options for integrating with a mobile or web app.

The best platform for your project may depend on the type of data in your dataset, as not every platform can train every type of data. 

Try out one or more of the tutorials from one or two platforms to see which platform will help you achieve the goals for your project.

Website: https://teachablemachine.withgoogle.com/

Classification types: images, sounds, poses

Technovation Integrations: App Inventor, Python, other integrations using APIs

Here are three tutorials to try out Teachable Machine using different data types.

Website: https://machinelearningforkids.co.uk/

Classification types: images, sounds, text, numbers

Technovation Integrations: App Inventor, Python

Machine Learning for Kids has many example tutorials and worksheets to learn more. 

You will need a mentor or teacher to sign up for a teacher account. Then they can set up a student account for you.

 

Check out these examples/tutorials using MachineLearningForKids.

Website: https://appinventor.mit.edu/explore/ai-with-mit-app-inventor

Classification types: images, sounds, poses, face mesh

Technovation Integrations: App Inventor mobile apps

If you are already using App Inventor as your coding platform for your project, this is a good option.

Here are some tutorials to get started:

Website: https://www.ximilar.com/services/computer-vision-platform/#image-classification

Classification types: images

Technovation Integrations: Thunkable, web apps (using APIs)

Although there are other options, this is a good one if you are using Thunkable as your coding platform.

Check out the first half of this tutorial to learn how to use Ximilar. The second half will be shown in the next unit, when you integrate your model with Thunkable.

The platforms above are just recommendations for easy on-ramps to training and using AI models.

There are many more advanced AI tools available. Some are listed in the Additional Resources section. They may require using advanced languages like Java, Python, or Swift and will most likely entail using APIs (Application Programming Interface).

ACTIVITY: TRAIN YOUR MODEL

Estimated time: 60 minutes

Train your AI model using your dataset

  1. Choose the appropriate platform for your project.
  2. Train your AI model using your dataset.
    • If you haven’t completely gathered all the examples for your dataset, add what you have.
    • Add more as you collect more data.
    • Save your project/model so you can return to it later!
  3. After training your AI model, test it with some additional examples. These test examples should be different from the training examples you used.
  4. If your model is not very accurate (over 70%), add more training examples, retrain, retest.

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.

stylized A, AmeriCorps logo in navy

REFLECTION

This activity is just about training the model.

In the next unit, you’ll on integrate your model into a software platform to turn into a working app.

Why is your chosen platform a good choice for your project?
What do you hope to achieve with your AI model now that you have built it?
Are you confident the platform you chose will help you achieve your goals?

REVIEW OF KEY TERMS

  • Platform – software or website that allows its users to perform a task or use a tool
  • Classification – Machine learning model used to identify or categorize different data

ADDITIONAL RESOURCES

Here are some more advanced platforms for building AI models.

Note: If you decide to use these tools, be sure to double check the pricing. Some tools are free to use depending on how many users use your app.