🌌 A full-stack machine learning system that predicts whether a distant exoplanet could harbor life —
powered by real astrophysical data, engineered features, and production-ready ML pipelines.
"There are more stars in the observable universe than grains of sand on Earth.
Among those stars orbit billions of planets. ExoHabitAI asks the question:
Which ones could be home?"
ExoHabitAI is not just a machine learning project — it is a scientific exploration tool.
It ingests raw exoplanet data, processes astrophysical signals, calculates Earth Similarity Indices, and deploys a trained ML model through a polished web dashboard to deliver habitability predictions in real-time.
This project bridges data science, astronomy, and software engineering — the way real-world AI systems are built.
| Access Point | Link |
|---|---|
| 🌐 Live App | b13-exohabitai-samridhigupta.onrender.com |
| 🖥️ Local Dashboard | http://127.0.0.1:5000 after running Flask |
| 🟢 Health Check | GET / |
| 🔵 Model Info | GET /model-info |
| 🚀 Predict | POST /predict |
| 🏆 Top Rankings | GET /rank |
| 📓 Notebooks | ./notebooks/ |
🚀 Watch ExoHabitAI in action — real-time prediction system
🎥 Demo Video:
👉
A futuristic AI-powered interface designed for seamless space exploration and intelligent habitability analysis.
↑ First impression of ExoHabitAI — immersive space UI with strong visual identity and entry point into the system.
↑ Overview of the platform, showcasing AI-driven exoplanet research, data pipeline, and model performance.
↑ Users input planetary parameters and instantly explore the top 20 most habitable exoplanets ranked by the model.
↑ Detailed habitability report with probability score, parameter influence, and scientific insights.
↑ Explains the mission, methodology, and AI approach behind ExoHabitAI.
↑ Advanced analytics dashboard with feature importance, distributions, model comparison, and data insights.
- 🌠 Futuristic space-themed UI/UX
- ⚡ Real-time AI habitability prediction
- 📊 Interactive data visualizations
- 🧪 Scientifically inspired feature engineering
- 🚀 Smooth navigation across multiple modules
From raw stellar data to intelligent predictions — a five-stage mission
RAW DATA ──► PREPROCESSING ──► FEATURE ENGINEERING ──► MODEL TRAINING ──► PREDICTION
🪐 🧹 🧮 🤖 ✅
- Loaded the NASA Exoplanet Archive dataset with 30+ astrophysical features
- Removed duplicate records and irrelevant columns
- Standardized column naming and data types
- Applied median imputation for numerical orbital features
- Used domain-constrained bounds to cap outliers (e.g., stellar temperature ranges)
- Visualized missingness patterns using heatmaps
↑ Missing values heatmap — guiding imputation strategy
- Engineered the Earth Similarity Index (ESI) from radius, density, escape velocity, and surface temperature
- Created orbital stability indicators
- Normalized all features using
StandardScaler
Trained and evaluated five models:
| Model | Accuracy | ROC-AUC |
|---|---|---|
| Logistic Regression | — | — |
| Decision Tree | — | — |
| Random Forest | — | — |
| XGBoost | — | — |
| Tuned Random Forest ✅ | Best | Best |
Replace
—with your actual metrics fromfinal_model_metrics.csv
- Confusion matrices, ROC curves, and feature importance analyzed for every model
- Final model serialized as
exohabit_model.pkl
The data tells a story — here's how we listened
↑ Side-by-side accuracy and AUC comparison across all trained models
↑ Top predictive features driving habitability classification
| Final Selected Model | Tuned XGBoost |
|---|---|
![]() |
![]() |
| Confusion Matrix — Best Model | Confusion Matrix — Tuned XGBoost |
| Random Forest | Logistic Regression |
|---|---|
![]() |
![]() |
| Random Forest ROC Curve | Logistic Regression ROC Curve |
The engine room — where predictions are born
Frontend (HTML/JS)
│
▼
Flask API (app_deploy.py · port 5000)
│
├──── GET / → Health Check
├──── GET /model-info → Model Metadata
├──── POST /predict → Habitability Prediction
└──── GET /rank → Top 10 Habitable Planets
│
▼
Feature Preprocessing (utils.py)
│
▼
exohabit_model.pkl ──► Prediction Output
GET / — Confirms the backend API is running.
// Response
{
"message": "ExoHabitAI Backend API Running",
"status": "success"
}
↑ GET 127.0.0.1:5000 — API health confirmed live in browser
GET /model-info — Returns model metadata and features used.
// Response
{
"features_used": [
"planet_radius",
"planet_mass",
"orbital_period"
],
"model_name": "ExoHabitAI",
"version": "1.0"
}
↑ GET 127.0.0.1:5000/model-info — model metadata returned
POST /predict — Predicts habitability of an exoplanet from input features.
# Tested via backend/test_api.py
python backend/test_api.py// Response
{
"habitability_probability": 0.9995276927947998,
"prediction": 1,
"status": "success"
}
prediction: 1→ Habitable ·prediction: 0→ Non-Habitable
↑ test_api.py output — 99.95% habitability probability returned
GET /rank — Returns the Top 10 most habitable exoplanets from the dataset, ranked by habitability probability and supporting metrics including ESI score, equilibrium temperature, orbital stability factor, and stellar compatibility index.
// Response (truncated)
{
"count": 10,
"status": "success",
"top_planets": [
{
"Equilibrium_Temp": 753.2,
"Habitability_Probability": 0.9999881,
"Habitability_Score_Index": 0.2260783639999819,
"Orbital_Period": 18.2734,
"Orbital_Stability_Factor": 0.40665921750518514,
"Planet_Density": 3.53,
"Planet_Mass": 8.7,
"Planet_Name": "TOI-134564 b",
"Planet_Radius": 2.469,
"Stellar_Compatibility_Index": 0.8883289840950909,
"Stellar_Metallicity": 0.0,
"Stellar_Temp": 5048.0,
"Target_Habitable": 1
}
// ... 9 more planets
]
}
↑ GET /rank — Top 10 habitable exoplanet candidates with full metrics
| Feature | Description |
|---|---|
| 🔭 Habitability Prediction | Binary classification — prediction: 1 (Habitable) or 0 (Non-Habitable) via POST /predict |
| 🌍 ESI Calculation | Earth Similarity Index computed from planetary radius, density, escape velocity, and surface temperature |
| 🤖 Multiple ML Models | Logistic Regression, Decision Tree, Random Forest, XGBoost — best model selected and deployed |
| 📊 Rich Visualizations | Confusion matrices, ROC curves, feature importance charts, missing-value heatmaps |
| 🖥️ Interactive Dashboard | Space-themed frontend with real-time prediction UI at frontend/dashboard.html |
| 🟢 Health Check API | GET / — confirms backend is live |
| 🔵 Model Info API | GET /model-info — returns model name, version, and features used |
| 🚀 Prediction API | POST /predict — returns habitability_probability (0–1) and binary prediction |
| 🏆 Ranking API | GET /rank — returns Top 10 habitable exoplanet candidates with full metrics |
| 📦 Deployment Ready | Configured for Render via render.yaml — live at onrender.com |
B13-EXOHABITAI/
│
├── 📁 assets/images/ # README screenshots & visuals
├── 📁 backend/ # Flask API
│ ├── app_deploy.py # 4 endpoints: /, /model-info, /predict, /rank
│ ├── utils.py # Feature preprocessing
│ └── best_model.pkl # Serialized production model
│
├── 📁 data/
│ ├── raw/ # NASA Exoplanet Archive snapshot (CSV)
│ ├── preprocessed/ # Cleaned & imputed dataset
│ └── processed/ # Feature-engineered + habitability-ranked output
│
├── 📁 frontend/
│ ├── index.html # Landing page
│ └── dashboard.html # Prediction UI
│
├── 📁 models/
│ └── exohabit_model.pkl # Tuned Random Forest — final production model
│
├── 📁 notebooks/
│ ├── DataPreprocessingCodeFile.ipynb
│ ├── model_training.ipynb
│ └── ExoHabitAI_Project_Report.pdf
│
├── 📁 reports/ # Model evaluation outputs (19 PNGs + 2 CSVs)
│ ├── final_model_metrics.csv
│ ├── model_comparison.png
│ ├── feature_importance.png
│ └── [confusion matrices & ROC curves for all 5 models]
│
├── render.yaml # Render deployment config
├── requirements.txt
└── README.md # You are here 📍
↑ Full project directory — VS Code Explorer
| Layer | Technology |
|---|---|
| Language | Python 3.10+ |
| ML Framework | Scikit-Learn, XGBoost |
| Data Processing | Pandas, NumPy |
| Visualization | Matplotlib, Seaborn |
| Backend / API | Flask |
| Frontend | HTML5, CSS3, JavaScript |
| Serialization | Pickle (.pkl) |
| Deployment | Render (render.yaml) |
| Notebooks | Jupyter |
| Version Control | Git & GitHub |
Python 3.10+
pip
Gitgit clone https://github.com/YOUR_USERNAME/B13-ExoHabitAI.git
cd B13-ExoHabitAIpython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtcd backend
python app_deploy.pyNavigate to: http://localhost:5000
🟢 You're live. Enter exoplanet parameters and receive your first habitability prediction.
ExoHabitAI is configured for Render deployment via render.yaml.
- Fork this repository
- Connect to Render and create a New Web Service
- Point it to your forked repo
- Render auto-detects
render.yamland configures the build - Set environment variables if needed
- Click Deploy 🚀
The mission doesn't end here — it's just beginning
- 🔭 Real-time NASA API Integration — pull live exoplanet data
- 🧠 Deep Learning Models — LSTM/Transformer-based habitability scoring
- 🌐 3D Planet Visualization — interactive Three.js exoplanet renderer
- 📱 Mobile-Responsive UI — full cross-device support
- 🔍 Explainability Layer — SHAP values for every prediction
- 🗃️ Database Integration — store and compare historical predictions
- 🛰️ Multi-Star System Support — binary star habitability zones
Contributions, ideas, and pull requests are welcome.
# Fork → Branch → Commit → PR
git checkout -b feature/your-feature-name
git commit -m "feat: describe your change"
git push origin feature/your-feature-namePlease follow clean commit conventions and add docstrings to new functions.
This project is licensed under the terms of the LICENSE file included in this repository.
ExoHabitAI was built at the intersection of data science and wonder.
Every model trained, every feature engineered, every prediction made —
is one small step toward answering humanity's oldest question:
Made with 🔭 by Samridhi Gupta — exploring worlds beyond Earth, one dataset at a time.









