Skip to content

archon774/Galaxy-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galaxy Classification Neural Network

This project implements a PyTorch-based neural network for galaxy classification. The code supports training, validation, and testing on custom datasets extracted from provided .zip archives.

Setup

  1. Clone the repository: git clone https://github.com/archon774/Galaxy-Classification.git
  • Then navigate to this repo using: cd Galaxy-Classification
  1. Create a virtual environment in this main repo folder using:
  • python3.13 -m venv venv
  1. Activate the virtual environment:

    • Linux/macOS: source venv/bin/activate
    • Windows: venv\Scripts\activate
  2. Install dependencies: pip install -r requirements.txt


Running the Trainer

python code/galaxy_model_trainer.py

  1. The script will prompt you to select a dataset size from 1000, 2500, 5000, 10000, 50000.
  2. It will automatically extract images to data/processed_data/imgs/ and use data/processed_data/labels/ for the labels.
  3. Training, validation, and test errors will be logged during execution.
  4. The best model (based on validation error) is saved in the saved_models folder.
  5. A plot of training and validation errors is saved in figures/.

Running the Tester

python code/galaxy_model_tester.py

  1. The script will prompt you to select what dataset size you want to test from 1000, 2500, 5000, 10000, 50000.
  2. The script will prompt you to select what model you would like to test, so long as it is valid (model dataset size matches desired test size)
  3. It will evaluate the model on the test set in data/processed_data/imgs/ and data/processed_data/labels/ while printing errors and metrics to the console.
  4. The script probes the four hidden layers in the neural network model, calculating RMSE along the layers for each test concept
  5. A final plot of the RMSE per layer per concept will be saved to figures/.

Notes

  • The code automatically sets random seeds for reproducibility.
  • Training is done on CPU or GPU, depending on availability. Currently the code supports CPU training, untested on GPU services like Google Colab.

License

coming soon

About

ERIRA 2025 Repo for Galaxy ML Classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages