A modern PyTorch implementation of AstroNet for exoplanet detection in Kepler light curves, optimized for Google Colab environments.
This repository provides a PyTorch implementation of AstroNet, a deep convolutional neural network originally developed by Google Research for detecting exoplanet transits in Kepler light curves. The colab_ver3 implementation offers enhanced features for research and practical exoplanet discovery applications, building upon the original TensorFlow work by Shallue & Vanderburg (2018) and subsequent PyTorch translation by the NASA Frontier Development Lab team.
AstroNet was originally developed in TensorFlow by Shallue & Vanderburg (2018) for classifying exoplanet transits in Kepler light curves. The model uses a two-branch CNN architecture:
The model uses a two-branch CNN architecture:
- Global Branch: Processes full light curves (2001 time points) to capture long-term stellar behavior
- Local Branch: Analyzes zoomed-in transit views (201 time points) to detect transit shapes
- Fusion: Combines features from both branches for final classification
Original TensorFlow Implementation: Google Research exoplanet-ml repository
In 2018, NASA's Frontier Development Lab (FDL) formed a team of scientists and machine learning experts to enhance AstroNet with scientific domain knowledge. The team translated the model from TensorFlow to PyTorch and added improvements for practical exoplanet discovery.
2018 NASA FDL Exoplanet Team:
Reference: 2018 NASA FDL Exoplanet Team (2018), ApJ Letters, 869, L7
Input: Light Curve Data
├── Global View (2001 points) → Global Branch → Features
├── Local View (201 points) → Local Branch → Features
└── Fusion Layer → Classification → Exoplanet Probability
See colab_ver3_structure_chart.md for detailed architecture documentation.
- Google Colab Integration: Automated data extraction from Google Drive
- Data Organization: Automatic file organization into train/val/test splits
- Model Training: 50 epochs, batch size 64, 12 workers for Colab
- Evaluation: Validation and test set metrics with visualizations
- Model Training: Train AstroNet on Kepler light curves
- Performance Evaluation: Calculate accuracy, precision, recall, and average precision
- Visualization: Generate training curves and evaluation plots
- Results Export: Save model weights and CSV files with predictions
- Open the notebook in Google Colab
- Upload Kepler data files to Google Drive in the
astronet_datafolder - Run the training pipeline
Each sample requires three files:
*_global.npy: Full light curve (2001 time points)*_local.npy: Zoomed-in transit view (201 time points)*_info.npy: Metadata including labels
Download Kepler data from Google Drive and organize into train/, val/, test/ folders.
- Modular Architecture: 13 functions vs 3 monolithic functions
- Google Colab Integration: Automated data handling vs manual command-line
- Enhanced Visualization: 8+ plots vs 4 basic plots
- Comprehensive Metrics: 10+ metrics vs 3 basic metrics
- Error Handling: Robust fallbacks vs minimal validation
- Documentation: 150+ lines of docstrings vs basic comments
# Training hyperparameters
BATCH_SIZE = 64
NUM_WORKERS = 12
EPOCHS = 50
LEARNING_RATE = 1e-5# Paths for Google Colab
DATA_DIR = '/content/astronet_data'
DRIVE_DIR = '/content/drive/MyDrive/astronet_data'Training for 50 epochs...
Epoch 25/50: Train Loss=0.1234, Val Loss=0.1456, Val Acc=0.9234, Val AP=0.9456
astronet_model.pth: Trained model weightspredictions.csv: Model predictions and ground truthtraining_history.csv: Training metrics per epochtraining_results.pdf: Visualization plots
If you use this work, please cite the original research and NASA FDL contributions:
@article{shallue2018identifying,
title={Identifying Exoplanets with Deep Learning: A Five-planet Resonant Chain around Kepler-80 and an Eighth Planet around Kepler-90},
author={Shallue, Christopher J and Vanderburg, Andrew},
journal={The Astronomical Journal},
volume={155},
number={2},
pages={94},
year={2018},
month={February},
doi={10.3847/1538-3881/aa9e09},
publisher={IOP Publishing}
}@article{ansdell2018exoplanet,
title={Exoplanet Detection with Machine Learning},
author={Ansdell, Megan and Ioannou, Yani and Osborn, Hugh and Sasdelli, Michele},
journal={Astrophysical Journal Letters},
volume={869},
pages={L7},
year={2018},
publisher={IOP Publishing}
}- Repository: Google Research exoplanet-ml
- Author: Chris Shallue (@cshallue)
- Paper: Shallue & Vanderburg (2018)
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Research: Original AstroNet development and TensorFlow implementation
- Chris Shallue: Original AstroNet author (@cshallue)
- NASA FDL: PyTorch translation and scientific enhancements
- Kepler Mission: Data and scientific foundation
- PyTorch Team: Deep learning framework
- Open Source Community: Tools and libraries
This is not an official Google product. This implementation builds upon the original Google Research work and NASA FDL contributions.