AutoLens: Automated Lensing Suite
- AutoLens is a fully automated modeling suite that infers the lens galaxy's light, mass profile, and source morphology without manual intervention.
- It combines techniques like Sérsic profile fitting, adaptive pixelization, and Bayesian model comparison to optimize model complexity and ensure robust inference.
- Its open-source implementation, PyAutoLens, enables scalable, reproducible lens analysis on high-resolution and wide-field survey datasets.
AutoLens is a fully automated modeling suite for strong gravitational lensing analysis that provides end-to-end inference of the lens galaxy's light, mass profile, and the lensed source's morphology, without human intervention. The software is designed to accommodate both high-resolution optical imaging (e.g., Hubble Space Telescope) and future wide-field surveys (e.g., Euclid). AutoLens models the lens galaxy’s light with a superposition of Sérsic profiles, parameterizes its mass with either single or decomposed (baryonic + dark matter) components, and reconstructs the background source on an adaptive pixel grid with regularization. The pipeline employs Bayesian model comparison to select optimal model complexities and rigorously benchmarks its inference on a diverse suite of mock datasets. PyAutoLens is its open-source Python implementation, offering automated, modular, and high-performance lens modeling via APIs, tutorials, and batch processing tools (Nightingale et al., 2017, Nightingale et al., 2021).
1. Automated Pipeline Structure
AutoLens operates as a sequenced processing pipeline structured as follows (Nightingale et al., 2017, Nightingale et al., 2021):
- Preprocessing: Executes sky subtraction and per-pixel error estimation; creates masks to isolate the lens system and exclude contaminating sources.
- Lens-Light Modeling: Fits the lens galaxy’s surface-brightness using a combination of Sérsic profiles:
where denotes the surface brightness at the effective radius , is the Sérsic index, and is a function of .
- Mass Modeling: Fits parameterized mass models, typically:
Single-component elliptical power-laws or two-component decomposed models decouple the luminous and dark matter, allowing for geometric (mis)alignment.
- Source Reconstruction: Solves the lens equation
via adaptive, amorphous pixel-grids, adjusting clustering and regularization:
where encodes pixel adjacency and 0 controls regularization.
- Bayesian Model Comparison: Computes Bayesian evidence for each candidate model,
1
and compares models using Bayes factors 2 via nested sampling.
This full automation facilitates batch analysis of large lens samples and enables robust, reproducible inference across heterogeneous datasets.
2. Adaptive Source-Plane Discretization and Regularization
AutoLens employs an amorphous, data-driven approach to source-plane pixelization. The method initializes with a fine grid and iteratively prunes or merges pixels where the data dictate reduced or increased resolution (Nightingale et al., 2017). High-magnification or structurally complex regions retain fine tessellation; smooth or weakly lensed areas are coarsened. This process simultaneously tunes regularization parameters (3, 4), tailored for each lens system. Such adaptivity allows the reconstructed source brightness 5 to be both expressive and well-regularized, ensuring morphological fidelity without overfitting noise.
Each model (grid geometry, regularization, mass profile, etc.) is subject to Bayesian evidence maximization, allowing AutoLens to automatically select the minimal-complexity model that explains the data.
3. Mass and Light Modeling Techniques
AutoLens systematically models the surface brightness of the lens using one or more Sérsic profiles, supporting complex morphologies and robust deblending of lens and source light (Nightingale et al., 2017). For mass distribution, it supports both:
- Single-Component Models: Power-law elliptical mass profiles with a slope parameter 6; centrally cored profiles are capable of central image detection.
- Decomposed Models: Explicit separation of baryonic (stellar) and dark matter mass, using distinct profiles for each and enabling tests for geometric alignment.
PyAutoLens further extends this methodology, providing analytic profiles for mass (e.g., SIE, NFW, point mass, external shear) and light (various Sérsic variants), all combinable within hierarchical models (Nightingale et al., 2021).
4. Bayesian Evidence and Model Selection
The assessment of model appropriateness is driven by Bayesian evidence calculations for each realization of light, mass, source regularization, and pixelization choices (Nightingale et al., 2017, Nightingale et al., 2021). Evidence is computed using nested sampling techniques, and model selection is based on Bayes factors, which systematically penalize unnecessary model complexity. This enables robust discrimination between, for example, different mass profile parameterizations or the need for additional source-plane resolution.
A summary of core model comparison elements is presented below:
| Model Element | Approach | Evidence-driven? |
|---|---|---|
| Lens light | Sérsic superpositions | Yes |
| Mass profile | Power-law, baryonic+DM decomposed | Yes |
| Source grid | Adaptive pixelation | Yes |
| Regularization | Optimized per configuration | Yes |
5. PyAutoLens: Implementation and Workflow
PyAutoLens is an open-source Python (3.6+) library encapsulating AutoLens methodology, intended for both galaxy- and cluster-scale lensing, with direct imaging or interferometry datasets (Nightingale et al., 2021). Key features include:
- Modular API: Extensible via analytic or pixelized models for light and mass; regularization classes; arbitrary lens/source complexity.
- Data Support: Imaging (e.g., HST), with explicit PSF convolution and masking; radio/sub-mm interferometry via non-uniform FFTs.
- Automated Pipelines: Chained non-linear model fitting phases via PyAutoFit (samplers include dynesty, emcee, MultiNest, and PySwarms).
- Batch Processing: Results stored in SQLite/PostgreSQL for scalable population studies.
- Tutorials/Workspace: Jupyter notebooks, example datasets, and lecture-series, distributed in the autolens_workspace (GitHub and Binder), supporting reproducible research and rapid user onboarding.
The standard workflow is:
- Data Preparation: Load scientific images, noise maps, PSFs. Preprocess via masking and sky subtraction.
- Model Definition: Specify Galaxy objects (light, mass, source) at different redshifts and combine into Tracers.
- Fit Execution: Choose a non-linear sampler, run the fit, and obtain posteriors.
- Visualization and Assessment: Plot results, inspect posterior distributions, and compare model residuals.
Commands and code snippets for these operations are provided in the PyAutoLens documentation (Nightingale et al., 2021).
6. Validation and Performance
AutoLens performance is evaluated on extensive simulated datasets representing a range of real-world scenarios (varied lens profiles, source morphologies, lensing geometries). The suite achieves accurate recovery of light, mass, and source profiles for both existing Hubble and upcoming Euclid-like data samples, indicating high reliability and robustness (Nightingale et al., 2017). The approach is highly adaptable, ensuring appropriate model complexity for each system analyzed. Its automated workflow and statistical foundations make it suitable for both targeted lens studies and population-scale inference required by forthcoming surveys.
7. Significance and Impact
AutoLens—and its implementation as PyAutoLens—represents a significant advance in precision cosmology and extragalactic astronomy, by enabling the automated, reproducible, and scalable analysis of strong gravitational lenses. Through its capacity for model selection, adaptive source reconstruction, and batch operation, AutoLens provides a generalized framework capable of characterizing both dark and luminous matter distributions in galaxies and clusters, detecting subtle features such as central images, and robustly deblending overlapping emission. Its methods are foundational for upcoming large-scale lens surveys and serve as a template for automated inference pipelines in other domains (Nightingale et al., 2017, Nightingale et al., 2021).