Jump to main content

Asteroid! Identify Space Hazards with Computer Vision

1
2
3
4
5
10 reviews

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

Areas of Science
Difficulty
Method
Time Required
Short (2-5 days)
Prerequisites

None

Material Availability

This project requires a computer with a webcam and internet access

Cost
Very Low (under $20)
Safety

No issues

Credits

The RAISE Playground was created by the MIT RAISE Initiative and the Personal Robots Group at the MIT Media Lab.

Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

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?

Figure 1. Artist's conception of a satellite breaking up in space.

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

Questions

Bibliography

Materials and Equipment

Experimental Procedure

This project follows the Engineering Design Process. Confirm with your teacher if this is acceptable for your project, and review the steps before you begin.

Part 1: Training Your Teachable Machine Model

  1. Go to Teachable Machine. Click "Get Started," select "Image Project," then "Standard image model."
  2. 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."
Figure 2. A blank Teachable Machine model.
  1. Create four classes for your model: Satellite, Space Debris, Meteoroid, and Nothing.
  2. For your Satellite class, click the Webcam button.
    1. Your browser should show a preview of your webcam view. 
    2. Hold your model satellite up in front of your webcam.
    3. Click the "Record" button and watch the countdown timer.
    4. 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).
  3. Repeat step 4 for each of your other classes. For the "Nothing" class, do not hold anything up in front of the webcam.
  4. Click the "Train Model" button. Keep your browser tab open and wait for your model to finish training.
  5. In the "Preview" section, make sure the "Input" switch is set to "On." 
  6. Try holding your different objects up in front of your webcam and looking at the bars and percentages in the "Output" section (Figure 3).
  7. 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?
Figure 3. Teachable Machine correctly identifying the "satellite" class.
  1. 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.
  2. After you record more images, you will need to re-train your model and test it with the "Preview" section again.
  3. 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").
  4. Export your model. 
    1. Click the "Export Model" button in the top right.
    2. Make sure "Upload (shareable link)" is selected and then click "Upload my model."
    3. 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

  1. Go to https://playground.raise.mit.edu/main/.
  2. Click the "Extensions" button in the bottom left corner.
  3. Select the "Teachable Machine" extension to add it to your program.
  4. Build the program shown in Figure 4 by dragging blocks from the menu on the left and snapping them together.
    1. The when green flag clicked block is available in the Events menu.
    2. The use model Paste URL here! and turn video on blocks are available in the Teachable Machine menu after you have added the extension.
Figure 4. Starter program to load Teachable Machine model.
  1. Paste the model URL that you copied in the previous section into the Paste URL here! box.
  2. Click the green flag above the stage on the right side of the window to run your program.
  3. Wait for the model to load and make sure your webcam view displays on stage.
    1. 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.
  4. 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. 
  5. 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.
Figure 5. A simple program to make the cat character say the name of the detected object class.
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • Can you make your sprite say more complex things or give warning messages, such as "Warning: space debris detected!"? Hint: use the join block in the Operators menu 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:

Career Profile
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Career Profile
Many aspects of peoples' daily lives can be summarized using data, from what is the most popular new video game to where people like to go for a summer vacation. Data scientists (sometimes called data analysts) are experts at organizing and analyzing large sets of data (often called "big data"). By doing this, data scientists make conclusions that help other people or companies. For example, data scientists could help a video game company make a more profitable video game based on players'… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Asteroid! Identify Space Hazards with Computer Vision." Science Buddies, 6 May 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p056/space-exploration/space-hazards-computer-vision. Accessed 23 June 2026.

APA Style

Finio, B. (2025, May 6). Asteroid! Identify Space Hazards with Computer Vision. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p056/space-exploration/space-hazards-computer-vision


Last edit date: 2025-05-06
Top
Free science fair projects.