glori: LDM + SWIIT for LOFAR radio sky maps

Pretrained weights for glori (Generate LOFAR Radio Images), a latent diffusion model (LDM) that generates realistic, synthetic radio-continuum survey maps (simulated LOFAR skies). The position, brightness and size of sources are set explicitly through a catalog context vector. Paired with SWIIT sampling, a sliding-window technique, it can generate maps of arbitrary size.

This repository contains two denoisers that share the same VQ-VAE and scaler:

  • LDM-Denoiser-WnetCC-v5: the model of the paper, conditioned on source positions, fluxes and sizes.
  • LDM-Denoiser-WnetCC-rms-v1: the same architecture with an additional local-noise channel. With the noise-band tools in the reference repo, it generates test images and large maps with a requested noise level in µJy/beam, together with the catalog of the sources put into them. It is meant for testing source finders.

Reference implementation and full documentation: github.com/tmartinezML/glori

The weights exactly as published with the paper (v5 only) are available at the revision tag paper-v1: hf_hub_download(..., revision="paper-v1").

Paper

T. Vicánek Martínez and M. Brüggen (2026), "Generating radio continuum survey maps of arbitrary size with latent diffusion models", A&A, arXiv:2609.06549

If you use these weights, please cite the paper above.

Files in this repository

File Component Notes
VQ-VAE-256-DR3opt-FT.ckpt VQ-VAE image ↔ latent compression, downsampling factor 4; shared by both denoisers
LDM-Denoiser-WnetCC-v5.ckpt Denoiser (paper) catalog-context-conditioned diffusion U-Net; 4-channel context
LDM-Denoiser-WnetCC-rms-v1.ckpt Denoiser (noise-conditioned) as v5, plus a local-noise channel; 5-channel context
scalers/LOFAR_scaler_II.pt Image scaler inverse-transforms generated latents/maps back to physical (Jy/beam-like) units
scalers/ctxt_scaler_ftot.pt Context scaler used only if you construct catalog context via ContextScaler (see repo)
scalers/ctxt_scaler_fpeak.pt Context scaler "
scalers/ctxt_scaler_maj.pt Context scaler "
noise/dr3_snr_pool.npz Noise tools SNR, total/peak ratio and size of LoTSS-DR3 sources, for the synthetic faint sources
noise/dr3_fields.csv Noise tools centres of LoTSS-DR3 fields with survey coverage, their native noise, and whether they are usable for large maps
noise/dr3_depth_tiles.csv Noise tools LoTSS-DR3 tiles of the image size (12.8') with their own depth, for images generated from unchanged real catalogs

All checkpoints are stripped to inference-only state (weights + hyperparameters, no optimizer/training state) via the reference repo's scripts/release/strip_checkpoint.py.

How to use

Requires the glori package (see the reference repo for installation: pinned dependencies including torch==2.2.1, numpy==1.25.2, and a specific vqtorch commit).

Catalog-conditioned maps (v5)

import torch
from glori.config.swiit_config import SWIITSamplerConfig
from glori.inference.swiit_sampler import SWIITSampler
from glori.data.trf.scalers import LOFARScaler
from glori.hub import download_pretrained

DENOISER_CKPT = download_pretrained("denoiser")
VAE_CKPT = download_pretrained("vae")
SCALER_PATH = download_pretrained("scaler")

config = SWIITSamplerConfig(
    denoiser="unused",  # ignored: an explicit "/" path in *_ckpt below bypasses name lookup
    denoiser_ckpt=DENOISER_CKPT,
    vae="unused",
    vae_ckpt=VAE_CKPT,
    device="cuda:0" if torch.cuda.is_available() else "cpu",
)
sampler = SWIITSampler(config=config)
sampler.scaler = LOFARScaler(**torch.load(SCALER_PATH, weights_only=False))

map_image, latent_map = sampler.sample(sampling_steps=(2, 2), timesteps=25)
physical_map = sampler.scaler.inverse_scale(map_image)  # back to Jy/beam-like units

For catalog-conditioned generation, larger maps, and the sampling parameters, see tutorials/tutorial_getting_started.ipynb in the reference repo.

Images and maps in a noise band (rms-v1)

The noise-band tools download everything they need from this repository and query source catalogs from the public LoTSS-DR3 cone search, so internet access is required. They need one GPU and a working PyBDSF installation.

# 512x512 px images with a noise of 40-55 µJy/beam each
python scripts/generate_noise_images.py --noise 40-55 --n 100 --out noise_40-55

# 2048x2048 px (51') maps with a median noise of 60-80 µJy/beam
python scripts/generate_noise_maps.py --noise 60-80 --n 8 --size 2048 --out maps_60-80

Output for each image or map:

  • a FITS image in Jy/beam;
  • for maps, also the PyBDSF rms map;
  • a truth catalog of all input sources (positions, peak and total flux as in the image and as input, size, real or synthetic);
  • the PyBDSF catalog of the image or map;
  • a report.

Noise is the median of the PyBDSF rms map (LoTSS settings, 6" beam, 1.5" pixels). Every image is rescaled so that its noise lies inside the requested band.

Valid ranges. Requests outside these ranges are refused.

Output Noise range Calibration
single 512 px images 38.9–222 µJy/beam below 65: 48 tiles × 7 noise levels, with real cutouts of the same tiles; above: 69 cutouts × 12 depths
large maps (2048 px tested; any size of 512 + k × 256 px, at least 1024) 50–224 µJy/beam, map median 8 fields × 7 depths

Why a catalog matters, not only the noise channel. The model infers the depth of an image mostly from its input catalog. A catalog complete to ~5σ already tells it the noise level. Changing only the noise channel of a fixed catalog therefore scales sources and noise together. The tools instead use a catalog consistent with the requested noise:

  • single images below 65 µJy/beam: the unchanged catalog of a real DR3 tile of that noise;
  • from 65 µJy/beam, and all large maps: a depth-matched catalog, with real LoTSS-DR3 sources above the completeness limit of their field, synthetic faint sources below it with DR3-like signal-to-noise ratios, sizes and numbers, and a noise channel that keeps the real noise excess around bright sources.

If you build context maps yourself, do the same; otherwise the noise channel has little effect.

Intended use & limitations

These models generate synthetic radio-continuum sky maps for augmenting training sets, testing pipelines, testing source finders, and methodology research. Outputs are not real observations and should not be presented as such. Generated maps carry known, characteristic SWIIT-sampling artifacts (e.g. faint striping at patch-overlap boundaries at full mask coverage); see the paper's Section on quality evaluation for details.

Additional limitations of the noise-band tools (rms-v1):

  • Positions: generated sources sit ~2–3 px (3–4.5") off their catalog position. Match truth and detections with a radius of ~12".
  • Fluxes: the denoiser compresses bright sources, so they come out fainter than in the real sky, depending on their SNR: peak ~0.93 of the input at SNR ~150, ~0.75 at 1500, ~0.42 at 8300 (maps: 0.25 at 8300). The images are not corrected, so do not use them for the bright end of the flux distribution. The truth catalog includes this and a flux factor per image or map (peak_flux, total_flux; the catalog values are in peak_flux_input, total_flux_input).
  • Check of the truth catalog, 600 images and 16 maps held out from the fits, median PyBDSF peak / truth: 0.90–1.02 up to 500 mJy in all modes. Above 500 mJy with small samples: 0.97–1.08 in real-depth images, 1.08–1.39 in depth-matched images, 1.01–1.14 in maps. This is correct on average, not per source: the 16–84 % range of single sources is 0.89–1.12 below 5 mJy and 0.69–1.44 at 200–500 mJy.
  • Noise in large maps: maps are flattened by default (--no-flatten keeps the drift). The ratio of noisy to quiet 256 px blocks (95th to 5th percentile, bright-source areas masked) is 1.14–1.25, against 1.20 in real DR3 fields and 1.36–1.72 before flattening. The noise still rises around bright sources, so use the delivered rms map for the local signal-to-noise ratio.
  • Artefacts: spokes and noise peaks around bright sources match real DR3 in single images below 65 µJy/beam. In large maps they are somewhat weaker (same sources above 200 mJy, at 1–2': 64 against 78 µJy/beam).
  • Selection at low noise: images with bright sources are dropped more often at low noise: 49 % of those at 40–65 µJy/beam on fields with a source ≥ 150 mJy, against 6–12 % on random fields. In random-field runs below 55 µJy/beam, 3 % of the images hold a source ≥ 200 mJy, against 6–8 % of real tiles of that noise.
  • Unlisted emission: faint emission that the model adds on its own, below the catalog depth, is not in the truth catalog.

Training data

All models were trained on LoTSS-DR3 (LOFAR Two-metre Sky Survey, Data Release 3) Stokes I continuum maps at 6" resolution:

  • the VQ-VAE on DR3 image patches;
  • both denoisers on 1024 px DR3 cutouts (random 512 px crops), encoded with the VQ-VAE, with the catalog context taken from the DR3 source catalog.

The rms-v1 denoiser has one extra context channel, the local noise: the catalog's Isl_rms in µJy/beam, summed per 6" cell like the other channels.

Training settings:

  • 250k optimizer steps;
  • batch size 24, with gradients accumulated over 2 batches;
  • learning rate 1e-5;
  • context dropout 0.1.

The released checkpoint is the final step.

License

CC BY-SA 4.0. The license is inherited from the training data: LoTSS-DR3 is licensed under the Creative Commons Attribution Share-Alike 3.0 License. The same applies to the DR3 source-property file in noise/ and the field and tile lists derived from the catalog. Commercial use is permitted, but if you redistribute a modified or fine-tuned version of these weights, it must also be released under a compatible CC BY-SA license with attribution.

If you use these weights, please cite:

  • T. Vicánek Martínez and M. Brüggen (2026), "Generating radio continuum survey maps of arbitrary size with latent diffusion models", A&A, arXiv:2609.06549
  • Shimwell et al. (2026), "The LOFAR Two-metre Sky Survey. VII. Third data release", A&A 707, A198, 10.1051/0004-6361/202557749

and give the LoTSS acknowledgements listed on the LoTSS credits page.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for astrokevin/glori-ldm-swiit