OpenBXT is an open-source PyTorch reimplementation of the ideas behind BlurXTerminator: an AI-based deconvolution / aberration-correction tool specifically designed for linear astronomical images.
It is not a generative super-resolution model. The goal is to recover detail that is actually present in the data (within the band-limit of the optics) without inventing structure.
- U-Net with PSF-conditioned residual prediction
- Joint stellar / non-stellar handling via a learned star map
- Support for spatially-varying PSF and optical aberrations:
- Defocus, coma, astigmatism, trefoil, spherical (Zernike-based)
- Atmospheric seeing (Moffat/Gaussian)
- Guiding errors (motion blur)
- Lateral / longitudinal chromatic aberration
- Synthetic training pipeline — no real ground truth needed
- Tiled inference for arbitrarily large frames
- FITS / TIFF / PNG I/O
pip install -r requirements.txtpython train.py \
--data_dir /path/to/sharp/linear/images \
--out_dir runs/openbxt_v1 \
--epochs 200 \
--batch_size 8The training set should contain sharp linear (un-stretched) astronomical images. The pipeline synthesizes blurs and aberrations on-the-fly.
python infer.py \
--input my_image.fits \
--output my_image_sharp.fits \
--weights runs/openbxt_v1/best.pt \
--sharpen_nonstellar 0.9 \
--sharpen_stellar 0.5openbxt/
model.py — UNet, PSF encoder, dual-branch heads
psf.py — Moffat / Gaussian / Zernike PSFs
aberrations.py — spatially-varying aberration synthesis
dataset.py — synthetic blur/aberration dataset
star_detect.py — DAOFIND-style star detection
losses.py — flux-conserving + edge-preserving losses
inference.py — tiled inference engine
utils.py — FITS / TIFF / PNG IO, normalization
train.py
infer.py
Deconvolution is mathematically ill-posed; many sharp images can produce the same blurry input. OpenBXT mitigates the "hallucination" risk in three ways:
- The training distribution only contains realistic astronomical blurs applied to real sharp astrophotos — the network never learns generic image priors.
- Loss functions enforce flux conservation (total energy preserved inside aperture-like regions).
- Output is a bounded residual added to the input, so under-confident predictions degrade gracefully toward the input rather than fabricating new structure.
MIT.