arXiv:2610.38816astro-ph.IMOct 2026

Manuscript Offprint

arXiv:2610.38816

UnEZ: A Fully Unsupervised Self-Templating Neural Network for Redshift and Line Strength Estimation

Asha Abd, Karl Glazebrook, Colin Jacobs

ABSTRACT

As spectroscopic surveys grow, estimating galaxy properties such as metallicity, star formation rate, and redshift becomes computationally cumbersome. Methods of estimating such properties rely on template spectra or curated redshift catalogs, which fail to represent the diversity of objects seen in large-scale surveys. We present UnEZ, a fully unsupervised, physics-informed machine learning model that can predict spectroscopic redshifts and line strengths with no prior redshift or line strength labels. An encoder predicts emission and absorption line amplitudes/widths, and a fixed deterministic decoder constructs a unique template, estimated redshift, redshift confidence curve, and spectral model. UnEZ was tested on the Sloan Digital Sky Survey (SDSS) Data Release 18 due to its large dataset and thoroughly vetted redshift catalog which serves as an independent benchmark. Despite the lack of templates, line strength labels, or redshift labels, UnEZ's performance competes with modern redshift estimation algorithms. At SNR > 10, UnEZ achieves an outlier fraction of 0.459% and a normalized median absolute deviation (NMAD) of 1.237×10−41.237 \times 10^{-4}. At SNR > 3, UnEZ achieves an outlier fraction of 3.89% and an NMAD of 1.471×10−41.471 \times 10^{-4}. Furthermore, we demonstrate how UnEZ's line strength and redshift predictions can be utilized for various purposes such as constructing template spectra required in traditional redshift estimation algorithms. UnEZ illustrates how a fully unsupervised neural network can allow redshift, among other galaxy properties, to emerge naturally from the spectra themselves, providing a template-free, label-free approach that scales to the demands of future surveys.

Key words: software: machine learning – techniques: spectroscopic – galaxies: distances and redshifts – surveys

1 INTRODUCTION

Recent efforts in astronomical surveying have yielded vast datasets ranging across many redshift regimes and areas of the sky. Such large datasets enable high-precision statistical modeling of the universe.

Redshift carries information that is vital to such cosmological models. Measures such as scale factor or lookback time (Hogg 2000) can be calculated from redshift for example. Other important galaxy characteristics such as rotation curves (Sofue & Rubin 2001) can also be isolated given the redshift of an object. Large-scale surveys allow statistical analyses across millions of spectra, such as measurements of the galaxy clustering power spectrum (Tegmark et al. 2004), making them valuable for verifying cosmological models (Abdul Karim et al. 2025).

Photometry has also been used to estimate redshifts. Traditional algorithms fit template spectral energy distributions (SEDs) to the broad features traced out between photometric filters (Benítez 2000). Photometric redshift can suffer from degeneracies resulting in catastrophic redshift prediction failures (Massarotti et al. 2001) and have larger uncertainties due to the lack of highly resolved emission/absorption lines. While photometric redshifts are cheap in both observational resources and compute needs, they lack the precision of spectroscopic redshifts (Newman & Gruen 2022).

Spectroscopy, while being more resource-expensive than photometry, is particularly important for high precision redshift measurements. Modern fiber-fed spectrographs can collect thousands of spectra in a single pointing allowing for large surveys (Smee et al. 2013). Redshift surveys were not always conducted on the scale they are today. The first surveys were composed of only a few dozen redshifts due to the hours or sometimes nights required to collect a spectrum on photographic plates.

Endeavors such as mapping out galaxy clusters require a large number of precise redshift measurements to understand how distant they are. Later surveys such as the Center for Astrophysics (CfA) survey collected several thousand spectra automatically. Such surveys led to the discovery of large-scale structures in the universe (Huchra et al. 1988). The 1990s and early 2000s brought even larger surveys such as the 2dF Galaxy Redshift Survey which produced almost 250,000 spectra (Colless et al. 2003), with later surveys such as the Sloan Digital Sky Survey (SDSS) producing millions of spectra (Almeida et al. 2023). Future and current endeavors such as the Dark Energy Spectroscopic Instrument (DESI) survey will bring tens of millions more spectra (DESI Collaboration et al. 2026), creating a unprecedented amount of data available for analysis.

Many methods of estimating the redshift of spectra have been adopted over the years. The first method required manually identifying spectral lines and comparing their distances to one another with a reference line list (Humason et al. 1956). This method was very

★ E-mail: aabd@swin.edu.au

© 2026 The Authors

Abd et al.

labor-intensive although it did come with the benefit of being human-verified for every data point. Modern methods of estimating redshift generally utilize a set of templates and a χ2\chi^2 or cross-correlation algorithm. The χ2\chi^2 algorithm fits templates to a spectrum at trial redshifts to minimize χ2\chi^2 (Bolton et al. 2012). The cross-correlation algorithm, on the other hand, computes the correlation between templates and spectra in log-wavelength space to find the redshift corresponding with the highest correlation (Tonry & Davis 1979). AUTOZ, an algorithm for estimating redshift, removes the continuum from spectra, removes potential skyline or cosmic ray contamination, and cross-correlates the processed spectrum with a set of templates to estimate redshift (Baldry et al. 2014). Further endeavors such as MARZ have refined that process with a larger template library and a user interface (Hinton et al. 2016).

As astronomical datasets grow in area and depth, estimating redshifts quickly becomes cumbersome. The SDSS dataset alone contains millions of spectra, and future surveys promise tens of millions more. Machine learning models are a good candidate for analyzing such datasets due to their capacity to learn complex non-linear relationships in the data (Fluke & Jacobs 2019). The use of neural networks in astronomy dates as far back as the 1990s for tasks such as correcting atmospheric aberrations in adaptive optics and object classification (Miller 1993). As neural networks became larger and more sophisticated, their accuracy and precision made them a much more enticing candidate for tasks such as morphological classification (Dieleman et al. 2015), photometric redshift estimation (Collister & Lahav 2004), and stellar classification (Liu et al. 2019). Neural networks can be classified into two generic categories, supervised and unsupervised, which come with different benefits and shortcomings.

Supervised machine learning models are very well studied. Models have been trained to predict redshift using redshift labels from traditional fitting algorithms (Zhong et al. 2024). SpecPT, for example, uses a unique transformer architecture to predict redshifts directly by training on spectra with their corresponding redshift label (Pattnaik et al. 2025). Such supervised neural networks learn by comparing predictions with ground-truth labels (Rumelhart et al. 1986). The ground-truth redshift labels are often sourced from template-fitting algorithms that have been heavily vetted for bad fits (Lan et al. 2023; Alexander et al. 2023).

Unsupervised learning, however, operates under fundamentally different constraints. Unsupervised models have no access to a label to directly compare their predictions to. These neural networks typically compress high-dimensional data (e.g. spectra) to a lower-dimensional space while preserving the important features of the data. For example, autoencoders compress their input data into a low-dimensional latent space before decompressing to recreate the input data (Bourlard & Kamp 1988). Another powerful unsupervised algorithm is the self-organizing map (SOM). SOMs map each input to a discrete and finite two-dimensional map (Kohonen 1982). Self-organizing maps are ideal for clustering because they preserve the topology of the input space (Carrasco Kind & Brunner 2014). Further research has been conducted combining such methods in a joint learning effort. The deeply-embedded self-organizing map (DESOM) embeds a SOM in the latent-space of an autoencoder. Such models use a unique method of backpropagation that updates the encoder based on the typical autoencoder loss and the SOM loss by modifying the SOM to be differentiable (Mong et al. 2023). DE-SOMs have been used to classify galaxy morphology, inclination angle, and star formation history (Teimoorinia et al. 2022). All of the mentioned unsupervised models attempt to recreate the data from a compressed representation, therefore using the input data itself as

the ground truth. Without prior labels for measures such as redshift, machine learning models cannot output directly interpretable values.

Numerous examples of using machine learning for redshift prediction have been introduced; however, they are all fully or semi-supervised models. Such supervised methods require spectra (Zhong et al. 2024) or photometry (Collister & Lahav 2004) with associated predetermined redshifts for training. These redshift labels are often created using templates. Examples of semi-supervised models for photometric redshift have been introduced such as SOMz (Carrasco Kind & Brunner 2014), which uses an underlying unsupervised machine learning mechanism with post-inference supervised steps that require redshift labels. However, all of the methods described thus far require prior redshift labels either in training, template construction, or post-inference calibration. Without prior labels, conventional unsupervised models compress and reconstruct data, but do not output directly interpretable physical measures such as redshift.

Modern conventional algorithms remain constrained by their reliance on human-made redshift catalogs and template spectra. SDSS templates are created by grouping objects with similar redshifts and spectral shapes together, stacking them, and using PCA to identify the eigenspectra or templates (Bolton et al. 2012). However, such templates are prone to their own biases, which translate to estimated redshift measures (Hewett & Wild 2010). As surveys grow and the diversity of objects observed increases, a small set of templates is not sufficient to model spectra that exhibit extreme features (Anand et al. 2024). Limitations in template-based redshift algorithms carry over to the redshift catalogs used to train neural networks, creating the need for a label-free method of estimating redshift.

We introduce UnEZ, a novel fully unsupervised redshift and line strength prediction model. UnEZ addresses the weaknesses of previous redshift estimation algorithms while maintaining high precision and accuracy. The model requires initialization with physical parameters such as a line list, redshift sampling resolution, and maximum expected redshift. UnEZ accurately predicts redshifts and line strength ratios while requiring no labels for training. These measures can then be used for further analysis such as creating templates for traditional redshift fitting algorithms, performing AGN diagnostics (Veilleux 2002), and identifying outliers. Importantly, this model learns how to predict redshift and line strengths from first-principles by constraining the model to only output scientifically significant measures.

This paper will discuss the training, architecture, performance, and shortcomings of UnEZ. Beginning in Section 2 the data used for training/validation is reviewed alongside the various data cuts applied before training and testing. Section 3 describes the UnEZ pipeline from the model priors to the final output. Furthermore, Section 4 analyzes UnEZ's precision and accuracy in both redshift and line strength prediction. Lastly, Section 5 concludes with discussion of the quality of UnEZ's outputs, shortcomings/benefits of the pipeline, and future endeavors.

References (29)