Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Exoplanet Detector

TESS light-curve analysis for automatic exoplanet transit detection.

A deep learning pipeline for detecting exoplanet transit candidates in TESS stellar light curves using a hybrid CNN-MLP neural network.

  • Deep learning pipeline: see README_DL.md for training & performance
  • Full pipeline (data → math → model): see README_PIPELINE.md
  • Current DL test accuracy: 60.31% (27 epochs, early stopped from max 80)

Python Jupyter PyTorch


📋 Overview

This project analyzes TESS (Transiting Exoplanet Survey Satellite) stellar light curves to classify stars as hosting exoplanet candidates or not. The system combines:

  • 1D Convolutional Neural Network (CNN) — learns patterns in brightness dips from light curves
  • Multi-Layer Perceptron (MLP) — processes Box Least Squares (BLS) transit features
  • Hybrid fusion — combines both feature types for improved classification

Classification Task

Label Meaning Class
CP, KP, PC Confirmed / Known / Candidate planet 1 — Planet
FP, FA False positive / False alarm 0 — Not a planet

🎯 Model Performance

Latest Results: 60.31% test accuracy with a hybrid neural network

Metric Score
Test Accuracy 60.31%
Test F1 Score 52.43%
Test ROC-AUC 63.61%
Best Validation Accuracy 69.5%
Training Epochs 27 (early stopped from max 80)

Dataset Statistics

  • Total Samples: 1,598 (after deduplication)
  • Planet Candidates: 736
  • Non-planets: 862
  • Test Set Size: 320 (20% hold-out)
  • Train/Val/Test Split: 64% / 16% / 20%

🚀 Quick Start

Installation

git clone https://github.com/Ash310u/Exoplanet-detector.git
cd Exoplanet-detector
pip install -r requirements.txt

Train the Model

python3 src/train_cnn.py --epochs 80 --patience 15

Run in Jupyter

Open src/plot.ipynb and run from the "DL MODEL" section.


📁 Project Structure

├── README.md                        # Project overview
├── README_DL.md                     # DL training summary & performance
├── README_PIPELINE.md               # Full pipeline: data → math → model layers
├── requirements.txt                 # Python dependencies
├── data/processed/
│   ├── labels_cleaned.csv           # Ground truth labels
│   ├── training_tid_features.csv    # BLS features
│   ├── stars/                       # Light curve files (TIC_*.npy)
│   └── transit_cnn.pt               # Trained model
└── src/
    ├── train_cnn.py                 # Main training script
    ├── plot.ipynb                   # Interactive notebook
    ├── extract_features.py          # BLS feature extraction
    └── build_folded_lightcurves.py  # Phase-folding utility

🔬 Pipeline Overview

Light Curves (.npy)    BLS Features (CSV)
        │                       │
        ▼                       ▼
   Preprocess            Normalize
        │                       │
        └───────┬───────────────┘
                ▼
         TransitHybrid Model
         ┌─────────────────┐
         │ CNN Branch      │
         │ BLS Branch      │
         │ Fusion Head     │
         └─────────────────┘
                ▼
         Planet Probability

Model Architecture

CNN Branch: Conv1d → BatchNorm → ReLU → MaxPool (×2) → 32 features

BLS Branch: Linear(5→128) → Linear(128→64) → Linear(64→32)

Fusion: Concatenate + Binary classifier

Training Settings

Setting Value
Optimizer AdamW (lr=0.001)
Loss Binary cross-entropy
Batch Size 32
Early Stopping 15 epochs
Max Epochs 80

📊 Performance Comparison

Model Accuracy
Original CNN 49.4%
Hybrid Model 60.3%
XGBoost Baseline ~63.4%

🔧 Improving Accuracy

Light curves are not phase-folded, limiting CNN learning. To improve:

python3 src/build_folded_lightcurves.py
python3 src/train_cnn.py --epochs 80 --patience 15

Phase-folding aligns repeated transit dips, making patterns clearer.


📚 Additional Resources

  • Full pipeline guide (data extraction → formulas → DL layers): See README_PIPELINE.md
  • Detailed DL documentation: See README_DL.md
  • Training arguments: Use --help flag with training script

💡 Key Technologies

  • PyTorch — Neural network framework
  • NumPy — Numerical computing
  • Pandas — Data manipulation
  • Scikit-learn — Preprocessing & metrics
  • Jupyter — Interactive notebooks

📝 Files Overview

File Purpose
train_cnn.py Main training script
plot.ipynb Interactive notebook
extract_features.py BLS feature extraction
transit_cnn.pt Saved model & threshold

🎓 Technical Details

Input Features

  1. Light curve: 512-point normalized brightness sequence
  2. BLS features: Period, depth, duration, SNR, power

Preprocessing

  • Clip outliers (5th–95th percentile)
  • Detrend with Savitzky–Golay filter
  • Robust scale: (x - median) / IQR

Validation Strategy

  • Stratified train/val/test split
  • Balanced class sampling
  • Per-epoch threshold optimization (0.2–0.8)
  • Model checkpointing & early stopping

🚧 Future Work

  • Phase-folded light curves
  • Data augmentation (time warping, noise)
  • Ensemble methods
  • Hyperparameter optimization
  • Advanced feature engineering

📄 License

Research and educational use.

✨ Quick Reference

Input:    512-point flux + 5 BLS features
Output:   Planet candidate probability
Task:     Binary classification
Model:    TransitHybrid (CNN + MLP)
Accuracy: 60.31% (27 epochs, early stopped from max 80)

About

Hybrid CNN + BLS deep-learning pipeline for automated exoplanet detection from NASA TESS light curves.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages