Skip to content

L1iith/SpaceApp2025-Public

Repository files navigation

KeplerAI πŸ”­

AI-Powered Exoplanet Analysis Platform with Multi-Task Predictions & Conversational AI Team: N0T_EV3N_CL0SE

NASA Space Apps 2025 Challenge: "A World Away: Hunting for Exoplanets with AI"

🌟 Overview

KeplerAI is a comprehensive machine learning platform that revolutionizes exoplanet research by combining false positive classification, planetary radius prediction, and habitability assessment in a single, intelligent system. The platform features an integrated AI chatbot that provides contextual insights and explanations, making complex astronomical data accessible to both researchers and the public.

Key Features

  • 🧠 Multi-Task AI Models: XGBoost classifier achieving 99.8% accuracy for false positive detection
  • 🌍 Habitability Assessment: Advanced ML models predict planetary habitability potential
  • πŸ“ Radius Prediction: Sophisticated algorithms estimate planetary radius from transit data
  • πŸ€– AI Chatbot: Conversational AI assistant with CSV integration for contextual Q&A
  • πŸ“Š SHAP Explanations: Complete transparency with explainable AI features
  • 🌌 3D Visualization: Interactive planet system visualization with Three.js
  • ⚑ Real-time API: Fast predictions with comprehensive multi-task analysis
  • πŸ“ˆ Light Curve Analysis: Advanced phase-folded transit visualization
  • 🐳 Docker Ready: Full containerization for seamless deployment

🎯 Problem Solved

Multiple Challenges, One Platform:

  1. False Positive Identification: Over 90% of automated exoplanet detections are false positives requiring manual review
  2. Planetary Characterization: Limited tools for estimating planetary properties from transit data
  3. Habitability Assessment: Complex calculations needed to evaluate planetary habitability potential
  4. Data Accessibility: Astronomical research tools often inaccessible to broader audiences

KeplerAI addresses these challenges with an integrated platform that provides accurate classification, detailed planetary analysis, and an intuitive conversational interface that makes exoplanet research accessible to everyone.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Input: KOI Data                     β”‚
β”‚         (Tabular Features + Light Curve)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚       Multi-Task AI Pipeline               β”‚
    β”‚                                             β”‚
    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”β”‚
    β”‚  β”‚  XGBoost    β”‚ β”‚ Radius      β”‚ β”‚Habit- β”‚β”‚
    β”‚  β”‚Classifier   β”‚ β”‚ Predictor   β”‚ β”‚abilityβ”‚β”‚
    β”‚  β”‚β€’ 99.8% Acc  β”‚ β”‚β€’ ML Model   β”‚ β”‚Model  β”‚β”‚
    β”‚  β”‚β€’ SHAP Ready β”‚ β”‚β€’ Rock/Gas   β”‚ β”‚β€’ Zone β”‚β”‚
    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚         FastAPI Backend                     β”‚
    β”‚  β€’ Multi-task Predictions                  β”‚
    β”‚  β€’ SHAP Explanations                       β”‚
    β”‚  β€’ Conversational AI Chat                  β”‚
    β”‚  β€’ CSV Data Integration                    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚          React Frontend                     β”‚
    β”‚  β€’ Interactive Dashboard                   β”‚
    β”‚  β€’ AI Chatbot Interface                    β”‚
    β”‚  β€’ Habitability Cards                      β”‚
    β”‚  β€’ Radius Prediction Cards                 β”‚
    β”‚  β€’ 3D Planet Visualization                 β”‚
    β”‚  β€’ SHAP Plot Integration                   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Python 3.11+ (for local development)
  • Node.js 18+ (for local development)

🐳 Docker Deployment (Recommended)

# Clone the repository
git clone https://github.com/L1iith/SpaceApp2025-Public
cd KeplerAI

# Build and run with Docker Compose
docker-compose up --build

# Access the application
# Frontend: http://localhost:80
# Backend API: http://localhost:8000
# API Documentation: http://localhost:8000/docs

πŸ’» Local Development

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run preprocessing (if needed)
python src/data/preprocessing.py

# Train models (if needed)
python src/models/train_xgboost.py

# Start API server
uvicorn api.main:app --reload

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

πŸ“Š Model Performance

Multi-Task Performance

XGBoost False Positive Classifier

  • Accuracy: 99.8%
  • Precision: 99.9%
  • Recall: 99.9%
  • ROC-AUC: 99.99%

Radius Prediction Model

  • Model Type: Gradient Boosting Regressor
  • Features: Transit depth, stellar parameters, orbital characteristics
  • Output: Planetary radius in Earth radii (RβŠ•)
  • Classification: Rocky (≀2.0 RβŠ•) vs Gaseous (>2.0 RβŠ•)

Habitability Assessment Model

  • Model Type: Multi-factor ML classifier
  • Key Factors: Temperature zone, planetary composition, stellar radiation
  • Output: Habitability score and binary classification
  • Criteria: Liquid water temperature range (200-350K) + rocky composition

Training Data

  • Total Samples: 7,585 KOIs
  • Features: 21+ engineered features per model
  • Classes: Confirmed (36%) vs False Positive (64%)
  • Cross-Validation: 5-fold stratified for all models

πŸ”¬ Technical Details

Multi-Task Machine Learning Pipeline

  1. Data Preprocessing & Feature Engineering

    • Comprehensive feature engineering from KOI catalog
    • Missing value imputation with domain knowledge
    • Multi-scale standardization and normalization
    • Stratified train/validation/test split (70/15/15)
  2. False Positive Classification (XGBoost)

    • Gradient boosting on 21 engineered tabular features
    • SHAP TreeExplainer for feature attribution
    • Bayesian hyperparameter optimization
    • Early stopping and L1/L2 regularization
  3. Planetary Radius Prediction

    • Ensemble of gradient boosting models
    • Transit depth analysis and stellar parameter integration
    • Uncertainty quantification for predictions
    • Rock/gas classification based on radius threshold
  4. Habitability Assessment

    • Multi-factor scoring system combining:
      • Habitable zone temperature calculations
      • Planetary composition analysis
      • Stellar radiation flux modeling
    • Binary classification with confidence scoring
  5. Conversational AI Integration

    • Context-aware chatbot with CSV data integration
    • Dynamic response generation based on KOI analysis
    • Scientific explanation generation for complex results

Key Features Analyzed

  • False Positive Flags: Secondary eclipse, centroid offset, etc.
  • Transit Properties: Period, depth, duration, impact parameter
  • Signal Quality: SNR, chi-square, multiple event statistics
  • Stellar Parameters: Temperature, radius, mass, surface gravity
  • Planet Properties: Radius, orbital distance, temperature

🎨 Frontend Features

Multi-Task Analysis Dashboard

  • Search Interface: Enter KOI IDs for comprehensive analysis
  • False Positive Classification: Primary detection with confidence metrics
  • Habitability Assessment: Detailed habitability analysis with Earth comparisons
  • Radius Prediction: Planetary size estimation with rock/gas classification
  • AI Chat Interface: Conversational assistant for contextual explanations

Advanced Visualizations

  • 3D Planet Viewer: Interactive orbital simulation with realistic rendering
  • Light Curve Plots: Phase-folded transit visualization with anomaly detection
  • SHAP Explanations: Feature importance and impact analysis across all models
  • Habitability Cards: Visual habitability checklist with temperature zones
  • Radius Comparison: Scale comparisons with Earth and solar system planets

Enhanced User Experience

  • Contextual AI Chat: Ask questions about specific results and get scientific explanations
  • Multi-Card Layout: Simultaneous view of all analysis results
  • Responsive Design: Optimized for desktop, tablet, and mobile
  • Real-time Updates: Live prediction results across all models
  • Export Features: Download plots, data, and analysis reports
  • Modern UI: Glass-morphism design with intuitive navigation

πŸ“‘ API Reference

Core Endpoints

# Multi-task prediction with all analyses
POST /api/predict
{
  "koi_id": "K00752.01",
  "features": { ... },
  "include_lightcurve": true,
  "explain": true,
  "include_habitability": true,
  "include_radius": true
}

# Conversational AI chat
POST /api/chat
{
  "message": "What does this classification mean?",
  "koi_id": "K00752.01",
  "context": { ... },
  "conversation_history": [...]
}

# Get light curve data
GET /api/lightcurve/{koi_id}

# Get detailed explanation
GET /api/explain/{koi_id}

# Batch processing
POST /api/batch
{
  "koi_ids": ["K00752.01", "K00753.01"],
  "include_multi_task": true
}

Enhanced Response Format

{
  "classification": {
    "prediction": "CONFIRMED",
    "confidence": 0.94,
    "shap_explanation": { ... }
  },
  "radius_prediction": {
    "predicted_radius_earth_radii": 1.42,
    "confidence": "model_based",
    "is_rocky": true
  },
  "habitability_prediction": {
    "prediction": "HABITABLE", 
    "confidence": 0.87,
    "factors": {
      "in_habitable_zone": true,
      "temperature_k": 287,
      "is_rocky": true,
      "habitability_score": 0.87
    }
  },
  "chat_response": {
    "response": "This planet is classified as confirmed...",
    "sources": ["koi_data", "ml_models"]
  }
}

πŸ§ͺ Testing & Validation

Multi-Task Model Validation

  • Cross-validation with stratified sampling across all models
  • Hold-out test set evaluation for each prediction task
  • Performance monitoring and drift detection
  • Feature importance analysis and SHAP consistency
  • Habitability model validation against confirmed habitable exoplanets
  • Radius prediction accuracy assessment using confirmed planet data

Comprehensive API Testing

  • Unit tests for all endpoints including chat functionality
  • Integration testing across multi-task prediction pipeline
  • Load testing with concurrent requests and chat sessions
  • Error handling validation for edge cases
  • Chat response quality assessment
  • Real-time performance monitoring

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸš€ Recent Updates

Version 2.0 - Multi-Task AI Platform

  • πŸ€– Conversational AI: Integrated chatbot with CSV data context
  • 🌍 Habitability Assessment: Advanced ML models for habitability prediction
  • πŸ“ Radius Prediction: Sophisticated planetary radius estimation
  • 🎨 Enhanced UI: Modern glass-morphism design with improved UX
  • πŸ“Š Multi-Card Dashboard: Simultaneous display of all analysis results
  • ⚑ Performance Optimizations: Faster predictions and real-time updates

πŸ™ Acknowledgments

  • NASA Exoplanet Archive: For providing the comprehensive KOI dataset
  • Kepler Space Telescope Team: For the groundbreaking exoplanet discoveries
  • SHAP Library: For enabling explainable machine learning
  • React Three Fiber: For beautiful 3D visualizations
  • NASA Space Apps Challenge: For inspiring this innovative platform
  • Open Source Community: For the amazing tools and frameworks that made this possible

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published