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.
