JWST Gas Morphology Classifier for Binary Evolution
Scientific Machine Learning with Simulated JWST Data
I built a PyTorch-based machine learning pipeline to classify gas morphologies around binary star systems using simulated JWST NIRCam observations. The model consumes 4-channel multi-band images (F200W–F444W) and predicts one of five morphology classes, spiral, shell, bipolar outflow, irregular, or no gas, each corresponding to distinct binary interaction regimes.
The Scientific Context
Binary star systems can transfer mass between companions, producing distinct gas structures visible in infrared wavelengths. These morphologies encode information about:
- Orbital parameters (separation, eccentricity)
- Mass transfer history
- Evolutionary state
- Potential gravitational-wave progenitor pathways
Traditional analysis requires manual inspection by expert astronomers. With JWST now operational and producing high-resolution NIRCam data, an automated classification system enables large-scale surveys and statistical studies of binary evolution.
Why Simulation-Based Training?
Real JWST observations of resolved gas morphologies around binaries are limited and rarely come with ground-truth labels. This is a classic problem in space science, high-quality data exists, but labeled training sets do not.
The solution: build a synthetic data pipeline that emulates JWST-resolved structures using astrophysical simulation outputs, then train on physically plausible examples. This approach trades perfect realism for abundant labeled data and enables controlled experimentation.
Model Architecture & Performance
Final Results:
- 92% accuracy on held-out test set (1,000+ simulated images)
- Macro-F1 = 0.91 (balanced performance across all classes)
- +6.7% performance gain from physics-motivated data augmentation
Network Design
- Input: 4-channel multi-band JWST NIRCam images (F200W, F277W, F356W, F444W)
- Architecture: Custom CNN with residual connections and channel attention
- Output: 5-class softmax (spiral, shell, bipolar, irregular, no gas)
- Training: Cross-entropy loss with class weighting to handle imbalance
Physics-Informed Augmentation
Standard augmentation (flips, rotations) improved generalization, but astrophysics-aware transformations gave the largest boost:
- Brightness scaling (simulates distance variations)
- PSF convolution (emulates telescope optics)
- Noise injection (matches JWST detector characteristics)
- Viewing angle perturbations (accounts for 3D projection effects)
These augmentations don’t just add variety, they encode physical invariances the model should learn.
Model Interpretability & Failure Mode Analysis
Rather than treating this as a black-box classifier, I built interpretability tools to diagnose physically meaningful failures:
1. Latent Space Analysis (t-SNE)
Visualizing the model’s learned representations showed:
- Clear clustering by morphology class
- Boundary confusion between spiral/shell structures (expected, they share physical origins)
- Distinct separation of “no gas” from structured morphologies
2. Silhouette Scores
Quantified cluster quality in latent space (higher = better-defined classes). This revealed which morphologies are intrinsically harder to distinguish.
3. Confusion Matrix Analysis
Showed the model’s failure modes align with astrophysical ambiguity:
- Spiral vs. shell confusion, both arise from circumbinary disks
- Irregular misclassifications, inherently noisy, low S/N examples
These diagnostics demonstrate that the model’s errors are physically interpretable, not random.
System Design: Built for Extension
This is Phase 1 of a broader research effort. The pipeline is designed to support:
- Domain Adaptation: Transfer learning from simulated → real JWST data
- Active Learning: Human-in-the-loop labeling for borderline cases
- Metadata Integration: Conditioning on orbital parameters, distances, stellar types
- Multi-Task Learning: Joint prediction of morphology + physical parameters
The codebase preserves astrophysical metadata alongside images, enabling future work to leverage simulation ground truth for regression tasks or physics-constrained architectures.
Why This Matters for ML/Space Roles
This project demonstrates key skills for space-industry ML engineering:
- Working Under Data Scarcity: Most space missions don’t have ImageNet-scale datasets. You need to be creative.
- Simulation-Based Inference: When real data is sparse, synthetic data + domain knowledge bridges the gap.
- Scientific Validation: ML for science requires interpretability, not just accuracy.
- Forward-Looking Design: Systems should enable future research, not just solve one problem.
These are the same challenges faced in:
- Satellite image analysis (limited labeled examples)
- Anomaly detection in spacecraft telemetry (rare failure modes)
- Autonomous navigation (simulation-to-reality transfer)
- Exoplanet characterization (indirect observations, model-dependent inference)
Technical Stack
- PyTorch: Model architecture, training, evaluation
- NumPy / SciPy: Image processing, augmentation
- Matplotlib / Seaborn: Visualization
- scikit-learn: Evaluation metrics, latent space analysis
- Astropy: FITS file handling, coordinate transformations
- Custom Simulation Pipeline: Procedural generation of gas morphologies
Current Status
Phase 1 Complete, System is production-ready for simulated data and designed for extension to real JWST observations.
Next steps:
- Acquire real JWST NIRCam data from archival programs
- Fine-tune model using transfer learning
- Build uncertainty quantification for borderline classifications
- Extend to regression: predict binary orbital parameters from morphology
Code Repository
View on GitHub (link to be added)
Key Insight, In space science, the data you need often doesn’t exist yet. Success requires building systems that bridge simulation and reality, and designing ML pipelines that preserve the physics of the problem.