Source-linked AI summary

MIMIC-Extract: A Data Extraction, Preprocessing, and Representation Pipeline for MIMIC-III

Shirly Wang, Matthew B. A. McDermott, Geeticka Chauhan, Michael C. Hughes, Tristan Naumann, Marzyeh Ghassemi

arXiv:1907.08322v2cs.LGstat.ML

TL;DR

Healthcare machine learning lacks standardized processing frameworks that support reproducible use of complex EHR data. MIMIC-Extract transforms MIMIC-III records into standardized, time-series dataframes through clinically informed preprocessing and aggregation. The pipeline supports benchmark prediction tasks, has been used to reproduce many MIMIC-III studies, and remains extensible despite scope limitations from its design choices.

  • Problem

    Complex MIMIC-III EHR data and researcher-specific cohort and preprocessing choices create barriers to entry and hinder reproducibility.

  • Method

    MIMIC-Extract is an open-source pipeline that extracts and preprocesses MIMIC-III data into flexible representations of static variables, time-varying measurements, interventions, and outcomes.

  • Results

    MIMIC-Extract has been used as the foundation for reproducing many recent machine-learning studies of MIMIC-III data and supports diverse clinical prediction tasks.

  • Takeaways & Limitations

    The pipeline is intended to support reproducible benchmark development and progress on new machine-learning tasks using clinically relevant MIMIC-III data.

  • Takeaways & Limitations

    Hourly bucketing loses raw temporal granularity and time-of-day information, while manually curated clinical groupings limit extensibility to new laboratories and vital signs.

Abstract

from arXiv · show

Robust machine learning relies on access to data that can be used with standardized frameworks in important tasks and the ability to develop models whose performance can be reasonably reproduced. In machine learning for healthcare, the community faces reproducibility challenges due to a lack of publicly accessible data and a lack of standardized data processing frameworks. We present MIMIC-Extract, an open-source pipeline for transforming raw electronic health record (EHR) data for critical care patients contained in the publicly-available MIMIC-III database into dataframes that are directly usable in common machine learning pipelines. MIMIC-Extract addresses three primary challenges in making complex health records data accessible to the broader machine learning community. First, it provides standardized data processing functions, including unit conversion, outlier detection, and aggregating semantically equivalent features, thus accounting for duplication and reducing missingness. Second, it preserves the time series nature of clinical data and can be easily integrated into clinically actionable prediction tasks in machine learning for health. Finally, it is highly extensible so that other researchers with related questions can easily use the same pipeline. We demonstrate the utility of this pipeline by showcasing several benchmark tasks and baseline results.

INTRODUCTION

MIMIC-Extract addresses technical and reproducibility barriers in using MIMIC-III by providing an extensible pipeline that converts complex ICU records into standardized, time-series data for machine learning.

  • MIMIC-III contains de-identified EHRs from 53,423 critical-care patients, but its complexity and cohort-extraction choices make analysis technically challenging and hinder reproducibility.
  • MIMIC-Extract is an open-source pipeline for extracting, preprocessing, and representing static, time-varying, intervention, and outcome data from MIMIC-III.
  • The pipeline standardizes laboratory and vital-sign representations, supports clinically meaningful interventions and outcomes, and preserves clinical time-series structure for prediction tasks.
  • The pipeline has served as the foundation for reproducing many recent machine-learning studies using MIMIC-III data.
  • MIMIC-Extract produces a generic cohort and output tables that maintain time-series data while providing aggregated cohort featurization, allowing adaptation across prediction tasks.

Variable Selection

MIMIC-Extract selects static and time-varying variables, preserves selected raw static values, and applies clinically informed preprocessing to make laboratory and vital-sign data more consistent and usable.

  • Static Variables: The pipeline extracts static demographics, admission information, in-ICU and in-hospital mortality, and total ICU length of stay.
  • Time-Varying Vitals and Labs: By default, MIMIC-Extract provides 104 clinically aggregated time-series variables covering vital signs and laboratory test results, with optional filtering by non-missingness.
  • Variable Selection: MIMIC-Extract includes all 12 time-varying features from Purushotham et al.’s small curated set of 17 features, while omitting selected diagnosis and prescription features.
  • Unit Conversion and Outlier Detection: Measurements are converted into consistent units, including kilograms, centimeters, and degrees Celsius, through an extensible conversion process.
  • Unit Conversion and Outlier Detection: Values outside clinically reasonable variable ranges are treated as missing, and the pipeline reports the proportion of detected outliers at the aggregated-feature level.
  • Unit Conversion and Outlier Detection: At the time of writing, MIMIC-Extract uniquely standardizes outlier detection and removal among the compared benchmarking pipelines.

Hourly Aggregation

MIMIC-Extract converts sparse, software-dependent ICU records into hourly representations of measurements and interventions. It groups equivalent clinical items and encodes treatment exposure as hourly binary indicators.

  • Measurements: Hourly discretization makes infrequent laboratory and vital-sign measurements denser and more compatible with time-series machine-learning methods.The raw database has fine-grained timestamps, but many measurements occur only every few hours.
  • Measurements: A manually curated clinical taxonomy groups semantically equivalent ItemIDs, such as HeartRate entries from different EHR systems.The same clinical concept can receive different ItemIDs across CareVue and MetaVision.
  • Interventions: Hourly intervention features record whether mechanical ventilation, vasopressors, and fluid boluses were provided during each hour.The representation uses binary treatment indicators, with missing data treated as non-treatment.
  • Interventions: The intervention representation includes individual vasopressors and an overall vasopressor-use indicator, alongside crystalloid and colloid boluses.Crystalloid and colloid boluses are extracted but are not predicted because they are often considered less aggressive alternatives to vasopressors.
  • Interventions: Table 3 reports mean hours across patients for continuous interventions and bolus administration, with nine distinct vasopressor drugs plus a general vasopressor category.Mean Hours counts active hours for continuous treatments and administration hours for intermittent boluses.

Extensibility of Data Pipeline

MIMIC-Extract is designed as a generic, configurable pipeline that can be adapted to different prediction tasks and research questions. Its extensibility comes from reusable cohorts, configurable extraction settings, resource files, and modifiable SQL queries.

  • Configurable extraction: Researchers can tailor extraction by changing keywords that control cohort restrictions, feature grouping, and missingness thresholds.These settings include age and ICU-duration limits, raw versus clinically aggregated features, and minimum non-missingness requirements.
  • Configurable extraction: Resource files can be modified to customize variable groupings, extracted variables, and outlier-detection thresholds for specific studies.The pipeline uses separate files for variable mapping and outlier correction.
  • Extensible outputs: Additional static variables, measurements, and treatment labels can be added by modifying the extraction code or embedding SQL queries.The paper gives acuity scores and treatment fluid amounts as examples of extensible outputs.
  • Extensible outputs: The framework focuses on general data-pipeline workflow rather than task specifics, supporting use with other clinical datasets.Its outputs can also be extended to include additional MIMIC-III information beyond static variables, vital signs, laboratory measurements, and interventions.
  • Generic cohort: A single generic cohort supports varied prediction tasks without imposing task-specific input features, targets, or inclusion criteria.This design is intended to make the pipeline more extensible and adaptable than task-specific cohorts.

OUTPUT COHORT CHARACTERIZATION

MIMIC-Extract produces a default cohort of 34,472 patients with diverse demographic and admission coverage. Researchers can obtain different cohorts by changing cohort-property requirements.

  • 34,472 patients comprise the default MIMIC-Extract cohort.
  • The default cohort provides diverse demographic and admission coverage.
  • Alternative cohort definitions, such as minimum-age requirements, can produce different cohorts.
  • Appendix A reports feature distributions and missingness rates for raw ItemIDs and grouped clinical aggregates.

BENCHMARK TASKS AND MODELS

The benchmark suite spans static mortality and long-length-of-stay classification tasks, using clinically grouped first-24-hour data and several baseline model families. A six-hour gap separates measurements from forecasted events to reduce temporal label leakage and preserve clinical response time.

  • Task Definitions: The benchmarks include in-ICU and in-hospital mortality plus LOS > 3 days and LOS > 7 days classification tasks.
  • Task Definitions: All static tasks use clinically grouped labs and vitals from the first 24 hours for patients with at least 30 hours of data.
  • Task Definitions: A six-hour gap between the latest measurement and forecasted event is used to prevent temporal label leakage.
  • Models Benchmarked: Logistic regression, random forest, and GRU-D models are profiled across the tasks.
  • Models Benchmarked: Hyperparameters are selected by random search, with fewer samples for GRU-D because it is more computationally intensive.
  • Results: AUROCs align with prior literature, while random forests often have poor F1 despite competitive AUPRC and GRU-D often performs relatively better on AUPRC.

Clinical Intervention Prediction

MIMIC-Extract supports clinically actionable intervention prediction by representing recent time-series data and predicting intervention changes after a response-enabling gap. CNN, LSTM, and random forest baselines are evaluated, with random forests outperforming the neural models and prior reported results.

  • Task Definition: A six-hour input-to-forecast gap follows a six-hour sliding input window for intervention prediction.
  • Task Definition: Intervention prediction targets the onset, offset, stay-on, and stay-off states of treatments.
  • Data Pre-processing: Intervention features include time-varying labs and vitals, five static variables, and time-of-day.
  • Models Benchmarked: Logistic regression, random forest, CNN, and LSTM models are benchmarked for intervention prediction.
  • Results: CNN and LSTM perform similarly to prior studies despite excluding clinical notes, while random forests outperform both and prior literature results.

DESIGN CHOICES AND LIMITATIONS

MIMIC-Extract prioritizes a broad, clinically meaningful cohort and representation, but its design choices constrain applicability. Excluded features, hourly aggregation, and manually curated groupings limit some tasks and extensions.

  • The pipeline may be less relevant for tasks that differ significantly from its presented benchmarks.
  • It excludes prescriptions, selected labs and vitals, treatments or interventions, and notes from its default features.
  • Some excluded features can be externally joined, while prescriptions are excluded partly because of robustness concerns.
  • Hourly bucketing loses raw temporal granularity and time-of-day information while regularizing irregular medical time series.
  • Manually curated clinical groupings limit extension to new laboratory and vital-sign variables.

A FEATURE SET

The feature set lists clinical variables with summary statistics, presence measures, and source ItemIDs or tables. It includes physiologic, laboratory, respiratory, and blood-measurement features, with some variables represented across multiple data sources.

  • Multiple sources: Several features combine measurements from multiple charting or laboratory sources, including cardiac output, creatinine, and respiratory rate.Cardiac output appears with separate fick and thermodilution entries, while creatinine and respiratory-rate entries include multiple source identifiers.
  • Clinical contexts: The entries retain distinct clinical contexts for measurements, including urine, pleural, ascites, body-fluid, and set-point variables.Examples include urine calcium and creatinine, pleural lactate dehydrogenase, ascites red blood cell count, body-fluid creatinine, and set respiratory-rate or PEEP variables.
  • Physiologic measurements: The set covers vital signs and respiratory variables such as heart rate, blood pressure, oxygen saturation, respiratory rate, airway pressures, and tidal volume.Examples include heart rate, diastolic and systolic blood pressure, mean blood pressure, oxygen saturation, respiratory rate, peak inspiratory pressure, PEEP, and observed tidal volume.
  • Feature organization: The feature table organizes each variable by summary statistics, presence values, and source metadata such as ItemID and database table.The column labels include low, high, average, standard deviation, presence measures, ItemID, and Table/DB fields.
  • Laboratory measurements: Laboratory features include electrolytes, blood gases, hematology, coagulation, renal markers, glucose, and lipid measurements.Examples include calcium, chloride, potassium, sodium, pH, carbon dioxide, hematocrit, hemoglobin, creatinine, glucose, cholesterol, and prothrombin-time measures.
Loading 1907.08322v2…