Variational Autoencoder with Normalizing flow for X-ray spectral fitting
Fiona Redmen, Ethan Tregidga, James Steiner, Cecilia Garraffo · 2026
Read Variational Autoencoder with Normalizing flow for X-ray spectral fitting by Fiona Redmen, Ethan Tregidga, James Steiner, Cecilia Garraffo (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-07440.txt.
Introduction
Fiona Redmen and colleagues wrote a 2026 arXiv preprint. The work covers variational autoencoder with normalizing flow for x-ray spectral fitting. ArXiv posted the preprint in 2026 under its PAPERS collection. Black hole X-ray binaries (BHBs) can be studied with spectral fitting to provide physical constraints on accretion in extreme gravitational environments.
Traditional methods of spectral fitting such as Markov Chain Monte Carlo (MCMC) face limitations due to computational times. The authors introduce a probabilistic model, use a variational autoencoder with a normalizing flow, trained to adopt a physical latent space. The work gives specialists a compact account of the problem and one proposed way to handle it.
Catalog record
| CREATOR | Fiona Redmen, Ethan Tregidga, James Steiner, Cecilia Garraffo |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 16 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-07440
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Variational Autoencoder with Normalizing flow for X-ray spectral fitting Fiona Redmen, Ethan Tregidga, James Steiner, Cecilia Garraffo Abstract Black hole X-ray binaries (BHBs) can be studied with spectral fitting to provide physical constraints on accretion in extreme gravitational environments. Traditional methods of spectral fitting such as Markov Chain Monte Carlo (MCMC) face limitations due to computational times. We introduce a probabilistic model, utilizing a variational autoencoder with a normalizing flow, trained to adopt a physical latent space. This neural network produces predictions for spectral-model parameters as well as their full probability distributions. Our implementations result in a significant improvement in spectral reconstructions over a previous deterministic model while performing three orders of magnitude faster than traditional methods. 1 Introduction Black hole X-ray binaries (BHBs) are composed of a close companion star orbiting, and accreting matter, onto a stellar-mass black hole. The accretion flows in these systems consist of a geometrically-thin and optically-thick disk enshrouded by a corona of hot electrons [ 14 ] . These components emit predominantly in the X-rays, and their resulting spectra can be fit to infer physical properties of the system. Such inference provides key insights into the accretion mechanisms at work [ 4 ] , enabling exploration of General Relativity in extreme environments [ 7 ] . The standard analytical software for X-ray astronomy, Xspec [ 1 ] , uses Markov Chain Monte Carlo (MCMC) to obtain full posterior distributions on physical parameters. This method of spectral fitting faces limitations due to unwieldy computational times when dealing with a large number of spectra, especially when employing complex models. This work advances a new approach, expediting the traditional MCMC method. We use a library of observational data collected for several dozen BHBs with the Neutron-star Interior Composition Explorer (NICER) mission on the International Space Station [ 8 ] , and additionally employ synthetic NICER spectra. Both cover the 0.3-10 keV energy range with 240 spectral bins, and from such data we derive full posterior distributions of five physical parameters, along with spectral reconstructions. Recent machine learning (ML) work for X-ray astronomy includes representation learning [ 21 ] , with applications in anomaly detection, unsupervised classification, and similarity searches [ 3 ] . Previous ML work in spectral fitting has successfully applied autoencoders (AEs) to this problem, which achieved parameter-value inference 2\,700 times faster than traditional techniques [ 20 ] . However, that study did not provide uncertainties on the parameter predictions, which is key for scientific interpretability. Moreover, the method required additional iterations of computationally-expensive spectral fitting via Xspec for parameter predictions to remain comparable in accuracy. The works in 2 and 5 discuss the application of simulation-based inference with automatic posterior transformation [ 9 ] to this problem and accurately obtain full posteriors. We present an implementation of the network described in 20 that outputs full posterior distributions. Our posterior predictions reproduce spectra with higher fidelity than before, with similar accuracy to traditional MCMC methods, removing the requirement of additional iterations of Xspec fitting. The architecture takes X-ray spectra as input and outputs the corresponding physical parameter distributions. In addition to maximizing posteriors as in 2 , we include a decoder, a reconstruction loss, and a latent loss to further modulate training. We demonstrate the robustness of our method when applied to real spectra. The code, which utilizes the repository in 20 , is available at https://github.com/fi-redmen/fspnet-var.git . 2 Method 2.1 Datasets We aggregate the full library of BHB spectra collected by NICER from July 2017 through August 2022, yielding a total of 10\,800 spectra, from 25 BHBs. Data is preprocessed as in 20 . Ground-truth benchmarks, which we call our targets, are obtained as a reference via rigorous fitting of spectra, performed using Xspec . Synthetic spectra are created using Xspec , simulating the physical model with the detector response accounted for, but excluding noise. A total of 100\,000 spectra are generated, spanning a broad distribution of viable physical parameters. We split the data to train on 80% of the spectra and use the remaining 20% as a validation set. 2.2 Physical Model In this exploratory work, we utilize a highly-simplified spectral model which incorporates three spectral features. Thermal emission from the inner thin disk is described by a multicolor black-body continuum [ 23 ] . The Compton up-scattering of thermal-disk’s photons by hot electrons in the corona redistributes a portion of those photons to higher energies, manifesting as a power law [ 18 ] . Photoelectric absorption by gas along our line of sight to the source cuts off the spectrum at low energies ( \lesssim 1 keV) [ 22 ] . Through this model, we can determine the following physical properties: temperature of the thin disk kT_{\mathrm{disk}} , the amplitude of the thin-disk emission N , photon index for the Comptonized emission \Gamma , the fraction of photons that are Compton up-scattered f_{\mathrm{sc}} , and the line-of-sight column density of neutral gas N_{\mathrm{H}} . 2.3 Architecture The network consists of three elements: an encoder, a normalizing flow (NF) [ 15 ] , and a decoder. We use the network and multi-stage training scheme as in 20 , as this has been shown to effectively perform deterministic spectral parameter predictions. The encoder contains a series of convolutional layers which downscale the dimensionality of the spectra [ 17 ] and learn patterns in spectra across neighboring data points through various scales. A series of linear layers then allows the encoder to map from the spectral space to the parameter space. The output of the encoder is a partially reduced dimension representation of the spectra, referred to as “context”. The NF is a neural spline flow [ 6 ] , parameterized by an autoregressive network [ 13 ] , which outputs a series of ten monotonic rational-quadratic spline transforms [ 6 ] , conditioned on the context. The transforms describe the predicted posteriors as a map from a standard normal distribution to the posterior. Draws are sampled from the posteriors to form our latent space, and serve as input to the decoder. The decoder follows a similar but reverse-ordered structure to the encoder; a series of linear layers map the parameter space to spectral space and a bidirectional gated recurrent unit [ 16 ] is used to learn sequential relationships from lower to higher energies and vice versa. We use GELU activation functions throughout the network. The architecture is displayed in Figure 1 . For each spectrum, a five-dimensional distribution is predicted, with each dimension representing a different parameter. Using a full NF rather than a vanilla VAE produces complex posteriors which more closely resemble the true spectral parameter distributions. We use a Gaussian negative log likelihood [ 12 ] reconstruction loss, as this prioritizes data points with lower relative errors. Since our goal is to obtain physical parameters, rather than an arbitrary decomposition of the spectra, we impose a physical latent space. To do this, we use an additional latent loss term which forces the latent values to match with physical quantities, penalizing differences as the mean square error. To learn the correct distributions, we include a third flow loss term that maximizes the log probability at the values seen in the dataset with