Ronan Legin
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Research Subjects
Ronan Legin has a total of 26 co-authors. Here are the top co-authors by number of shared publications:
- Laurence Perreault-Levasseur
Université de Montréal
8 shared publications - Yashar Hezaveh
Université de Montréal
8 shared publications - Alexandre Adam
Department of Physics, University of Montréal, Montreal, QC H2V 0B3, Canada
5 shared publications - Connor Stone
Department of Physics, Universite de Montreal
5 shared publications Benjamin Wandelt
Sorbonne Université, CNRS , UMR 7095, Institut d’Astrophysique de Paris, 98 bis bd Arago, Paris 75014 , France
3 shared publications- Gabriel Missael Barco
Université de Montréal
3 shared publications
Latest Publications
- Open Access
- 29 October 2026
- Published by American Astronomical Society in The Astrophysical Journal
- Vol. 1011 (1) , 129
Pixelated Posterior Sampling of Point-spread Functions in Astronomical Images
We introduce a novel framework for upsampled point-spread function (PSF) modeling using pixel-level Bayesian inference. Accurate PSF characterization is critical for precision measurements in many fields, including weak lensing, astrometry, and photometry. Our method defines the posterior distribution of the pixelized PSF model through the combination of an analytic Gaussian likelihood and a highly expressive generative diffusion model prior, trained on a library of Hubble Space Telescope effective PSF (ePSF) templates. Compared to traditional methods (parametric Moffat, ePSF template-based, and regularized likelihood), we demonstrate that our PSF models achieve orders-of-magnitude-higher likelihood and residuals consistent with noise, all while remaining visually realistic. Further, the method applies even for faint and heavily masked point sources, merely producing a broader posterior. By recovering a realistic, pixel-level posterior distribution, our technique enables the first meaningful propagation of detailed PSF morphological uncertainty in downstream analysis. An implementation of our posterior sampling procedure is available on GitHub.
- 29 October 2026
- Published by American Astronomical Society in The Astrophysical Journal
- Vol. 1011 (1) , 129
Open AccessPixelated Posterior Sampling of Point-spread Functions in Astronomical Images
We introduce a novel framework for upsampled point-spread function (PSF) modeling using pixel-level Bayesian inference. Accurate PSF characterization is critical for precision measurements in many fields, including weak lensing, astrometry, and photometry. Our method defines the posterior distribution of the pixelized PSF model through the combination of an analytic Gaussian likelihood and a highly expressive generative diffusion model prior, trained on a library of Hubble Space Telescope effective PSF (ePSF) templates. Compared to traditional methods (parametric Moffat, ePSF template-based, and regularized likelihood), we demonstrate that our PSF models achieve orders-of-magnitude-higher likelihood and residuals consistent with noise, all while remaining visually realistic. Further, the method applies even for faint and heavily masked point sources, merely producing a broader posterior. By recovering a realistic, pixel-level posterior distribution, our technique enables the first meaningful propagation of detailed PSF morphological uncertainty in downstream analysis. An implementation of our posterior sampling procedure is available on GitHub.
- Open Access
Pixellated Posterior Sampling of Point Spread Functions in Astronomical Images
We introduce a novel framework for upsampled Point Spread Function (PSF) modeling using pixel-level Bayesian inference. Accurate PSF characterization is critical for precision measurements in many fields including: weak lensing, astrometry, and photometry. Our method defines the posterior distribution of the pixelized PSF model through the combination of an analytic Gaussian likelihood and a highly expressive generative diffusion model prior, trained on a library of HST ePSF templates. Compared to traditional methods (parametric Moffat, ePSF template-based, and regularized likelihood), we demonstrate that our PSF models achieve orders of magnitude higher likelihood and residuals consistent with noise, all while remaining visually realistic. Further, the method applies even for faint and heavily masked point sources, merely producing a broader posterior. By recovering a realistic, pixel-level posterior distribution, our technique enables the first meaningful propagation of detailed PSF morphological uncertainty in downstream analysis. An implementation of our posterior sampling procedure is available on GitHub.
Open AccessPixellated Posterior Sampling of Point Spread Functions in Astronomical Images
We introduce a novel framework for upsampled Point Spread Function (PSF) modeling using pixel-level Bayesian inference. Accurate PSF characterization is critical for precision measurements in many fields including: weak lensing, astrometry, and photometry. Our method defines the posterior distribution of the pixelized PSF model through the combination of an analytic Gaussian likelihood and a highly expressive generative diffusion model prior, trained on a library of HST ePSF templates. Compared to traditional methods (parametric Moffat, ePSF template-based, and regularized likelihood), we demonstrate that our PSF models achieve orders of magnitude higher likelihood and residuals consistent with noise, all while remaining visually realistic. Further, the method applies even for faint and heavily masked point sources, merely producing a broader posterior. By recovering a realistic, pixel-level posterior distribution, our technique enables the first meaningful propagation of detailed PSF morphological uncertainty in downstream analysis. An implementation of our posterior sampling procedure is available on GitHub.
- Open Access
Blind Strong Gravitational Lensing Inversion: Joint Inference of Source and Lens Mass with Score-Based Models
Score-based models can serve as expressive, data-driven priors for scientific inverse problems. In strong gravitational lensing, they enable posterior inference of a background galaxy from its distorted, multiply-imaged observation. Previous work, however, assumes that the lens mass distribution (and thus the forward operator) is known. We relax this assumption by jointly inferring the source and a parametric lens-mass profile, using a sampler based on GibbsDDRM but operating in continuous time. The resulting reconstructions yield residuals consistent with the observational noise, and the marginal posteriors of the lens parameters recover true values without systematic bias. To our knowledge, this is the first successful demonstration of joint source-and-lens inference with a score-based prior.
Open AccessBlind Strong Gravitational Lensing Inversion: Joint Inference of Source and Lens Mass with Score-Based Models
Score-based models can serve as expressive, data-driven priors for scientific inverse problems. In strong gravitational lensing, they enable posterior inference of a background galaxy from its distorted, multiply-imaged observation. Previous work, however, assumes that the lens mass distribution (and thus the forward operator) is known. We relax this assumption by jointly inferring the source and a parametric lens-mass profile, using a sampler based on GibbsDDRM but operating in continuous time. The resulting reconstructions yield residuals consistent with the observational noise, and the marginal posteriors of the lens parameters recover true values without systematic bias. To our knowledge, this is the first successful demonstration of joint source-and-lens inference with a score-based prior.
- Open Access
- 29 May 2025
- Published by American Astronomical Society in The Astrophysical Journal Letters
- Vol. 985 (2) , L46
Gravitational-wave Parameter Estimation in Non-Gaussian Noise Using Score-based Likelihood Characterization
Gravitational-wave (GW) parameter estimation typically assumes that instrumental noise is Gaussian and stationary. Obvious departures from this idealization are typically handled on a case-by-case basis, e.g., through bespoke procedures to “clean” non-Gaussian noise transients (glitches), as was famously the case for the GW170817 neutron-star binary. Although effective, this data manipulation can bias key astrophysical inferences, such as binary precession, and compound unpredictably when combining multiple observations. Alternative bias-free methods, like joint noise-signal inference, remain too computationally expensive for large-scale execution. Here we take a different approach: rather than explicitly modeling individual non-Gaussianities to then apply the traditional GW likelihood, we seek to learn the true distribution of instrumental noise without presuming Gaussianity and stationarity in the first place. Assuming only noise additivity, we employ score-based diffusion models to learn an empirical noise distribution directly from detector data and then combine it with a deterministic waveform model to provide an unbiased estimate of the likelihood function. We validate the method by performing inference on a subset of GW parameters from 400 mock observations, containing real LIGO noise from either the Livingston or Hanford detectors. We show that the proposed method can recover the true parameters even in the presence of loud glitches, and that the inference is unbiased over a population of signals without applying any cleaning to the data. This work provides a promising avenue for extracting unbiased source properties in future GW observations over the coming decade.
- 29 May 2025
- Published by American Astronomical Society in The Astrophysical Journal Letters
- Vol. 985 (2) , L46
Open AccessGravitational-wave Parameter Estimation in Non-Gaussian Noise Using Score-based Likelihood Characterization
Gravitational-wave (GW) parameter estimation typically assumes that instrumental noise is Gaussian and stationary. Obvious departures from this idealization are typically handled on a case-by-case basis, e.g., through bespoke procedures to “clean” non-Gaussian noise transients (glitches), as was famously the case for the GW170817 neutron-star binary. Although effective, this data manipulation can bias key astrophysical inferences, such as binary precession, and compound unpredictably when combining multiple observations. Alternative bias-free methods, like joint noise-signal inference, remain too computationally expensive for large-scale execution. Here we take a different approach: rather than explicitly modeling individual non-Gaussianities to then apply the traditional GW likelihood, we seek to learn the true distribution of instrumental noise without presuming Gaussianity and stationarity in the first place. Assuming only noise additivity, we employ score-based diffusion models to learn an empirical noise distribution directly from detector data and then combine it with a deterministic waveform model to provide an unbiased estimate of the likelihood function. We validate the method by performing inference on a subset of GW parameters from 400 mock observations, containing real LIGO noise from either the Livingston or Hanford detectors. We show that the proposed method can recover the true parameters even in the presence of loud glitches, and that the inference is unbiased over a population of signals without applying any cleaning to the data. This work provides a promising avenue for extracting unbiased source properties in future GW observations over the coming decade.
- Open Access
- 8 April 2025
- Published by American Astronomical Society in The Astronomical Journal
- Vol. 169 (5) , 254
Echoes in the Noise: Posterior Samples of Faint Galaxy Surface Brightness Profiles with Score-based Likelihoods and Priors
Examining the detailed structure of galaxy populations provides valuable insights into their formation and evolution mechanisms. Significant barriers to such analysis are the nontrivial noise properties of real astronomical images and the point-spread function, which blurs structure. Here we present a framework which combines recent advances in score-based likelihood characterization and diffusion model priors to perform a Bayesian analysis of image deconvolution. The method, when applied to minimally processed Hubble Space Telescope data, recovers structures which have otherwise only become visible in next-generation James Webb Space Telescope imaging.
- 8 April 2025
- Published by American Astronomical Society in The Astronomical Journal
- Vol. 169 (5) , 254
Open AccessEchoes in the Noise: Posterior Samples of Faint Galaxy Surface Brightness Profiles with Score-based Likelihoods and Priors
Examining the detailed structure of galaxy populations provides valuable insights into their formation and evolution mechanisms. Significant barriers to such analysis are the nontrivial noise properties of real astronomical images and the point-spread function, which blurs structure. Here we present a framework which combines recent advances in score-based likelihood characterization and diffusion model priors to perform a Bayesian analysis of image deconvolution. The method, when applied to minimally processed Hubble Space Telescope data, recovers structures which have otherwise only become visible in next-generation James Webb Space Telescope imaging.
- Open Access
- 22 November 2024
- Published by The Open Journal in Journal of Open Source Software
- Vol. 9 (103) , 7081
Caustics: A Python Package for Accelerated Strong Gravitational Lensing Simulations
Gravitational lensing is the deflection of light rays due to the gravity of intervening masses. This phenomenon is observed at a variety of configurations, involving any non-uniform mass such as planets, stars, galaxies, clusters of galaxies, and even the large-scale structure of the Universe. Strong lensing occurs when the distortions are significant and multiple images of the background source are observed. The lens and lensed object(s) must be aligned closely on the sky. As the discovery of lens systems has grown to the low thousands, these systems have become pivotal for precision measurements in astrophysics, notably for phenomena including dark matter (e.g. Hezaveh et al., 2016; Vegetti & Vogelsberger, 2014), supernovae (e.g. Rodney et al., 2021), quasars (e.g. Peng et al., 2006), the first stars (e.g. Welch et al., 2022), and the Universe's expansion rate (e.g. K. C. Wong et al., 2020). With future surveys expected to discover hundreds of thousands of lensing systems, the modelling and simulation of such systems must be done at orders of magnitude larger scale than ever before. Here we present caustics, a Python package designed to facilitate machine learning and Bayesian methods to handle the extensive computational demands of modelling such a vast number of lensing systems.
- 22 November 2024
- Published by The Open Journal in Journal of Open Source Software
- Vol. 9 (103) , 7081
Open AccessCaustics: A Python Package for Accelerated Strong Gravitational Lensing Simulations
Gravitational lensing is the deflection of light rays due to the gravity of intervening masses. This phenomenon is observed at a variety of configurations, involving any non-uniform mass such as planets, stars, galaxies, clusters of galaxies, and even the large-scale structure of the Universe. Strong lensing occurs when the distortions are significant and multiple images of the background source are observed. The lens and lensed object(s) must be aligned closely on the sky. As the discovery of lens systems has grown to the low thousands, these systems have become pivotal for precision measurements in astrophysics, notably for phenomena including dark matter (e.g. Hezaveh et al., 2016; Vegetti & Vogelsberger, 2014), supernovae (e.g. Rodney et al., 2021), quasars (e.g. Peng et al., 2006), the first stars (e.g. Welch et al., 2022), and the Universe's expansion rate (e.g. K. C. Wong et al., 2020). With future surveys expected to discover hundreds of thousands of lensing systems, the modelling and simulation of such systems must be done at orders of magnitude larger scale than ever before. Here we present caustics, a Python package designed to facilitate machine learning and Bayesian methods to handle the extensive computational demands of modelling such a vast number of lensing systems.
- Open Access
- 4 October 2023
- Published by Oxford University Press (OUP) in Monthly Notices of the Royal Astronomical Society: Letters
- Vol. 527 (1) , L173-L178
Posterior sampling of the initial conditions of the universe from non-linear large scale structures using score-based generative models
Reconstructing the initial conditions of the universe is a key problem in cosmology. Methods based on simulating the forward evolution of the universe have provided a way to infer initial conditions consistent with present-day observations. However, due to the high complexity of the inference problem, these methods either fail to sample a distribution of possible initial density fields or require significant approximations in the simulation model to be tractable, potentially leading to biased results. In this work, we propose the use of score-based generative models to sample realizations of the early universe given present-day observations. We infer the initial density field of full high-resolution dark matter N-body simulations from the present-day density field and verify the quality of produced samples compared to the ground truth based on summary statistics. The proposed method is capable of providing plausible realizations of the early universe density field from the initial conditions posterior distribution marginalized over cosmological parameters and can sample orders of magnitude faster than current state-of-the-art methods.
- 4 October 2023
- Published by Oxford University Press (OUP) in Monthly Notices of the Royal Astronomical Society: Letters
- Vol. 527 (1) , L173-L178
Open AccessPosterior sampling of the initial conditions of the universe from non-linear large scale structures using score-based generative models
Reconstructing the initial conditions of the universe is a key problem in cosmology. Methods based on simulating the forward evolution of the universe have provided a way to infer initial conditions consistent with present-day observations. However, due to the high complexity of the inference problem, these methods either fail to sample a distribution of possible initial density fields or require significant approximations in the simulation model to be tractable, potentially leading to biased results. In this work, we propose the use of score-based generative models to sample realizations of the early universe given present-day observations. We infer the initial density field of full high-resolution dark matter N-body simulations from the present-day density field and verify the quality of produced samples compared to the ground truth based on summary statistics. The proposed method is capable of providing plausible realizations of the early universe density field from the initial conditions posterior distribution marginalized over cosmological parameters and can sample orders of magnitude faster than current state-of-the-art methods.
- Open Access
- 1 June 2023
- Published by American Astronomical Society in The Astrophysical Journal Letters
- Vol. 949 (2) , L41
Beyond Gaussian Noise: A Generalized Approach to Likelihood Analysis with Non-Gaussian Noise
Likelihood analysis is typically limited to normally distributed noise due to the difficulty of determining the probability density function of complex, high-dimensional, non-Gaussian, and anisotropic noise. This is a major limitation for precision measurements in many domains of science, including astrophysics, for example, for the analysis of the cosmic microwave background, gravitational waves, gravitational lensing, and exoplanets. This work presents Score-based LIkelihood Characterization, a framework that resolves this issue by building a data-driven noise model using a set of noise realizations from observations. We show that the approach produces unbiased and precise likelihoods even in the presence of highly non-Gaussian correlated and spatially varying noise. We use diffusion generative models to estimate the gradient of the probability density of noise with respect to data elements. In combination with the Jacobian of the physical model of the signal, we use Langevin sampling to produce independent samples from the unbiased likelihood. We demonstrate the effectiveness of the method using real data from the Hubble Space Telescope and James Webb Space Telescope.
- 1 June 2023
- Published by American Astronomical Society in The Astrophysical Journal Letters
- Vol. 949 (2) , L41
Open AccessBeyond Gaussian Noise: A Generalized Approach to Likelihood Analysis with Non-Gaussian Noise
Likelihood analysis is typically limited to normally distributed noise due to the difficulty of determining the probability density function of complex, high-dimensional, non-Gaussian, and anisotropic noise. This is a major limitation for precision measurements in many domains of science, including astrophysics, for example, for the analysis of the cosmic microwave background, gravitational waves, gravitational lensing, and exoplanets. This work presents Score-based LIkelihood Characterization, a framework that resolves this issue by building a data-driven noise model using a set of noise realizations from observations. We show that the approach produces unbiased and precise likelihoods even in the presence of highly non-Gaussian correlated and spatially varying noise. We use diffusion generative models to estimate the gradient of the probability density of noise with respect to data elements. In combination with the Jacobian of the physical model of the signal, we use Langevin sampling to produce independent samples from the unbiased likelihood. We demonstrate the effectiveness of the method using real data from the Hubble Space Telescope and James Webb Space Telescope.
- Open Access
Posterior Sampling of the Initial Conditions of the Universe from Non-linear Large Scale Structures using Score-Based Generative Models
Reconstructing the initial conditions of the universe is a key problem in cosmology. Methods based on simulating the forward evolution of the universe have provided a way to infer initial conditions consistent with present-day observations. However, due to the high complexity of the inference problem, these methods either fail to sample a distribution of possible initial density fields or require significant approximations in the simulation model to be tractable, potentially leading to biased results. In this work, we propose the use of score-based generative models to sample realizations of the early universe given present-day observations. We infer the initial density field of full high-resolution dark matter N-body simulations from the present-day density field and verify the quality of produced samples compared to the ground truth based on summary statistics. The proposed method is capable of providing plausible realizations of the early universe density field from the initial conditions posterior distribution marginalized over cosmological parameters and can sample orders of magnitude faster than current state-of-the-art methods.
Open AccessPosterior Sampling of the Initial Conditions of the Universe from Non-linear Large Scale Structures using Score-Based Generative Models
Reconstructing the initial conditions of the universe is a key problem in cosmology. Methods based on simulating the forward evolution of the universe have provided a way to infer initial conditions consistent with present-day observations. However, due to the high complexity of the inference problem, these methods either fail to sample a distribution of possible initial density fields or require significant approximations in the simulation model to be tractable, potentially leading to biased results. In this work, we propose the use of score-based generative models to sample realizations of the early universe given present-day observations. We infer the initial density field of full high-resolution dark matter N-body simulations from the present-day density field and verify the quality of produced samples compared to the ground truth based on summary statistics. The proposed method is capable of providing plausible realizations of the early universe density field from the initial conditions posterior distribution marginalized over cosmological parameters and can sample orders of magnitude faster than current state-of-the-art methods.
- Open Access
- 1 January 2023
- Published by American Astronomical Society in The Astrophysical Journal
- Vol. 943 (1)
A Framework for Obtaining Accurate Posteriors of Strong Gravitational Lensing Parameters with Flexible Priors and Implicit Likelihoods Using Density Estimation
We report the application of implicit likelihood inference to the prediction of the macroparameters of strong lensing systems with neural networks. This allows us to perform deep-learning analysis of lensing systems within a well-defined Bayesian statistical framework to explicitly impose desired priors on lensing variables, obtain accurate posteriors, and guarantee convergence to the optimal posterior in the limit of perfect performance. We train neural networks to perform a regression task to produce point estimates of lensing parameters. We then interpret these estimates as compressed statistics in our inference setup and model their likelihood function using mixture density networks. We compare our results with those of approximate Bayesian neural networks, discuss their significance, and point to future directions. Based on a test set of 100,000 strong lensing simulations, our amortized model produces accurate posteriors for any arbitrary confidence interval, with a maximum percentage deviation of 1.4% at the 21.8% confidence level, without the need for any added calibration procedure. In total, inferring 100,000 different posteriors takes a day on a single GPU, showing that the method scales well to the thousands of lenses expected to be discovered by upcoming sky surveys.
- 1 January 2023
- Published by American Astronomical Society in The Astrophysical Journal
- Vol. 943 (1)
Open AccessA Framework for Obtaining Accurate Posteriors of Strong Gravitational Lensing Parameters with Flexible Priors and Implicit Likelihoods Using Density Estimation
We report the application of implicit likelihood inference to the prediction of the macroparameters of strong lensing systems with neural networks. This allows us to perform deep-learning analysis of lensing systems within a well-defined Bayesian statistical framework to explicitly impose desired priors on lensing variables, obtain accurate posteriors, and guarantee convergence to the optimal posterior in the limit of perfect performance. We train neural networks to perform a regression task to produce point estimates of lensing parameters. We then interpret these estimates as compressed statistics in our inference setup and model their likelihood function using mixture density networks. We compare our results with those of approximate Bayesian neural networks, discuss their significance, and point to future directions. Based on a test set of 100,000 strong lensing simulations, our amortized model produces accurate posteriors for any arbitrary confidence interval, with a maximum percentage deviation of 1.4% at the 21.8% confidence level, without the need for any added calibration procedure. In total, inferring 100,000 different posteriors takes a day on a single GPU, showing that the method scales well to the thousands of lenses expected to be discovered by upcoming sky surveys.