Step-by-Step Instructions for Teachable Machine, MIT App Inventor & Scratch
Lesson 12: Build Your Own AI | Evolve AI Institute
teachablemachine.withgoogle.comSelect the type of AI model you want to create:
Teaches a computer to recognize objects, people, or scenes in pictures
Example: Recycling sorter, plant identifier
Teaches a computer to recognize different sounds or spoken words
Example: Musical instrument classifier, voice commands
Teaches a computer to recognize body positions and movements
Example: Yoga pose detector, hand gesture controller
This is the most important step - quality training data leads to better AI!
For Image Projects:
For Audio Projects:
For Pose Projects:
If your AI isn't performing well, here's how to improve it:
Click "Under the Hood" to adjust advanced settings like learning rate, batch size, and number of epochs. Usually, the defaults work well for beginners.
Click the three-dot menu and select "Download" to save your entire project (including all training data) to your computer. You can upload it later to continue working.
If you have poor quality samples, hover over them in the class panel and click the X to delete them. Then retrain for better results.
| Problem | Solution |
|---|---|
| Webcam/microphone not working | Check browser permissions. Click the camera/microphone icon in the address bar and allow access. Try refreshing the page or using a different browser. |
| Model accuracy is very low | Ensure you have enough samples (50+ per class), samples are diverse, and classes are clearly different from each other. Simplify categories if they're too similar. |
| Training takes forever | Reduce the number of samples or decrease image quality in "Under the Hood" settings. Large datasets with high-resolution images take longer to train. |
| Works in training but not real world | Your training data doesn't match real-world conditions. Add more samples that match how you plan to use the AI (different lighting, angles, backgrounds). |
| Page is slow or freezing | Close other browser tabs, clear browser cache, or try a different browser. Chrome typically works best with Teachable Machine. |
appinventor.mit.eduMIT App Inventor has two main views:
Where you design the visual layout of your app. Drag and drop components like buttons, images, and text boxes. This is like designing a website or poster.
Where you program the behavior of your app. Connect colorful blocks to create logic and functionality. This is where the magic happens!
You'll switch between these views as you build your app. Design the look in Designer, then program the function in Blocks.
Start by creating the visual layout:
Essential Components for an AI App:
Arrange Your Components:
Click "Blocks" button (top right) to switch to programming view.
Basic Block Structure for Image Classification:
Building Blocks Step-by-Step:
There are two ways to test your app:
Method 1: MIT AI2 Companion App (Recommended)
Method 2: Emulator (Computer Only)
Make your app speak the results! Add "TextToSpeech" component and call it when classification is complete.
Add "Sound" component with audio files for success, error, or interaction feedback to make your app more engaging.
Create a welcome screen, results screen, and help screen. Use "Open another screen" blocks to navigate between them.
Save classification history using TinyDB component. Great for tracking past results or creating a user profile.
Add "Sharing" component to let users share results via social media, email, or messaging apps.
Instead of using pre-trained models, create your own classifier using "Personal Image Classifier" with your own training data.
| Problem | Solution |
|---|---|
| Companion app won't connect | Ensure phone and computer are on the same WiFi network. Try refreshing the QR code. Check that AI2 Companion is the latest version. |
| Camera isn't working | Check app permissions on your phone. Make sure Camera component is properly added in Designer. Test with a simple button to isolate the issue. |
| AI classifier returns errors | Verify image format is compatible. Check internet connection (some classifiers require online access). Ensure image isn't too large. |
| Blocks won't snap together | Check if block types are compatible. Blocks must have matching shapes/colors to connect. Look for error indicators (red triangles). |
| App is slow or laggy | Optimize images (resize before displaying). Reduce number of components. Simplify block logic. Test on a newer device if possible. |
| APK won't install on phone | Enable "Install from Unknown Sources" in phone security settings. Make sure you're using an Android device (iOS not supported). Check that APK file downloaded completely. |
scratch.mit.eduScratch has several extensions that enable AI/ML features:
machinelearningforkids.co.uk (separate platform that integrates with Scratch)There are two main approaches to adding AI to Scratch:
Use Scratch's Video Sensing and other built-in extensions for simple AI-like behavior. Good for beginners and quick projects.
Train custom models on ML for Kids platform, then import into Scratch. More powerful but requires additional setup.
Perfect for motion-based games and interactive experiences:
Basic Video Sensing Project Structure:
Project Ideas Using Video Sensing:
For custom trained models that can recognize specific objects, sounds, or text:
Setup Process:
machinelearningforkids.co.ukTraining a Model on ML for Kids:
Once your ML model is imported into Scratch, you'll see special new blocks:
Key ML Blocks You'll Use:
Combine ML blocks with Scratch's powerful features:
Essential Scratch Features for AI Projects:
Example Game Structure:
Use the confidence value to only act on high-confidence predictions: if confidence > 80 then...
Train separate models for different parts of your game (one for objects, one for gestures, etc.)
Start with easy classifications, increase difficulty as player improves. Use variables to track progress.
Show players what the AI "sees" by drawing on screen or showing confidence bars.
Create two-player games where both players use gestures or voice commands recognized by AI.
Build projects that teach concepts while using AI (math games, language learning, science simulations).
| Problem | Solution |
|---|---|
| ML blocks not appearing in Scratch | Make sure you're using the special Scratch link from ML for Kids, not regular Scratch. The link should include your model ID. |
| Video/camera not working | Check browser permissions (camera access). Try different browser (Chrome works best). Make sure no other program is using the camera. |
| Classifications are very inaccurate | Return to ML for Kids and add more diverse training examples. Make sure categories are clearly different. Retrain the model. |
| Project is slow or laggy | Reduce number of sprites. Add "wait" blocks between classifications. Simplify scripts. Close other browser tabs. |
| Can't share project | Projects with custom ML models from ML for Kids can only be shared via the special link. Regular Scratch sharing may not work with ML extensions. |
| Model works on ML for Kids but not Scratch | Ensure you're testing in similar conditions. Check that all blocks are properly connected. Verify video is turned on if using image recognition. |
| Platform | Best For | Difficulty | Output |
|---|---|---|---|
| Teachable Machine | Quick AI experiments, first-time AI creators, demonstration projects | â Easiest | Trained model (exportable) |
| MIT App Inventor | Real mobile apps, practical tools, projects you can share with family | ââ Moderate | Android mobile app (.apk) |
| Scratch with ML | Interactive games, educational content, creative storytelling | âââ Challenging | Interactive web project |
You now have the knowledge and tools to create amazing AI projects. Keep learning, keep building, and most importantly - keep innovating! The future of AI includes YOU.