This project is a Flask-based web application that uses a Convolutional Neural Network (CNN) to classify galaxies from images into 5 categories. It is trained using a dataset from Kaggle and deployed locally for interactive predictions.
.
├── static/
│ ├── style.css
│ └── uploads/ ← (Create this folder manually after training)
├── templates/
│ ├── home.html
│ ├── input.html
│ └── output.html
├── training/
│ ├── Galaxy_Dataset
| ├── test
| ├── train
| └── val
│ ├── Train_dataset
| ├── Cigar-shaped smooth
| ├── completely rounf=d smooth
| ├── edge-on
| ├── In between smooth
| └── spiral
│ └── sdss.ipynb ← Jupyter notebook to train and save the model
├── SDSSmodel.h5 ← Saved model after training
├── run.py ← Flask web server
├── README.md ← This file
Download the dataset from Kaggle:
🔗 The Galaxy Classification Dataset
- Ensure your dataset contains exactly 5 classes corresponding to:
Cigar-shaped smooth
In between smooth
Completely round smooth
Edge-on
Spiral
Organize the dataset in this format:
galaxy_dataset/
├── cigar-shaped smooth/
├── in between smooth/
├── completely round smooth/
├── edge-on/
└── spiral/
- Open
sdss.ipynb
in Jupyter Notebook or Google Colab. - Update the dataset path in the notebook if necessary.
- Train your model using TensorFlow or Keras.
- Save the trained model using:
model.save('model.h5')
- Move the
model.h5
file into your project root directory (same asrun.py
).
Create an empty uploads
directory inside the static
folder to store uploaded images:
mkdir static/uploads
pip install flask tensorflow pillow numpy
python run.py
http://127.0.0.1:5000/
You’ll be taken to the home page with a “Start Classification” button.
home.html
– Starting page with a navigation buttoninput.html
– Upload an imageoutput.html
– View the prediction and confidence score
- Backend: Python, Flask
- Frontend: HTML, CSS
- ML Framework: TensorFlow / Keras
- Model Format:
.h5
- Only image files (
.jpg
,.jpeg
,.png
) are supported. - The model input size used in preprocessing (e.g.,
(256, 256)
) must match what was used during training. - The app assumes classification into exactly 5 galaxy types.
Maintained by Jayanth Srinivas Bommisetty
For questions or feedback, feel free to raise an issue on GitHub or Gmail: jayanth.b.cse@gmail.com.