Table of Contents
Fetching ...

Interpreting anomaly detection of SDSS spectra

Edgar Ortiz Manrique, Médéric Boquien

TL;DR

This work tackles interpretability in anomaly detection for large spectroscopic surveys by combining a variational autoencoder (VAE) – to score spectral outliers via reconstruction errors – with a spectrally adapted LIME framework (LIME-Spectra-Interpreter) that explains which wavelength segments drive each anomaly. Eight anomaly-score variants (four based on mean-squared error and four on inverse-flux weighted $\chi^2$) are computed, with artifact-mitigating variants, enabling nuanced detection of astrophysical outliers and data quality issues. By normalizing LIME explanation weights and clustering the top 1% anomalies, the study reveals seven coherent groups, including artifact-dominated clusters and physically meaningful emission-line populations such as dusty starbursts, metal-poor extreme emitters, and intermediate-metallicity H II regions, all aligned with standard emission-line diagnostics. The framework demonstrates fast explanation generation suitable for high-throughput pipelines and offers a generalizable approach for QC, follow-up targeting, and discovery in current and upcoming surveys. Overall, the work provides a transparent, scalable path to connect anomaly scores with physical interpretation in large spectroscopic datasets.

Abstract

The increasing use of ML in astronomy introduces important questions about interpretability. Due to their complexity and non-linear nature, it can be challenging to understand their decision-making process. While these models can effectively identify unusual spectra, interpreting the physical nature of the flagged outliers remains a major challenge. We aim to bridge the gap between anomaly detection and physical understanding by combining deep learning with interpretable ML (iML) techniques to identify and explain anomalous galaxy spectra from SDSS data. We present a flexible framework that uses a variational autoencoder to compute multiple anomaly scores, including physically-motivated variants of the mean squared error. We adapt the iML LIME algorithm to spectroscopic data, systematically explore segmentation and perturbation strategies, and compute explanation weights that identify the features most responsible for each detection. To uncover population-level trends, we normalize the LIME weights and apply clustering to the top 1\% most anomalous spectra. Our approach successfully separates instrumental artifacts from physically meaningful outliers and groups anomalous spectra into astrophysically coherent categories. These include dusty, metal-rich starbursts; chemically-enriched H\,II regions with moderate excitation; and extreme emission-line galaxies with low metallicity and hard ionizing spectra. The explanation weights align with established emission-line diagnostics, enabling a physically-grounded taxonomy of spectroscopic anomalies. Our work shows that interpretable anomaly detection provides a scalable, transparent, and physically meaningful approach to exploring large spectroscopic datasets. Our framework opens the door for incorporating interpretability tools into quality control, follow-up targeting, and discovery pipelines in current and future surveys.

Interpreting anomaly detection of SDSS spectra

TL;DR

This work tackles interpretability in anomaly detection for large spectroscopic surveys by combining a variational autoencoder (VAE) – to score spectral outliers via reconstruction errors – with a spectrally adapted LIME framework (LIME-Spectra-Interpreter) that explains which wavelength segments drive each anomaly. Eight anomaly-score variants (four based on mean-squared error and four on inverse-flux weighted ) are computed, with artifact-mitigating variants, enabling nuanced detection of astrophysical outliers and data quality issues. By normalizing LIME explanation weights and clustering the top 1% anomalies, the study reveals seven coherent groups, including artifact-dominated clusters and physically meaningful emission-line populations such as dusty starbursts, metal-poor extreme emitters, and intermediate-metallicity H II regions, all aligned with standard emission-line diagnostics. The framework demonstrates fast explanation generation suitable for high-throughput pipelines and offers a generalizable approach for QC, follow-up targeting, and discovery in current and upcoming surveys. Overall, the work provides a transparent, scalable path to connect anomaly scores with physical interpretation in large spectroscopic datasets.

Abstract

The increasing use of ML in astronomy introduces important questions about interpretability. Due to their complexity and non-linear nature, it can be challenging to understand their decision-making process. While these models can effectively identify unusual spectra, interpreting the physical nature of the flagged outliers remains a major challenge. We aim to bridge the gap between anomaly detection and physical understanding by combining deep learning with interpretable ML (iML) techniques to identify and explain anomalous galaxy spectra from SDSS data. We present a flexible framework that uses a variational autoencoder to compute multiple anomaly scores, including physically-motivated variants of the mean squared error. We adapt the iML LIME algorithm to spectroscopic data, systematically explore segmentation and perturbation strategies, and compute explanation weights that identify the features most responsible for each detection. To uncover population-level trends, we normalize the LIME weights and apply clustering to the top 1\% most anomalous spectra. Our approach successfully separates instrumental artifacts from physically meaningful outliers and groups anomalous spectra into astrophysically coherent categories. These include dusty, metal-rich starbursts; chemically-enriched H\,II regions with moderate excitation; and extreme emission-line galaxies with low metallicity and hard ionizing spectra. The explanation weights align with established emission-line diagnostics, enabling a physically-grounded taxonomy of spectroscopic anomalies. Our work shows that interpretable anomaly detection provides a scalable, transparent, and physically meaningful approach to exploring large spectroscopic datasets. Our framework opens the door for incorporating interpretability tools into quality control, follow-up targeting, and discovery pipelines in current and future surveys.

Paper Structure

This paper contains 20 sections, 10 equations, 14 figures, 4 tables, 1 algorithm.

Figures (14)

  • Figure 1: Example of a good (upper panel) and poor (lower panel) reconstruction by the VAE. The MSE score for the good reconstruction is $\approx$0.00019 and for the poor reconstruction is $\approx$0.015. Fluxes are median normalized.
  • Figure 2: Overview of SDSS anomalies identified by different variations of the MSE score. Each row displays example spectra (with SDSS imaging thumbnails) found using the respective MSE variation (e.g., MSE, Trimmed MSE), with two representative examples per variation. The different MSE variations are effective in highlighting different anomalous patterns in the spectra. Fluxes are median normalized.
  • Figure 3: Explanations of four representative anomalies detected with different MSE-based scores, each showing the median normalized flux (top, with SDSS imaging thumbnail) and corresponding max normalized LIME explanation weights (bottom). Panels illustrate: (a) extreme emission-line object driven by [OIII] and H$\alpha$ peaks (MSE); (b) red-end weighting from likely instrumental noise (MSE); (c) broad emitter with high weights on H$\alpha$ and [OII] (Filtered MSE); (d) continuum deviations near H$\alpha$ and the 400 nm break (Filtered + Trimmed MSE). Explanations consistently highlight features driving the anomaly, aligning with astronomers' interpretations.
  • Figure 4: Average spectrum and LIME explanation weights for Clusters 0, 5, 4, and 6 from the top 1% most anomalous spectra (MSE score). Clusters 0 and 5 (top rows) show diffuse or noisy explanations with low weights, consistent with poor continuum reconstructions or spikes. Clusters 4 and 6 (bottom rows) feature strong weights at truncated [OIII] $\lambda$500.7 lines due to masked regions during preprocessing. This illustrates how explanation-based clustering isolates artifacts from astrophysical signals. Fluxes are median normalized.
  • Figure 5: Average spectrum and LIME explanation weights for Clusters 1 and 2 of the top 1% most anomalous spectra (MSE score). Cluster 1 (left pannels) emphasizes H$\alpha$+[NII] and [OIII], consistent with dusty, metal-rich starbursts. Cluster 2 (right pannels) highlights [OII]$\lambda$372.7, indicating moderate-excitation, enriched H II regions. Clustering by explanation profiles reveals distinct physical regimes within spectrally similar galaxies. Fluxes are median normalized.
  • ...and 9 more figures