Skip to content

🌌 AI meets Astronomy! This project classifies stars using machine learning based on temperature, luminosity & more. Real-time predictions, cosmic visuals & educational insightsβ€”all in one sleek Flask web app. Dive into the stars with science & code! πŸš€βœ¨

License

Notifications You must be signed in to change notification settings

Monike123/SunClassifier

Repository files navigation

πŸ›°οΈ Star Classifier: Predict Stellar Types from Astronomical Data

Star Classifier is an interactive web application built using Flask that allows users to predict the type of a star based on its astronomical properties such as temperature, luminosity, radius, magnitude, color, and spectral class.

The model is trained to classify stars into one of six categories:

  • πŸŒ‘ Brown Dwarf
  • πŸ”΄ Red Dwarf
  • βšͺ White Dwarf
  • β˜€οΈ Main Sequence
  • 🌟 Supergiant
  • πŸ’₯ Hypergiant

Each prediction is accompanied by an informative description, fun facts, and a dynamically displayed animation-style video to help users visualize the star type!


🧠 Machine Learning Model

The backend uses a Voting Classifier composed of several base models (like Decision Trees, KNN, and Random Forests). The model is trained on a balanced dataset with features encoded to match the trained environment.


🌌 Preview

ChatGPT Image Apr 13, 2025, 01_07_56 AM


βš™οΈ Installation & Setup

πŸ”§ Requirements

  • Python 3.7+
  • Flask
  • NumPy
  • Scikit-learn
  • Pickle

πŸ’» Clone the Repository

git clone https://github.com/your-username/star-classifier.git
cd star-classifier

πŸ“¦ Install Dependencies

We recommend using a virtual environment:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

πŸ“‚ Project Structure

star-classifier/
β”‚
β”œβ”€β”€ static/
β”‚   └── videos/               # MP4 videos named after star types (e.g., Brown_Dwarf.mp4)
β”‚
β”œβ”€β”€ templates/
β”‚   └── index.html            # Frontend form + canvas animation + star info
β”‚
β”œβ”€β”€ voting_classifier_model.pkl  # Trained model
β”œβ”€β”€ app.py                    # Flask backend
β”œβ”€β”€ README.md                 # This file
└── requirements.txt          # Python dependencies

πŸš€ Run the Application

python app.py

Then visit: http://127.0.0.1:5000 in your browser.

ChatGPT Image Apr 13, 2025, 01_18_10 AM


πŸ–ΌοΈ Video Assets

Place your video files inside the static/videos/ folder, with filenames exactly matching the star prediction labels:

  • Brown_Dwarf.mp4
  • Red_Dwarf.mp4
  • White_Dwarf.mp4
  • Main_Sequence.mp4
  • Super_Giants.mp4
  • Hyper_Giants.mp4

πŸ’» Tech Stack

  • Frontend: HTML5, JavaScript, CSS (Canvas animations)
  • Backend: Python, Flask
  • ML Libraries: scikit-learn, NumPy
  • Visualization: HTML5 Video & JSON-driven UI updates

🀝 Example Usage

Cosmic.Classifier.-.Star.Type.Prediction.-.Google.Chrome.2025-04-13.01-45-03.online-video-cutter.com.mp4

🀝 Contributing

  1. Fork this repository
  2. Create a new branch (git checkout -b feature-name)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin feature-name)
  5. Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

About

🌌 AI meets Astronomy! This project classifies stars using machine learning based on temperature, luminosity & more. Real-time predictions, cosmic visuals & educational insightsβ€”all in one sleek Flask web app. Dive into the stars with science & code! πŸš€βœ¨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published