An AI-based pipeline and dashboard for automatically detecting exoplanet transit signals in noisy astronomical light-curve data. Transit photometry hunts for the tiny, periodic dips in a star's brightness caused by a planet crossing its disk. In crowded fields these signals are buried under detector noise and contamination from blended foreground/background sources, and they are easily confused with eclipsing binaries or starspots. This project pairs a deep-learning classifier with an interactive mission-control dashboard to surface and explain candidate transits.
| π Interactive Dashboard | Visualises the full detection workflow across five panels: raw light curve, AI pipeline diagram, denoised signal, transit probability over time, and a phase-folded detection summary. |
| π Three Input Modes | Feed the model a phase-folded image, a time,flux CSV, or a TESS TIC ID. CSV/TIC run the full pipeline server-side and repopulate every panel from the real data. |
| π¦ Batch & Export | Submit many inputs at once (multiple files or a list of TIC IDs); they process sequentially with a live progress bar, and all results download together as one JSON file. |
| π€ Live Model Inference | The trained ResNet18 classifier returns a verdict, confidence score, and per-class probability bars β updated in real time. |
| π§ Guided Onboarding | A first-visit welcome and an "Analyze Your Data" call-to-action point newcomers to the input panel; the default view is a clearly-labelled sample, not stored data. |
| π Help & Detail Views | Every section has a ? explainer and a fullscreen β€’ expand that opens an in-depth reference panel (and a detailed pipeline flowchart). |
| π¨ Design System | Single-screen dark layout, sharp corners, greyscale + electric blue (#00e8f7), subtle animations, and an icon splash/loading screen. Documented in DESIGN.md. |
| Layer | Technology |
|---|---|
| Backend | Python Β· Flask Β· gunicorn (production) |
| ML / Inference | PyTorch Β· torchvision (ResNet18) Β· Pillow |
| Frontend | HTML Β· CSS Β· Vanilla JavaScript Β· Chart.js |
| Analysis & Training | Lightkurve Β· Astroquery Β· matplotlib Β· NumPy |
| Fonts | Bitcount Prop Single (headings) Β· Ubuntu (body) |
The classifier is a ResNet18 fine-tuned on 224Γ224 RGB images of phase-folded light curves β black scatter on a white background β normalised with standard ImageNet statistics. The full training process is documented in model/tessnet.ipynb.
Raw TESS Data β BLS Period Search β Phase-fold β Render Image β ResNet18 Fine-tune
- Download TESS light curves via Lightkurve (SPOC pipeline).
- Clean β remove NaNs, sigma-clip outliers, flatten the trend.
- BLS periodogram β find the dominant period, epoch, and duration.
- Phase-fold the light curve and render it as a 224Γ224 PNG.
- Fine-tune a pre-trained ResNet18 with a custom classification head.
Trained weights ship as frontend/tess_resnet18_model.pth. Inference mirrors the notebook's predict_and_evaluate function exactly.
Class labels: The checkpoint outputs 2 classes but does not store their names. They default to
noise(index 0) andtransits(index 1), matching torchvision's alphabeticalImageFolderordering. If your training set used a different pair, update theCLASS_NAMESlist at the top offrontend/model_service.py.
isro-bah-2026/
β
βββ DESIGN.md # Visual & interaction design principles
βββ LICENSE # GNU GPL v3
βββ README.md
βββ render.yaml # Render deployment blueprint
β
βββ model/
β βββ tessnet.ipynb # Data preparation + ResNet18 training
β βββ sample_data/ # Example light-curve samples
β
βββ paper/
β βββ tessnet.tex # LaTeX source of the project paper
β βββ tessnet.pdf # Compiled paper
β
βββ frontend/
βββ app.py # Flask application & API routes
βββ model_service.py # Model loading, lazy init & inference
βββ pipeline.py # CSV/TIC β clean β BLS β fold β render β classify
βββ gunicorn.conf.py # Production WSGI server config
βββ requirements.txt
βββ tess_resnet18_model.pth # Trained ResNet18 weights (~45 MB)
β
βββ assets/
β βββ icon.png # App icon (favicon + loading splash)
β βββ tessnet.pdf # Paper, served via the "Read Paper" button
β
βββ templates/
β βββ index.html # Main dashboard template
β
βββ static/
βββ css/
β βββ style.css # Full design-system stylesheet
βββ js/
βββ data.js # Synthetic demo light-curve generator
βββ charts.js # Chart.js rendering + live-update API
βββ help.js # Help modal + fullscreen detail dialog
βββ details.js # Extended per-section reference content
βββ predict.js # Inputs β batch processing β live results + JSON export
βββ onboarding.js # First-visit welcome + "Analyze Your Data" CTA
βββ loader.js # Splash / loading overlay
Requires Python 3.9+
# 1. Clone the repository
git clone https://github.com/<your-org>/isro-bah-2026.git
cd isro-bah-2026/frontend
# 2. Create and activate a virtual environment (recommended)
python -m venv env
# Windows
env\Scripts\activate
# macOS / Linux
source env/bin/activate
# 3. Install dependencies
pip install -r requirements.txtrequirements.txt already pins the CPU-only PyTorch wheels (via the PyTorch
CPU index) to keep the install small. If you need a different build, install torch
and torchvision manually, e.g.:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpuStart the Flask dev server from the frontend/ directory:
python app.pyOpen http://127.0.0.1:5000 in your browser.
On Linux/Unix, serve the app with the bundled gunicorn config:
gunicorn -c gunicorn.conf.py app:app # serves on 0.0.0.0:8000The config uses 2 workers and a 120 s timeout (BLS period search and MAST
downloads are slow), binds to $PORT, and forces matplotlib's headless Agg
backend. Tune via WEB_CONCURRENCY, GUNICORN_TIMEOUT, and GUNICORN_BIND.
(gunicorn does not run on native Windows β use the dev server or waitress there.)
The repo ships a render.yaml blueprint (root dir frontend/,
start command gunicorn -c gunicorn.conf.py app:app). The index route is kept
lightweight β the model and analysis libraries load lazily on first use, not on
page load β so the worker boots fast. The full ML stack (torch + lightkurve +
matplotlib) needs more RAM than the free tier, so the blueprint requests the
Standard plan.
The dashboard opens on a clearly-labelled sample view (synthetic data β nothing is stored between visits). In the Detection Result panel, pick one of three input modes:
| Mode | Input | What happens |
|---|---|---|
| Image | A phase-folded light-curve PNG (black scatter, white background) | Classified directly by ResNet18; updates the verdict, confidence and probability bars. |
| CSV | A time,flux CSV |
Server flattens β BLS period search β phase-folds β renders the model image β classifies, then repopulates every panel from the real data. |
| TIC ID | A TESS TIC ID (e.g. 25155310) |
Downloads the SPOC light curve from NASA MAST and runs the full pipeline. Requires internet access. |
Every mode accepts multiple inputs (several files, or a comma/space-separated list of TIC IDs): they process sequentially with a progress bar, the dashboard updates live per item, and all results export together as one JSON file.
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Serves the dashboard. |
GET |
/api/model-status |
Returns model readiness and class labels as JSON. |
POST |
/predict |
Multipart image upload β JSON classification result. |
POST |
/analyze/csv |
Multipart file (time/flux CSV) β full pipeline result (params, classification, image, series). |
POST |
/analyze/tic |
Form field tic_id β downloads from MAST and runs the full pipeline. |
{
"ok": true,
"predicted": "transits",
"predicted_label": "Planetary Transit",
"confidence": 0.97,
"transit_detected": true,
"probabilities": [
{ "name": "transits", "label": "Planetary Transit", "p": 0.97 },
{ "name": "noise", "label": "Noise / No Transit", "p": 0.03 }
]
}Released under the GNU General Public License v3.0.