Source code for Ad Astra's exoplanet-detecting machine learning model (Developed for the NASA Space Apps Hackathon)
A World Away is an end-to-end platform that leverages machine learning to detect and analyze exoplanets using photometric data from the Kepler Space Telescope. Designed for both researchers and astronomy enthusiasts, the system provides powerful tools for exoplanet discovery, analysis, and education.
- Framework: React 19 + Vite
- Styling: Tailwind CSS + Tailwind Forms/Typography
- 3D Visualization: Three.js + React Three Fiber
- Data Visualization: Chart.js, D3.js
- State Management: React Hooks, Context API, React Query
- Routing: React Router v7
- Build Tool: Vite
- Framework: Flask 2.2.0
- Machine Learning: Scikit-learn 1.2.0+
- Scientific Computing: NumPy, SciPy, Pandas
- Astronomy Tools: Lightkurve, Astroquery
- API: RESTful endpoints with CORS support
- Containerization: Docker
- Data Analysis Pipeline
- Process raw Kepler light curve data
- Extract transit features and stellar parameters
- Generate comprehensive reports with confidence intervals
- Interactive Playground
- Visualize exoplanet flux charts
- Learn about detection methods
- Learn about habitability of exoplanets
-
Data Processing
- Light curve normalization and detrending
- Transit feature extraction
- Stellar parameter estimation
- Outlier detection and handling
-
Model Architecture
- Ensemble learning for robust predictions
- Feature importance analysis
- Confidence scoring for detections
-
Core Technologies
- React 19 with Vite for fast development and building
- Tailwind CSS for utility-first styling
- React Router for client-side navigation
-
Main Components
- ForResearchers.jsx: Interface for researchers to upload and analyze light curve data
- AboutPhysics.jsx: Educational content about astrophysics and exoplanet research
- AboutModel.jsx: Technical details about the ML model and its performance
- Playground.jsx: Interactive tools for exploring exoplanet concepts
-
State Management
- React Hooks for component-level state
- Context API for global state management
- React Query for server state and data fetching
-
Data Processing Pipeline
format-data.py: Processes raw light curve data and enriches it with stellar parametersstar_aggregator.py: Extracts statistical features from light curve dataml-model.py: Implements and trains the machine learning modelinput-test.py: Handles prediction on new data
-
Data Flow
- Raw light curve data →
format-data.py→ Enriched data - Enriched data →
star_aggregator.py→ Feature matrix - Feature matrix →
ml-model.py→ Trained model - New data →
input-test.py→ Predictions
- Raw light curve data →
- Flux Statistics: Mean, standard deviation, skewness, kurtosis
- Transit Characteristics: Depth, duration, ingress/egress times, symmetry
- Stellar Parameters: Effective temperature (Teff), radius, mass, surface gravity (logg), metallicity (feh)
- Accuracy and Balanced Accuracy
├── backend/
│ ├── input-test.csv
│ ├── detailed_data.csv # process light curves
│ ├── features.csv # extract features
│ ├── model/
│ │ ├── model.pkl # trained model
│ │ └── metrics.json # performance metrics
│ ├── format-data.py # data preprocessing
│ ├── ml-model.py # training
│ ├── star_aggregator.py # feature extraction
│ ├── input-test.py # prediction script
│ └── data/ # raw light curve data and test data
│
├── frontend/
│ └── src/
│ ├── components/ # reusable UI components
│ │ ├── calculator/ # habitability calculator components
│ │ ├── game/ # light curve game components
│ │ └── ui/ # base UI components (buttons, animations, etc.)
│ ├── pages/
│ │ ├── AboutModel.jsx # model technical details
│ │ ├── AboutPhysics.jsx # interact with the ML model
│ │ ├── ForResearchers.jsx # data analysis interface
│ │ └── Playground.jsx # interactive tools for non-technical users
│ ├── lib/ # utilities
│ │
│ ├── App.jsx
│ ├── main.jsx
│ └── App.css
│
├── .gitignore
├── LICENSE
└── README.md
CSV files should contain the following columns:
time: Timestamps of observationsflux: Measured brightness valuesflux_err: Measurement errorsstar_id: Identifier for the star (optional for single-star analysis)
- Node.js 18+ (for frontend)
- Python 3.9+ (for backend)
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/myrmlbst/NASA-AI-Challenge.git cd NASA-AI-Challenge -
Set up the backend
cd backend python -m venv venv source venv/bin/activate # On Windows: .\venv\Scripts\activate pip install -r requirements.txt
-
Set up the frontend
cd ../frontend npm install
-
Start the backend server
cd backend flask run --port 5050 -
Start the frontend development server
cd frontend npm run dev -
Access the application at
http://localhost:5173
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/FeatureName) - Commit your changes (
git commit -m 'Add FeatureName') - Push to the branch (
git push origin feature/FeatureName) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.