ExoDetect AI is a high-performance, full-stack exoplanet detection and analysis web application designed for the ISRO Bharatiya Antariksh Hackathon. It leverages NASA's Kepler Space Telescope light curve archives and an integrated machine learning classifier to identify orbiting exoplanets.
-
Genuinely Trained Machine Learning Classifier:
- Performs real-time classification using an integrated Scikit-Learn Random Forest Classifier model trained on statistical and spectral features derived from light curves (including standard deviation, flux ranges, downsampled signatures, and Box Least Squares transit parameters).
-
Transit Parameter Extraction:
- Computes orbital period, transit depth, estimated planet radius (in Earth Radii
$R_\oplus$ ), and transit duration on-the-fly using a fast, vectorized Box Least Squares (BLS) periodogram solver.
- Computes orbital period, transit depth, estimated planet radius (in Earth Radii
-
Light Curve Format Auto-Detection:
- Supports official NASA Kepler format (row-based flux values), generic column-based CSVs (
timeandfluxcolumns), and raw sequence inputs (no headers).
- Supports official NASA Kepler format (row-based flux values), generic column-based CSVs (
-
Stunning Interactive Visualizations:
- Renders interactive Plotly.js charts featuring:
- Raw Flux: the original noisy light curve.
-
Smoothed Flux: high-frequency instrument noise filtered out via a 1D Gaussian kernel (
$\sigma=10$ ). - Phase Folded View: Aligned transit events showing the U-shape crossing with cyan/gold highlights.
- Renders interactive Plotly.js charts featuring:
-
Session History Persistence:
- Automatically synchronizes exoplanet detection history to the browser's
localStorageso results persist across page refreshes.
- Automatically synchronizes exoplanet detection history to the browser's
-
DevOps & Production Readiness:
- Supports Docker and Docker Compose containerization.
- Comprehensive environment variable configs (
.env) for REST endpoints, ports, hosts, and CORS restrictions. - Robust automated unit test suite.
graph TD
User([User]) -->|Uploads CSV| Frontend[React Frontend]
User -->|Loads Demo| Frontend
subgraph Frontend App
Vite[Vite Dev Server] --> React[React UI Components]
React -->|History| LS[(Browser LocalStorage)]
React -->|Plotly.js| Chart[Interactive Charts]
end
Frontend -->|POST /api/predict| Backend[Flask API Server]
Frontend -->|GET /api/sample| Backend
subgraph Flask Backend
Parser[Format Auto-detector] --> Preprocess[Gaussian Smoothing & Standardization]
Preprocess --> BLS[Box Least Squares Periodogram]
Preprocess --> Extract[Feature Extractor]
BLS --> Extract
Extract -->|Feature Vector| ML[Random Forest Classifier]
ML -->|Predict & Probability| Response[JSON Result Structure]
end
Backend -->|JSON Data| Frontend
- Frontend: React.js + Tailwind CSS (v4) + Lucide React + Plotly.js
- Backend: Python Flask REST API + NumPy + SciPy + Pandas + Scikit-Learn + Joblib
- Containerization: Docker + Docker Compose
exoplanet-detector/
βββ backend/
β βββ app.py # Flask application server
β βββ model.py # ML prediction classifier (loads model.pkl)
β βββ train.py # Training pipeline (generates synthetic dataset & model.pkl)
β βββ preprocess.py # Format detection & Gaussian filter
β βββ bls.py # Box Least Squares periodogram calculations
β βββ test_backend.py # Unit tests for backend features
β βββ Dockerfile # Backend container configuration
β βββ requirements.txt # Python dependencies
β βββ .env.example # Example environment variables
β βββ sample_data/ # Kepler demo csv files
βββ frontend/
β βββ index.html
β βββ vite.config.js # Vite configuration
β βββ postcss.config.js
β βββ Dockerfile # Frontend container configuration
β βββ .env.example
β βββ src/
β βββ main.jsx
β βββ App.jsx # App wrapper & notification system
β βββ index.css
β βββ components/ # UI Components (Starfield, Plotly Chart, ResultCard)
β βββ pages/ # Page Containers (Home, Detector, HowItWorks, About)
βββ docker-compose.yml # Service orchestrator
βββ .gitignore
βββ README.md
Make sure you have Docker and Docker Compose installed:
# Build and spin up both services
docker-compose up --buildThe React frontend will be available at http://localhost:5173 and the Flask backend at http://localhost:5000.
cd backend
# Install dependencies
python -m pip install -r requirements.txt
# (Optional) Retrain the machine learning model
python train.py
# Run Flask server
python app.pyNote: Create a .env file in the backend/ folder based on .env.example to customize ports and host bindings.
cd frontend
# Install Node.js dependencies
npm install
# Run Vite development server
npm run devNote: Create a .env file in the frontend/ folder pointing VITE_API_URL to your Flask endpoint (e.g. http://localhost:5000).
A Python unit test suite is included to verify exoplanet classification and preprocessing pipelines:
cd backend
python -m unittest test_backend.py-
GET /api/health- Description: Returns the API status and checks if the model weights are loaded.
- Response:
{ "model_loaded": true, "status": "healthy", "version": "1.0.0" }
-
GET /api/sample?name=<kepler69c|kepler22b|normal>- Description: Loads the selected Kepler target CSV file, computes physical parameters, runs the classifier, and returns analysis results.
- Response:
{ "star_id": "Kepler-69c (Confirmed Planet)", "has_planet": true, "confidence": 73.3, "transit_depth_percent": 0.157, "orbital_period_days": 8.9, "planet_radius_earth": 43.23, "transit_duration_hours": 3.2, "time_array": [...], "raw_flux": [...], "smoothed_flux": [...] }
-
POST /api/predict- Description: Accepts a custom uploaded
.csvfile in a multipart form under thefilefield. Automatically parses structure, filters instrument noise, runs the BLS transit solver, and outputs ML prediction results. - Response: Matches the sample response structure.
- Description: Accepts a custom uploaded
Contributions to ExoDetect AI are welcome! Please follow these guidelines:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'feat: add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2026 ExoDetect AI Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.