M

← Back to Projects
Project 04v4.0.0-alpha

NeuroSynth

Clinical AI Decision Support Platform for Neurological Disease Diagnosis

0.9408
Production AUC
6
Diseases Classified
48mo
Forecast Horizon
11
Docker Services
15K
Training Samples
0.020
Calibration Error
The Problem

Neurological diseases — Alzheimer's, Parkinson's, MS, Epilepsy, ALS, Huntington's — share overlapping biomarker profiles, making early differential diagnosis difficult. Existing tools produce opaque predictions without explanation, lack longitudinal trajectory information, and fail to meet clinical documentation and regulatory traceability standards required for real-world clinical deployment.

The Solution

NeuroSynth ingests a 31-feature clinical vector and outputs: (a) calibrated multi-disease risk probabilities across all 6 conditions with ICD-10 codes, (b) 48-month LSTM progression trajectory at 8 time points with confidence bands, (c) causal intervention recommendations showing which modifiable risk factors to address, (d) SHAP / LIME / counterfactual explanations satisfying clinician interpretability needs, and (e) a Claude claude-sonnet-4-6 SOAP clinical note with hallucination guard (±12% tolerance on all stated percentages) and FHIR R4 export. The entire pipeline meets FDA Software as a Medical Device (SaMD) standards with SHA-256 hash-chained audit logs, PSI + KS drift detection with auto-retrain triggers, and CI-enforced AUC ≥ 0.92 promotion gates.

Architecture

11-service Docker Compose: React 18 UI (Vercel) → FastAPI backend (port 8000, Render) → PostgreSQL 16 (Neon, 6 tables) + Redis 7 broker/cache → Celery worker (async retrain + chord aggregation) → dedicated model-server (port 8001, GPU-optional) → Kafka KRaft (biomarker event streaming) → Prometheus (15 metrics) + Grafana (10-panel dashboard) + node/redis/postgres exporters. Model artifacts stored on Cloudflare R2 (fetched on startup). Production K8s: EKS g4dn.xlarge GPU nodes via Terraform, HPA scaling 2–8 pods on CPU + latency. Frontend demo mode serves realistic simulated data when backend is unreachable.

Key Features
Calibrated 5-Model Ensemble (AUC 0.9408)

Stacks RandomForest (500 trees), GradientBoosting, ExtraTrees, LogisticRegression, and LightGBM with an out-of-fold meta-learner and isotonic calibration — reducing Expected Calibration Error from 0.109 to 0.020. Hard promotion gate requires AUC ≥ 0.92 in CI before any model version is deployed.

48-Month Longitudinal Trajectory Forecasting

A PyTorch LSTM predicts disease progression at 8 future time points (6, 12, 18, 24, 30, 36, 42, 48 months) with upper and lower confidence bands. Results render as an interactive Recharts area chart in the React UI, giving clinicians a visual progression timeline per patient.

Explainability Triad: SHAP + LIME + Counterfactuals

Every inference returns SHAP waterfall attributions (top-10 features), LIME perturbation-based local explanations with direction indicators, and up to 5 counterfactual 'what-if' recommendations showing exactly which feature changes would reduce the patient's risk score and by how much.

Claude LLM SOAP Report with Hallucination Guard

ClinicalReportGeneratorV3 calls claude-sonnet-4-6 to write structured SOAP clinical notes with ICD-10 codes. A post-generation verifier checks every stated percentage against the inference payload (±12% tolerance) — falling back to a Jinja2 template if verification fails — ensuring the note never contradicts the model output.

Real-Time Biomarker Streaming + 3D Brain Visualization

A Server-Sent Events endpoint streams AR(1)-driven wearable vitals every 2 seconds. A Three.js / react-three-fiber procedural brain mesh is colored by aggregated SHAP values mapped to anatomical regions via a custom brain atlas, giving clinicians a spatial view of which areas drive the prediction.

FDA-Grade MLOps: Drift Detection, Fairness & Audit Trail

PSI + KS drift detection with 4-tier severity auto-triggers Celery retraining on CRITICAL. Fairness auditing enforces Demographic Parity Ratio and Equalized Odds Ratio in [0.80, 1.25] across age, sex, and ethnicity. A SHA-256 hash-chained audit_log table provides tamper-evident FDA 21 CFR Part 11 / IEC 62304 compliance.

Tech Stack
FastAPI 0.111Python 3.11Celery 5.4asyncpgReact 18 + ViteTypeScript 5.5Three.js + R3FRecharts + D3PostgreSQL 16Redis 7PyTorch 2.2 (LSTM)XGBoostCatBoostLightGBM 4.3scikit-learn 1.4SHAP + LIMEMAPIE (Conformal)Claude claude-sonnet-4-6 APIDoWhy (Causal)Docker Compose (11 svc)Kafka (KRaft)Prometheus + GrafanaHelmTerraformKubeflowVercel + Render + Neon
backendfrontendmldbinframobile