metadata
license: apache-2.0
language:
- en
metrics:
- accuracy
library_name: keras
pipeline_tag: image-classification
tags:
- astronomy
Model Card for Model ID
This model classifies RGB images to the 2 classes, Spheroid or Spiral.
Model Details
Model Description
- Developed by: Jeroen den Otter
- Funded by: NASA
- Shared by [optional]: Michael Rutkowski
- Model type: Keras Sequential
- Language(s) (NLP): English
- License: Apache2
Model Sources [optional]
- Repository: https://www.kaggle.com/c/galaxy-zoo-the-galaxy-challenge/overview
- Paper [optional]: In progress
Uses
The model can be used for identifying different galaxies from cutout images. It does not provide bounding boxes, so multiple galaxies in 1 image is not desired.
How to Get Started with the Model
Use the code below to get started with the model.
model = tf.keras.models.load_model('model.keras')
prediction = model.predict(image)
print(prediction)
Training Details
Training Data
From the kaggle zoo challenge the classes one_one(Spheroid) 80%> and one_two(Spiral) 90%> are used.
Furthermore are the image segmented for noice removal
Training Procedure
data_augmentation = tf.keras.Sequential([
tf.keras.layers.RandomFlip('horizontal'),
tf.keras.layers.RandomRotation(0.2),
tf.keras.layers.RandomZoom(0.2),
tf.keras.layers.RandomContrast(0.2),
tf.keras.layers.RandomBrightness(0.2),
tf.keras.layers.GaussianNoise(0.1),
])
AUTOTUNE = tf.data.AUTOTUNE
train_ds = train_ds.cache().shuffle(1000).prefetch(buffer_size=AUTOTUNE)
val_ds = val_ds.cache().prefetch(buffer_size=AUTOTUNE)
model = tf.keras.Sequential([
data_augmentation,
tf.keras.layers.Rescaling(1./255, input_shape=(img_height, img_width, 3)),
tf.keras.layers.Conv2D(32, (3, 3), activation='relu'),
tf.keras.layers.MaxPooling2D(2, 2),
tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
tf.keras.layers.MaxPooling2D(2, 2),
tf.keras.layers.Conv2D(128, (3, 3), activation='relu'),
tf.keras.layers.MaxPooling2D(2, 2),
tf.keras.layers.Conv2D(128, (3, 3), activation='relu'),
tf.keras.layers.MaxPooling2D(2, 2),
tf.keras.layers.Flatten(),
tf.keras.layers.Dropout(0.5),
tf.keras.layers.Dense(512, activation='relu'),
tf.keras.layers.Dense(num_classes, activation='softmax')
])
model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.001),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
Training Hyperparameters
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
Test data is manual retrieved data from Hubble and James web, see manually manipulated data in the files and their accuracy. Of each a log and linear scaling is used.
Results
precision recall f1-score support
one_one 0.96 0.98 0.96 1637
one_two 0.98 0.93 0.96 1740
accuracy 0.96 3377
macro avg 0.96 0.96 0.96 3377 weighted avg 0.96 0.96 0.96 3377
Environmental Impact
- Hardware Type: M3 Pro
- Hours used: 30min