|
Download README.md from leoshen/RealICU: direct link, hf CLI and curl.
- Browser
- Download file 10.2 kB
-
https://huggingface.co/datasets/leoshen/RealICU/resolve/main/README.md
- Command line
-
hf download hf://datasets/leoshen/RealICU/README.md
-
curl -L -o README.md https://huggingface.co/datasets/leoshen/RealICU/resolve/main/README.md
10.2 kB
| pretty_name: RealICU | |
| license: other | |
| license_name: physionet-credentialed-health-data-license-1.5.0 | |
| license_link: https://physionet.org/about/licenses/physionet-credentialed-health-data-license-150/ | |
| language: | |
| - en | |
| tags: | |
| - medical | |
| - clinical | |
| - intensive-care | |
| - electronic-health-records | |
| - benchmark | |
| - llm-agents | |
| size_categories: | |
| - n<1K | |
| configs: | |
| - config_name: icu_stays | |
| data_files: trajectories/icu_stay.parquet | |
| - config_name: events | |
| data_files: trajectories/events.parquet | |
| # RealICU | |
| [Paper](https://arxiv.org/abs/2605.13542) · [Code](https://github.com/chengzhi-leo/RealICU-Bench) · [Project page](https://chengzhi-leo.github.io/RealICU-Bench/) | |
| > [!IMPORTANT] | |
| > **This repository contains a synthetic sample, not the benchmark data.** The files here describe 5 | |
| > synthetic patients in exactly the same file layout, Parquet schemas, and label JSON format as the full | |
| > dataset. They contain no patient data: every identifier, date, measurement, note, and label was generated | |
| > from hand-written scenarios, not from MIMIC records. Use the sample to inspect the format and to test data | |
| > pipelines; do not use it to evaluate models. | |
| > | |
| > **The full dataset is distributed through PhysioNet.** RealICU is derived from MIMIC-IV, so it is released | |
| > under PhysioNet credentialed access: a credentialed PhysioNet account, completed human-subjects research | |
| > training (CITI), and a signed data use agreement. It has been submitted to PhysioNet as | |
| > *MIMIC-IV-Ext-RealICU* and is under review. The PhysioNet link will be added here once it is published. | |
| RealICU is a benchmark for evaluating language models and agents on ICU decision support. For each | |
| evaluation window, it provides clinical events for constructing model inputs and aligned reference labels | |
| for four tasks: patient status, acute problems, recommended actions, and red flag actions. | |
| The full dataset (version 1.0.0) contains 94 MIMIC-derived patients, one target ICU stay per patient, and | |
| 2,989,158 clinical events. The trajectories include available records before, during, and after the target | |
| ICU stay. | |
| | Annotation set | Reference source | Windows | Action ratings | | |
| | --- | --- | ---: | ---: | | |
| | RealICU-Gold | Paired physician consensus on Oracle candidates | 930 | 2,189 | | |
| | RealICU-Scale | Oracle, an LLM hindsight annotator | 11,862 | 25,387 | | |
| Gold and Scale share the same patients and have partially overlapping windows; Gold is not a window subset | |
| of Scale. Both are evaluation sets and should not be used as separate training and test cohorts. Windows | |
| generally span 30 minutes, with shorter intervals at the end of a stay when needed. | |
| ## Synthetic sample in this repository | |
| | Content | Sample | Full dataset | | |
| | --- | ---: | ---: | | |
| | Patients (one target ICU stay each) | 5 | 94 | | |
| | Clinical events | 1,743 | 2,989,158 | | |
| | Gold windows / action ratings | 35 / 46 | 930 / 2,189 | | |
| | Scale windows / action ratings | 198 / 219 | 11,862 / 25,387 | | |
| The five synthetic stays cover septic shock, hypoxemic respiratory failure, diabetic ketoacidosis, upper | |
| gastrointestinal bleeding, and decompensated heart failure. They also reproduce the format's edge cases: a | |
| truncated final window, a Gold window with an unavailable patient-status label, a Scale window without | |
| acute-problem references, an `insufficient_data` window, an ICU readmission, and in-hospital deaths after | |
| ICU discharge. Synthetic identifiers start with 9 (for example `90000001_99000001`) and do not overlap | |
| MIMIC-IV identifier ranges. | |
| ## Quick start | |
| The standalone loader requires Python 3.10 or later, `pandas`, and `pyarrow`: | |
| ```bash | |
| python -m pip install pandas pyarrow huggingface_hub | |
| hf download leoshen/RealICU --repo-type dataset --local-dir realicu | |
| cd realicu | |
| ``` | |
| Load one Gold window: | |
| ```python | |
| from loader import RealICULoader | |
| loader = RealICULoader(".", "gold", "90000001_99000001") | |
| sample = loader.load_window( | |
| loader.window_indices[0], | |
| icu_history_hours=None, | |
| pre_icu_history_hours=48, | |
| excluded_event_codes=("NOTE_DISCHARGESUMMARY", "META_DEATH"), | |
| ) | |
| model_input = sample["input"] | |
| labels = sample["labels"] | |
| current_events = model_input["current_events"] | |
| references = labels["reference_labels"] | |
| availability = labels["label_availability"] | |
| print(current_events.head()) | |
| if availability["patient_status"]: | |
| print(references["patient_assessment"]["overall"]["label"]) | |
| ``` | |
| Use `"scale"` instead of `"gold"` to read Oracle annotations. The loader reads a stay once; call | |
| `load_window` for any ID in `loader.window_indices`. These IDs may be nonconsecutive. List available stays | |
| with `pandas.read_parquet("trajectories/icu_stay.parquet")["stay_id"]`. | |
| Each sample has two parts: | |
| - `input`: sample and stay identifiers, actual window timestamps, and the three event tables below. | |
| - `labels`: the four tasks under `reference_labels`, plus `label_availability` indicating which references | |
| can be used for evaluation. | |
| | Input event table | Included observations | | |
| | --- | --- | | |
| | `pre_icu_events` | Before target ICU admission, within the chosen pre-ICU lookback | | |
| | `history_events` | During the target ICU stay, before the window, within the chosen ICU lookback | | |
| | `current_events` | Within the actual half-open interval `[window_start_time, window_end_time)` | | |
| Both lookbacks and `excluded_event_codes` are required choices. Use a number of hours, `None` for all | |
| available history, or `0` for no history. The pre-ICU lookback is measured from ICU admission; the ICU | |
| lookback is measured from the window start. An empty tuple retains all event categories. The example's | |
| 48-hour lookback and exclusions are illustrative, not benchmark defaults. | |
| The same example is available from the command line: | |
| ```bash | |
| python loader.py --root . --label-set gold --stay-id 90000001_99000001 \ | |
| --window-index 0 --icu-history-hours all --pre-icu-history-hours 48 \ | |
| --excluded-event-codes NOTE_DISCHARGESUMMARY META_DEATH | |
| ``` | |
| The prediction and evaluation code in [RealICU-Bench](https://github.com/chengzhi-leo/RealICU-Bench) reads | |
| this layout directly; set `data.root` to the downloaded directory. | |
| ## Tasks and reference labels | |
| The paths below are relative to `reference_labels`: | |
| | Task | JSON path | Reference content | | |
| | --- | --- | --- | | |
| | Patient Status | `patient_assessment.overall` | `stable`, `improving`, `deteriorating`, or `insufficient_data`, with a rationale | | |
| | Acute Problems | `patient_assessment.active_risks` | Active clinical problems or emerging risks, with supporting evidence | | |
| | Recommended Actions | `action_review.evaluations` | Recorded actions rated `best_practice`, `acceptable`, `potentially_harmful`, or `insufficient_data` | | |
| | Red Flag Actions | `action_review.red_flags` | Actions to avoid, with a rationale and supporting evidence | | |
| Actions rated `best_practice` or `acceptable` form the positive reference set for recommendation | |
| evaluation. Every retained action refers to an event within its assigned window. Numeric action and | |
| evidence IDs refer to `icu_event_index` within the same target stay. | |
| Check `label_availability` for each task before scoring. Its keys are `patient_status`, `active_risks`, | |
| `recommended_action`, and `red_flags`. A false value means the reference is unavailable. An unavailable | |
| patient-status label is stored as `unavailable`; this is not a clinical class. An available | |
| `insufficient_data` label remains a valid reference. An available empty list means no retained reference | |
| items, not a comprehensive finding that no clinical problems or contraindications exist. | |
| In the full dataset, Gold contains physician-consensus labels and selected items from Oracle candidates; | |
| its `rationale` and `key_evidence` were retained from Oracle. Scale labels and explanations are Oracle | |
| outputs. Annotations use retrospective context, so evidence may refer to events before or after the | |
| observation window, or to pre-ICU history and discharge summaries. | |
| ## Files and alignment | |
| ```text | |
| README.md | |
| loader.py | |
| croissant.json | |
| trajectories/ | |
| events.parquet | |
| icu_stay.parquet | |
| gold/labels/<stay_id>.json | |
| scale/labels/<stay_id>.json | |
| ``` | |
| `events.parquet` contains one clinical event per row. `icu_stay.parquet` contains one target ICU stay per | |
| row, including admission/discharge times, trajectory bounds, event counts, and outcomes. Join trajectories | |
| and annotations using `stay_id`, formatted as `<subject_id>_<icu_stay_id>`. An event's own `icu_stay_id` | |
| may refer to a different encounter; use the added `stay_id` for joins. | |
| Each annotation set has one JSON file per target stay. The file contains stay identifiers, | |
| `trajectory_metadata`, and a `window_outputs` list. Each window has `sample_id`, `window_index`, | |
| `window_key`, `window_metadata`, `reference_labels`, and `label_availability`. Use the actual timestamps in | |
| `window_metadata` to align events; `window_key` gives nominal hours relative to ICU admission. | |
| | Event identifier | Meaning | | |
| | --- | --- | | |
| | `event_idx`, `source_event_index` | Original source event identifier | | |
| | `event_index` | Zero-based position in the published trajectory | | |
| | `icu_event_index` | Zero-based chronological event ID within the target ICU stay; null outside it | | |
| `croissant.json` provides Croissant 1.1 metadata with field descriptions and Responsible AI documentation. | |
| Its record sets expose ICU stays, events, windows, action evaluations, active risks, and red flags; each | |
| label record set covers Gold and Scale, distinguished by `label_set`. Its file URLs point to this | |
| repository, so it can be loaded directly with `mlcroissant`. | |
| ## Evaluation input construction | |
| Keep reference answers and retrospective outcomes out of model inputs. For Action Recommendation, the paper | |
| removes recorded actions from the current window before prediction to prevent answer leakage (Appendix | |
| A.1); the loader does not perform this masking automatically. | |
| ## Citation | |
| ```bibtex | |
| @article{shen2026realicu, | |
| title={RealICU: Do LLM Agents Understand Long-Context ICU Data? A Benchmark Beyond Behavior Imitation}, | |
| author={Shen, Chengzhi and Shen, Weixiang and Susetzky, Tobias and Chen, Chen (Cherise) and Li, Jun and Liu, Yuyuan and Zhang, Xuepeng and Gong, Zhenyu and Rueckert, Daniel and Pan, Jiazhen}, | |
| journal={arXiv preprint arXiv:2605.13542}, | |
| year={2026} | |
| } | |
| ``` | |