Abstract
Space is a dangerous place for astronauts and spacecraft. Earth's orbit is full of potential hazards like meteoroids, space debris, and other satellites that you do not want to crash into! How do scientists detect these objects in space? If you do detect an object, how can you tell what it is? In this project you will make your own computer program that can recognize and react to three different models of objects that can be found in space. No previous programming experience is required!
Summary
None
This project requires a computer with a webcam and internet access
No issues
The RAISE Playground was created by the MIT RAISE Initiative and the Personal Robots Group at the MIT Media Lab.
Objective
Train a machine learning model to identify different space-related objects and write a Scratch program that reacts to them.
Introduction
There are millions of objects in orbit around the Earth, ranging from objects the size of a grain of sand up to the International Space Station and everything in between. A collision with any one of these objects can pose a major threat to spacecraft, potentially damaging or even destroying them. Many of these objects are too small to track, so engineers can take steps like shielding spacecraft to help protect them from collisions. However, thousands of objects roughly the size of a softball or larger (about 10 cm in diameter) are big enough to track and, if necessary, maneuver a spacecraft to avoid them.
This raises the question: if an object is big enough to see, how do you know what it is? Is it another spacecraft or satellite that may look small because it is far away? Is it a piece of space debris like a speck of paint or a fragment of another spacecraft (Figure 1) that broke up due to a previous collision? Or is it a naturally occurring hazard like a meteoroid?
With so many objects in space, it can be hard for scientists to identify them all. This is where computer vision can help. Just like humans can learn to recognize and classify different objects, scientists can "teach" computer programs to identify different types of objects in pictures using a process called machine learning. To teach a computer program to identify different objects, you need to provide lots of example images of the objects, or training data, for the program to learn from. Think about showing a baby or toddler pictures of dogs and cats, telling them "this one is a dog" and "this one is a cat," until they learn the difference and can identify dogs and cats on their own. Machine learning works in much the same way!
In this project, you will use an online program called Teachable Machine to create a model, or program that is trained to recognize certain objects. You will train your model to recognize different objects that represent possible space hazards, such as other spacecraft, space debris, and meteoroids. Then, you will import your Teachable Machine model into a beginner-friendly programming language called Scratch, where you can write a program that will react differently depending on what type of object it detects.
Terms and Concepts
- Orbit
- Space debris
- Meteoroid
- Computer vision
- Machine learning
- Training data
- Model
Questions
- What is space debris? Why is it dangerous?
- How do scientists currently track space debris? What size objects can they track?
- What are some steps scientists can take to help prevent future problems with space debris?
Bibliography
- The Aerospace Corporation (n.d.). Space Debris 101. Retrieved March 13, 2025
Materials and Equipment
- Computer with internet access and webcam
- Objects to represent different space hazards, such as:
- A small rock to represent a meteoroid
- A piece of aluminum foil to represent space debris
- A small model satellite made from craft materials or building toys
Experimental Procedure

Part 1: Training Your Teachable Machine Model
- Go to Teachable Machine. Click "Get Started," select "Image Project," then "Standard image model."
- Your browser screen should look like Figure 2. This is a new, blank model. By default, a new model has two "classes" for different objects you want to recognize. You can change the names of these classes by clicking on them, and add more classes by clicking "Add a class."

- Create four classes for your model: Satellite, Space Debris, Meteoroid, and Nothing.
- For your Satellite class, click the Webcam button.
- Your browser should show a preview of your webcam view.
- Hold your model satellite up in front of your webcam.
- Click the "Record" button and watch the countdown timer.
- Once it starts recording, move your satellite around in front of the webcam (rotate it, move it side to side, front to back, and up and down).
- Repeat step 4 for each of your other classes. For the "Nothing" class, do not hold anything up in front of the webcam.
- Click the "Train Model" button. Keep your browser tab open and wait for your model to finish training.
- In the "Preview" section, make sure the "Input" switch is set to "On."
- Try holding your different objects up in front of your webcam and looking at the bars and percentages in the "Output" section (Figure 3).
- Rotate the objects and move them around. How accurate is your model? Can it always correctly identify the objects? Does it ever get confused and identify something incorrectly?

- If your model does not work very well, try adding more training data. You can click the "Webcam" button under each class again to record more images. You can also click the gear icon next to the record button to increase the length of the recording.
- After you record more images, you will need to re-train your model and test it with the "Preview" section again.
- Once your model can reliably identify your objects without many mistakes, make sure you save it (click the top left menu and then select "Save project to Drive").
- Export your model.
- Click the "Export Model" button in the top right.
- Make sure "Upload (shareable link)" is selected and then click "Upload my model."
- Wait for the model to finish uploading and then copy the resulting URL. You will need it in the next section.
Part 2: Writing Your Scratch Program
- Go to https://playground.raise.mit.edu/main/.
- Click the "Extensions" button in the bottom left corner.
- Select the "Teachable Machine" extension to add it to your program.
- Build the program shown in Figure 4 by dragging blocks from the menu on the left and snapping them together.
- The
when green flag clickedblock is available in theEventsmenu. - The
use model Paste URL here!andturn video onblocks are available in theTeachable Machinemenu after you have added the extension.
- The

- Paste the model URL that you copied in the previous section into the
Paste URL here!box. - Click the green flag above the stage on the right side of the window to run your program.
- Wait for the model to load and make sure your webcam view displays on stage.
- Note: if your webcam view does not display on stage, you may need to close your Teachable Machine browser tab or restart your web browser.
- Now for the fun part! Can you write a Scratch program that reacts or does different things depending on what object the model detects? Figure 5 shows a simple example that makes the on-screen sprite (the cat character) say the name of the detected object class. Can you make the sprite move to a different location depending on what type of object is detected? There are many other things you can try - see the Variations section for more ideas.
- This version of Scratch does not auto-save to the cloud. Make sure you back up your work frequently by saving from the "File" menu.

Ask an Expert
Global Goals
The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.
Variations
- Can you make your sprite say more complex things or give warning messages, such as "Warning: space debris detected!"? Hint: use the
joinblock in theOperatorsmenu to put sentences together. - Can you make your sprite take evasive action to avoid on-screen objects? Hint: divide your screen into quadrants (top left, top right, bottom left, and bottom right) and train a new Teachable Machine model with classes for objects in each quadrant. Make your Scratch program react by moving the sprite to a "safe" quadrant to avoid the detected object.
Careers
If you like this project, you might enjoy exploring these related careers:









