What the App Does

Our application allows users to draw or input a custom star pattern on a canvas, which the system then compares against a database of known constellations. Based on the spatial structure and connections between the stars, the app uses machine learning to identify and return the closest-matching real-world constellation.

This helps users explore and learn about astronomy in an engaging, interactive way that nurtures curiosity and interest in the night sky.


How the ML Model Was Developed and Trained

We used a Random Forest Classifier for identifying constellations based on star coordinate patterns.

Data Preparation

  • Defined major constellations using realistic star positions (normalized to a [0, 1] range) and connection indices.
  • Generated 500 augmented versions of each constellation using:
    • Random translations
    • Rotations
    • Scaling
    • Slight jitter
  • These augmentations simulate real-world variability while preserving the original structure.

Feature Engineering

To convert constellations into model-friendly input:

  • Flattened the star coordinates into a single list:
    [x₀, y₀, x₁, y₁, ...]
  • Calculated distances between connected stars to capture geometric relationships.
  • Both coordinates and distances were padded or truncated to fixed lengths.
  • Final feature vector = [flattened coordinates] + [distances], labeled with the true constellation name.

Model Training

  • Used RandomForestClassifier from scikit-learn.
  • Data split 80/20 for training and testing.
  • Model learned to identify spatial and structural patterns in the constellation vectors.
  • Saved the trained model and label encoder using pickle for real-time inference in the app.

How It Integrates into the App

The frontend provides a drawing canvas where users place stars and connect them.

When the user submits a pattern:

  • Frontend sends a JSON payload to the backend with:

    • List of coordinates: [[x1, y1], [x2, y2], ...]
    • List of edges/connections: [[0, 1], [1, 2], ...]
    • Input normalization
  • Backend performs:

    • Feature extraction
    • Classification using the trained model
    • Returns the predicted constellation and its details

The Problem It Solves and Our Approach

Most astronomy education tools are passive or require precise inputs, which can limit engagement—especially for beginners.

Our goal was to create an intuitive, hands-on way to recognize constellations from user-drawn patterns, even if they’re rough or imprecise.

By allowing users to sketch freely, the app taps into natural curiosity and helps nurture a genuine interest in astronomy through active exploration.

We approached this by:

  • Generating a large, augmented training dataset based on real constellations
  • Using shape-aware feature engineering to preserve geometric relationships
  • Training a Random Forest Classifier to detect constellation patterns
  • Building a responsive interface that balances user freedom with ML-powered structure recognition

The result is an engaging, educational constellation matcher that makes learning about the night sky both accessible and enjoyable.

Share this project:

Updates