Overview & Methods Status
The health engine of the Astronaut Health Intelligence Platform (AHI) lives in frontend/web/src/engine/. It turns simulated device readings and check-ins into a status per metric, body region and astronaut, a transparent risk score, short forecasts, recommendations and alerts. It is pure TypeScript, runs in the browser and is unit tested with vitest.
Statistics first
Status, risk and alerts come only from classical statistics and explicit rules with an id. One experimental machine learning detector (a per astronaut Isolation Forest) adds an informational "Unusual combination" note and never changes a status. The optional Ask AHI assistant explains engine outputs and computes nothing. Why: AI and analytics approach.
Pipeline
| Stage | Page | Code |
|---|---|---|
| Personal normal per metric and context | Personal baseline | baseline.ts |
| Acute deviation, drift, persistence, data quality | Anomaly detection | anomaly.ts |
| Combined rules, score, confidence, regions | Risk assessment | risk.ts |
| Projection with interval, 24 h to 15 days | Forecasting | forecast.ts |
| Eye (SANS) and hearing exams | Eye health and hearing | assess.ts |
| Mission profile, dose, space weather | Mission profiles | profiles.ts |
| Experimental multivariate note | Anomaly detection | multivariate.ts |
| Next steps, who can act, what-if | Recommendations, autonomy and what-if | recommendations.ts |
| Alert lifecycle and escalation | Alerts and escalation | alerts.ts |
| Where the data comes from | Device simulation and scenarios | adapters.ts |
| Check-ins and communication delay | Self-report and Earth link | comms.ts |
| Every fixed number | Thresholds and limitations | config.ts |
How the engine is wired into the app (clock, publishing, bounded memory) is in Engine and simulation architecture.
Versions
| Component | Version string (in config.ts) |
|---|---|
| Engine | ahi-engine 2.0.0 |
| Risk model | AHI transparent rules v2.0 (demo) |
| Baseline | robust-baseline v1 (median/MAD) |
| Forecast | Damped Holt linear smoothing v1 |
| Recommendation catalog | rec-catalog v2.0 |
| CUSUM | Tabular CUSUM on hourly mean robust z v1 |
| Multivariate detector | ahi-iforest-ts v1 (experimental, PCA whitened) |
Versions are stored on every baseline, risk assessment, prediction and recommendation, so each output says which method produced it.
Methods status
The product spec (section 9.3) lists candidate methods. This table is the audit of that list against the code: statistics first, machine learning only where the statistics leave a gap, and then only as an experimental, informational layer.
| Method | Purpose | Status | Where |
|---|---|---|---|
| Rolling robust baseline (median, MAD, p05 / p95, context buckets) | Personal normal | Implemented | Personal baseline |
| Robust z-score | Acute deviation from the personal normal | Implemented | Anomaly detection |
| EWMA of z | Slow, persistent drift | Implemented | Anomaly detection |
| Persistence windows | Repeated daily deviations | Implemented | Anomaly detection |
| Data quality and staleness | Missing, stale or questionable data | Implemented | Anomaly detection |
| Transparent rule based risk score 0 to 100 | Attention level | Implemented | Risk assessment |
| Damped Holt linear smoothing with 80% interval | Short term projection | Implemented | Forecasting |
| Band exit and recovery rule | Time until leaving the normal range | Implemented | Forecasting |
| Deterministic noise free what-if projection | Discussion of an action | Experimental | Recommendations |
| Moving average / rolling median | Smoothing | Implemented 30 min window means feed forecasts; the acute check uses a rolling median of 3 readings | Forecasting |
| IQR rule | Outlier detection | Not implemented robust z covers it | |
| CUSUM | Small but steady shifts that stay under the EWMA rule | Implemented Watch only | Anomaly detection |
| Isolation Forest | Unusual combination of several signals | Experimental per astronaut, informational only, spec US-019 | Anomaly detection |
| ARIMA | Time series forecasting | Not implemented | AI and analytics |
| XGBoost | Risk from a labeled dataset | Not implemented no labeled data | AI and analytics |
| SHAP | Model explanation | Not implemented rules explain themselves | AI and analytics |
| Survival analysis | Time to event | Not implemented |
Design principles
- Personal first. Status compares each person with their own baseline; fixed thresholds are a demo safety net.
- Explainable by construction. Every hit has a rule id, a plain-language label and a weight; the score formula is public. The experimental detector lists its top contributing signals.
- Missing is not normal. No valid value within a stale window is
NO_DATA, and it lowers confidence. - Bounded and streaming. O(1) work per sample per metric; histories and logs have caps.
- Deterministic. Seeded simulation; the same seed gives the same results (tested).
Next steps
- Personal baseline
- Validation results: what the evaluation measured.