Variational Autoencoder with Normalizing flow for X-ray spectral fitting
Fiona Redmen, Ethan Tregidga, James F. Steiner, Cecilia Garraffo
TL;DR
This work tackles the slow posterior inference problem in X-ray spectral fitting of black hole X-ray binaries by replacing traditional MCMC with a variational autoencoder augmented by a neural spline normalizing flow, yielding full posterior distributions over the five physical parameters ($kT_{ ext{disk}}$, $N$, $ ext{Gamma}$, $f_{ ext{sc}}$, $N_H$) from NICER spectra in the $0.3-10$ keV band. The model is trained on 10,800 real NICER spectra and 100,000 synthetic spectra in a three-stage pipeline, enforcing a physics-informed latent space via GNLL, latent, and flow losses. It achieves spectra reconstructions with fidelity comparable to Xspec while delivering dramatic speedups—about $6.4 imes10^2$ per posterior sample and up to $ imes2000$ for 1000 samples—enabling rapid, uncertainty-aware analysis for large NICER datasets. The approach demonstrates robustness on real data and lays groundwork for scalable population studies, with potential extensions to more complex physical models.
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.
