sunlabuiuc/PyHealth

A deep learning toolkit for healthcare AI: EHR (MIMIC, eICU, OMOP), clinical text, signals and imaging. 30+ models, reproducible pipelines.

What it solves

PyHealth simplifies the complex process of building and benchmarking clinical AI models. It removes the heavy lifting required to process raw electronic health records (EHR), clinical text, biosignals, and medical images, allowing researchers to go from raw data to a trained, evaluated model in about 15 lines of code.

How it works

The toolkit uses a modular five-stage pipeline:

  1. Datasets: Standardized loaders for major formats like MIMIC-III, MIMIC-IV, eICU, and OMOP-CDM.
  2. Tasks: Pre-defined clinical objectives like mortality prediction or drug recommendation, which can be customized with simple Python functions.
  3. Models: A library of over 33 deep learning models (including Transformers and RNNs) with a unified interface that allows you to swap models with a single line of code.
  4. Trainer: A standardized training loop that handles checkpoints and optimization.
  5. Metrics: Built-in evaluation tools for reproducible results, including patient-level data splits and confidence intervals.

Who it’s for

PyHealth is designed for clinical AI researchers and data scientists who need a reproducible, efficient way to build and benchmark machine learning models on healthcare data.

Highlights

  • Healthcare-first data layer: Includes built-in medical code mapping (ICD, NDC, ATC, RxNorm) and ontology lookup.
  • High performance: Uses Polars and Dask with on-disk caching, making data processing roughly 3x faster than pandas.
  • Extensive model library: Supports 33+ models including RETAIN, SafeDrug, GAMENet, and EHRMamba.
  • Independent utilities: Includes standalone modules for medical code tokenization and ontology mapping that can be used outside the main pipeline.

Related

  • Project
  • Project
  • Project
  • Project
  • Project