Skip to content

A project to train convolutional neural networks to detect quasars using images from the Sloan Digital Sky Survey

License

Notifications You must be signed in to change notification settings

LocalSymmetry/DetectingQuasars

Repository files navigation

DetectingQuasars

A project to train machine learning algorithms to detect quasars using images from the Sloan Digital Sky Survey. This project was created for The Society of Physics Students at Northeastern State University and the Y0 Physics Seminar. On testing data, the inception network was 96.6% accurate at classifying Quasars with an F1 Score of 0.95.

A technical description of the project can be found here.

To deploy the model, download QuasarClassifier.py and the Inception Model Checkpoint.

How to use:

Given a list of images with the same dimensions (at least 30 pixels by 30 pixels), use the QuasarClassifier function to classify if they are of quasars.

QuasarClassifier(ImageFilenames, image_width, image_height)

Parameters:

ImageFilenames : list
    A list of the image filenames to classify using this classifier.  

image_width : integer
    The number of pixels in the images' width.

image_height : integer        
    The number of pixels in the images' height.

To convert image filenames to a NumPy array use ImportImages.

ImportImages(ImageFilenames, image_width, image_height)

Parameters:

ImageFilenames : numpy array
    A numpy array of the image filenames to classify from the base
    directory of the python file using this classifier.

image_width : integer
    The number of pixels in the images' width.

image_height : integer        
    The number of pixels in the images' height.

Repository Files

Data Collection.ipynb - Gathering images from the Sloan Digital Sky Survey using SIMBAD Astronomical Database and the Penn State Center for Astrostatistics.

Model Training.ipynb - Training of a Random Forest, Simple Convolutional Neural Network, and an Inception Neural Network classifier to detect quasars.

QuasarClassifier.py - A functional version of the quasar classifier. Requires the Inception Model Checkpoint files.

QuasarCandidatePredictions.ipynb - Using the trained classification model to predict if quasar candidates are quasars.

NonQuasarsData.csv - 94670 randomly chosen non-quasar celestial objects in the range of the Sloan Digital Sky Survey. Constructed from the Data Collection notebook.

QuasarCandidatesData.csv - 5418 quasar candidate objects in the range of the Sloan Digital Sky Survey. Constructed from the Data Collection notebook.

train_data.csv - The training images randomly chosen in the Model Training notebook. Contains a data frame of 98763 image filenames with quasar classification.

valid_data.csv - The validation images randomly chosen in the Model Training notebook. Contains a data frame of 21163 image filenames with quasar classification

test_data.csv - The training images randomly chosen in the Model Training notebook. Contains a data frame of 21164 image filenames with quasar classification

QuasarCandidateDataWithClassification.csv - 5418 quasar candidate objects in the range of the Sloan Digital Sky Survey and their classification probabilities by the trained model.

Images and Inception Model Checkpoint - Externally hosted on Dropbox due to size. Contains the images from the Data Collection notebook and the parameters for the trained Inception ConvNet.

About

A project to train convolutional neural networks to detect quasars using images from the Sloan Digital Sky Survey

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published