Skip to main content

Bayesian Light Source Separator (BLISS)

tests codecov.io PyPI

Introduction

BLISS is a Bayesian method for deblending and cataloging light sources. BLISS provides:

  • Accurate estimation of parameters in crowded fields with overlapping sources
  • Calibrated uncertainties through fully Bayesian inference via neural posterior estimation (NPE)
  • Scalability to petabyte-scale surveys containing billions of celestial objects

BLISS uses neural posterior estimation (NPE), a form of simulation-based inference in which a neural network maps telescope images directly to an approximate Bayesian posterior. BLISS uses autoregressive tiling with checkerboard patterns that align the variational distribution's conditional dependencies with the true posterior, improving calibration. BLISS systematically outperforms standard survey pipelines for light source detection, flux measurement, star/galaxy classification, and galaxy shape measurement.

Installation

Requirements: Python 3.12 or higher

BLISS is pip installable with the following command:

pip install bliss-toolkit

The required dependencies are listed in the [tool.poetry.dependencies] block of the pyproject.toml file.

Installation (Developers)

  1. Install poetry:
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.in-project true
  1. Install the fftw library (which is used by galsim). With Ubuntu you can install it by running
sudo apt-get install libfftw3-dev
  1. Install git-lfs if you haven't already installed it for another project:
git-lfs install
  1. Now download the bliss repo and fetch some pre-trained models and test data from git-lfs:
git clone git@github.com:prob-ml/bliss.git
  1. To create a poetry environment with the bliss dependencies satisfied, run
cd bliss
poetry install
  1. Activate the virtual environment:
source .venv/bin/activate
  1. Verify that bliss is installed correctly by running the tests both on your CPU (default) and on your GPU:
pytest
pytest --gpu
  1. Finally, if you are planning to contribute code to this repository, consider installing our pre-commit hooks so that your code commits will be checked locally for compliance with our coding conventions:
pre-commit install

Usage

BLISS provides a command-line interface powered by Hydra for configuration management. The basic usage pattern is:

bliss mode={generate,train,predict} [config options]
  • mode=generate - Generate synthetic training data from the forward model
  • mode=train - Train encoder networks on simulated or real data
  • mode=predict - Run inference on astronomical images to produce catalogs

Configuration files are located in bliss/conf/ and can be composed and overridden via command line arguments.

Case Studies

The case_studies/ directory contains research applications of BLISS:

  • weak_lensing/ - Shear (γ) and convergence (κ) estimation, validated on DC2 and DECaLS simulations
  • redshift/ - Photo-z estimation (BLISS-PZ) with multiple variational families
  • galaxy_clustering/ - Galaxy cluster detection and membership prediction, validated on DES DR2
  • dc2_cataloging/ - Full cataloging pipeline for DC2 simulation
  • strong_lensing/ - Strong gravitational lens detection
  • spatial_tiling/ - Spatially autoregressive tiling for astronomical cataloging
  • psf_variation/ - Spatially varying PSFs for astronomical cataloging

References

Yicun Duan, Xinyue Li, Camille Avestruz, Jeffrey Regier, and LSST Dark Energy Collaboration. Neural posterior estimation for cataloging astronomical images from the Legacy Survey of Space and Time. arXiv:2510.15315. 2025.

Jeffrey Regier. Neural posterior estimation with autoregressive tiling for detecting objects in astronomical images. arXiv:2510.03074. 2025.

Aakash Patel, Tianqing Zhang, Camille Avestruz, Jeffrey Regier, and LSST Dark Energy Science Collaboration. Neural posterior estimation for cataloging astronomical images with spatially varying backgrounds and point spread functions. The Astronomical Journal. 2025.

Runjing Liu, Jon D. McAuliffe, Jeffrey Regier, and The LSST Dark Energy Science Collaboration. Variational inference for deblending crowded starfields. Journal of Machine Learning Research. 2023.

Mallory Wang, Ismael Mendoza, Cheng Wang, Camille Avestruz, and Jeffrey Regier. Statistical inference for coadded astronomical images. NeurIPS Workshop on Machine Learning and the Physical Sciences. 2022.

Yash Patel and Jeffrey Regier. Scalable Bayesian inference for detecting strong gravitational lensing systems. NeurIPS Workshop on Machine Learning and the Physical Sciences. 2022.

Derek Hansen, Ismael Mendoza, Runjing Liu, Ziteng Pang, Zhe Zhao, Camille Avestruz, and Jeffrey Regier. Scalable Bayesian inference for detection and deblending in astronomical images. ICML Workshop on Machine Learning for Astrophysics. 2022.

Metadata

Release files for bliss-toolkit 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bliss-toolkit 0.4.2
File Size Uploaded Provenance
bliss_toolkit-0.4.2.tar.gz 61.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bliss-toolkit 0.4.2
File Interpreter ABI Platform
bliss_toolkit-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 131.4 kB

Release files / bliss_toolkit-0.4.2.tar.gz

Download URL bliss_toolkit-0.4.2.tar.gz
Size 61.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6a9d4a01644e77c9def993987283c7553a190fb459c5a402330d89308074c9ee
BLAKE2b-256 checksum
How to use checksums
d63a391d55e75a2fc5a8b9ab1dd4cfd65a9651aea211a894834e745227cc8e93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.3 Linux/6.14.0-36-generic

Release files / bliss_toolkit-0.4.2-py3-none-any.whl

Download URL bliss_toolkit-0.4.2-py3-none-any.whl
Size 69.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29e22e58ed675d6378a3b9cbaaf0820cff2bc5d7da81abad034e42c8166ea081
BLAKE2b-256 checksum
How to use checksums
d4577b6a7917dbeb86e03d98ed56758d36e14a63ccb6201e9cc8a384cc06b79f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.3 Linux/6.14.0-36-generic

Security for bliss-toolkit 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page