← All work
Project write up · Python, scikit-learn, NumPy, SciPy

Finding planets in starlight

A pipeline that searches TESS light curves for the small, repeating dip of a transiting planet and decides whether it is one. Judged on 766 real TESS candidates that follow-up has since resolved, it ranks the confirmed planets above the false positives with an average precision of 0.84, where guessing scores 0.49. A version trained only on simulated planets scored 0.61, barely better than ranking by signal strength.

The problem

A planet crossing in front of its star dims the light by 0.05 to 1% for a few hours, once per orbit. Only a few per cent of stars host one that can be seen, and the dip sits on top of stellar variability ten to a hundred times deeper. Most dips that do repeat are not planets: eclipsing binaries, a binary on a neighbouring star blended into the same pixel, or the spacecraft itself. Every candidate a pipeline flags costs nights of telescope time to check, so what matters is how cleanly the real planets rise to the top of the list.

How it works

download→ detrend→ search→ vet→ fit

Each light curve is flattened with a robust spline that is shown to keep a transit's depth to within 5% while removing variability ten times deeper, then refitted with the transits masked. A box least squares search finds the strongest repeating dip. The classifier, gradient boosting on 23 vetting measurements (odd against even transit depths, a search for a secondary eclipse, transit shape, how much the dip stands out from the rest of the periodogram), scores how planet-like the signal is. A centroid test checks the pixel images to see whether the dip is on the target star or a neighbour. For candidates worth a closer look, a limb-darkened transit model is fitted with MCMC to give the planet's size, impact parameter and the stellar density the transit implies.

The same code vets one star (python -m transitml.vet "TIC 100100827", which is WASP-18) or a whole sector with a cache and a ranked dashboard.

On real TESS data

The test that matters is the one a vetting tool faces in use: real TESS signals that follow-up observers have since resolved as confirmed planet or false positive, labels nobody in this project chose. Both classes have already passed TESS's own detection and automated vetting, so the false positives are the hard ones that got through.

Average precision on the 766 resolved TOI hosts of sectors 14 to 26, for a model trained on the real dispositions of sectors 1 to 13. "Later sectors" joins each star's observations from sectors 27 to 102, up to five years of data.
Test on real dataResultChance
746 resolved TOIs, model trained on synthetic curvesAP 0.610.50
  ranking the same stars by BLS SNRAP 0.600.50
766 hosts of sectors 14 to 26, trained on 1 to 13AP 0.8420.491
857 hosts of sectors 1 to 13, trained on 14 to 26AP 0.8760.536
101 open TOIs since confirmed, among 1,856 rankedROC-AUC 0.630.50
Synthetic planets injected into real sector 14 noiseAP 0.460.04

What these numbers do not say: the follow-up labels carry the follow-up programme's own choices, and about half of TOIs are planets, far more than in the sky. So the 0.8s measure how well the model ranks TOIs like the resolved ones, not the precision of a survey.

The synthetic benchmark

Before any real data, the pipeline was built against 2,400 simulated light curves in which 4% of stars host a transiting planet, with eclipsing binaries and variable stars as the false positives and 35% held out. Here the truth is known for every star.

ScorerAverage precisionROC-AUCTop 20
Random ranking (chance)0.0400.500
Rank by BLS depth0.0970.7520 of 20
Rank by BLS depth SNR0.1790.8312 of 20
Gradient boosting on vetting features0.7450.92118 of 20

Reproduce it

git clone https://github.com/rohanKraghu/transit-detection && cd transit-detection
pip install -r requirements.txt
python run_pipeline.py      # the synthetic benchmark, about 3 minutes on 4 cores
pytest                      # 574 tests

The real-data runs download thousands of light curves from MAST through lightkurve, which takes hours the first time; the README gives the command for each result above. Numbers on this page are from the README at commit 8f0c69f (21 October 2026).

Limits