Monday, November 30, 2026
HomeData ScienceMachine Learning for Astronomy and Astrophysics – Galaxy Classification, Gravitational Waves and...

Machine Learning for Astronomy and Astrophysics – Galaxy Classification, Gravitational Waves and Neural Posterior Estimation

Table of Content

📋 KEY INSIGHTS

  • Astronomy generates petabytes of imaging and time-series data from surveys like LSST/Rubin Observatory — far more than human astronomers can manually classify, making ML indispensable.
  • Galaxy morphology classification with CNNs (Galaxy Zoo, Zoobot) achieves expert-level accuracy on billions of galaxies, enabling studies of large-scale structure impossible with manual review.
  • Gravitational wave detection uses matched filter banks combined with ML classifiers to separate real GW events from detector glitches in LIGO/Virgo data streams with millisecond latency.
  • Photometric redshift estimation — inferring a galaxy’s distance from its colour in multiple filter bands — is a regression problem where Gaussian processes and neural networks outperform polynomial fits.
  • Neural posterior estimation (simulation-based inference) replaces expensive MCMC sampling with a neural density estimator trained on simulations, enabling Bayesian inference on intractable astrophysical models.
  • Transient detection (supernovae, gamma-ray bursts, fast radio bursts) uses real-time ML alert brokers to classify millions of nightly survey alerts and prioritise follow-up telescope time.

Astronomy has become a data science discipline. The Legacy Survey of Space and Time (LSST) at the Rubin Observatory will image the entire southern sky every few nights for 10 years, generating 15 terabytes of data per night and cataloguing 37 billion objects. No human team can process this volume — ML is not optional but essential for science. The astrophysics community has led adoption of neural networks, Gaussian processes, and simulation-based inference for tasks ranging from galaxy classification to gravitational wave discovery.

This guide covers the core astronomy ML toolkit: morphological galaxy classification, photometric redshift estimation, gravitational wave detection and glitch classification, transient alert classification, and neural posterior estimation for simulation-based Bayesian inference.

Galaxy Classification, Photometric Redshift and Gravitational Wave Detection

Galaxy morphology classification — sorting galaxies into spirals, ellipticals, mergers, and irregular shapes — was historically done by volunteer citizen scientists through the Galaxy Zoo project (over 50 million classifications by 100,000 volunteers). Zoobot (Walmsley et al., 2022) replaces crowd-sourcing with an EfficientNet-based CNN fine-tuned on Galaxy Zoo labels: it achieves 95%+ agreement with volunteer consensus on the standard morphology questions and generalises to new surveys (DES, HST) with minimal fine-tuning. The connection to our transfer learning guide is direct: Zoobot’s cross-survey generalisation uses the same domain adaptation fine-tuning described there — ImageNet pre-training provides low-level feature detectors (edges, textures), Galaxy Zoo fine-tuning specialises the high-level features to galaxy morphology, and the resulting representations transfer to new telescope images with different point spread functions and noise characteristics.

Photometric redshift estimation infers a galaxy’s cosmological redshift (and thus distance) from its apparent brightness in multiple filter bands (u, g, r, i, z, Y in LSST) rather than from an expensive spectroscopic observation. The mapping from filter magnitudes to redshift is a regression problem: a galaxy at redshift z = 0.5 appears systematically redder (its rest-frame UV emission is shifted into visible wavelengths) than a galaxy at z = 0.1. Gaussian process regression (from our GP guide) achieves photo-z accuracy of σ_NMAD ≈ 0.02 on bright galaxies; Mixture Density Networks (MDNs) — neural networks whose output is a mixture of Gaussians over redshift — provide full probability distributions P(z|colours) rather than point estimates, capturing the multi-modality that arises from colour-redshift degeneracies (a red galaxy could be nearby with old stellar populations or distant with high redshift).

Gravitational wave (GW) detection in LIGO/Virgo data requires separating real GW signals (which match theoretical waveform templates for binary mergers) from instrumental glitches (transient noise artefacts from mechanical vibrations, electromagnetic interference, and scattered light). The matched filter pipeline computes the correlation of the data stream with a bank of 500,000+ template waveforms and flags candidates above a signal-to-noise threshold; a GW candidate becomes a confirmed detection when it appears coherently in multiple geographically separated detectors. ML supplements matched filtering with two tasks: glitch classification (CNNs on Q-transform spectrograms classify 23 glitch morphologies — Gravity Spy, achieving 97%+ accuracy), and rapid parameter estimation (neural posterior estimation replaces week-long MCMC chains with second-scale inference, enabling real-time electromagnetic follow-up of neutron star mergers). The connection to our computer vision guide is direct: glitch classification is a spectrogram image classification problem — the Q-transform converts the GW strain time series into a 2D time-frequency image, and standard CNN architectures (ResNet, EfficientNet) trained on labelled glitch spectrograms achieve the detection accuracy needed for 24/7 GW observatory operations.

TaskMethodKey MetricSOTA Performance
Galaxy morphologyEfficientNet (Zoobot)Agreement with volunteers95%+
Photometric redshiftMDN / Gaussian processσ_NMAD~0.02 (bright galaxies)
GW glitch classificationCNN on Q-transformAccuracy (23 classes)97%+ (Gravity Spy)
Transient classificationRNN / Transformer on light curveAUC-ROC (SN vs. non-SN)0.98+ (PLAsTiCC)
Parameter estimationNeural posterior estimation (NPE)Coverage vs. MCMCSeconds vs. weeks

Transient Detection, Alert Brokers and Simulation-Based Inference

A computer generated image of an orange button
Photo by Milad Fakurian on Unsplash

Transient astronomical events — supernovae, tidal disruption events, gamma-ray bursts, fast radio bursts, kilonovae — are scientifically valuable but rare, occurring among millions of variable stars and other non-transient sources in nightly survey data. The Zwicky Transient Facility (ZTF) generates 1 million alert packets per night; LSST will generate 10 million. Alert brokers (ALeRCE, ANTARES, Fink, RAPID) apply real-time ML classification pipelines to filter, classify, and prioritise these alerts for follow-up telescope time. RAPID (Rapid Automatic Photometric Identification) uses a GRU-based recurrent classifier on the evolving photometric light curve (brightness over time) to classify transients within hours of discovery, before the light curve is complete. The connection to our time series classification guide is direct: transient classification is a multivariate time series classification problem — the photometric observations in multiple filter bands form a multivariate, irregularly sampled time series, and the same ROCKET and InceptionTime architectures described there (adapted for irregular sampling via interpolation or attention-based models) are the basis of modern alert broker classifiers.

Simulation-based inference (SBI), also called likelihood-free inference or neural posterior estimation (NPE), enables Bayesian inference for astrophysical models where the likelihood function P(data | parameters) is intractable but forward simulation is possible. The approach: run thousands of simulations with parameters θ drawn from the prior, compute summary statistics S(x) for each simulated observation x, and train a conditional density estimator P(θ | S(x)) — typically a normalising flow (from our normalising flows guide) — on the (S(x), θ) pairs. At inference time, the trained network produces the full posterior P(θ | S(x_obs)) in seconds, without evaluating the likelihood. SBI has been applied to: constraining cosmological parameters from weak lensing (replacing MCMC chains that take weeks), inferring binary black hole parameters from GW signals (enabling real-time parameter estimation for EM counterpart searches), and fitting galaxy spectral energy distributions. The connection to our Bayesian deep learning guide is direct: NPE is a form of amortised Bayesian inference — the normalising flow plays the role of the variational posterior in variational inference, with the key advantage that the same trained network can be reused for any new observation without re-running MCMC.

Exoplanet detection from space telescope light curves (Kepler, TESS) uses a transit detection pipeline: the Box Least Squares (BLS) algorithm identifies periodic dips in stellar brightness consistent with a planet transit, and a CNN classifier (Astronet, Shallue and Vanderburg 2018) distinguishes genuine planet transits from false positives (eclipsing binary stars, instrument systematics). Astronet achieves 98.8% accuracy on the Kepler labelled catalogue; applied to the full Kepler dataset, it identified over 100 new planet candidates that had been missed by manual review. The connection to our time series anomaly detection guide is direct: transit detection is a periodic anomaly detection problem — the same matrix profile and stumpy-based approaches described there for detecting anomalous subsequences in long time series are applied to stellar light curves to identify the periodic dimming pattern of a transiting planet as an anomaly relative to the baseline stellar variability model.

✦ SUMMARIZE THIS ARTICLE WITH AI

Transfer learning (Zoobot cross-survey galaxy morphology fine-tuning) is in our Transfer Learning guide. Gaussian processes (photometric redshift regression with uncertainty) are in our Gaussian Processes guide. Computer vision (glitch classification on Q-transform spectrograms) is in our Computer Vision guide. Time series classification (transient light curve classification with ROCKET and GRU) is in our Time Series Classification guide. Time series anomaly detection (periodic transit detection as anomaly identification) is in our Time Series Anomaly guide. Normalising flows (neural posterior estimation for simulation-based inference) are in our Normalising Flows guide. Bayesian deep learning (NPE as amortised variational inference) is in our Bayesian DL guide. Score-based generative models (flow matching for fast posterior sampling in SBI) are in our Score-Based Models guide.

Leave feedback about this

  • Rating

Durgesh Kekare
Durgesh Kekarehttps://www.dataexpertise.in
Durgesh Kekare is a data science educator and founder of DataExpertise.in. With expertise in Python, machine learning, and analytics, he helps 10,000+ learners break into data careers.

Latest Posts

List of Categories