The problem
Next-generation observatories will produce far more spectra than astronomers can fit by hand. Trained CNNs can infer temperature, gravity, metallicity and C/O ratio in milliseconds instead of slow grid-based retrieval, but a model that can't be interrogated is of little use to a scientist. My job was to make the predictions auditable.
Approach
- Package architecture: DataMaster (loading, splitting, scaling, feature engineering), DeepTrainer (tuned TensorFlow CNNs), Predictor (observational spectra → parameters with uncertainty), StatVisAnalyzer (χ² tests, confidence intervals, reporting) and LIMEXplainer, my module.
- Spectra are neither images nor tables: neighbouring wavelengths are strongly correlated, and the meaningful unit is a band, not a pixel. I redesigned LIME's perturbation step around contiguous wavelength segments.
- LIMEXplainer pipeline: segment the spectrum into bands → perturb by masking bands (mean, zero or noise) → predict each variant with the CNN → weight by proximity (configurable kernel width) → fit a sparse linear surrogate whose coefficients give per-band importance → aggregate across instances to find bands that consistently drive a parameter.
- One explanation per predicted parameter, with bands that raise or lower the estimate. Because the influential bands line up with physically meaningful spectral features, the plots also serve as a sanity check on what the network has learned.
- Collaborated through GitHub code review and CI/CD with the NASA Ames team (HWO AI/ML working group).
Result
Published in the Journal of Open Source Software (2024; arXiv:2407.16917), released on PyPI under GPL-3.0, and part of the Habitable Worlds Observatory AI/ML working group's tooling.