Science and engineering

Machine learning for physics and astronomy

Astronomers use machine learning to classify galaxies and transients in survey images, to estimate redshifts from photometry, and to find rare objects in catalogues too large to inspect. Physicists apply the same methods to simulations and detector data.

How machine learning is used in physics and astronomy

Classifying galaxies

Convolutional networks learn galaxy shapes from images labelled by experts or volunteers, then classify millions of galaxies in new survey data consistently.

Real exampleRotation-invariant CNNs for galaxy morphology (Dieleman, Willett and Dambre, 2015)Developed for the Galaxy Challenge, the model reproduced the consensus of Galaxy Zoo volunteers with near-perfect accuracy on images where they agreed strongly.

Estimating redshifts from photometry

Spectra give precise distances but are slow to take, while images in a few filters are cheap. Models trained on galaxies with both learn to estimate redshift, and its uncertainty, from images or colours alone.

Real exampleCNN photometric redshifts from SDSS images (Pasquet et al., 2018)Trained a convolutional neural network on SDSS galaxy images to estimate photometric redshifts with probability distributions, using the images directly without feature extraction.

Finding real transients among false detections

Surveys that compare new images with old ones produce many artefacts. Real-bogus classifiers keep genuine new or changing objects so follow-up telescopes are not wasted.

Real examplebraai for the Zwicky Transient Facility (Duev et al., 2019)A convolutional neural network real-bogus classifier that separates genuine astrophysical events from false positive detections in Zwicky Transient Facility data.

Vetting exoplanet candidates

Transit searches produce many candidate signals, most of them not planets. Classifiers trained on vetted examples rank candidates so the most planet-like are followed up.

Real exampleIdentifying exoplanets with deep learning (Shallue and Vanderburg, 2018)Trained a neural network to classify Kepler planet candidates and identified new planets, including an eighth planet around Kepler-90 and a fifth in a resonant chain around Kepler-80.

Can you learn machine learning for astronomy?

Yes. Astronomers and physics students already have the maths and statistics; the additions are Python machine learning tools, good validation habits and deep learning for images and time series.

  1. Python and AstropyRead FITS files and catalogues and handle coordinates and units in Python.Learn it in Python
  2. StatisticsBayesian inference, selection effects and error bars matter more in astronomy than in most ML applications.Learn it in Statistics
  3. Classical machine learningRandom forests and gradient boosting for catalogue tasks such as photometric redshifts.Learn it in Machine Learning
  4. Deep learning for images and light curvesConvolutional networks for survey images and sequence models for light curves.Learn it in Deep Learning

Moving into machine learning for astronomy

If you already work in the field

Astronomers already work with large catalogues, images and careful statistics. Add PyTorch and machine learning practice using public survey data, for example from SDSS or ZTF, and take on a classification or redshift task. Large survey projects need people with this mix of skills.

If you come from data science or ML

Machine learning practitioners should learn coordinate systems, magnitudes and photometry, and survey selection effects, because training sets are usually biased towards bright, nearby objects. Astropy tutorials and public survey data releases are good starting points.

Roles that do this workAstronomerAstrophysics data scientistSurvey science software engineerResearch software engineer

Tools you will use

ToolWhat you use it for
AstropyHandle FITS files, coordinates, units and tables for astronomical data.
AstroqueryQuery survey archives such as SDSS and Gaia from Python.
scikit-learnFit photometric-redshift regressors and catalogue classifiers.
PyTorchTrain convolutional networks on galaxy and transient images.

Public data to practise on

  • Galaxy10 DECaLS: Galaxy images labelled into morphology classes from Galaxy Zoo volunteers.
  • SDSS SkyServer: Sloan Digital Sky Survey photometry, spectra and redshifts queryable with SQL.

Your first project

Download Galaxy10 DECaLS, classify galaxy morphology with a small convolutional network, and compare it with logistic regression on downsampled pixels using balanced accuracy.

Common questions

How is AI used in astronomy?

To classify galaxies and transients, estimate distances, find rare objects, filter false detections and speed up simulations. Large surveys produce too much data for manual inspection, so machine learning is part of most pipelines.

Can machine learning find exoplanets?

Yes. Neural networks have been used to vet planet candidates from Kepler and TESS light curves, and some candidates were confirmed as planets after further analysis.

What is Galaxy Zoo?

Galaxy Zoo is a citizen-science project in which volunteers classify galaxy shapes from survey images. Its labels have been widely used to train and test machine learning models.

What is the real-bogus problem?

Pipelines that subtract images to find changes produce many false detections from artefacts. Real-bogus classifiers separate genuine astrophysical events from these artefacts so follow-up goes to real transients.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.