pyAKI - An Open Source Solution to Automated KDIGO classification

Christian Porschen, Jan Ernsting, Paul Brauckmann, Raphael Weiss, Till Würdemann, Hendrik Booke, Wida Amini, Ludwig Maidowski, Benjamin Risse, Tim Hahn, Thilo Caspar von GrootearXiv 2024 · DOI

Abstract

Acute Kidney Injury (AKI) is a prevalent condition in intensive care units, yet its diagnosis via the KDIGO clinical standards remains complex and error-prone when performed manually on time-series data. We present pyAKI, an open-source Python pipeline that automates AKI staging. By implementing a standardized data model and flexible baseline logic, pyAKI achieves perfect diagnostic accuracy, outperforming trained physicians and enabling scalable clinical research.

Introduction

Acute Kidney Injury (AKI) affects approximately half of all patients in Intensive Care Units (ICUs). The global standard for diagnosis is the KDIGO criteria, which evaluate three clinical pathways: urine output (UO) reduction, serum creatinine (SCr) elevation, and the initiation of renal replacement therapy (dialysis).

Despite the apparent simplicity of these rules, applying them to "messy" clinical time-series data is challenging. Manual annotation is resource-intensive and susceptible to human errors, such as rounding mistakes or miscalculated baselines. Furthermore, the lack of a standardized data format across research groups hinders the reproducibility and comparability of studies. pyAKI was developed to bridge this gap by providing a reliable, automated, and open-source tool for AKI staging.

Methods

The pyAKI pipeline transforms raw clinical data into validated AKI stages (0–3) through several key components:

  • Standardized Data Model: The system utilizes three primary input tables—Urine Data, Creatinine Data, and Kidney Replacement Data—linked by patient identifiers and timestamps.
  • Flexible Baseline Logic: Users can choose from various methods to define "baseline" creatinine, such as rolling windows or the Cockcroft-Gault formula, addressing a major source of variability in AKI research.
  • Data Interpolation: To handle sparse clinical records, the pipeline includes customizable imputation methods to up-sample data to hourly intervals, ensuring consistent application of KDIGO temporal windows (6, 12, or 24 hours).
The pyAKI Data Model illustrating the input tables and the resulting staging output.

The tool was validated using the MIMIC-IV demo version 2.2, extracting 2,651 hours of data from 15 patients. A "ground truth" was established by three junior physicians, with final review and conflict resolution provided by a panel of senior expert physicians.

Results

The validation study demonstrated that pyAKI significantly outperforms human experts in diagnostic precision.

  • Perfect Accuracy: pyAKI achieved an accuracy of 1.0 (100%) across all categories, including UO, SCr, Dialysis, and Overall Stage, when compared against the expert-resolved ground truth.
  • Human Error Margin: In contrast, human physicians achieved an overall accuracy of 0.9771. Errors were most frequent in the Urine Output pathway (0.9664 accuracy), likely due to the difficulty of manually performing windowed averaging over long time series.
  • Efficiency and Scalability: The automated nature of the pipeline allows for the processing of large-scale datasets that would be practically impossible for human experts to annotate manually.
Comparison of diagnostic accuracy between human physicians and the pyAKI pipeline across different KDIGO pathways.

Discussion and Limitations

While pyAKI offers a robust solution for adult ICU data, several areas for future development remain. The current version is not validated for pediatric use, as KDIGO criteria for children involve different GFR thresholds. Additionally, while the pipeline automates staging, users must still perform initial data cleaning to fit the pyAKI data model.

The success of pyAKI highlights the importance of standardization in clinical machine learning. By providing a "minimal required subset" of variables and transparent baseline calculations, pyAKI serves as a blueprint for future automated clinical research. Future iterations may see integration into real-time clinical decision support systems to provide early warnings for AKI events in the ICU.

Summary updated

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
MIMIC-IV · expert-annotated validation datasetpyAKI generated labelsOverall AKI-stage accuracy1.0split: val
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
MIMIC-IV · expert-annotated validation datasetpyAKI generated labelsUrine-output (UO) accuracy1.0split: val · criterion=urine-output
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
MIMIC-IV · expert-annotated validation datasetpyAKI generated labelsRelative serum creatinine (SCr) elevation accuracy1.0split: val · criterion=relative-serum-creatinine-elevation
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
MIMIC-IV · expert-annotated validation datasetHuman labels (senior physicians) baselineOverall AKI-stage accuracy0.9771split: val
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
MIMIC-IV · expert-annotated validation datasetHuman labels (senior physicians) baselineUrine-output (UO) accuracy0.9664split: val · criterion=urine-output
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
MIMIC-IV · expert-annotated validation datasetHuman labels (senior physicians) baselineRelative serum creatinine (SCr) elevation accuracy0.9996split: val · criterion=relative-serum-creatinine-elevation
Source quote
L85: An overview of all measured accuracies, categorized by each stage and each criterion of \acrshort{kdigo} classification, after comparing to the labels generated by the senior physicians is depicted in table \ref{tab:aki_and_accuracies}. Overall accuracy was high, both in the labels generated by physicians, as well as the labels generated by the pipeline. Accuracy across \acrshort{kdigo}-stages were also high (human vs. pyAKI): \acrshort{uo} was 0.9664 vs. 1.0 and relative \acrshort{scr} elevation was 0.9996 vs. 1.0. Accuracy for both dialysis-stage and absolute \acrshort{scr} elevation was 1.0 both in human labelling, as well as in labels generated by pyAKI. For overall \acrshort{aki}-stage, accuracy where 0.9771 for human labels and 1.0 for pyAKI generated labels.
BibTeX
@misc{porschen2024pyaki,
  author = {Christian Porschen and Jan Ernsting and Paul Brauckmann and Raphael Weiss and Till Würdemann and Hendrik Booke and Wida Amini and Ludwig Maidowski and Benjamin Risse and Tim Hahn and Thilo Caspar von Groote},
  title = {{pyAKI - An Open Source Solution to Automated KDIGO classification}},
  year = {2024},
  eprint = {2401.12930},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.12930},
}
Figure