Overview

A catalog-driven deep-learning pipeline that classifies stars from RGB image cutouts. The model predicts the Morgan–Keenan spectral letter (O, B, A, F, G, K, M) and the subclass digit (0–9 within the predicted letter) from photometric imagery alone.

Inputs are constructed by querying VizieR catalogs for coordinates, magnitudes, colors, and spectral hints, then fetching color cutouts from Pan-STARRS with graceful fallbacks to other surveys. Each cutout is preprocessed to expose color cues without saturating the stellar core, then routed through a multi-task CNN.

Pipeline

Three independent stages: catalog ingestion, image builder, and classifier.

Dataset

The raw class distribution is steeply imbalanced: K and F stars dominate; O and M are rare. The builder applies a "curved" target distribution to soften this skew without throwing away the long tail.

Letter class counts
Letter Before balancing After balancing
K 30,901 26,154
F 30,117 25,754
A 17,127 18,356
G 12,072 14,881
B 5,537 9,322
M 285 1,572
O 78 283
Final dataset splits
Split Images
Train 67,227
Validation 14,406
Test 14,406

Splits total 96,039 rows, slightly below the post-balancing total of 96,322 because the per-split quality gates reject a handful of frames that survived initial balancing (corrupted decodes, missing files, or borderline centring).

Quality gates

Model architecture

A compact, regularized three-block ConvNet with three jointly-trained heads.

Conv → BatchNorm → ReLU blocks feed global average pooling and dense layers. Three softmax heads sit on top:

Training

Two-stage. Stage 1 optimizes the letter head alone to establish a stable backbone. Stage 2 unfreezes the full multi-task model, balancing letter and combined-head losses; the stage head joins if any stage labels are present. Class balance is handled by curved resampling plus class-balanced sample weights. The 70 / 15 / 15 split is stratified on letter; tf.data caching and prefetching keep the input pipeline ahead of the GPU. Plateau-triggered LR reductions and early stopping with best-weight restoration prevent overfitting.

Letter-head training and validation loss/accuracy curves over the multi-task training run.
Letter-head loss and accuracy across training. The two-stage schedule is visible: Stage 1 establishes the backbone on the letter task alone, before Stage 2 unfreezes the full multi-task model.

Results

The letter head is the headline number: it tracks the macroscopic temperature sequence robustly. Subclass resolution is harder because RGB cutouts encode color differences only coarsely. Subclass accuracy is reported two ways: conditional on the letter being correct (isolates the subclass head's own contribution) and overall (penalizes letter errors as well).

Letter confusion matrix

Test set letter-head confusion across the seven spectral classes. The diagonal dominates as expected; what little off-diagonal mass exists is concentrated on adjacent letters in the temperature sequence.

7-class spectral letter confusion matrix (O, B, A, F, G, K, M) on the held-out test set.
Held-out test set, 14,406 samples. Confusion concentrates on A/F, F/G, and K/M, neighbouring letters in the H–R diagram, which is consistent with the model learning a smooth temperature sequence.

Error analysis

Confusion concentrates at decision boundaries that are physically adjacent: the model is learning a smooth temperature sequence rather than memorizing class identities.

Combined letter × subclass confusion matrix: 70 effective classes spread across O, B, A, F, G, K, M letters and 0–9 subclass digits.
Combined letter × subclass confusion matrix on the test set. The block-diagonal structure shows that errors cluster within a letter (off-by-one subclass) far more than they cross letter boundaries: the model has learned the temperature sequence as a continuous quantity, not a set of independent classes.

Inference program

The inference script loads the trained model and the class map, reads new star images, applies the same preprocessing as training, and writes per-object predictions for letter and subclass with confidence scores. Batch evaluation produces a CSV that can be merged back onto catalog rows for downstream analysis.

Limitations & future work