https://github.com/siddh-coder/celestial-body-classifier
https://github.com/siddh-coder/celestial-body-classifier
machine-learning streamlit
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/siddh-coder/celestial-body-classifier
- Owner: siddh-coder
- Created: 2025-01-12T12:29:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-12T13:55:35.000Z (over 1 year ago)
- Last Synced: 2025-07-21T19:53:58.010Z (11 months ago)
- Topics: machine-learning, streamlit
- Language: Python
- Homepage: https://celestial-body-classifier-by-sid.streamlit.app
- Size: 25 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Star Classification with Pre-trained Machine Learning Models
## Project Overview
This project is a web-based application that uses **7 pre-trained machine learning models** to classify celestial objects—such as stars, galaxies, and quasars—based on their photometric properties. The app is built using **Streamlit** for its user interface and supports interactive inputs to predict the class of celestial objects using various models.
---
## Features
1. **Input Photometric Data:**
- Users can provide values for features like “U, G, R, I, Z” magnitudes, right ascension (“Alpha”), declination (“Delta”), and redshift.
2. **Multiple Pre-trained Models:**
- Predictions are made using:
- Support Vector Machine (SVM)
- Random Forest
- Logistic Regression
- K-Nearest Neighbors (KNN)
- Decision Tree
- Gradient Boosting
- Naive Bayes
3. **Final Classification:**
- The app provides individual model predictions and a final classification based on majority voting.
4. **Educational Content:**
- A detailed explanation of the significance of photometric filters (U, G, R, I, Z) in astronomy is included.
- Users can learn about the importance of magnitudes and how they help classify celestial objects.
---
## How to Run the Application
### Prerequisites
Ensure you have the following installed:
- Python (>= 3.8)
- pip (Python package installer)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/your-repo/star-classification-app.git
cd star-classification-app
```
2. Install the required dependencies:
```bash
pip install -r requirements.txt
```
3. Ensure the pre-trained models (`*.pkl` files) are in the root directory.
### Run the Application
1. Start the Streamlit server:
```bash
streamlit run app.py
```
2. Open your browser and navigate to the local URL provided (e.g., `http://localhost:8501`).
---
## Project Structure
```
star-classification-app/
|-- app.py # Main Streamlit application
|-- requirements.txt # Required Python libraries
|-- svm_classifier.pkl
|-- random_forest_classifier.pkl
|-- logistic_regression_model.pkl
|-- k_nearest_neighbors_model.pkl
|-- decision_tree_model.pkl
|-- gradient_boosting_model.pkl
|-- naive_bayes_model.pkl
|-- scaler.pkl # Scaler for feature preprocessing
|-- label_encoder.pkl # Encoder for target labels
|-- README.md # Project documentation (this file)
```
---
## Inputs and Outputs
### Inputs
Users are required to provide the following inputs through the sidebar:
- **Alpha (α):** Right ascension of the celestial object.
- **Delta (δ):** Declination of the celestial object.
- **U, G, R, I, Z:** Magnitudes in respective photometric bands.
- **Redshift:** A measure of the object’s distance and velocity.
### Outputs
- Predictions from all 7 machine learning models.
- Final classification based on majority voting.
- Educational insights about magnitudes and filters.
---
## Explanation of U, G, R, I, Z Filters
### What Are They?
**U, G, R, I, Z** are photometric filters used to observe celestial objects in specific wavelength ranges:
- **U (Ultraviolet):** 300-400 nm
- **G (Green):** 400-550 nm
- **R (Red):** 550-700 nm
- **I (Infrared):** 700-850 nm
- **Z (Near-Infrared):** 850-1000 nm
### Importance in Astronomy
These filters measure how much light an object emits in each wavelength band, enabling astronomers to:
- **Classify objects** (e.g., stars, galaxies, quasars).
- **Determine distances** using redshift.
- **Analyze properties** like temperature, composition, and age.
### Magnitudes
Magnitudes are a logarithmic measure of brightness:
- **Smaller values = brighter objects.**
- A difference of 5 magnitudes corresponds to a brightness ratio of 100.
---
## Future Improvements
- Adding more classifiers to enhance prediction reliability.
- Incorporating real-time data visualization.
- Enabling upload functionality for batch predictions.
- Expanding educational content to include visual aids and examples.
---
## Contributors
- Siddharth Tripathi - Project Developer
---
## Acknowledgments
- **Kaggle:** For providing data(https://www.kaggle.com/datasets/fedesoriano/stellar-classification-dataset-sdss17)
- **Streamlit:** For the user-friendly web interface.
- **scikit-learn:** For powerful machine learning tools.
---
Thank you for using the Star Classification App! Feel free to contribute or raise issues to improve this project further.