  With the dramatic rise in high-quality galaxy data expected from Euclid and
Vera C. Rubin Observatory, there will be increasing demand for fast
high-precision methods for measuring galaxy fluxes. These will be essential for
inferring the redshifts of the galaxies. In this paper, we introduce Lumos, a
deep learning method to measure photometry from galaxy images. Lumos builds on
BKGnet, an algorithm to predict the background and its associated error, and
predicts the background-subtracted flux probability density function. We have
developed Lumos for data from the Physics of the Accelerating Universe Survey
(PAUS), an imaging survey using 40 narrow-band filter camera (PAUCam). PAUCam
images are affected by scattered light, displaying a background noise pattern
that can be predicted and corrected for. On average, Lumos increases the SNR of
the observations by a factor of 2 compared to an aperture photometry algorithm.
It also incorporates other advantages like robustness towards distorting
artifacts, e.g. cosmic rays or scattered light, the ability of deblending and
less sensitivity to uncertainties in the galaxy profile parameters used to
infer the photometry. Indeed, the number of flagged photometry outlier
observations is reduced from 10% to 2%, comparing to aperture photometry.
Furthermore, with Lumos photometry, the photo-z scatter is reduced by ~10% with
the Deepz machine learning photo-z code and the photo-z outlier rate by 20%.
The photo-z improvement is lower than expected from the SNR increment, however
currently the photometric calibration and outliers in the photometry seem to be
its limiting factor.
