Unsupervised deep learning for exoplanet detection
View the Project on GitHub SNaveenMathew/Unsupervised-Exoplanet
I was very fortunate to explore ASTR 596 (AI in Astronomy) at UIUC in Spring 2019. I understood that machine learning can teach us a lot in scientific domains such as Physics and Astronomy when the problem is well structured.
The intent of this project is to continue my efforts in improving the unsupervised deep learning pipeline for exoplanet detection.
Geocentric model was proposed by Ptolemy. Astonomical predictions of this model were used for over 1500 years. Heliocentric model came into picture in the late 16th century. But the biggest breakthrough came Newton’s laws met Tycho Brahe’s observations - when models were built to explain the orbits of planets, asteroids, comets, etc. and predictions were made, which were later confirmed (with negligible differences) through observations.
Models form an important component of Physics and Astronomy. The ultimate objective of a scientist is to build a model that allows causal inference. If the importance for accuracy outweighs the need for a rational explanation of the predictions, the machine learning approach is short sighted. This is because (accurate) pattern identification without (scientific / logical / causal) reasoning does not provide a reasonable forecast. The application of such an approach is limited to computational models that are based on estimates of some form correlation - not causation.
Currently reasoning is a very difficult task for AI. As a result, I’m not sure whether the long term goal of this project will be met, but I will keep trying.
At the end of STAT 430 (Data Science Programming Methods) and ASTR 596 (AI in Astronomy), this repository had:
There were several constraints during the execution of the project: in terms of resources and portability. Therefore, the code was tested only on 36 light curves. Manual observation of the light curves showed that the model had a good recall - it detected all exoplanet transits, but it had poor precision - there were many periodic false detections.
Conv1D + MaxPooling1D $\to$ Bottleneck $\to$ UpSampling1D + Conv1D), optimized for modern GPUs with batch sizes up to 256–512 and sequence length $L = 128$ cadences (~2.6 days).counts.sh, counts_df.sh) for native Kepler star parsing and database population across Windows and Linux..tbl files upon user selection if not pre-generated, running inference via star-specific or global autoencoder models and storing the rendered plots in plots/test_pred_plot/ for future instant loading.user_star until “Confirm Tags”; “Cancel” discards the session untouched. “Reset Tags to Model” still reverts a star to model-detected candidates immediately.test_idx Cache: When a star has no dedicated .hdf5 model, inference now falls back to a shared global_conv1d_autoencoder.hdf5. Model-detected candidate windows are persisted once per star into a new test_idx table and reused across sessions instead of being recomputed on every view; per-user overrides still live in user_star.user_star and test_idx — no separate bandit-state table required. Each star is modeled as a Beta-Bernoulli arm whose “reward” is disagreement among taggers: stars with zero human tags get an uninformative Beta(1, 1) prior, stars with two or more taggers use the mean pairwise IoU (interval overlap) between their saved windows, and stars with exactly one tagger fall back to comparing that tagger against the model’s own test_idx detection as a weaker second opinion. Thompson Sampling — drawing a fresh posterior sample per star on every request — was chosen over epsilon-greedy/UCB1 specifically because this is a multi-user dashboard: UCB1 is deterministic, so every concurrent session would get funneled to the exact same star, and epsilon-greedy can’t tell “unlabeled” apart from “already agreed on.” Random posterior draws naturally spread concurrent taggers across several high-priority stars while still concentrating attention on the ones that most need it.requireNamespace() / tryCatch() guards so the dashboard still renders (falling back to a zero baseline) when the Python/Keras backend isn’t available — a step toward reliable shinyapps.io deployment.output$trainPlot render that already computes y_pred, with no extra state table.imputeTS import from app.Rmd’s global chunk — a leftover from the old Stineman-interpolation preprocessing that nothing in the current pipeline calls — so the dashboard no longer needs an extra, unused package installed just to start.shinydashboard (collapsible sidebar for Kepler ID selection, dashboard header with a GitHub link) with shinyBS tooltips on every toolbar control.The detection pipeline has been expanded beyond the original autoencoder-only workflow. Recent updates include a lighter-weight triage scan to screen light curves efficiently, unified candidate scoring that combines several signals into one decision path, and more robust candidate generation across noisy or irregular data segments. The pipeline also adds support for batch precomputation, export tooling for crowd-consensus training data, and additional vetting checks to separate promising transit-like dips from spurious periodic noise. Together, these changes improve the speed, consistency, and scalability of the search process while preserving the project’s unsupervised approach.
app.Rmd now guards all Keras/reticulate calls and pins an explicit resource_files manifest of the bundled .tbl / .hdf5 files for shinyapps.io, but full Python backend support there is still unresolved.)Unsupervised-Exoplanet/
├── main.R # CLI entry point (docopt); runs the pipeline
├── pipeline.R # 1D-CNN autoencoder training, plotting, SQLite output
├── util.R # helpers (gap splitting, detrending, transit detection, DB)
├── download.R # downloads Kepler KOI light curves into data/
├── counts.sh / counts_df.sh # legacy star / planet-count helpers
├── Kepler_KOI_DV_wget_remaining.bat
├── Unsupervised-Exoplanet.Rproj
├── _config.yml
├── data/
│ ├── Kepler_KOI_DV_wget.bat # bulk download script for Kepler DV light curves
│ ├── remove_log.sh
│ └── *.tbl # Kepler light-curve tables (downloaded; gitignored)
├── plots/ # generated by pipeline.R or on-demand by Shiny (gitignored)
│ ├── learning_curve/ # Autoencoder training-history plots (*_learning.png)
│ ├── train_pred_plot/ # train-set prediction vs actual (*_train_plot.png)
│ └── test_pred_plot/ # test-set prediction vs actual (*_test_plot.png)
├── trained_models/ # saved Keras models (*.hdf5; gitignored)
├── shiny/
│ └── app.Rmd # Shiny dashboard
├── Report/ # course report sources (gitignored)
└── Presentation/ # course presentation sources (gitignored)
pipeline.R and shiny/app.Rmd create plots/learning_curve, plots/train_pred_plot, and plots/test_pred_plot (and trained_models/) if they do not already exist. Kepler *.tbl files are downloaded into data/ by download.R / data/Kepler_KOI_DV_wget.bat.
Generated and course-material binaries were previously committed and bloated the repository. They have been purged from git history and are gitignored. Regenerate pipeline outputs locally by running main.R; do not commit them.
| Path | What was stored |
|---|---|
plots/learning_curve/ |
Autoencoder training-history plots (*_learning.png) |
plots/train_pred_plot/ |
Training-set prediction plots (*_train_plot.png) |
plots/test_pred_plot/ |
Test-set prediction plots (*_test_plot.png); this was the largest plot set |
| repository root | A stray test plot, kplr002302548_q1_q16_tce_02_dvt_lc_test_plot.png |
Presentation/ |
Course slides, embedded HTML, GIFs, and example PNGs |
Report/ |
Course report PDF/LaTeX sources and figure PNGs |
exoplanet_db.sqlite, shiny/exoplanet_db.sqlite |
SQLite databases of transit indices / users |
README.html |
Rendered copy of this README |