Photometry on Structured Backgrounds: Local Pixelwise Infilling by Regression
Authors
Andrew K. Saydjari, Douglas P. Finkbeiner
Abstract
Photometric pipelines struggle to estimate both the flux and flux uncertainty for stars in the presence of structured backgrounds such as filaments or clouds. However, it is exactly stars in these complex regions that are critical to understanding star formation and the structure of the interstellar medium. We develop a method, similar to Gaussian process regression, which we term local pixelwise infilling (LPI). Using a local covariance estimate, we predict the background behind each star and the uncertainty on that prediction in order to improve estimates of flux and flux uncertainty. We show the validity of our model on synthetic data and real dust fields. We further demonstrate that the method is stable even in the crowded field limit. While we focus on optical-IR photometry, this method is not restricted to those wavelengths. We apply this technique to the 34 billion detections in the second data release of the Dark Energy Camera Plane Survey (DECaPS2). In addition to removing many $>3σ$ outliers and improving uncertainty estimates by a factor of $\sim 2-3$ on nebulous fields, we also show that our method is well-behaved on uncrowded fields. The entirely post-processing nature of our implementation of LPI photometry allows it to easily improve the flux and flux uncertainty estimates of past as well as future surveys.
Concepts
The Big Picture
Imagine trying to measure the brightness of a single candle on a table covered with a crumpled, glowing tablecloth. The candle is easy enough to spot, but how much of the light reaching you comes from the candle versus the shifting glow beneath it? This is roughly the challenge astronomers face when measuring stars sitting in cosmic clouds of gas and dust near the Galactic plane.
Traditional astronomical software pipelines, the automated tools that process raw telescope images into usable catalogs, are built for cleaner situations: stars against relatively smooth, dark skies. When a star sits atop a filament of glowing interstellar gas or a wisp of dust cloud, those tools systematically misattribute background glow to the star itself. They also fail to quantify how uncertain the measurement is. These stars aren’t a fringe concern. They’re the ones that matter most for understanding star formation and the interstellar medium, the diffuse gas and dust filling the space between stars.
Andrew Saydjari and Douglas Finkbeiner at Harvard developed a technique called Local Pixelwise Infilling (LPI) that reconstructs what the background would look like if the star weren’t there, then uses that reconstruction to produce cleaner brightness measurements and more honest error bars.
Key Insight: By statistically predicting the background hidden beneath each star using its local neighborhood of pixels, LPI produces both corrected brightness measurements and reliable uncertainty estimates, something previous background-subtraction approaches could not do.
How It Works
LPI builds on Gaussian Process Regression (GPR), a statistical method that predicts unknown values from the pattern of nearby known ones. Pixels in astronomical images follow this logic, especially in smoothly varying dust clouds: knowing the surrounding pixels lets you estimate what a hidden pixel’s value should be.

Here’s the LPI workflow in practice:
- Mask the star. For each detected source, the algorithm identifies which pixels are contaminated by starlight, based on the telescope’s Point Spread Function (the characteristic blurred halo that starlight spreads into through any real optical system).
- Estimate local covariance. Using surrounding unmasked pixels, LPI builds a local statistical model of how background brightness varies. Covariance captures how strongly neighboring pixels tend to rise and fall in brightness together, essentially the texture of the dust or gas in that region.
- Infill the hidden pixels. With this covariance model, the algorithm predicts what the background beneath the star should have been, along with how uncertain that prediction is.
- Correct the flux and error. The predicted background is subtracted from the measured brightness, yielding a cleaner stellar flux. The infill uncertainty propagates directly into the reported error bar.
The difference from classical GPR is in how LPI handles covariance. Standard GPR requires choosing a specific functional form, say an exponential decay or a Matérn kernel, then fitting its parameters. LPI skips that step entirely. It estimates covariance nonparametrically, straight from the data, using only a local patch of pixels and assuming no particular formula. Because astronomical images live on pixelized grids, covariance is sampled at fixed pixel separations, which keeps the calculation tractable.
Saydjari and Finkbeiner validated LPI on synthetic images with known ground-truth backgrounds, then on real dust fields. It holds up even in crowded fields where stars overlap and photometric pipelines notoriously break down.
Why It Matters
The scale of the application backs up the method. Saydjari and Finkbeiner ran LPI on the full second data release of the Dark Energy Camera Plane Survey (DECaPS2), a dataset containing 34 billion individual detections.
On nebulous fields, LPI cleared out large numbers of >3σ outliers, readings more than three standard deviations from expected values and a standard red flag for unreliable data. Uncertainty estimates improved by a factor of roughly 2 to 3. That’s not marginal. Error bars that were previously half the size they should have been now match reality.

The practical appeal is that LPI works as a post-processing step, running after a standard photometric pipeline has already finished. No one has to rebuild complex data reduction infrastructure. It can retroactively improve archival survey data and slot into future surveys like the Legacy Survey of Space and Time (LSST) at the Vera C. Rubin Observatory, which will observe billions of Galactic-plane stars over its decade-long run.
The method isn’t limited to optical or infrared wavelengths. Any survey with pixelized images and spatially correlated backgrounds (radio, submillimeter, X-ray) could use the same approach.
Getting uncertainty estimates right has consequences beyond any single measurement. Most of what astronomers care about, from stellar distances and ages to maps of interstellar dust, comes from statistical inferences built on brightness catalogs. Feed those inferences error bars that are too small and every downstream conclusion becomes overconfident. LPI forces the data to be honest about its own limitations.
Bottom Line: LPI is a statistically grounded, scalable, post-processing method that corrects stellar brightness measurements on complex backgrounds and produces honest uncertainty estimates. Applied to 34 billion measurements in DECaPS2, it improves catalog quality and stands ready for the next generation of sky surveys.
IAIFI Research Highlights
This work takes Gaussian process-inspired statistical machine learning and applies it to a core problem in observational astrophysics, using nonparametric covariance estimation to connect raw pixel data to precise stellar measurements.
LPI shows how principled uncertainty quantification can be built into a regression-based infilling framework without neural networks. The approach offers a concrete model for interpretable uncertainty estimation in scientific imaging tasks.
By improving photometric accuracy for stars embedded in interstellar gas and dust, the method sharpens our ability to map the structure of the interstellar medium and trace the environments where star formation occurs.
Future surveys like LSST at the Vera C. Rubin Observatory and the Nancy Grace Roman Space Telescope will produce datasets where structured backgrounds are the norm, making methods like LPI essential; see [arXiv:2201.07246](https://arxiv.org/abs/2201.07246) for the full paper.
Original Paper Details
Photometry on Structured Backgrounds: Local Pixelwise Infilling by Regression
2201.07246
["Andrew K. Saydjari", "Douglas P. Finkbeiner"]
Photometric pipelines struggle to estimate both the flux and flux uncertainty for stars in the presence of structured backgrounds such as filaments or clouds. However, it is exactly stars in these complex regions that are critical to understanding star formation and the structure of the interstellar medium. We develop a method, similar to Gaussian process regression, which we term local pixelwise infilling (LPI). Using a local covariance estimate, we predict the background behind each star and the uncertainty on that prediction in order to improve estimates of flux and flux uncertainty. We show the validity of our model on synthetic data and real dust fields. We further demonstrate that the method is stable even in the crowded field limit. While we focus on optical-IR photometry, this method is not restricted to those wavelengths. We apply this technique to the 34 billion detections in the second data release of the Dark Energy Camera Plane Survey (DECaPS2). In addition to removing many $>3σ$ outliers and improving uncertainty estimates by a factor of $\sim 2-3$ on nebulous fields, we also show that our method is well-behaved on uncrowded fields. The entirely post-processing nature of our implementation of LPI photometry allows it to easily improve the flux and flux uncertainty estimates of past as well as future surveys.