Semi-Supervised Domain Adaptation for Cross-Survey Galaxy Morphology Classification and Anomaly Detection

Aleksandra Ciprijanovic, Ashia Lewis, Kevin Pedro, Sandeep Madireddy, Brian Nord, Gabriel N. Perdue, Stefan M. Wild

TL;DR

DeepAstroUDA is a new semi-supervised framework that allows deep learning models to bridge the gap between different astronomical surveys while simultaneously identifying unknown "anomaly" classes like merging galaxies. By combining adaptive clustering with entropy-based separation, the authors demonstrate that a model trained on one telescope's data can successfully classify galaxies in another, much noisier survey, even when that second survey contains entirely new types of objects.

What Problem Does This Paper Address?

In the era of "Big Data" astronomy, we have massive datasets from surveys like the Sloan Digital Sky Survey (SDSS) and the Dark Energy Camera Legacy Survey (DECaLS). Ideally, an AI trained to recognize galaxy shapes in one survey should work on the other.

However, "domain shift" stands in the way. Because different telescopes have different resolutions, noise levels, and filters, a neural network trained on SDSS often performs miserably when tested on DECaLS. Furthermore, real-world data is messy: one survey might contain rare objects—like gravitational lenses or merging galaxies—that weren't present in the training set. Standard "Domain Adaptation" (DA) methods usually fail here because they try to force-align all data, even the classes that don't overlap. This paper introduces DeepAstroUDA to solve this "Universal Domain Adaptation" problem, allowing for cross-survey classification and automated anomaly detection.

Methods

DeepAstroUDA uses a ResNet50 backbone and a semi-supervised approach, meaning it uses labeled data from a "source" domain (SDSS) and unlabeled data from a "target" domain (DECaLS). The model is trained using a combination of three loss functions:

  1. Weighted Cross-Entropy (CE) Loss: The standard supervised loss used for the labeled source images.
  2. Adaptive Clustering (AC) Loss: This groups unlabeled target samples into clusters by comparing their extracted features. It forces the model to be consistent: if two images have very similar features, they should get the same class label.
  3. Entropy Separation (ES) Loss: This is the core innovation for handling anomalies. The model calculates the "entropy" (uncertainty) of its predictions. Known classes usually have low entropy, while unknown anomalies have high entropy. The ES loss pushes known classes toward the source domain distributions while pushing high-entropy "unknown" samples away into their own clusters.

Datasets

The authors utilized data from the Galaxy Zoo project, specifically:

  • Source Domain: SDSS (GZ2) images.
  • Target Domain: DECaLS (GZ3/Galaxy10 DECaLS) images.

They tested two scenarios:

  • 3-Class Task: Classifying Spiral and Elliptical galaxies (known), with Merging galaxies acting as the "unknown" anomaly class in the target domain.
  • 10-Class Task: A granular morphological classification (9 known classes) with Gravitational Lenses added as the "unknown" anomaly class.

Key Insights and Ideas

  • Bridging the Observational Gap: This is the first time domain adaptation has been successfully demonstrated between two substantially different observational datasets in astronomy, rather than just between simulations and real data.
  • Anomaly Detection as a Feature, Not a Bug: Instead of being confused by new classes in the target data, DeepAstroUDA uses the difference in data distributions to "outlier" them. As seen in the t-SNE plots, the model successfully pushes the unknown merger class to the outskirts of the feature space.
Figure 3: t-SNE plots of the latent space of the model trained on the 3-class problem. Without DA (left) the target domain (empty circles) remains completely separate from the source (filled circles), while using DA (right) aligns classes correctly, which allows the model to perform well in both domains. Furthermore, we can see that the unknown merger class (yellow) in the target domain is separated from the rest and moved to the outskirts.
  • Entropy as a Boundary: The use of a confidence threshold ($m$) around an entropy boundary ($\rho$) allows the model to actively decide if a sample is "known" or "unknown" during training, which is then fine-tuned as the model learns.

Key Results

The inclusion of Domain Adaptation led to dramatic performance gains in the target domain:

  • 3-Class Accuracy: Jumped from 0.56 (without DA) to 0.82 (with DA).
  • 10-Class Accuracy: Jumped from 0.43 (without DA) to 0.79 (with DA).

Qualitatively, the model proved adept at identifying anomalies. In the 3-class problem, the "unknown" merger class accuracy improved steadily throughout training.

Figure 2: Top (3-class): left: target domain accuracies during training (elliptical in violet, spiral in navy and unknown merger class in yellow); right: loss functions during training (CE loss in yellow, AC loss in green, ES loss in dark green). Vertical dashed lines on the left plot show epochs in which hyperparameters of the ES loss were fine-tuned. Bottom (10-class): left: target domain mean known class accuracy (blue), unknown gravitational lens class accuracy (red), and mean accuracy for all classes (black dashed line); right: target test set confusion matrix to illustrate confusion between morphologically similar classes (disturbed (0), merging (1), round smooth (2), cigar shaped smooth (3), barred spiral (4), unbarred tight spiral (5), unbarred loose spiral (6), edge-on without bulge (7), edge-on with bulge (8), lenses (9)).

Figure 1 illustrates the practical effect: even when the visual quality differs between SDSS and DECaLS, the model correctly identifies the morphology.

Figure 1: Example images from the 3-class problem. Source domain SDSS data (spiral and elliptical classes) is given in the top row, while the target domain DECaLS data (spiral, elliptical, and merging classes) is in the bottom row. We give true labels in the top left corner of each image and predicted labels in the top right corner (when trained with DA). These examples show the most often correctly and incorrectly classified objects in our experiments.

Limitations and Future Work

The authors note that this is a preliminary study. A primary limitation is that they only reported results from a single training run without multiple random seeds or error bars.

Future work will involve exploring different types of domain shift problems and applying the method to more complex astronomical tasks. The authors also suggest this framework could be vital for real-time detection of transient phenomena or anomalies in upcoming large-scale surveys.

Summary updated

Abstract

In the era of big astronomical surveys, our ability to leverage artificial intelligence algorithms simultaneously for multiple datasets will open new avenues for scientific discovery. Unfortunately, simply training a deep neural network on images from one data domain often leads to very poor performance on any other dataset. Here we develop a Universal Domain Adaptation method DeepAstroUDA, capable of performing semi-supervised domain alignment that can be applied to datasets with different types of class overlap. Extra classes can be present in any of the two datasets, and the method can even be used in the presence of unknown classes. For the first time, we demonstrate the successful use of domain adaptation on two very different observational datasets (from SDSS and DECaLS). We show that our method is capable of bridging the gap between two astronomical surveys, and also performs well for anomaly detection and clustering of unknown data in the unlabeled dataset. We apply our model to two examples of galaxy morphology classification tasks with anomaly detection: 1) classifying spiral and elliptical galaxies with detection of merging galaxies (three classes including one unknown anomaly class); 2) a more granular problem where the classes describe more detailed morphological properties of galaxies, with the detection of gravitational lenses (ten classes including one unknown anomaly class).
BibTeX
@misc{ciprijanovic2022semi,
  author = {Aleksandra Ciprijanovic and Ashia Lewis and Kevin Pedro and Sandeep Madireddy and Brian Nord and Gabriel N. Perdue and Stefan M. Wild},
  title = {{Semi-Supervised Domain Adaptation for Cross-Survey Galaxy Morphology Classification and Anomaly Detection}},
  year = {2022},
  eprint = {2211.00677},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.00677},
}
Figure