Back to projects

E2E-VarNet MRI Reconstruction

A rigorously honest reproduction of E2E-VarNet, plus a free signal that knows when it's out of its depth.

SWE (AI/MLOps)Medical ImagingMRI ReconstructionPyTorchUncertainty EstimationMLOps

A production inference stack: a Gradio and FastAPI service on a HuggingFace Space (ZeroGPU), serving a K=2 checkpoint-ensemble model behind a REST endpoint, called by a React, Vite, and Tailwind frontend deployed on Vercel. Drift detection is wired end to end, an uncertainty threshold flags out-of-distribution scans directly in the API response, backed by an Evidently AI monitor, Prometheus and Grafana dashboards, and a GitHub Actions quality gate that blocks regressions below a baseline-relative SSIM threshold.

Live demo frontend: e2e-varnet-mri-reconstruction.vercel.app
Worst, median, and best-case reconstructions vs ground truth (T=8)
GAP 1 (cascade depth vs OOD SSIM) and GAP 2 (uncertainty vs error) summary
Training convergence: T=4 vs T=6
GAP 3: self-supervised test-time adaptation trajectories (negative result)

What I built

  • Deployed inference as a Gradio 5 and FastAPI service on a HuggingFace Space with ZeroGPU, exposing POST /reconstruct and GET /health endpoints called by a separately deployed frontend.
  • Built a React, Vite, and Tailwind frontend on Vercel that uploads a fastMRI .h5 file, calls the REST endpoint, and renders the reconstruction, uncertainty map, and metrics returned as JSON.
  • Wired the checkpoint-ensemble uncertainty scalar into an automatic drift flag (threshold 0.018) returned directly in the API response, backed by an offline Evidently AI k-space feature-drift monitor.
  • Stood up local observability with Prometheus and Grafana (RED metrics plus an uncertainty gauge) and an MLflow-backed experiment registry with a backfill script for historical runs.
  • Wrote a CPU-only quality gate (pytest, no GPU required) enforcing a baseline-relative SSIM threshold, run automatically through GitHub Actions on every push.
  • Built a resumable, checkpoint-based training loop that survived repeated session disconnects across a Kaggle-to-Vast.ai GPU migration, recovering full model, optimizer, and epoch state each time.

Tech stack

SWE (AI/MLOps)Medical ImagingMRI ReconstructionPyTorchUncertainty EstimationMLOps

Key results

1.54x

OOD drift signal

[1.35x, 1.74x]

Bootstrap 95% CI

0.7607

Knee SSIM (T=8)

0.6773

Brain SSIM (T=8, OOD)

Back to all projects